Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"nextra": "^4.6.1",
"nextra-theme-docs": "^4.6.1",
"react": "^19.2.3",
"react-confetti": "^6.4.0",
"react-dom": "^19.2.3",
"react-snowfall": "^2.4.0",
"sonner": "^2.0.7",
Expand Down
33 changes: 33 additions & 0 deletions src/components/Confetti/Confetti.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use client';

import React from 'react';
import ReactConfetti from 'react-confetti';

export const Confetti = () => {
// We need window size for react-confetti to work properly full screen
// If react-use is not available we might need a custom hook or just 100vw/100vh
// Let's check if react-use is installed, otherwise fallback to CSS approach or basic hook

const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 });

React.useEffect(() => {
const updateDimensions = () => {
setDimensions({
width: window.innerWidth,
height: window.innerHeight
});
};

// Initial set
updateDimensions();

window.addEventListener('resize', updateDimensions);
return () => window.removeEventListener('resize', updateDimensions);
}, []);

return (
<div className='fixed inset-0 w-screen h-screen z-0 pointer-events-none'>
<ReactConfetti width={dimensions.width} height={dimensions.height} numberOfPieces={50} recycle={true} />
</div>
);
};
20 changes: 19 additions & 1 deletion src/components/Logo/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ENABLE_CHRISTMAS_THEME } from '../../constants/featureFlags';
import { ENABLE_CHRISTMAS_THEME, ENABLE_NEW_YEAR_THEME } from '../../constants/featureFlags';

export function Logo() {
return (
Expand Down Expand Up @@ -29,6 +29,15 @@ export function Logo() {
<rect x='18' y='-4' width='36' height='8' rx='4' fill='white' />
</g>
)}
{/* New Year Hat */}
{ENABLE_NEW_YEAR_THEME && (
<g transform='translate(15 5) rotate(-30) scale(1.2) translate(-36 0)'>
<path d='M25 5 L 55 5 L 40 -35 Z' fill='#FFD700' />
<circle cx='40' cy='-35' r='4' fill='#FF4500' />
<circle cx='35' cy='-15' r='3' fill='#4169E1' />
<circle cx='45' cy='-5' r='3' fill='#32CD32' />
</g>
)}
</svg>
);
}
Expand All @@ -50,6 +59,15 @@ export function LogoMobile() {
<rect x='18' y='-4' width='36' height='8' rx='4' fill='white' />
</g>
)}
{/* New Year Hat */}
{ENABLE_NEW_YEAR_THEME && (
<g transform='translate(15 5) rotate(-30) scale(1.2) translate(-36 0)'>
<path d='M25 5 L 55 5 L 40 -35 Z' fill='#FFD700' />
<circle cx='40' cy='-35' r='4' fill='#FF4500' />
<circle cx='35' cy='-15' r='3' fill='#4169E1' />
<circle cx='45' cy='-5' r='3' fill='#32CD32' />
</g>
)}
</svg>
);
}
20 changes: 10 additions & 10 deletions src/components/Snowflakes/Snowflakes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import Snowfall from 'react-snowfall';

export const Snowflakes = () => {
return (
<Snowfall
style={{
position: 'fixed',
width: '100vw',
height: '100vh',
zIndex: 50,
pointerEvents: 'none'
}}
snowflakeCount={200}
/>
<div className='fixed inset-0 w-screen h-screen z-0 pointer-events-none'>
<Snowfall
style={{
position: 'absolute',
width: '100%',
height: '100%'
}}
snowflakeCount={150}
/>
</div>
);
};
1 change: 1 addition & 0 deletions src/constants/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const ENABLE_CHRISTMAS_THEME = true;
export const ENABLE_NEW_YEAR_THEME = false;
10 changes: 7 additions & 3 deletions src/providers/DocsProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Theme } from '@radix-ui/themes';
import { ThemeSwitch } from 'nextra-theme-docs';
import { usePathname } from 'next/navigation';
import { Snowflakes } from '../components/Snowflakes/Snowflakes';
import { ENABLE_CHRISTMAS_THEME } from '../constants/featureFlags';
import { Confetti } from '../components/Confetti/Confetti';
import { ENABLE_CHRISTMAS_THEME, ENABLE_NEW_YEAR_THEME } from '../constants/featureFlags';

// Defer Nextra Search until user clicks the trigger (client-only wrapper)
const SearchDynamic = dynamic(() => import('../components/NextraSearch/NextraSearch'), { ssr: false, loading: () => <div /> });
Expand Down Expand Up @@ -88,8 +89,11 @@ export default function DocsProviders({ children, pageMap }) {
{isMobile && <ConditionalNavbar />}
<Theme accentColor='red' grayColor='gray' scaling='100%'>
{ENABLE_CHRISTMAS_THEME && <Snowflakes />}
{!isMobile && <ConditionalNavbar />}
{children}
{ENABLE_NEW_YEAR_THEME && <Confetti />}
<div className='relative z-10'>
{!isMobile && <ConditionalNavbar />}
{children}
</div>
</Theme>
</Layout>
</>
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7698,6 +7698,13 @@ react-compiler-runtime@^19.1.0-rc.2:
resolved "https://registry.yarnpkg.com/react-compiler-runtime/-/react-compiler-runtime-19.1.0-rc.1-rc-af1b7da-20250421.tgz#996cf954a27b7f73ade1710e44f4303fa84e80e2"
integrity sha512-Til/juI+Zfq+eYpGYn9lFxqW5RyJDs3ThOxmg0757aMrPpfx/Zb0SnGMVJhF3vw+bEQjJiD+xPFD3+kE0WbyeA==

react-confetti@^6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/react-confetti/-/react-confetti-6.4.0.tgz#e9416b5b3c8baf6f0bb1c5a8e1e3c89babd2c837"
integrity sha512-5MdGUcqxrTU26I2EU7ltkWPwxvucQTuqMm8dUz72z2YMqTD6s9vMcDUysk7n9jnC+lXuCPeJJ7Knf98VEYE9Rg==
dependencies:
tween-functions "^1.2.0"

react-dom@^19.2.3:
version "19.2.3"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.3.tgz#f0b61d7e5c4a86773889fcc1853af3ed5f215b17"
Expand Down Expand Up @@ -8689,6 +8696,11 @@ tsx@^4.19.3:
optionalDependencies:
fsevents "~2.3.3"

tween-functions@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/tween-functions/-/tween-functions-1.2.0.tgz#1ae3a50e7c60bb3def774eac707acbca73bbc3ff"
integrity sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA==

twoslash-protocol@0.3.4:
version "0.3.4"
resolved "https://registry.yarnpkg.com/twoslash-protocol/-/twoslash-protocol-0.3.4.tgz#276ccd73dbbc99e19d8df7214b28c01a04d2294a"
Expand Down