initial commit

This commit is contained in:
2024-07-19 19:55:57 +02:00
commit 049e063d48
53 changed files with 15239 additions and 0 deletions

BIN
front/src/app/favicon.ico Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

22
front/src/app/layout.tsx Normal file
View File

@@ -0,0 +1,22 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "@/styles/main.scss";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "Personal finance - Home",
description: "Manage your money blablabla",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}

10
front/src/app/page.tsx Normal file
View File

@@ -0,0 +1,10 @@
import ThemeSwitcher from "@/modules/common/theme-switcher";
export default function Home() {
return (
<main>
Main page
<ThemeSwitcher />
</main>
);
}

View File

@@ -0,0 +1,3 @@
"use client";
export { ThemeSwitcher as default } from "./theme-switcher.component";

View File

@@ -0,0 +1,20 @@
import React from "react";
// TODO: make it consistent and link current data-theme with checked state fo the checkbox, maybe with a react state
export const ThemeSwitcher = () => {
const changeHandler = () => {
const isDarkTheme =
document.documentElement.getAttribute("data-theme") === "dark";
document.documentElement.setAttribute(
"data-theme",
isDarkTheme ? "light" : "dark",
);
};
return (
<label className="switch">
<input type="checkbox" onClick={changeHandler} />
<span className="slider round"></span>
</label>
);
};

View File

@@ -0,0 +1,8 @@
$default-font-size: 1.6rem;
$color-primary: #ff7730;
$color-secondary: #ff7730;
$color-background: var(--color-white);
$color-foreground: var(--color-black);
$color-white: var(--color-white);

View File

@@ -0,0 +1,51 @@
// For variable definition
:root {
--color-white: #fafafa;
--color-black: #101010;
}
[data-theme="dark"] {
--color-white: #101010;
--color-black: #fafafa;
}
*,
::after,
::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
max-width: 100vw;
overflow-x: hidden;
font-size: 62.5%; // 1rem = 10px; 10px/16px = 62.5%
@media only screen and (min-width: 112.5em) {
font-size: 75%;
}
@media only screen and (max-width: 75em) {
font-size: 56.25%;
}
@media only screen and (max-width: 56.25em) {
font-size: 50%;
}
}
body {
box-sizing: border-box;
background-color: $color-background;
color: $color-foreground;
}
a {
color: inherit;
text-decoration: none;
}
::selection {
background-color: $color-primary;
color: $color-white;
}