Skip to content

Commit 3f5e692

Browse files
changed background color
1 parent e598c48 commit 3f5e692

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

pages/_app.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export default function App({ Component, pageProps }: AppProps) {
1111
const router = useRouter();
1212

1313
return (
14-
<NextUIProvider navigate={router.push}>
15-
<NextThemesProvider>
14+
<NextThemesProvider attribute="class" defaultTheme="dark">
15+
<NextUIProvider navigate={router.push}>
1616
<Component {...pageProps} />
17-
</NextThemesProvider>
18-
</NextUIProvider>
17+
</NextUIProvider>
18+
</NextThemesProvider>
1919
);
2020
}
2121

pages/index.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
11
import { Select, SelectItem } from "@nextui-org/select";
22
import { Button } from "@nextui-org/button";
33
import { Input } from "@nextui-org/input";
4+
import { useTheme } from "next-themes";
5+
import { Switch } from "@nextui-org/switch";
6+
import { FiDownload } from "react-icons/fi";
47

58
import useIndex, { LICENSE_TYPES } from "@/hooks/useIndex";
9+
import { MoonFilledIcon, SunFilledIcon } from "@/components/icons";
610

711
export default function IndexPage() {
12+
const { theme, setTheme } = useTheme();
813
const { formData, setFormData, handleSubmit } = useIndex();
914

15+
const darkBgColor =
16+
"bg-gradient-to-b from-indigo-950 via-purple-950 to-blue-950";
17+
const lightBgColor = "bg-gradient-to-b from-gray-100 via-gray-50 to-gray-200";
18+
1019
return (
11-
<div className="min-h-screen py-12">
12-
<div className="max-w-md mx-auto p-8">
13-
<h1 className="text-3xl font-bold text-center mb-8">
14-
MobaXterm Keygen
15-
</h1>
20+
<div
21+
className={`min-h-screen py-12 ${theme === "dark" ? darkBgColor : lightBgColor}`}
22+
>
23+
<div className="max-w-md mx-auto p-8 rounded-xl backdrop-blur-lg bg-white/10 dark:bg-white/10 light:bg-black/10 shadow-2xl border border-gray-700/50 dark:border-gray-700/50 light:border-gray-300/50">
24+
<div className="flex justify-between items-center mb-8">
25+
<h1
26+
className={`text-3xl font- ${theme === "dark" ? "text-white" : "text-black"}`}
27+
>
28+
MobaXterm Keygen
29+
</h1>
30+
<Switch
31+
defaultSelected={theme === "dark"}
32+
size="lg"
33+
color="secondary"
34+
startContent={<SunFilledIcon className="h-6 w-6" />}
35+
endContent={<MoonFilledIcon className="h-6 w-6" />}
36+
onChange={() => setTheme(theme === "dark" ? "light" : "dark")}
37+
/>
38+
</div>
1639

1740
<form className="space-y-6" onSubmit={handleSubmit}>
1841
<Select
@@ -68,6 +91,7 @@ export default function IndexPage() {
6891
type="submit"
6992
className="w-full"
7093
>
94+
<FiDownload className="h-4 w-4" />
7195
Download Key
7296
</Button>
7397
</form>

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {nextui} from '@nextui-org/theme'
1+
import { nextui } from "@nextui-org/theme";
22

33
/** @type {import('tailwindcss').Config} */
44
module.exports = {

0 commit comments

Comments
 (0)