Compare commits

..

7 Commits

Author SHA1 Message Date
a15ed45b53 dont publish if lint fails 2025-08-31 18:21:05 +02:00
90d32e29f4 add githooks and setup.sh
Some checks failed
CI / build (pull_request) Successful in 14s
CI / build (push) Successful in 11s
CI / lint (pull_request) Successful in 9s
CI / create-and-publish-docker-image (pull_request) Successful in 13s
CI / lint (push) Successful in 9s
CI / create-and-publish-docker-image (push) Has been cancelled
2025-08-31 18:14:50 +02:00
1100be75c5 correct permission on shell script 2025-08-31 17:11:21 +02:00
59001d5e97 create git hash html 2025-08-31 17:10:57 +02:00
46d9b8df94 docker image now uses dist folder from build step for deploy 2025-08-31 17:05:20 +02:00
7912f59fb8 ensure git-hash.js is in dist folder 2025-08-31 17:01:10 +02:00
90771b85e9 write git sha env variable into docker container 2025-08-31 16:58:19 +02:00
4 changed files with 7 additions and 110 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 MiB

View File

@@ -1,91 +0,0 @@
import { useEffect, useState } from "react";
import amogus from "/img/amogus.png";
import imposter from "/img/imposter.png";
import style from "./style.module.css";
type Amogus = {
isImposter: boolean;
posX: number;
posY: number;
speedX: number;
speedY: number;
};
const getImage = (sus: Amogus) => (sus.isImposter ? imposter : amogus);
const initialCrewmates: Amogus[] = [
{ key: "a", isImposter: true, posX: 10, posY: 20, speedX: 10, speedY: 30 },
{
key: "b",
isImposter: false,
posX: 400,
posY: 200,
speedX: 10,
speedY: -20,
},
{
key: "c",
isImposter: false,
posX: 900,
posY: 200,
speedX: -20,
speedY: 10,
},
];
const makeCrewmate = (crewmate: Amogus) => {
const image = getImage(crewmate);
return (
<div
key={crewmate.key}
className={style.container}
style={{ top: crewmate.posY, left: crewmate.posX }}
>
<img src={image} alt="Amogus" />
</div>
);
};
const stepCrewmates = (list: Amogus[]) => {
const { innerWidth: width, innerHeight: height } = window;
const newCrewmates = list.slice();
for (const c of newCrewmates) {
let newX = c.posX + c.speedX;
let newY = c.posY + c.speedY;
if (newX > width - 90) {
newX = width - 90;
c.speedX *= -1;
}
if (newX < 0) {
newX = 0;
c.speedX *= -1;
}
if (newY > height - 120) {
newY = height - 120;
c.speedY *= -1;
}
if (newY < 0) {
newY = 0;
c.speedY *= -1;
}
c.posX = newX;
c.posY = newY;
}
return newCrewmates;
};
export default function Amogus() {
const [crewmates, setCrewmates] = useState(initialCrewmates);
useEffect(() => {
const timer = setInterval(() => {
const c = crewmates;
setCrewmates(stepCrewmates(c));
}, 100);
return () => {
clearInterval(timer);
};
}, [crewmates]);
return <>{crewmates.map((c) => makeCrewmate(c))}</>;
}

View File

@@ -1,4 +0,0 @@
.container {
z-index: 100;
position: absolute;
}

View File

@@ -1,7 +1,5 @@
import FourTwenty from "@components/FourTwenty/FourTwenty";
import classNames from "classnames";
import { useEffect, useState } from "react";
import Amogus from "@/components/Amogus/Amogus";
import Card from "@/components/Card/Card";
import {
CardColumn,
@@ -13,7 +11,7 @@ import Footer from "@/components/Footer/Footer";
import Terminal from "@/components/Terminal/Terminal";
import Timetable from "@/components/Timetable/Timetable";
import Weather from "@/components/Weather/Weather";
import amogus from "/img/amogus.png";
import style from "./style.module.css";
export default function Dashboard() {
@@ -44,7 +42,9 @@ export default function Dashboard() {
return (
<div className={`${style.dashboard} ${scheme}`}>
<Amogus />
<div className={style.amogus}>
<img src={amogus} alt="Amogus" />
</div>
<div className={style.body}>
<CardColumn>
<Card icon="🚊" name="Timetable">
@@ -59,17 +59,9 @@ export default function Dashboard() {
<Card icon="🌤" name="Weather">
<Weather />
</Card>
<div
className={classNames(
style.bouncingWindow,
style.hidden,
)}
>
<Card icon="🍁" name="420">
<FourTwenty />
</Card>
</div>
<Card icon="🍁" name="420">
<FourTwenty />
</Card>
</CardRow>
<Card icon="🔔" name="Terminal" active={true}>