diff --git a/client/src/App.jsx b/client/src/App.jsx index 1170d6b..c88d170 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -1,29 +1,84 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { BrowserRouter, Link, Route, Routes } from 'react-router-dom'; - import { logo } from './assets'; import { Home, CreatePost } from './pages/index.js'; -const App = () => ( - -
- -
- logo -

OwnAI

+const App = () => { + const [theme, setTheme] = useState(() => { + // const savedTheme = localStorage.getItem('theme'); + // if (savedTheme) return savedTheme; + return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; + }); + + useEffect(() => { + if (theme === 'dark') { + document.documentElement.classList.add('dark'); + } else { + document.documentElement.classList.remove('dark'); + } + localStorage.setItem('theme', theme); + }, [theme]); + + const toggleTheme = () => { + setTheme((prevTheme) => (prevTheme === 'light' ? 'dark' : 'light')); + }; + const contrastStyle = { + filter: theme=='dark' ? 'contrast(0.1)' : 'contrast(1)', + }; + return ( + +
+ +
+ logo +

OwnAI

+
+ + +
+ + + + + + Create +
- - +
- Create -
-
- - } /> - } /> - -
-
-); +
+ + } /> + } /> + +
+ + ); +}; -export default App; \ No newline at end of file +export default App; diff --git a/client/src/components/FormField.jsx b/client/src/components/FormField.jsx index 5e54258..3008abe 100644 --- a/client/src/components/FormField.jsx +++ b/client/src/components/FormField.jsx @@ -14,7 +14,7 @@ const FormField = ({
@@ -22,7 +22,7 @@ const FormField = ({ diff --git a/client/src/index.css b/client/src/index.css index 42fb166..b8855ba 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -2,22 +2,27 @@ @tailwind components; @tailwind utilities; + * { - font-family: "Inter", sans-serif; + font-family: "Inter", sans-serif; + transition: color 0.5s ease, background-color 0.6s ease; } +/* Grid layout adjustment */ @media screen and (min-width: 480px) { - .card:nth-child(7n + 1) { - grid-column: auto/span 2; - grid-row: auto/span 2; - } + .card:nth-child(7n + 1) { + grid-column: auto/span 2; + grid-row: auto/span 2; + } } .prompt::-webkit-scrollbar { - width: 5px; + width: 5px; } .prompt::-webkit-scrollbar-thumb { - background-color: #666e75; - border-radius: 5px; + background-color: #666e75; + border-radius: 5px; } + + diff --git a/client/src/pages/CreatePost.jsx b/client/src/pages/CreatePost.jsx index 66f9538..4cf0b13 100644 --- a/client/src/pages/CreatePost.jsx +++ b/client/src/pages/CreatePost.jsx @@ -81,8 +81,8 @@ const CreatePost = () => { return (
-

Create

-

Generate an imaginative image through Own-AI and share it with the community

+

Create

+

Generate an imaginative image through Own-AI and share it with the community

diff --git a/client/src/pages/Home.jsx b/client/src/pages/Home.jsx index 764f3a9..5d0fa35 100644 --- a/client/src/pages/Home.jsx +++ b/client/src/pages/Home.jsx @@ -63,8 +63,8 @@ const Home = () => { return (
-

The Community Showcase

-

Browse through a collection of imaginative and visually stunning images generated by Own-AI based on pollinations.ai model.

+

The Community Showcase

+

Browse through a collection of imaginative and visually stunning images generated by Own-AI based on pollinations.ai model.

diff --git a/client/tailwind.config.js b/client/tailwind.config.js index 109fd06..9b0d2e5 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -2,6 +2,7 @@ export default { content: ['./src/**/*.{js,jsx}'], + darkMode: 'class', theme: { extend: { screens: { @@ -14,6 +15,9 @@ export default { card: '0 0 1px 0 rgba(189,192,207,0.06),0 10px 16px -1px rgba(189,192,207,0.2)', cardhover: '0 0 1px 0 rgba(189,192,207,0.06),0 10px 16px -1px rgba(189,192,207,0.4)', }, + colors: { + 'custom-black': '#0a0a0a', // Define a very dark shade of black + }, }, }, plugins: [],