Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…dchickens into hanya/postmatch
  • Loading branch information
azaleacolburn committed Dec 1, 2024
2 parents 48c537d + 39736e1 commit f4e7b29
Show file tree
Hide file tree
Showing 36 changed files with 206 additions and 152 deletions.
143 changes: 143 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
Expand All @@ -12,3 +13,145 @@
scrollbar-width: none; /* Firefox */
}
}

@layer base {
@font-face {
font-family: Teko;
font-style: normal;
font-weight: 300;
src: url(/static/fonts/teko/Teko-Light.ttf) format('tff');
}
@font-face {
font-family: Teko;
font-style: normal;
font-weight: 400;
src: url(/static/fonts/teko/Teko-Regular.ttf) format('tff');
}
@font-face {
font-family: Teko;
font-style: normal;
font-weight: 500;
src: url(/static/fonts/teko/Teko-Medium.ttf) format('tff');
}
@font-face {
font-family: Teko;
font-style: normal;
font-weight: 600;
src: url(/static/fonts/teko/Teko-SemiBold.ttf) format('tff');
}
@font-face {
font-family: Teko;
font-style: normal;
font-weight: 700;
src: url(/static/fonts/teko/Teko-Bold.ttf) format('tff');
}

@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 100;
src: url(/static/fonts/poppins/Poppins-Thin.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 100;
src: url(/static/fonts/poppins/Poppins-ThinItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 200;
src: url(/static/fonts/poppins/Poppins-ExtraLight.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 200;
src: url(/static/fonts/poppins/Poppins-ExtraLightItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 300;
src: url(/static/fonts/poppins/Poppins-Light.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 300;
src: url(/static/fonts/poppins/Poppins-LightItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 400;
src: url(/static/fonts/poppins/Poppins-Regular.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 400;
src: url(/static/fonts/poppins/Poppins-Italic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 500;
src: url(/static/fonts/poppins/Poppins-Medium.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 500;
src: url(/static/fonts/poppins/Poppins-MediumItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 600;
src: url(/static/fonts/poppins/Poppins-SemiBold.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 600;
src: url(/static/fonts/poppins/Poppins-SemiBoldItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 700;
src: url(/static/fonts/poppins/Poppins-Bold.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 700;
src: url(/static/fonts/poppins/Poppins-BoldItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 800;
src: url(/static/fonts/poppins/Poppins-ExtraBold.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 800;
src: url(/static/fonts/poppins/Poppins-ExtraBoldItalic.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: normal;
font-weight: 900;
src: url(/static/fonts/poppins/Poppins-Black.ttf) format('tff');
}
@font-face {
font-family: Poppins;
font-style: italic;
font-weight: 900;
src: url(/static/fonts/poppins/Poppins-BlackItalic.ttf) format('tff');
}
}
2 changes: 1 addition & 1 deletion src/lib/components/SuccessFail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<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"
class="grid h-dvh max-h-[48rem] w-dvw max-w-96 grid-cols-2 grid-rows-4 gap-4 p-4 font-heading text-xl font-extrabold text-white"
>
<button
class="row-span-3 rounded-lg bg-jungle_green shadow-lg shadow-jungle_green/50"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
{/if}
{/each}
{#if actions.length === 0}
<h3 class="m-auto">No actions yet :3</h3>
<h3 class="m-auto font-heading font-bold">No actions yet :3</h3>
{/if}
</div>
</button>
3 changes: 2 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export type TeamMatch = {
scout_id: string;
match_key: string;
team_key: string;
skill: number;
speed: number;
awareness: number;
notes: string;
broke: boolean;
died: boolean;
Expand Down
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-eerie_black text-white;
@apply bg-eerie_black font-sans text-white;
}
</style>
32 changes: 14 additions & 18 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,35 @@
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
let name: string = (browser && window.localStorage.getItem('name')) || '';
let inputname: string;
let inputname: string = '';
onMount(() => {
let isLoggedIn = browser != null && window.localStorage.getItem('name') != '';
let isLoggedIn = browser && window.localStorage.getItem('username');
if (isLoggedIn) {
goto('/homepage');
}
});
function login() {
if (inputname === '') {
alert('Enter your name');
} else {
browser && window.localStorage.setItem('name', inputname);
name = inputname;
goto('/homepage');
}
browser && window.localStorage.setItem('username', inputname);
goto('/homepage');
}
</script>

<div class="flex h-dvh flex-col items-center justify-evenly">
<h1 class="text-text_red text-center text-5xl font-bold">hiiii :3</h1>
<div>
<input
class="bg-btn_grey border-text_red text-text_yellow rounded border-2 border-solid px-4 py-2"
class="bg-btn_grey rounded border-2 border-solid px-4 py-2 text-black"
type="text"
placeholder="Enter your name here"
placeholder="Please enter your name here"
bind:value={inputname}
/>
<button
class="text-text_yellow text-l bg-btn_grey border-text_red rounded border-2 border-solid px-4 py-2 text-center"
on:click={login}
>
Login
</button>
{#if inputname != ''}
<button
class="text-l bg-grey rounded border-2 border-solid px-4 py-2 text-center text-white"
on:click={login}
>
Login
</button>
{/if}
</div>
</div>
2 changes: 1 addition & 1 deletion src/routes/homepage/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</h1>
<a
class="text-text_yellow text-l bg-btn_grey border-text_red rounded border-2 border-solid px-4 py-2 text-center"
href="/scout"
href="/queue"
>
Scout
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/queue/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div
class="grid h-full w-full grid-cols-1 grid-rows-2 place-items-center gap-4 align-middle text-4xl text-white"
>
<h1 class="p-2">In Queue</h1>
<h1 class="p-2 font-heading font-bold">In Queue</h1>

<button class="rounded border p-4" onclick={leave}>Leave Queue</button>
</div>
24 changes: 16 additions & 8 deletions src/routes/scout/[team_data]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type { PageData } from './$types';
import { ArrowRight, ArrowLeft } from 'lucide-svelte';
import { browser } from '$app/environment';
import Postmatch from './Postmatch.svelte';
const { data }: { data: PageData } = $props();
Expand All @@ -20,7 +21,8 @@
// The furthest index in actions that was made during auto
let furthest_auto_index = $state(0);
let skill = $state(0);
let speed = $state(3);
let awareness = $state(3);
let broke = $state(false);
let died = $state(false);
let notes = $state('');
Expand All @@ -44,26 +46,29 @@
scout_id,
team_key: data.team_key,
match_key: data.match_key,
skill,
speed,
awareness,
broke,
died,
notes,
auto_actions,
tele_actions
};
console.log(match);
}
</script>

<div class="m-auto flex h-dvh max-w-md flex-col items-center gap-2 p-2">
<div class="flex w-full justify-between border-b-2 border-white/10 pb-2 font-semibold">
<span class="flex-shrink-0">Team {data.team_key}</span>
<h2 class="flex-shrink-0 font-heading font-semibold">Team {data.team_key}</h2>
<div class="flex gap-2">
<button
onclick={phaseShiftLeft}
class={gamePhase === 'Auto' ? 'pointer-events-none opacity-30' : ''}
><ArrowLeft /></button
>
<span class="text-right">{gamePhase}: {pageName}</span>
<h2 class="text-right font-heading font-semibold">{gamePhase}: {pageName}</h2>
<button
onclick={phaseShiftRight}
class={gamePhase === 'Post' ? 'pointer-events-none opacity-30' : ''}
Expand All @@ -75,7 +80,7 @@
{#if gamePhase === 'Auto'}
<AutoActionInputs bind:furthest_auto_index bind:held bind:actions bind:pageName />
<button
class="w-full border-t-2 border-white/10 pt-2 text-center font-semibold"
class="w-full border-t-2 border-white/10 pt-2 text-center font-heading font-semibold"
onclick={(e: Event) => {
e.stopPropagation();
timelineExtended = true;
Expand All @@ -90,7 +95,7 @@
{:else if gamePhase === 'Tele'}
<TeleActionInputs bind:held bind:actions bind:pageName />
<button
class="w-full border-t-2 border-white/10 pt-2 text-center font-semibold"
class="w-full border-t-2 border-white/10 pt-2 text-center font-heading font-semibold"
onclick={(e: Event) => {
e.stopPropagation();
timelineExtended = true;
Expand All @@ -103,7 +108,10 @@
bind:displaying={timelineExtended}
/>
{:else}
<div>Postmatch</div>
<button class="mt-auto w-full rounded bg-gunmetal p-2 font-bold">Submit</button>
<Postmatch bind:awareness bind:speed bind:broke bind:died bind:notes />

<button onclick={submit} class="mt-auto w-full rounded bg-gunmetal p-2 font-bold"
>Submit</button
>
{/if}
</div>
14 changes: 10 additions & 4 deletions src/routes/scout/[team_data]/AutoActionInputs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@

<div class="align-center flex w-full max-w-md flex-grow flex-col px-2">
{#if is_none_state}
<div class="grid flex-grow grid-cols-1 grid-rows-3 gap-2 py-2 text-2xl font-bold">
<div
class="grid flex-grow grid-cols-1 grid-rows-3 gap-2 py-2 font-heading text-2xl font-bold"
>
<button class="rounded bg-gunmetal p-2" onclick={intake_piece}>Intake</button>
{#if held_scorables > 0}
<button class="rounded bg-gunmetal p-2" onclick={score_piece}>Score</button>
Expand All @@ -81,7 +83,9 @@
{/if}
</div>
{:else if is_intake_state}
<div class="grid w-full flex-grow grid-cols-2 grid-rows-2 gap-2 py-2 text-xl font-bold">
<div
class="grid w-full flex-grow grid-cols-2 grid-rows-2 gap-2 py-2 font-heading text-xl font-bold"
>
<button class="rounded bg-gunmetal p-2" onclick={() => (actionState = 'IntakeBunny')}
>Bunny</button
>
Expand All @@ -101,7 +105,9 @@
onclick={() => (actionState = 'None')}>Cancel</button
>
{:else if is_score_state}
<div class="flex w-full flex-grow flex-col items-center gap-2 py-2 text-lg font-bold">
<div
class="flex w-full flex-grow flex-col items-center gap-2 py-2 font-heading text-lg font-bold"
>
{#if held.bunnies > 0}
<div class="flex w-full flex-grow flex-col items-center gap-2 text-lg">
<h1>Bunny</h1>
Expand Down Expand Up @@ -160,7 +166,7 @@
>
</div>
{:else if is_eject_state}
<div class="grid w-full flex-grow grid-flow-row gap-2 py-2 font-bold">
<div class="grid w-full flex-grow grid-flow-row gap-2 py-2 font-heading font-bold">
{#if held.bunnies > 0}
<button
class="w-full rounded bg-gunmetal p-2"
Expand Down
Loading

0 comments on commit f4e7b29

Please sign in to comment.