diff --git a/ui/footer.slint b/ui/footer.slint index d2e61a3..6e42f8d 100644 --- a/ui/footer.slint +++ b/ui/footer.slint @@ -1,6 +1,6 @@ -import { IconButton } from "icon_button.slint"; -import { Theme } from "theme.slint"; -import { GradientButton } from "button.slint"; +import { IconButton } from "./icon_button.slint"; +import { Theme } from "./theme.slint"; +import { GradientButton } from "./gradient-button.slint"; export component Footer inherits Rectangle { callback settings-clicked(); diff --git a/ui/button.slint b/ui/gradient-button.slint similarity index 97% rename from ui/button.slint rename to ui/gradient-button.slint index 472b10c..7ce179c 100644 --- a/ui/button.slint +++ b/ui/gradient-button.slint @@ -3,6 +3,7 @@ import { Theme } from "theme.slint"; export component GradientButton inherits Rectangle { callback clicked <=> touch.clicked; in property text; + in property icon; background: Theme.gradient-main; border-radius: Theme.radius; diff --git a/ui/gradient-icon.slint b/ui/gradient-icon.slint new file mode 100644 index 0000000..2170049 --- /dev/null +++ b/ui/gradient-icon.slint @@ -0,0 +1,24 @@ +import { Theme } from "theme.slint"; + +export component GradientIcon inherits Rectangle { + in property icon; + + background: Theme.gradient-main; + border-radius: Theme.radius; + drop-shadow-offset-x: Theme.shadow-primary-x; + drop-shadow-offset-y: Theme.shadow-primary-y; + drop-shadow-blur: Theme.shadow-primary-blur; + drop-shadow-color: touch.has-hover ? Theme.shadow-color : transparent; + horizontal-stretch: 0; + + animate drop-shadow-color { duration: 300ms; } + + touch := TouchArea { } + + Image { + width: 24px; + height: 24px; + source: icon; + colorize: white; + } +} diff --git a/ui/header.slint b/ui/header.slint index 1eb5641..7f4f164 100644 --- a/ui/header.slint +++ b/ui/header.slint @@ -1,5 +1,6 @@ import { BrowserConfig } from "./types.slint"; -import { Theme } from "theme.slint"; +import { Theme } from "./theme.slint"; +import { GradientIcon } from "./gradient-icon.slint"; export component Header inherits Rectangle { in property url; @@ -13,16 +14,22 @@ export component Header inherits Rectangle { HorizontalLayout { spacing: Theme.spacing-md; - Rectangle { + // Rectangle { + // width: 48px; + // height: 48px; + // border-radius: Theme.radius; + // background: Theme.gradient-main; + + // Image { + // source: @image-url("../icons/globe.svg"); + // colorize: white; + // } + // } + + GradientIcon { width: 48px; height: 48px; - border-radius: Theme.radius; - background: Theme.gradient-main; - - Image { - source: @image-url("../icons/globe.svg"); - colorize: white; - } + icon: @image-url("../icons/globe.svg"); } VerticalLayout { diff --git a/ui/icon_button.slint b/ui/icon_button.slint index 461c300..93f8880 100644 --- a/ui/icon_button.slint +++ b/ui/icon_button.slint @@ -1,8 +1,11 @@ +import { Theme } from "theme.slint"; export component IconButton inherits Rectangle { callback clicked <=> touch.clicked; in property icon; - property icon_color: touch.has-hover ? #ffffff : #94a3b8; + property icon_color: touch.has-hover ? Theme.text-main : Theme.text-muted; + + animate icon_color { duration: 300ms; } height: 24px; width: 24px; background: transparent; diff --git a/ui/theme.slint b/ui/theme.slint index 51efa4b..7e9404e 100644 --- a/ui/theme.slint +++ b/ui/theme.slint @@ -4,23 +4,23 @@ export global Theme { out property width: 448px; out property surface-main: is-dark ? #0f172a : #ffffff; - out property surface-control: is-dark ? #1e293b4d : #ffffff; - out property surface-elevated: is-dark ? #1e293b80 : #ffffff; + // out property surface-control: is-dark ? #1e293b4d : #ffffff; + out property surface-elevated: is-dark ? #1e293b80 : #f8fafc; out property surface-hover: is-dark ? #1e293b : #ffffff; - out property border-main: is-dark ? #334155 : #ffffff; + out property border-main: is-dark ? #334155 : #e2e8f0; out property gradient-main: @linear-gradient(135deg, rgb(59, 130, 246), rgb(6, 182, 212)); - out property text-main: is-dark ? #ffffff : #000000; - out property text-muted: is-dark ? #94a3b8 : #000000; + out property text-main: is-dark ? #ffffff : #0f172a; + out property text-muted: is-dark ? #94a3b8 : #64748b; - out property text-control: is-dark ? #cbd5e1 : #000000; - out property text-control-muted: is-dark ? #64748b : #000000; + out property text-control: is-dark ? #cbd5e1 : #475569; + out property text-control-muted: is-dark ? #64748b : #94a3b8; - out property text-hint: is-dark ? #475569 : #000000; + out property text-hint: is-dark ? #475569 : #475569; - out property shadow-color: is-dark ? #3b82f640 : #000000; + out property shadow-color: is-dark ? #3b82f640 : #3b82f640; out property shadow-primary-x: 0px; out property shadow-primary-y: 10px;