-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impr: Start creating the settings UI. Refactoring of button components
- Loading branch information
1 parent
6835e87
commit 17775d2
Showing
29 changed files
with
313 additions
and
201 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script lang="ts"> | ||
export let round: number = 0; | ||
export let size: number | undefined = undefined; | ||
export let width = "inherit"; | ||
export let height = "inherit"; | ||
export let padding = "inherit"; | ||
export let normalFgColor = "var(--fg-header)"; | ||
export let normalBgColor = "var(--bg-header)"; | ||
export let hoverBgColor = "var(--bg-tab-hover)"; | ||
if (size) { | ||
width = `${size}px`; | ||
height = `${size}px`; | ||
} | ||
</script> | ||
|
||
<div | ||
on:mousedown|capture | ||
on:mouseup|capture | ||
style={` | ||
--button-padding: ${padding}; | ||
--button-width: ${width}; | ||
--button-height: ${height}; | ||
--button-border-radius: ${round}px; | ||
--button-normal-bg-color: ${normalBgColor}; | ||
--button-hover-bg-color: ${hoverBgColor}; | ||
--button-normal-fg-color: ${normalFgColor}; | ||
`} | ||
> | ||
<slot /> | ||
</div> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: var(--button-normal-bg-color); | ||
color: var(--button-normal-fg-color); | ||
border-radius: var(--button-border-radius); | ||
width: var(--button-width); | ||
height: var(--button-height); | ||
padding: var(--button-padding); | ||
opacity: 0.4; | ||
transition: all 0.1s ease; | ||
} | ||
div:hover { | ||
opacity: 1; | ||
} | ||
</style> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import Button from "./Button.svelte"; | ||
export let padding = "0px 18px"; | ||
export let normalBgColor = "var(--bg-header-control)"; | ||
export let activeBgColor = "var(--bg-header-control-hover)"; | ||
export let hoverBgColor = "var(--bg-header-control-hover)"; | ||
export let isActive = false; | ||
</script> | ||
|
||
<Button {padding} {normalBgColor} {activeBgColor} {hoverBgColor} {isActive} on:mousedown on:mouseup> | ||
<slot /> | ||
</Button> |
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 |
---|---|---|
@@ -1,8 +1,3 @@ | ||
export { default as ButtonNormal } from "./ButtonNormal.svelte"; | ||
export { default as ButtonControl } from "./ButtonControl.svelte"; | ||
export { default as ButtonControlHover } from "./ButtonControlHover.svelte"; | ||
export { default as ButtonWinControl } from "./ButtonWinControl.svelte"; | ||
export { default as ButtonTabClose } from "./ButtonTabClose.svelte"; | ||
export { default as ButtonHome } from "./ButtonHome.svelte"; | ||
export { default as ButtonClose } from "./ButtonClose.svelte"; | ||
export { default as Button } from "./Button.svelte"; | ||
export { default as ButtonWindow } from "./ButtonWindow.svelte"; | ||
export { default as ButtonTool } from "./ButtonTool.svelte"; |
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,9 @@ | ||
<div> | ||
<slot /> | ||
</div> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
export let grow = 0; | ||
</script> | ||
|
||
<div style={`--flexGrow: ${grow}`}> | ||
<slot /> | ||
</div> | ||
|
||
<style> | ||
div { | ||
flex-grow: var(--flexGrow); | ||
} | ||
</style> |
Oops, something went wrong.