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
echo "Deploying Docker container..."
docker-compose pull
docker-compose stop || true
docker-compose rm || true
docker-compose up -d
docker-compose down
docker-compose up -d

View File

@@ -1,11 +1,26 @@
import CardHeader from "@/components/CardHeader/CardHeader";
import style from "./style.module.css";
export default function Card({
active,
icon,
name,
children,
active = false,
header = true,
}: {
icon: string;
name: string;
active?: boolean;
header?: boolean;
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 {
display: flex;
flex-direction: column;
justify-content: flex-start;
background-color: #c0c0c0;
@@ -10,5 +11,6 @@
}
.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";
export default function CardHeader({ icon, content, active = false }) {
let containerClass = style.container;
if (active) {
containerClass += ` ${style.active}`;
}
const styles = {
container: style.container,
active: style.active,
};
const cx = classNames.bind(styles);
export default function CardHeader({ icon, content, isActive = false }) {
return (
<div className={containerClass}>
<div className={cx("container", { active: isActive })}>
<div className={style.title}>
<div className={style.icon}>{icon}</div>
<div className={style.content}>{content}</div>

View File

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

View File

@@ -19,29 +19,3 @@
.night {
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 weedImage from "/img/weed.png"
import weedImage from "/img/weed.png";
export default function Footer() {
return (
<div className={style.container}>
<div className={style.taskbar}>
@@ -29,6 +27,9 @@ export default function Footer() {
<span className={style.window}>
<span className={style.windowIcon}>🧹</span>Flatastic
</span>
<span className={style.window}>
<span className={style.windowIcon}></span>Weather
</span>
</div>
</div>
</div>

View File

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

View File

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