Skip to content

Commit

Permalink
feat: drawer bg props thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
awwpotato committed Jan 28, 2025
1 parent 0beb596 commit 10d51b1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"echarts-stat": "^1.2.0",
"lucide-svelte": "^0.469.0",
"socket.io": "^4.8.1",
"socket.io-client": "^4.8.1"
"socket.io-client": "^4.8.1",
"tailwindcss-color-mix": "^0.0.9"
},
"prisma": {
"seed": "bun ./prisma/seed.ts"
Expand Down
4 changes: 3 additions & 1 deletion src/lib/components/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
let {
children,
displaying = $bindable(),
bg = "bg-eerie_black",
}: {
displaying: boolean
bg: String
} = $props()
</script>

Expand All @@ -18,7 +20,7 @@
}}
>
<div
class="no-scrollbar absolute inset-x-0 bottom-0 flex max-h-[80svh] min-h-[40svh] w-dvw flex-col items-center gap-2 overflow-y-scroll rounded-t-lg bg-gunmetal p-2 text-white"
class="no-scrollbar absolute inset-x-0 bottom-0 flex max-h-[80svh] min-h-[40svh] w-dvw flex-col items-center gap-2 overflow-y-scroll rounded-t-lg {bg} p-2 text-white"
>
{#if children}
{@render children()}
Expand Down
4 changes: 3 additions & 1 deletion src/routes/match-scout/Timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
actions = $bindable(),
displaying = $bindable(),
furthest_auto_index = $bindable(),
bg = "bg-eerie_black",
}: {
actions: AutoActionData[] // TODO Action[]
furthest_auto_index: number
displaying: boolean
bg: String
} = $props()
/// Determine if currying is the right solution or if we should use a binding
Expand All @@ -27,7 +29,7 @@
}
</script>

<Drawer bind:displaying>
<Drawer bind:displaying {bg}>
{#each actions as _, i}
<Action
action_data={actions[actions.length - i - 1]}
Expand Down
5 changes: 4 additions & 1 deletion src/routes/match-scout/auto/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
)
</script>

<div class="flex min-h-dvh flex-col bg-steel_blue/5 accent-steel_blue">
<div
class="flex min-h-dvh flex-col bg-eerie_black accent-steel_blue bg-mix-steel_blue bg-mix-amount-10"
>
<Header
game_stage={"Auto"}
team_name={1540}
Expand Down Expand Up @@ -79,6 +81,7 @@
}}>Show Timeline</button
>
<Timeline
bg={"bg-eerie_black bg-mix-steel_blue bg-mix-amount-10"}
bind:actions
bind:displaying={displaying_timeline}
bind:furthest_auto_index
Expand Down
5 changes: 4 additions & 1 deletion src/routes/match-scout/tele/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
)
</script>

<div class="flex min-h-dvh flex-col bg-eminence/10 accent-eminence">
<div
class="flex min-h-dvh flex-col bg-eerie_black accent-eminence bg-mix-eminence bg-mix-amount-10"
>
<Header
game_stage={"Tele"}
team_name={1540}
Expand Down Expand Up @@ -86,6 +88,7 @@
}}>Show Timeline</button
>
<Timeline
bg={"bg-eerie_black bg-mix-amount-10 bg-mix-amount-10"}
bind:actions
bind:displaying={displaying_timeline}
bind:furthest_auto_index
Expand Down
2 changes: 2 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { fontFamily } from "tailwindcss/defaultTheme"
import type { Config } from "tailwindcss"
const colorMix = require("tailwindcss-color-mix")

const config: Config = {
darkMode: ["class"],
content: ["./src/**/*.{html,js,svelte,ts}"],
safelist: ["dark"],
plugins: [colorMix()],
theme: {
container: {
center: true,
Expand Down

0 comments on commit 10d51b1

Please sign in to comment.