Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new colorsceme + update css #7

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8616432
feat: type model for scouting system
azaleacolburn Oct 23, 2024
3a9c864
chore: update svelte
azaleacolburn Oct 24, 2024
fc86844
feat: add none
azaleacolburn Oct 25, 2024
a7fe051
refactor: type state model
azaleacolburn Oct 26, 2024
a0c787e
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
azaleacolburn Oct 28, 2024
0b18cca
feat: state transforms
azaleacolburn Oct 30, 2024
0d37bc8
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
azaleacolburn Oct 30, 2024
e294d06
add successfail screen
awwpotato Nov 5, 2024
f515290
theme fixes
awwpotato Nov 6, 2024
6ff4f16
Merge branch 'main' into azalea/input-grid
awwpotato Nov 9, 2024
4105ff5
fix: package.json
awwpotato Nov 9, 2024
a9571e0
fix: formating
awwpotato Nov 9, 2024
d80ad01
fix: dependencies
awwpotato Nov 9, 2024
040d95c
format thingy
awwpotato Nov 9, 2024
c9dc82e
refactor: update types to match new schema
azaleacolburn Nov 12, 2024
9d24e18
Merge branch 'azalea/input-grid' of https://github.com/flamingchicken…
azaleacolburn Nov 12, 2024
3457625
fix: id after clarifying with Brandon
azaleacolburn Nov 12, 2024
8601e25
update dep
awwpotato Nov 12, 2024
01b0333
style: format files
awwpotato Nov 12, 2024
4be6e7b
refactor: action input state machine into component
azaleacolburn Nov 14, 2024
1dcc4a5
feat: make cancel buttons go back one level
azaleacolburn Nov 14, 2024
c083a05
fix: actions display on timeline
azaleacolburn Nov 14, 2024
7662583
feat: piece specific error prevention
azaleacolburn Nov 14, 2024
1ba1b6a
feat: ejectables!
azaleacolburn Nov 14, 2024
b91cc3c
fix: name in pkg.json + update dep
awwpotato Nov 14, 2024
b8b501b
Merge branch 'azalea/input-grid' of github.com:flamingchickens1540/in…
awwpotato Nov 14, 2024
1ed41a2
style: format files
awwpotato Nov 14, 2024
8d43bf0
Merge branch 'main' into azalea/input-grid
awwpotato Nov 14, 2024
be983f5
feat: update colorsceme
awwpotato Nov 14, 2024
4bb7455
feat: timeline popup above contents
awwpotato Nov 14, 2024
027576e
feat: better timeline thingy
awwpotato Nov 14, 2024
c691b06
style: format files
awwpotato Nov 14, 2024
8cf10db
feat: timeline reorder + styling
awwpotato Nov 15, 2024
12188ba
format: prettier tailwind reorder thingy
awwpotato Nov 15, 2024
374c44a
style: format files
awwpotato Nov 15, 2024
151ef86
feat: some small styling tweaks
awwpotato Nov 15, 2024
ae4160a
fix: make successfail work on all screen sizes
awwpotato Nov 15, 2024
d9869fd
feat: more updating styling
awwpotato Nov 16, 2024
08ef46e
fix: success vs. failure logic
azaleacolburn Nov 17, 2024
90c83b8
feat: make timeline grow up
azaleacolburn Nov 17, 2024
0967248
feat: more consistent titles & layout
awwpotato Nov 18, 2024
453e6d5
style: format files
awwpotato Nov 18, 2024
2594729
fix: dont display held pieces
awwpotato Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
Binary file modified bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"typescript": "^5.6.3",
"typescript-eslint": "^8.14.0",
"vite": "^5.4.11"
},
"dependencies": {
"lucide-svelte": "^0.456.0"
}
}
52 changes: 36 additions & 16 deletions src/lib/components/Action.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
<script lang="ts">
import type { AutoActionData } from '$lib/types';
import { MoveUp, MoveDown, X } from 'lucide-svelte';

let {
action_data = $bindable(),
deleteself
}: { action_data: AutoActionData; deleteself: () => void } = $props();
index,
shift,
remove
}: {
action_data: AutoActionData;
index: number;
shift: (index: number, change: number) => void;
remove: (index: number) => void;
} = $props();

//let actionBorderColor = $derived(action.success ? 'border-cresc_green' : 'border-fail_red');
let actionBackgroundColor = $derived(action_data.success ? 'bg-cresc_green' : 'bg-fail_red');
let color = $derived(
action_data.success
? 'bg-jungle_green/50 shadow-jungle_green/10'
: 'bg-flaming_red/50 shadow-flaming_red/10'
);
</script>

<!-- <button -->
<!-- class="{actionBorderColor} w-full p-1 rounded border-2 text-text_yellow" -->
<!-- onclick={deleteself} -->
<!-- > -->
<!-- {action.type} -->
<!-- </button> -->

<button
class="{actionBackgroundColor} w-full p-1 rounded border-2 border-outline_gray text-text_white"
onclick={deleteself}
<div
class="group flex flex-row content-center justify-between {color} w-full rounded p-2 text-white shadow-lg"
>
{action_data.action}
</button>
<span class="w-auto shrink text-clip">{action_data.action}</span>
<div class="flex shrink-0 flex-row content-center justify-end gap-4">
<button
class="group-first:pointer-events-none group-first:opacity-30"
onclick={() => shift(index, -1)}
>
<MoveUp />
</button>
<button
class="group-last:pointer-events-none group-last:opacity-30"
onclick={() => shift(index, 1)}
>
<MoveDown />
</button>
<button onclick={() => remove(index)}>
<X />
</button>
</div>
</div>
30 changes: 16 additions & 14 deletions src/lib/components/SuccessFail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
$props();
</script>

