Compare commits

...

2 Commits

Author SHA1 Message Date
365aacd8cb Bouncing Amogus
Some checks failed
CI / build (push) Successful in 12s
CI / lint (push) Failing after 11s
CI / create-and-publish-docker-image (push) Successful in 16s
2025-08-31 18:14:12 +02:00
df2999516d auto restart firefox after publish; write git hash into file for server
All checks were successful
CI / build (push) Successful in 13s
CI / lint (push) Successful in 10s
CI / create-and-publish-docker-image (push) Successful in 18s
2025-08-31 16:48:10 +02:00
5 changed files with 119 additions and 8 deletions

View File

@@ -18,6 +18,8 @@ jobs:
run: bun install
- name: Build
run: bun run build
- name: Write git hash into dist
run: echo "export const GIT_HASH = '$(git rev-parse HEAD)';" > dist/git-hash.js
- name: Create Build Artifact
uses: christopherhx/gitea-upload-artifact@v4
with:
@@ -39,7 +41,7 @@ jobs:
- name: Run Biome
run: biome ci .
build-and-push-docker:
create-and-publish-docker-image:
needs: [build]
runs-on: ubuntu-latest
steps:
@@ -69,6 +71,9 @@ jobs:
script: |
cd monitor-im-flur
echo "Deploying Docker container..."
$HYPRLAND_INSTANCE_SIGNATURE
hyprctl dispatch exec 'pkill firefox'
hyprctl dispatch exec 'firefox -kiosk localhost:9123'
git clean -dfx
git reset --hard HEAD
git pull

BIN
public/img/imposter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

View File

@@ -0,0 +1,93 @@
import { useEffect, useState } from "react";
import style from "./style.module.css";
import amogus from "/img/amogus.png";
import imposter from "/img/imposter.png";
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 (let 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(() => {
let c = crewmates;
setCrewmates(stepCrewmates(c));
}, 100);
return () => {
clearInterval(timer);
};
}, []);
return <>{crewmates.map((c) => makeCrewmate(c))}</>;
}

View File

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

View File

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