Skip to content

Commit

Permalink
added brain and added animation to ball
Browse files Browse the repository at this point in the history
  • Loading branch information
day-mon committed Apr 28, 2024
1 parent ca72b37 commit afa32be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 9 additions & 4 deletions ui/src/pages/Games.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@ import { Prediction } from '~/model/prediction.ts';
import { AccuribetAPI } from '~/client/api.ts';
import { AnimationDiv } from '~/components/animated-div.tsx';
import { SimpleTooltip } from '~/components/tooltip.tsx';
import { cache } from '@solidjs/router';

async function fetchGames() {
const instance = AccuribetAPI.getInstance();
return await instance.dailyGames();
}

const fetchModels = cache(async () => {

async function fetchModels() {
if (sessionStorage.getItem('models')) {
return JSON.parse(sessionStorage.getItem('models') as string);
}
const instance = AccuribetAPI.getInstance();
return await instance.listModels();
}, 'models');
const response = await instance.listModels();
sessionStorage.setItem('models', JSON.stringify(response));
return response;
}

async function fetchPredictions(model: string) {
const instance = AccuribetAPI.getInstance();
Expand Down
12 changes: 4 additions & 8 deletions ui/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Button } from "~/components/ui/button.tsx";
import { AiFillGithub } from "solid-icons/ai";
import { AnimationDiv } from "~/components/animated-div.tsx";
import { FaSolidBasketball } from "solid-icons/fa";
import { BsCloudRain } from 'solid-icons/bs';
import { TbBrain } from 'solid-icons/tb';

export const Home = () => {
return (
Expand Down Expand Up @@ -38,7 +40,7 @@ export const Home = () => {
easing={"ease-in-out"}
>
<AnimationDiv animate={{ rotate: [0, 360] }} duration={1.2} easing={"linear"}>
<FaSolidBasketball class="mx-auto w-48 h-48 overflow-hidden rounded-xl object-cover sm:w-full lg:order-last light:fill-white" />
<FaSolidBasketball class="mx-auto w-48 h-48 overflow-hidden rounded-xl object-cover sm:w-full lg:order-last light:fill-white transition-all duration-500 ease-in-out transform hover:scale-125 hover:rotate-45 cursor-pointer" />
</AnimationDiv>
</AnimationDiv>
</div>
Expand All @@ -61,13 +63,7 @@ export const Home = () => {
</div>
</div>
<div class="mx-auto grid max-w-5xl items-center gap-6 py-12 lg:grid-cols-2 lg:gap-12">
<img
alt="Accuracy Chart"
class="mx-auto aspect-video overflow-hidden rounded-xl object-cover object-center sm:w-full lg:order-last"
height="310"
src="https://placeholder.pics/svg/300x200/F97EFF-8589FF/Placedholder"
width="550"
/>
<TbBrain class="mx-auto w-48 h-48 overflow-hidden rounded-xl object-cover sm:w-full lg:order-last text-secondary"/>
<div class="flex flex-col justify-center space-y-4">
<ul class="grid gap-6">
<li>
Expand Down

0 comments on commit afa32be

Please sign in to comment.