<div
class="bg-zinc-800 text-zinc-50 text-xl font-extrabold fixed inset-0 grid grid-cols-2 grid-rows-3 gap-4 p-4"
>
<button
class="rounded-lg row-span-2 shadow-lg shadow-green-600/50 bg-green-600"
onclick={() => complete(true)}>Success</button
>
<button
class="rounded-lg row-span-2 shadow-lg shadow-red-600/50 bg-red-600"
onclick={() => complete(false)}>Fail</button
>
<button
class="rounded-lg col-span-2 shadow-lg shadow-zinc-600/50 bg-zinc-600"
onclick={() => cancel()}>Cancel</button
<div class="fixed inset-0 flex items-center justify-center bg-eerie_black">
<div
class="grid h-dvh max-h-[48rem] w-dvw max-w-96 grid-cols-2 grid-rows-4 gap-4 p-4 text-xl font-extrabold text-white"
>
<button
class="row-span-3 rounded-lg bg-jungle_green shadow-lg shadow-jungle_green/50"
onclick={() => complete(true)}>Success</button
>
<button
class="row-span-3 rounded-lg bg-flaming_red shadow-lg shadow-flaming_red/50"
onclick={() => complete(false)}>Fail</button
>
<button
class="col-span-2 rounded-lg bg-gunmetal shadow-lg shadow-gunmetal/50"
onclick={() => cancel()}>Cancel</button
>
</div>
</div>
41 changes: 32 additions & 9 deletions src/lib/components/Timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,38 @@
import type { AutoActionData } from '$lib/types';
import Action from './Action.svelte';

let { actions = $bindable() }: { actions: AutoActionData[] } = $props();
let {
actions = $bindable(),
displaying = $bindable()
}: { actions: AutoActionData[]; displaying: boolean } = $props();
// let latestActions: AutoActionData[] = $derived(actions.toReversed().slice(0, 5));

const remove = (index: number) => {
actions.splice(index, 1);
};

const shift = (index: number, change: number) => {
let item = actions[index];
actions.splice(index, 1);
actions.splice(index + change, 0, item);
};
</script>

{#each actions as _, i}
<Action
action_data={actions[i]}
deleteself={() => {
actions.splice(actions.indexOf(actions[i]), 1);
}}
/>
{/each}
<button
class="fixed inset-0 transition-all {displaying ? 'backdrop-blur' : 'translate-y-full'}"
onclick={(e: Event) => {
if (e.target === e.currentTarget) displaying = false;
}}
>
<div
class="absolute inset-x-0 bottom-0 flex h-[50dvh] w-dvw flex-col items-center gap-3 rounded-t-lg bg-gunmetal p-3 text-white"
id="timeline"
>
{#each actions as _, i}
<Action action_data={actions[i]} index={i} {remove} {shift} />
{/each}
{#if actions.length === 0}
<h3 class="m-auto">No actions yet :3</h3>
{/if}
</div>
</button>
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

<style lang="postcss">
:global(body) {
@apply bg-zinc-800;
@apply bg-eerie_black text-white;
}
</style>
7 changes: 5 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div class="flex flex-col items-center justify-evenly h-dvh text-text_white">
<div class="flex h-dvh flex-col items-center justify-evenly">
<h1 class="text-center text-5xl font-bold">hiiii :3</h1>
<a class="text-center text-2xl rounded bg-btn_grey px-4 py-2 font-bold" href="/scout">
<a
class="rounded bg-gunmetal px-4 py-2 text-center text-2xl font-bold text-yolk_yellow"
href="/scout"
>
scout
</a>
</div>
33 changes: 13 additions & 20 deletions src/routes/scout/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { type TeamMatch, type AutoActionData } from '$lib/types';
import type { TeamMatch, AutoActionData } from '$lib/types';
import Timeline from '$lib/components/Timeline.svelte';
import ActionInputs from './ActionInputs.svelte';

Expand All @@ -26,24 +26,17 @@
});
</script>

<div class="grid grid-row-10 text-zinc-50 p-2 h-svh place-items-center">
<h1 class="row-span-1 text-center font-bold pb-2 h-5">Team {team_key}</h1>
{#if timelineExtended}
<div class="row-span-8">
<Timeline bind:actions />
</div>
<button
class="row-span-1 bg-btn_grey h-10 w-80 p-1 rounded border-2 border-outline_gray static"
onclick={() => (timelineExtended = false)}>Hide Timeline</button
>
{:else}
<div class="row-span-8">
<ActionInputs bind:actions />
</div>
<div class="m-auto flex h-dvh max-w-md flex-col items-center gap-2 p-2">
<span class="w-full border-b-2 border-white/10 pb-2 font-semibold">Team {team_key}</span>

<button
class="row-span-1 bg-btn_grey h-10 w-80 p-1 rounded border-2 border-outline_gray static"
onclick={() => (timelineExtended = true)}>Show Timeline</button
>
{/if}
<ActionInputs bind:actions />

<button
class="w-full border-t-2 border-white/10 pt-2 text-center font-semibold"
onclick={(e: Event) => {
e.stopPropagation();
timelineExtended = true;
}}>Show Timeline</button
>
<Timeline bind:actions bind:displaying={timelineExtended} />
</div>
Loading
Loading