Skip to content

Commit

Permalink
fix: background integration (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilialtes authored Jan 27, 2025
2 parents 96ee4fc + 5367ef3 commit f0e0514
Show file tree
Hide file tree
Showing 9 changed files with 22,751 additions and 79 deletions.
22,352 changes: 22,352 additions & 0 deletions .pnp.cjs

Large diffs are not rendered by default.

285 changes: 285 additions & 0 deletions .pnp.loader.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Home: NextPage = () => {

return (
<>
<div className="relative flex justify-center items-center min-h-screen text-white overflow-hidden">
<div className="relative flex justify-center items-center min-h-screen overflow-hidden">
<StarryBackground />
<div className="relative text-center p-4 space-y-6 -z-5">
<h1 className="text-5xl md:text-6xl font-extrabold mb-4">
Expand Down
4 changes: 4 additions & 0 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useOutsideClick } from "~~/hooks/scaffold-stark";
import { CustomConnectButton } from "~~/components/scaffold-stark/CustomConnectButton";
import { usePathname } from "next/navigation";
import StarryBackground from "../components/starryBackground/_components/StarryBackground";
import ToggleMode from "./ToggleMode";

type HeaderMenuLink = {
label: string;
Expand Down Expand Up @@ -123,6 +124,9 @@ export const Header = () => {
</ul>
</div>
<div className="flex ml-auto">
<ToggleMode />
</div>
<div className="flex mr-2">
<CustomConnectButton />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/components/ScaffoldStarkAppWithProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { useNativeCurrencyPrice } from "~~/hooks/scaffold-stark/useNativeCurrenc

const ScaffoldStarkApp = ({ children }: { children: React.ReactNode }) => {
useNativeCurrencyPrice();
const { resolvedTheme } = useTheme();
const isDarkMode = resolvedTheme === "dark";
const { resolvedTheme, theme } = useTheme();
const isDarkMode = theme
return (
<>
<div className="flex relative flex-col min-h-screen bg-main">
Expand Down
26 changes: 26 additions & 0 deletions packages/nextjs/components/ToggleMode.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { MoonIcon, SunIcon } from "@radix-ui/react-icons";
import { useTheme } from "next-themes";

const ToggleMode = () => {
const { setTheme, theme } = useTheme();
const isDarkMode = theme === "dark";

const toggleMode = () => {
theme == "dark" ? setTheme("light") : setTheme("dark");
};

console.log("Current Theme:", theme);

return (
<button className="btn btn-ghost" onClick={toggleMode}>
{isDarkMode ? (
<MoonIcon className="h-6 w-6 text-yellow-400" />
) : (
<SunIcon className="h-6 w-6 text-yellow-400" />
)}
</button>
);
};

export default ToggleMode;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

const StarryBackground = () => {
return (
<div className="absolute inset-0 bg-gradient-to-b from-[#243B55] to-[#141E30] overflow-hidden">
<div className="absolute inset-0 overflow-hidden">
<div
className="absolute w-[1px] h-[1px] bg-transparent animate-stars"
style={{
Expand Down
4 changes: 4 additions & 0 deletions packages/nextjs/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ p {
filter: blur(229px);
position: absolute;
top: 0;
display: none
}

.circle-gradient-blue {
Expand All @@ -49,6 +50,7 @@ p {
position: absolute;
top: 0;
right: 0;
display: none
}

.border-gradient {
Expand Down Expand Up @@ -100,6 +102,7 @@ p {
border-radius: 630px;
background: #7353d2;
filter: blur(229px);
display: none
}

.circle-gradient-blue-dark {
Expand All @@ -109,6 +112,7 @@ p {
position: absolute;
top: 0;
right: 0;
display: none
}

@layer utilities {
Expand Down
Loading

0 comments on commit f0e0514

Please sign in to comment.