Skip to content

Commit 0349d04

Browse files
authored
Merge pull request #78 from karelnagel/dev
Dev
2 parents b091fcf + 82087de commit 0349d04

File tree

9 files changed

+729
-78
lines changed

9 files changed

+729
-78
lines changed

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "motionly",
33
"private": true,
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"type": "module",
66
"scripts": {
77
"fe-dev": "vite",

landing/app/globals.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

landing/app/layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { Metadata } from "next";
22
import "./globals.css";
3+
import { Inter } from "next/font/google";
4+
import { Theme } from "~/components/Theme";
5+
6+
const inter = Inter({ subsets: ["latin"] });
37

48
export const metadata: Metadata = {
59
title: "Motionly",
@@ -14,7 +18,9 @@ export const metadata: Metadata = {
1418
export default function RootLayout({ children }: { children: React.ReactNode }) {
1519
return (
1620
<html lang="en">
17-
<body>{children}</body>
21+
<body style={inter.style}>
22+
<Theme>{children}</Theme>
23+
</body>
1824
</html>
1925
);
2026
}

landing/app/page.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import { Inter } from "next/font/google";
2-
3-
const inter = Inter({ subsets: ["latin"] });
4-
51
export default function Home() {
62
return (
7-
<main style={inter.style}>
8-
<h1>Motionly</h1>
3+
<main>
4+
<h1 className="bg-base-100">Motionly</h1>
95
</main>
106
);
117
}

landing/components/Theme.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"use client";
2+
3+
import { ReactNode, useEffect, useState } from "react";
4+
5+
export const Theme = ({ children }: { children: ReactNode }) => {
6+
const [theme, setTheme] = useState<"dark" | "light">("light");
7+
useEffect(() => {
8+
const theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
9+
setTheme(theme);
10+
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
11+
setTheme(e.matches ? "dark" : "light");
12+
});
13+
}, []);
14+
return (
15+
<div className="min-h-screen bg-base-100 text-base-content" data-theme={theme}>
16+
{children}
17+
</div>
18+
);
19+
};

landing/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"next": "13.2.4",
1818
"react": "^18.2.0",
1919
"react-dom": "^18.2.0",
20+
"tw-colors": "^1.2.0",
2021
"typescript": "5.0.3"
22+
},
23+
"devDependencies": {
24+
"autoprefixer": "^10.4.13",
25+
"postcss": "^8.4.18",
26+
"tailwindcss": "^3.2.1"
2127
}
2228
}

landing/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

landing/tailwind.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const { createThemes } = require('tw-colors');
2+
3+
/** @type {import('tailwindcss').Config} */
4+
module.exports = {
5+
content: [
6+
"./app/**/*.{js,ts,jsx,tsx}",
7+
"./components/**/*.{js,ts,jsx,tsx}",
8+
],
9+
theme: {
10+
extend: {
11+
colors: {
12+
'primary': {
13+
"DEFAULT": "#316fff",
14+
"content": "#e8f5ff",
15+
'50': '#e8f5ff',
16+
'100': '#d5edff',
17+
'200': '#b4dbff',
18+
'300': '#86c2ff',
19+
'400': '#5799ff',
20+
'500': '#316fff',
21+
'600': '#0e42ff',
22+
'700': '#0538fd',
23+
'800': '#0835d7',
24+
'900': '#11339e',
25+
'950': '#0a1c5c',
26+
},
27+
}
28+
},
29+
},
30+
plugins: [
31+
createThemes({
32+
light: {
33+
"base-100": "#f7f7f7",
34+
"base-200": "#e3e3e3",
35+
"base-300": "#c8c8c8",
36+
"base-content": "#1a1a1a"
37+
},
38+
dark: {
39+
"base-100": "#1a1a1a",
40+
"base-200": "#313131",
41+
"base-300": "#383838",
42+
"base-content": "#f7f7f7"
43+
}
44+
})
45+
],
46+
}

0 commit comments

Comments
 (0)