Compare commits

...

5 Commits

Author SHA1 Message Date
45a02b84f2 Fix timetable width
All checks were successful
CI / build (push) Successful in 11s
CI / lint (push) Successful in 8s
CI / build-and-push-docker (push) Successful in 12s
2025-08-30 22:52:18 +02:00
7face12353 use docker compose down command to stop container 2025-08-30 22:34:33 +02:00
59dc667c15 Fix card header alignment and add weather to footer 2025-08-30 22:30:17 +02:00
0347ead200 Add headers to card component 2025-08-30 22:04:30 +02:00
9dbb0d6b4d Card container components for a cleaner dashboard 2025-08-30 21:24:48 +02:00
11 changed files with 88 additions and 65 deletions

View File

@@ -69,6 +69,5 @@ jobs:
cd monitor-im-flur cd monitor-im-flur
echo "Deploying Docker container..." echo "Deploying Docker container..."
docker-compose pull docker-compose pull
docker-compose stop || true docker-compose down
docker-compose rm || true docker-compose up -d
docker-compose up -d

View File

@@ -1,11 +1,26 @@
import CardHeader from "@/components/CardHeader/CardHeader";
import style from "./style.module.css"; import style from "./style.module.css";
export default function Card({ export default function Card({
active, icon,
name,
children, children,
active = false,
header = true,
}: { }: {
icon: string;
name: string;
active?: boolean; active?: boolean;
header?: boolean;
children: React.ReactNode; children: React.ReactNode;
}) { }) {
return <div className={style.card}>{children}</div>; return (
<div className={style.card}>
{header && (
<CardHeader icon={icon} content={name} isActive={active} />
)}
<div className={style.cardContent}>{children}</div>
</div>
);
} }

View File

@@ -1,4 +1,5 @@
.card { .card {
display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
background-color: #c0c0c0; background-color: #c0c0c0;
@@ -10,5 +11,6 @@
} }
.cardContent { .cardContent {
padding: 1px 100px 30px 100px; display: flex;
height: 100%;
} }

View File

@@ -0,0 +1,9 @@
import style from "./style.module.css";
export function CardRow({ children }) {
return <div className={style.cardRow}>{children}</div>;
}
export function CardColumn({ children }) {
return <div className={style.cardColumn}>{children}</div>;
}

View File

@@ -0,0 +1,17 @@
.cardColumn {
height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
gap: 30px;
margin: 30px;
}
.cardRow {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
gap: 30px;
}

View File

@@ -1,12 +1,17 @@
import classNames from "classnames/bind";
import style from "./style.module.css"; import style from "./style.module.css";
export default function CardHeader({ icon, content, active = false }) { const styles = {
let containerClass = style.container; container: style.container,
if (active) { active: style.active,
containerClass += ` ${style.active}`; };
}
const cx = classNames.bind(styles);
export default function CardHeader({ icon, content, isActive = false }) {
return ( return (
<div className={containerClass}> <div className={cx("container", { active: isActive })}>
<div className={style.title}> <div className={style.title}>
<div className={style.icon}>{icon}</div> <div className={style.icon}>{icon}</div>
<div className={style.content}>{content}</div> <div className={style.content}>{content}</div>

View File

@@ -1,13 +1,17 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Card from "@/components/Card/Card"; import Card from "@/components/Card/Card";
import CardHeader from "@/components/CardHeader/CardHeader"; import {
CardColumn,
CardRow,
} from "@/components/CardContainers/CardContainers";
import Datetime from "@/components/Datetime/Datetime"; import Datetime from "@/components/Datetime/Datetime";
import Flatastic from "@/components/Flatastic/Flatastic"; import Flatastic from "@/components/Flatastic/Flatastic";
import Footer from "@/components/Footer/Footer"; import Footer from "@/components/Footer/Footer";
import Terminal from "@/components/Terminal/Terminal"; import Terminal from "@/components/Terminal/Terminal";
import Timetable from "@/components/Timetable/Timetable"; import Timetable from "@/components/Timetable/Timetable";
import Weather from "../Weather/Weather"; import Weather from "@/components/Weather/Weather";
import style from "./style.module.css"; import style from "./style.module.css";
export default function Dashboard() { export default function Dashboard() {
@@ -38,36 +42,31 @@ export default function Dashboard() {
return ( return (
<div className={`${style.dashboard} ${scheme}`}> <div className={`${style.dashboard} ${scheme}`}>
<div className={style.cardWrapper}> <CardColumn>
<Card> <Card icon="🚊" name="Timetable">
<CardHeader icon="🚊" content="Timetable" />
<Timetable /> <Timetable />
</Card> </Card>
<div className={style.clockAndWeather}>
<div className={style.small}> <CardRow>
<Card> <Card icon="🕐" name="Clock">
<CardHeader icon="🕐" content="Clock" /> <Datetime />
<Datetime /> </Card>
</Card>
</div> <Card icon="🌤" name="Weather">
<Card>
<CardHeader icon="🌤️" content="Weather" />
<Weather /> <Weather />
</Card> </Card>
</div> </CardRow>
<Card>
<CardHeader icon="🔔" content="Terminal" active={true} /> <Card icon="🔔" name="Terminal" active={true}>
<Terminal /> <Terminal />
</Card> </Card>
<Card> <Card icon="🧹" name="Flatastic">
<CardHeader icon="🧹" content="Flatastic" />
<Flatastic /> <Flatastic />
</Card> </Card>
</div> </CardColumn>
<div className={style.footer}>
<Footer /> <Footer />
</div>
</div> </div>
); );
} }

View File

@@ -19,29 +19,3 @@
.night { .night {
background-color: #2a3f55; background-color: #2a3f55;
} }
.clockAndWeather {
display: flex;
align-items: center;
}
.cardWrapper {
margin: 30px;
height: 100%;
gap: 30px;
flex-direction: column;
display: flex;
justify-content: flex-start;
}
.small {
width: 45%;
}
.terminal {
margin: 2px;
}
.footer {
background-color: #c0c0c0;
}

View File

@@ -1,10 +1,8 @@
import style from "./style.module.css"; import style from "./style.module.css";
import weedImage from "/img/weed.png" import weedImage from "/img/weed.png";
export default function Footer() { export default function Footer() {
return ( return (
<div className={style.container}> <div className={style.container}>
<div className={style.taskbar}> <div className={style.taskbar}>
@@ -29,6 +27,9 @@ export default function Footer() {
<span className={style.window}> <span className={style.window}>
<span className={style.windowIcon}>🧹</span>Flatastic <span className={style.windowIcon}>🧹</span>Flatastic
</span> </span>
<span className={style.window}>
<span className={style.windowIcon}></span>Weather
</span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,11 +1,12 @@
.container { .container {
background-color: #c0c0c0;
height: 30px; height: 30px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
margin: 2px; padding: 2px;
} }
.taskbar { .taskbar {

View File

@@ -1,3 +1,4 @@
.container { .container {
padding: 1px 100px 30px 100px; padding: 1px 100px 30px 100px;
width: 100%;
} }