-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a "Patch render engine" button. Which makes playing with the examples easier. #98
- Loading branch information
Bob Fanger
committed
Mar 18, 2023
1 parent
788d40e
commit ad874a6
Showing
12 changed files
with
244 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script lang="ts"> | ||
export let value: boolean | undefined = undefined; | ||
export let location: "ALONE" | "LEFT" | "CENTER" | "RIGHT" = "ALONE"; | ||
function onToggle() { | ||
if (typeof value === "boolean") { | ||
value = !value; | ||
} | ||
} | ||
</script> | ||
|
||
<button | ||
class="button" | ||
class:pressed={value} | ||
data-location={location} | ||
on:click={onToggle} | ||
on:click|stopPropagation | ||
on:dblclick|stopPropagation={() => {}}><slot /></button | ||
> | ||
|
||
<style lang="scss"> | ||
.button { | ||
appearance: none; | ||
background: #545454 no-repeat center center; | ||
color: #e6e6e6; | ||
border: 1px solid #3d3d3d; | ||
padding-inline: 8px; | ||
height: 18px; | ||
flex-shrink: 0; | ||
box-shadow: 0 1px 1px rgba(black, 0.6); | ||
cursor: pointer; | ||
&[data-location="ALONE"] { | ||
border-radius: 2px / 3px; | ||
} | ||
&[data-location="LEFT"] { | ||
border-top-left-radius: 2px 3px; | ||
border-bottom-left-radius: 2px 3px; | ||
margin-right: 1px; | ||
} | ||
&[data-location="CENTER"] { | ||
margin-right: 1px; | ||
} | ||
&[data-location="RIGHT"] { | ||
border-top-right-radius: 2px 3px; | ||
border-bottom-right-radius: 2px 3px; | ||
} | ||
&:hover { | ||
background: #656565; | ||
color: #ffffff; | ||
} | ||
&.pressed, | ||
&:active { | ||
background-color: #4772b3; | ||
color: #ffffff; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script lang="ts"> | ||
export let icon: "warning" | "error" = "warning"; | ||
export let message = ""; | ||
</script> | ||
|
||
<div class="warning" data-icon={icon}> | ||
{message}<slot /> | ||
</div> | ||
|
||
<style lang="scss"> | ||
.warning { | ||
background: #472722; | ||
color: #e1e1e1; | ||
padding: 2px 4px 4px 30px; | ||
position: relative; | ||
border: 1px solid #3d3d3d; | ||
border-radius: 3px; | ||
overflow: hidden; | ||
min-height: 16px; | ||
&::before { | ||
content: ""; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 24px; | ||
height: 100%; | ||
background: #c1432a center center no-repeat; | ||
} | ||
&[data-icon="warning"]::before { | ||
background-image: var(--icon-warning); | ||
} | ||
&[data-icon="error"]::before { | ||
background-image: var(--icon-error); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.