formula project

This commit is contained in:
colden
2025-12-20 12:20:43 +08:00
commit 28e1507889
156 changed files with 7444 additions and 0 deletions

689
frontend/src/assets/source.ts Executable file
View File

@@ -0,0 +1,689 @@
import piastri from '@/assets/drivers/piastri.avif'
import lando from '@/assets/drivers/lando.avif'
import russell from '@/assets/drivers/russell.avif'
import ant from '@/assets/drivers/ant.avif'
import max from '@/assets/drivers/max.avif'
import yuki from '@/assets/drivers/yuki.avif'
import ham from '@/assets/drivers/ham.avif'
import lec from '@/assets/drivers/lec.avif'
import alb from '@/assets/drivers/alb.avif'
import sai from '@/assets/drivers/sai.avif'
import law from '@/assets/drivers/law.avif'
import haj from '@/assets/drivers/haj.avif'
import str from '@/assets/drivers/str.avif'
import alo from '@/assets/drivers/alo.avif'
import hul from '@/assets/drivers/hul.avif'
import bor from '@/assets/drivers/bor.avif'
import oc from '@/assets/drivers/oc.avif'
import ber from '@/assets/drivers/ber.avif'
import gas from '@/assets/drivers/gas.avif'
import col from '@/assets/drivers/col.avif'
import mclaren from '@/assets/teams/mclaren.avif'
import mercedes from '@/assets/teams/merc.avif'
import redbull from '@/assets/teams/rb.avif'
import ferrari from '@/assets/teams/fe.avif'
import williams from '@/assets/teams/will.avif'
import racingBulls from '@/assets/teams/srb.avif'
import astonMartin from '@/assets/teams/am.avif'
import haasF1Team from '@/assets/teams/hass.avif'
import kickSauber from '@/assets/teams/kick.avif'
import alpine from '@/assets/teams/alp.avif'
import mclarenLogo from '@/assets/teams/mclogo.avif'
import mercedesLogo from '@/assets/teams/merclogo.avif'
import redbullLogo from '@/assets/teams/rblogo.avif'
import ferrariLogo from '@/assets/teams/felogo.avif'
import williamsLogo from '@/assets/teams/willogo.avif'
import racingBullsLogo from '@/assets/teams/srblogo.avif'
import astonMartinLogo from '@/assets/teams/amlogo.avif'
import haasF1TeamLogo from '@/assets/teams/hasslogo.avif'
import kickSauberLogo from '@/assets/teams/kicklogo.avif'
import alpineLogo from '@/assets/teams/alplogo.avif'
import australia from '@/assets/prix/australia.avif'
import china from '@/assets/prix/china.avif'
import japan from '@/assets/prix/japan.avif'
import bahrain from '@/assets/prix/bahrain.avif'
export const getColor = (team: string) : string => {
switch (team) {
case "McLaren":
return "#eb7100";
case "Mercedes":
return "#00cfaf";
case "Red Bull Racing":
return "#003282";
case "Ferrari":
return "#710006";
case "Williams":
return "#155dd1";
case "Racing Bulls":
return "#2345ab";
case "Aston Martin":
return "#00482c";
case "Haas F1 Team":
return "#4d5052";
case "Kick Sauber":
return "#006300";
case "Alpine":
return "#005081";
default:
return "#000";
}
}
export const getLogoColor = (team: string) : string => {
switch (team) {
case "McLaren":
return "#eb7100";
case "Mercedes":
return "#00cfaf";
case "Red Bull Racing":
return "#003282";
case "Ferrari":
return "#710006";
case "Williams":
return "#155dd1";
case "Racing Bulls":
return "#2345ab";
case "Aston Martin":
return "#00482c";
case "Haas F1 Team":
return "#4d5052";
case "Kick Sauber":
return "#006300";
case "Alpine":
return "#005081";
default:
return "#000";
}
}
export const getImage = (name: string) : string => {
switch (name) {
case "Oscar Piastri":
return piastri;
case "Lando Norris":
return lando;
case "George Russell":
return russell;
case "Kimi Antonelli":
return ant;
case "Max Verstappen":
return max;
case "Yuki Tsunoda":
return yuki;
case "Lewis Hamilton":
return ham;
case "Charles Leclerc":
return lec;
case "Alexander Albon":
return alb;
case "Carlos Sainz":
return sai;
case "Liam Lawson":
return law;
case "Isack Hadjar":
return haj;
case "Lance Stroll":
return str;
case "Fernando Alonso":
return alo;
case "Esteban Ocon":
return oc;
case "Oliver Bearman":
return ber;
case "Nico Hulkenberg":
return hul;
case "Gabriel Bortoleto":
return bor;
case "Pierre Gasly":
return gas;
case "Franco Colapinto":
return col;
default:
return "";
}
}
export const getCarImage = (team: string) : string => {
switch (team) {
case "McLaren":
return mclaren;
case "Mercedes":
return mercedes;
case "Red Bull Racing":
return redbull;
case "Ferrari":
return ferrari;
case "Williams":
return williams;
case "Racing Bulls":
return racingBulls;
case "Aston Martin":
return astonMartin;
case "Haas F1 Team":
return haasF1Team;
case "Kick Sauber":
return kickSauber;
case "Alpine":
return alpine;
default:
return "";
}
}
export const getLogo = (team: string) : string => {
switch (team) {
case "McLaren":
return mclarenLogo;
case "Mercedes":
return mercedesLogo;
case "Red Bull Racing":
return redbullLogo;
case "Ferrari":
return ferrariLogo;
case "Williams":
return williamsLogo;
case "Racing Bulls":
return racingBullsLogo;
case "Aston Martin":
return astonMartinLogo;
case "Haas F1 Team":
return haasF1TeamLogo;
case "Kick Sauber":
return kickSauberLogo;
case "Alpine":
return alpineLogo;
default:
return "";
}
}
export const prix = [
{
id: 1,
name: "Australia",
image: australia,
},
{
id: 2,
name: "China",
image: china,
},
{
id: 3,
name: "Japan",
image: japan,
},
{
id: 4,
name: "Bahrain",
image: bahrain,
}
]
/* export const teams = [
{
id: 1,
name: "McLaren",
nation: "United Kingdom",
image: mclaren,
color: "#eb7100",
driver1: "Oscar Piastri",
driver2: "Lando Norris",
logo: mclarenLogo
},
{
id: 2,
name: "Mercedes",
nation: "Germany",
image: mercedes,
color: "#00d2be",
driver1: "George Russell",
driver2: "Kimi Antonell",
logo: mercedesLogo
},
{
id: 3,
name: "Red Bull Racing",
nation: "United Kingdom",
image: redbull,
color: "#003282",
driver1: "Max Verstappen",
driver2: "yuki Tsunoda",
logo: redbullLogo
},
{
id: 4,
name: "Ferrari",
nation: "Italy",
image: ferrari,
color: "#dc0000",
driver1: "Lewis Hamilton",
driver2: "Charles Leclerc",
logo: ferrariLogo
},
]
*/
export const prixes = [
{
id: 1,
name: "澳大利亚",
date: "16 Mar",
pos: 0,
pts: 0
},
{
id: 2,
name: "中国",
date: "23 Mar",
pos: 0,
pts: 0
},
{
id: 3,
name: "日本",
date: "06 Apr",
pos: 0,
pts: 0
},
{
id: 4,
name: "巴林",
date: "13 Apr",
pos: 0,
pts: 0
},
{
id: 5,
name: "沙特阿拉伯",
date: "20 Apr",
pos: 0,
pts: 0
},
{
id: 6,
name: "迈阿密",
date: "04 May",
pos: 0,
pts: 0
},
{
id: 7,
name: "伊莫拉",
date: "18 May",
pos: 0,
pts: 0
},
{
id: 8,
name: "摩纳哥",
date: "25 May",
pos: 0,
pts: 0
},
{
id: 9,
name: "西班牙",
date: "01 Jun",
pos: 0,
pts: 0
},
{
id: 10,
name: "意大利",
date: "15 Jun",
pos: 0,
pts: 0
},
]
export const driver_career = [
{
name: "Oscar Piastri",
races: 69,
points: 781,
hf: 1,
podiums: 25,
hg: 1,
polepositions: 6,
wc: 0,
dnfs: 4,
wins: 9
},
{
name: "Lando Norris",
races: 151,
points: 1415,
hf: 1,
podiums: 43,
hg: 1,
polepositions: 16,
wc: 0,
dnfs: 13,
wins: 11
},
{
name: "George Russell",
races: 151,
points: 1023,
hf: 1,
podiums: 24,
hg: 1,
polepositions: 7,
wc: 0,
dnfs: 19,
wins: 5
},
{
name: "Kimi Antonelli",
races: 23,
points: 150,
hf: 2,
podiums: 3,
hg: 2,
polepositions: 0,
wc: 0,
dnfs: 4,
wins: 0
},
{
name: "Max Verstappen",
races: 232,
points: 3419.5,
hf: 1,
podiums: 126,
hg: 1,
polepositions: 47,
wc: 4,
dnfs: 33,
wins: 71
},
{
name: "yuki Tsunoda",
races: 110,
points: 124,
hf: 4,
podiums: 0,
hg: 3,
polepositions: 0,
wc: 0,
dnfs: 15,
wins: 0
},
{
name: "Charles Leclerc",
races: 170,
points: 1660,
hf: 1,
podiums: 50,
hg: 1,
polepositions: 27,
wc: 0,
dnfs: 23,
wins: 8
},
{
name: "Lewis Hamilton",
races: 379,
points: 5014.5,
hf: 1,
podiums: 202,
hg: 1,
polepositions: 104,
wc: 7,
dnfs: 34,
wins: 105
},
{
name: "Alexander Albon",
races: 127,
points: 313,
hf: 3,
podiums: 2,
hg: 4,
polepositions: 0,
wc: 0,
dnfs: 22,
wins: 0
},
{
name: "Carlos Sainz",
races: 229,
points: 1336.5,
hf: 1,
podiums: 29,
hg: 1,
polepositions: 6,
wc: 0,
dnfs: 42,
wins: 4
},
{
name: "Liam Lawson",
races: 34,
points: 44,
hf: 5,
podiums: 0,
hg: 3,
polepositions: 0,
wc: 0,
dnfs: 6,
wins: 0
},
{
name: "Isack Hadjar",
races: 22,
points: 51,
hf: 3,
podiums: 1,
hg: 4,
polepositions: 0,
wc: 0,
dnfs: 2,
wins: 0
},
{
name: "Lance Stroll",
races: 189,
points: 324,
hf: 3,
podiums: 3,
hg: 1,
polepositions: 1,
wc: 0,
dnfs: 31,
wins: 0
},
{
name: "Fernando Alonso",
races: 426,
points: 2385,
hf: 1,
podiums: 106,
hg: 1,
polepositions: 22,
wc: 2,
dnfs: 83,
wins: 32
},
{
name: "Esteban Ocon",
races: 179,
points: 477,
hf: 1,
podiums: 4,
hg: 3,
polepositions: 0,
wc: 0,
dnfs: 25,
wins: 1
},
{
name: "Oliver Bearman",
races: 26,
points: 48,
hf: 4,
podiums: 0,
hg: 8,
polepositions: 0,
wc: 0,
dnfs: 3,
wins: 0
},
{
name: "Nico Hulkenberg",
races: 250,
points: 620,
hf: 3,
podiums: 1,
hg: 1,
polepositions: 1,
wc: 0,
dnfs: 44,
wins: 0
},
{
name: "Gabriel Bortoleto",
races: 23,
points: 19,
hf: 6,
podiums: 0,
hg: 7,
polepositions: 0,
wc: 0,
dnfs: 5,
wins: 0
},
{
name: "Pierre Gasly",
races: 176,
points: 458,
hf: 1,
podiums: 5,
hg: 2,
polepositions: 0,
wc: 0,
dnfs: 26,
wins: 1
},
{
name: "Franco Colapinto",
races: 26,
points: 5,
hf: 8,
podiums: 0,
hg: 8,
polepositions: 0,
wc: 0,
dnfs: 3,
wins: 0
}
]
export const team_career = [
{
name: "Alpine",
races: 392,
points: 2000,
hf: 1,
podiums: 60,
hg: 1,
polepositions: 20,
wc: 2
},
{
name: "Aston Martin",
races: 152,
points: 863,
hf: 1,
podiums: 12,
hg: 1,
polepositions: 1,
wc: 0
},
{
name: "Ferrari",
races: 1123,
points: 10675,
hf: 1,
podiums: 639,
hg: 1,
polepositions: 254,
wc: 16
},
{
name: "Hass F1 Team",
races: 214,
points: 386,
hf: 4,
podiums: 0,
hg: 4,
polepositions: 1,
wc: 0
},
{
name: "Kick Sauber",
races: 615,
points: 1088,
hf: 1,
podiums: 27,
hg: 1,
polepositions: 1,
wc: 0
},
{
name: "McLaren",
races: 995,
points: 7783.5,
hf: 1,
podiums: 445,
hg: 1,
polepositions: 177,
wc: 10
},
{
name: "Mercedes",
races: 329,
points: 8159.5,
hf: 1,
podiums: 201,
hg: 1,
polepositions: 135,
wc: 8
},
{
name: "Racing Bulls",
races: 399,
points: 947,
hf: 1,
podiums: 6,
hg: 1,
polepositions: 1,
wc: 0
},
{
name: "Red Bull Racing",
races: 418,
points: 8288,
hf: 1,
podiums: 233,
hg: 1,
polepositions: 111,
wc: 6
},
{
name: "Williams",
races: 851,
points: 3768,
hf: 1,
podiums: 245,
hg: 1,
polepositions: 128,
wc: 9
}
]