Compare commits
16 Commits
7c23621561
...
windows95
| Author | SHA1 | Date | |
|---|---|---|---|
| cb4ce4188e | |||
| 53db7e795c | |||
| 3606f9b043 | |||
| 5da900c1c3 | |||
| 8653365af1 | |||
| d914f47640 | |||
| 668d260fd6 | |||
| 03dc0984f3 | |||
| 0d94904c50 | |||
| 2c805ab513 | |||
| 2b21310dfb | |||
| 756e709181 | |||
| 9872b64fbd | |||
| b6c9c51ec3 | |||
| 83f872577b | |||
| 2b489e83ba |
@@ -18,8 +18,8 @@ jobs:
|
|||||||
run: bun install
|
run: bun install
|
||||||
- name: Build
|
- name: Build
|
||||||
run: bun run build
|
run: bun run build
|
||||||
- name: Write git hash into dist
|
- name: Write Git-Hash into html
|
||||||
run: echo "export const GIT_HASH = '$(git rev-parse HEAD)';" > dist/git-hash.js
|
run: ./pipeline/create-git-hash-html.sh
|
||||||
- name: Create Build Artifact
|
- name: Create Build Artifact
|
||||||
uses: christopherhx/gitea-upload-artifact@v4
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
run: biome ci .
|
run: biome ci .
|
||||||
|
|
||||||
create-and-publish-docker-image:
|
create-and-publish-docker-image:
|
||||||
needs: [build]
|
needs: [lint]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -60,7 +60,6 @@ jobs:
|
|||||||
run: docker build -t git.rivercry.com/wg/monitor-im-flur .
|
run: docker build -t git.rivercry.com/wg/monitor-im-flur .
|
||||||
- name: Push Docker image
|
- name: Push Docker image
|
||||||
run: docker push git.rivercry.com/wg/monitor-im-flur
|
run: docker push git.rivercry.com/wg/monitor-im-flur
|
||||||
|
|
||||||
- name: Deploy via SSH
|
- name: Deploy via SSH
|
||||||
uses: appleboy/ssh-action@v0.1.10
|
uses: appleboy/ssh-action@v0.1.10
|
||||||
with:
|
with:
|
||||||
@@ -70,13 +69,13 @@ jobs:
|
|||||||
password: ${{ secrets.GARRISON_DOCKER_PASSWORD }}
|
password: ${{ secrets.GARRISON_DOCKER_PASSWORD }}
|
||||||
script: |
|
script: |
|
||||||
cd monitor-im-flur
|
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 clean -dfx
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git pull
|
git pull
|
||||||
docker-compose pull
|
docker-compose pull
|
||||||
docker-compose down
|
docker-compose down
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
|
export HYPRLAND_INSTANCE_SIGNATURE=$(hyprctl instances -j | jq '.[0].instance' | tr -d "'\"")
|
||||||
|
hyprctl dispatch exec 'pkill firefox'
|
||||||
|
hyprctl dispatch exec 'firefox -kiosk localhost:9123'
|
||||||
|
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
FROM oven/bun as builder
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
RUN bun install
|
|
||||||
RUN bun run build
|
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY ./dist /usr/share/nginx/html
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
12
githooks/pre-commit
Executable file
12
githooks/pre-commit
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Running pre-commit hooks..."
|
||||||
|
|
||||||
|
biome check --write
|
||||||
|
biome lint --write
|
||||||
|
|
||||||
|
if git diff --quiet; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
git add -u
|
||||||
|
fi
|
||||||
@@ -16,7 +16,7 @@ http {
|
|||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html /git-hash.js;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
11
pipeline/create-git-hash-html.sh
Executable file
11
pipeline/create-git-hash-html.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Git Hash</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<pre>GITHUB_SHA = '$GITHUB_SHA';</pre>
|
||||||
|
</body>
|
||||||
|
</html>" > dist/git-hash.html
|
||||||
3
setup.sh
Executable file
3
setup.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git config --local core.hooksPath githooks
|
||||||
@@ -11,11 +11,14 @@ type Amogus = {
|
|||||||
speedY: number;
|
speedY: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const amogusWidth = 70;
|
||||||
|
const amogusHeight = 70;
|
||||||
|
|
||||||
const { innerWidth: width, innerHeight: height } = window;
|
const { innerWidth: width, innerHeight: height } = window;
|
||||||
|
|
||||||
const getImage = (sus: Amogus) => (sus.isImposter ? imposter : amogus);
|
const getImage = (sus: Amogus) => (sus.isImposter ? imposter : amogus);
|
||||||
|
|
||||||
const makeInitialCrewmates: Amogus[] = () => {
|
const makeInitialCrewmates = (): Amogus[] => {
|
||||||
return [
|
return [
|
||||||
makeCrewmate(true),
|
makeCrewmate(true),
|
||||||
makeCrewmate(false),
|
makeCrewmate(false),
|
||||||
@@ -23,22 +26,26 @@ const makeInitialCrewmates: Amogus[] = () => {
|
|||||||
makeCrewmate(false),
|
makeCrewmate(false),
|
||||||
makeCrewmate(false),
|
makeCrewmate(false),
|
||||||
makeCrewmate(false),
|
makeCrewmate(false),
|
||||||
|
makeCrewmate(false),
|
||||||
|
makeCrewmate(false),
|
||||||
|
makeCrewmate(false),
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
const randNum: number = (min: number, max: number) =>
|
const randNum = (min: number, max: number): number =>
|
||||||
Math.random() * (max - min) + min;
|
Math.random() * (max - min) + min;
|
||||||
|
|
||||||
const makeCrewmate: Amogus = (imposter: boolean) => ({
|
const makeCrewmate = (imposter: boolean): Amogus => ({
|
||||||
isImposter: imposter,
|
isImposter: imposter,
|
||||||
posX: randNum(0, width - 90),
|
posX: randNum(0, width - amogusWidth),
|
||||||
posY: randNum(0, height - 120),
|
posY: randNum(0, height - amogusHeight),
|
||||||
speedX: Math.random() > 0.5 ? randNum(5, 15) : randNum(-5, -15),
|
speedX: Math.random() > 0.5 ? randNum(3, 10) : randNum(-3, -10),
|
||||||
speedY: Math.random() > 0.5 ? randNum(5, 15) : randNum(-5, -15),
|
speedY: Math.random() > 0.5 ? randNum(3, 10) : randNum(-3, -10),
|
||||||
});
|
});
|
||||||
|
|
||||||
const intersect: Bool = (c1: Crewmate, c2: Crewmate) =>
|
const intersect = (c1: Amogus, c2: Amogus): boolean =>
|
||||||
Math.abs(c1.posX - c2.posX) < 80 && Math.abs(c1.posY - c2.posY) < 90;
|
Math.abs(c1.posX - c2.posX) < amogusWidth - 20 &&
|
||||||
|
Math.abs(c1.posY - c2.posY) < amogusHeight - 20;
|
||||||
|
|
||||||
const doMove = (crewmates: Amogus[]) =>
|
const doMove = (crewmates: Amogus[]) =>
|
||||||
crewmates.map((c) => ({
|
crewmates.map((c) => ({
|
||||||
@@ -47,18 +54,42 @@ const doMove = (crewmates: Amogus[]) =>
|
|||||||
posY: c.posY + c.speedY,
|
posY: c.posY + c.speedY,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const doCollision = (crewmates: Amogus[]) => p;
|
const doCollisionWalls = (crewmates: Amogus[]) =>
|
||||||
crewmates.map((c) => {
|
crewmates.map((c) => {
|
||||||
if (c.posX > width - 90) {
|
if (c.posX > width - amogusWidth) {
|
||||||
return { ...c, posX: width - 90, speedX: c.speedX * -1 };
|
return {
|
||||||
} else if (c.posX < 0) {
|
...c,
|
||||||
return { ...c, posX: 0, speedX: c.speedX * -1 };
|
posX: width - amogusWidth,
|
||||||
} else if (c.posY > height - 120) {
|
speedX: c.speedX * -1,
|
||||||
return { ...c, posY: height - 120, speedY: c.speedY * -1 };
|
};
|
||||||
} else if (c.posY < 0) {
|
} else if (c.posX < -20) {
|
||||||
return { ...c, posY: 0, speedY: c.speedY * -1 };
|
return { ...c, posX: -20, speedX: c.speedX * -1 };
|
||||||
} else return c;
|
} else if (c.posY > height - amogusHeight) {
|
||||||
});
|
return {
|
||||||
|
...c,
|
||||||
|
posY: height - amogusHeight,
|
||||||
|
speedY: c.speedY * -1,
|
||||||
|
};
|
||||||
|
} else if (c.posY < -20) {
|
||||||
|
return { ...c, posY: -20, speedY: c.speedY * -1 };
|
||||||
|
} else return c;
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: This is ugly
|
||||||
|
const doCollisionOthers = (crewmates: Amogus[]) =>
|
||||||
|
crewmates.map((c) => {
|
||||||
|
const intersections = crewmates
|
||||||
|
.filter((o) => o !== c) // don't collide with yourself pls
|
||||||
|
.filter((o) => intersect(c, o));
|
||||||
|
|
||||||
|
if (intersections.some((o) => Math.abs(o.posX - c.posX) < 50)) {
|
||||||
|
return { ...c, speedX: c.speedX * -1 };
|
||||||
|
}
|
||||||
|
if (intersections.some((o) => Math.abs(o.posY - c.posY) < 50)) {
|
||||||
|
return { ...c, speedY: c.speedY * -1 };
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
});
|
||||||
|
|
||||||
const doKills = (crewmates: Amogus[]) => {
|
const doKills = (crewmates: Amogus[]) => {
|
||||||
const imposters = crewmates.filter((c) => c.isImposter);
|
const imposters = crewmates.filter((c) => c.isImposter);
|
||||||
@@ -87,7 +118,8 @@ export default function Amogus() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
setCrewmates((c) => doMove(c));
|
setCrewmates((c) => doMove(c));
|
||||||
setCrewmates((c) => doCollision(c));
|
setCrewmates((c) => doCollisionWalls(c));
|
||||||
|
setCrewmates((c) => doCollisionOthers(c));
|
||||||
setCrewmates((c) => doKills(c));
|
setCrewmates((c) => doKills(c));
|
||||||
setCrewmates((c) => checkReset(c));
|
setCrewmates((c) => checkReset(c));
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
.container {
|
.container {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
scale: 50%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,16 +60,9 @@ export default function Dashboard() {
|
|||||||
<Weather />
|
<Weather />
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<div
|
<Card icon="🍁" name="420">
|
||||||
className={classNames(
|
<FourTwenty />
|
||||||
style.bouncingWindow,
|
</Card>
|
||||||
style.hidden,
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<Card icon="🍁" name="420">
|
|
||||||
<FourTwenty />
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
</CardRow>
|
</CardRow>
|
||||||
|
|
||||||
<Card icon="🔔" name="Terminal" active={true}>
|
<Card icon="🔔" name="Terminal" active={true}>
|
||||||
|
|||||||
@@ -25,30 +25,3 @@
|
|||||||
.night {
|
.night {
|
||||||
background-color: #2a3f55;
|
background-color: #2a3f55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.amogus {
|
|
||||||
z-index: 100;
|
|
||||||
position: absolute;
|
|
||||||
scale: 60%;
|
|
||||||
animation:
|
|
||||||
x 10s linear infinite alternate,
|
|
||||||
y 7s linear infinite alternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes x {
|
|
||||||
from {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
left: calc(100vw - 70px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes y {
|
|
||||||
from {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
top: calc(100vh - 90px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user