From 9f5bd52be23e3d54ec18400cf80e0a564f52d871 Mon Sep 17 00:00:00 2001 From: Olivier Demers Date: Mon, 20 Feb 2023 10:57:20 -0500 Subject: [PATCH] dropped tba api, results done, missing pictures --- src/routes/resultats/+page.svelte | 78 ++++++++++++++++++++++++++--- src/routes/resultats/+page.ts | 34 ------------- src/routes/resultats/Event.svelte | 7 --- src/routes/resultats/EventsStore.ts | 39 --------------- src/routes/resultats/Year.svelte | 16 ------ 5 files changed, 70 insertions(+), 104 deletions(-) delete mode 100644 src/routes/resultats/+page.ts delete mode 100644 src/routes/resultats/Event.svelte delete mode 100644 src/routes/resultats/EventsStore.ts delete mode 100644 src/routes/resultats/Year.svelte diff --git a/src/routes/resultats/+page.svelte b/src/routes/resultats/+page.svelte index 77b62df..1e89615 100644 --- a/src/routes/resultats/+page.svelte +++ b/src/routes/resultats/+page.svelte @@ -1,13 +1,75 @@
- {#each $events as year} - - {/each} +
+
Saison 2022
+ Festival de robotique de Montréal (Jour 3) +
    +
  • 11e en qualification
  • +
+
+
+
Saison 2020
+ Festival de robotique de Sherbrooke +
    +
  • 18e en qualification
  • +
  • Finaliste Prix Liste de Dean Kamen (Édouard Moffet)
  • +
  • Prix du Professionnalisme coopératif
  • +
+
+
+
Saison 2019
+ Festival de robotique de Québec +
    +
  • 1er en qualification
  • +
  • Alliance finaliste
  • +
+ Championnat Mondial de Détroit (Tesla) +
    +
  • 21e en qualification
  • +
+
+
+
Saison 2018
+ Festival de robotique de Montréal +
    +
  • 9e en qualification
  • +
  • Finalise Prix Liste de Dean Kamen (Olivier Demers)
  • +
+
+
+
Saison 2017
+ Festival de robotique de Montréal +
    +
  • 18e en qualification
  • +
  • Alliance finaliste
  • +
  • Prix de l'inspiration en ingénierie
  • +
+ Championnat Mondial de St. Louis (Carson) +
    +
  • 47e en qualification
  • +
+
+
+
Saison 2016
+ Festival de robotique de Montréal +
    +
  • 1er en qualification
  • +
  • Alliance championne
  • +
  • Prix de l'entrepreneuriat
  • +
+ Championnat Mondial de St. Louis (Hopper) +
    +
  • 15e en qualification
  • +
+
+
+
Saison 2015
+ Festival de robotique de Montréal +
    +
  • 5e en qualification
  • +
  • Prix de l’Équipe recrue la mieux classée en qualifications
  • +
+
diff --git a/src/routes/resultats/+page.ts b/src/routes/resultats/+page.ts deleted file mode 100644 index 963f07c..0000000 --- a/src/routes/resultats/+page.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { events } from './EventsStore'; -import type { PageLoad } from './$types'; -import type { Events, Event } from './EventsStore'; - -export const load = (async ({ fetch }) => { - events.reset(); - const years_response = await fetch( - 'https://www.thebluealliance.com/api/v3/team/frc5618/years_participated', - { - method: 'GET', - headers: { - 'X-TBA-Auth-Key': '6oQL4iTAIFO0tc5xmRSWVQoNlgm5jpB5x4YZBdqhGTFJjqfqM6XV53s8FBAEiXOJ' - } - } - ); - const years: Array = await years_response.json(); - years.reverse().forEach(async (year) => { - const events_response = await fetch( - `https://www.thebluealliance.com/api/v3/team/frc5618/events/${year}/simple`, - { - method: 'GET', - headers: { - 'X-TBA-Auth-Key': '6oQL4iTAIFO0tc5xmRSWVQoNlgm5jpB5x4YZBdqhGTFJjqfqM6XV53s8FBAEiXOJ' - } - } - ); - const year_events: Array = await events_response.json(); - const response: Events = { year, events_list: year_events }; - events.insert(response); - }); - return { - events - }; -}) satisfies PageLoad; diff --git a/src/routes/resultats/Event.svelte b/src/routes/resultats/Event.svelte deleted file mode 100644 index 8f0affe..0000000 --- a/src/routes/resultats/Event.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - -
{event.name}
diff --git a/src/routes/resultats/EventsStore.ts b/src/routes/resultats/EventsStore.ts deleted file mode 100644 index 1a46aac..0000000 --- a/src/routes/resultats/EventsStore.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { writable } from 'svelte/store'; - -function createCount() { - const { subscribe, set, update } = writable(new Array()); - - return { - subscribe, - insert: (events: Events) => { - update((n) => [...n, events]); - }, - reset: () => set([]) - }; -} - -export const events = createCount(); - -export type Event = { - key: string; - name: string; - event_code: string; - event_type: string; - district: { - abbreviation: string; - display_name: string; - key: string; - year: number; - }; - city: string; - state_prov: string; - country: string; - start_date: string; - end_date: string; - year: number; -}; - -export type Events = { - year: number; - events_list: Array; -}; diff --git a/src/routes/resultats/Year.svelte b/src/routes/resultats/Year.svelte deleted file mode 100644 index 377bc08..0000000 --- a/src/routes/resultats/Year.svelte +++ /dev/null @@ -1,16 +0,0 @@ - - -
-
-
{year.year}
- {#each year.events_list as event} - - {/each} -
-