Skip to content

Commit 1df378f

Browse files
authored
uwu (#6817)
1 parent e538800 commit 1df378f

File tree

6 files changed

+91
-13
lines changed

6 files changed

+91
-13
lines changed

public/images/uwu.png

51.4 KB
Loading

src/components/Layout/Footer.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ export function Footer() {
285285
dir="ltr">
286286
©{new Date().getFullYear()}
287287
</div>
288+
<div className="uwu-visible text-xs">
289+
Logo by
290+
<ExternalLink
291+
className="ms-1"
292+
href="https://twitter.com/sawaratsuki1004">
293+
@sawaratsuki1004
294+
</ExternalLink>
295+
</div>
288296
</div>
289297
<div className="flex flex-col">
290298
<FooterLink href="/learn" isHeader={true}>

src/components/Layout/HomeContent.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import Link from 'components/MDX/Link';
2626
import CodeBlock from 'components/MDX/CodeBlock';
2727
import {ExternalLink} from 'components/ExternalLink';
2828
import sidebarBlog from '../../sidebarBlog.json';
29+
import * as React from 'react';
2930

3031
function Section({children, background = null}) {
3132
return (
@@ -115,12 +116,15 @@ export function HomeContent() {
115116
<>
116117
<div className="ps-0">
117118
<div className="mx-5 mt-12 lg:mt-24 mb-20 lg:mb-32 flex flex-col justify-center">
119+
<div className="uwu-visible flex justify-center">
120+
<img className="uwu-visible h-24 lg:h-40" src="/images/uwu.png" />
121+
</div>
118122
<Logo
119123
className={cn(
120-
'mt-4 mb-3 text-link dark:text-link-dark w-24 lg:w-28 self-center text-sm me-0 flex origin-center transition-all ease-in-out'
124+
'uwu-hidden mt-4 mb-3 text-link dark:text-link-dark w-24 lg:w-28 self-center text-sm me-0 flex origin-center transition-all ease-in-out'
121125
)}
122126
/>
123-
<h1 className="text-5xl font-display lg:text-6xl self-center flex font-semibold leading-snug text-primary dark:text-primary-dark">
127+
<h1 className="uwu-hidden text-5xl font-display lg:text-6xl self-center flex font-semibold leading-snug text-primary dark:text-primary-dark">
124128
React
125129
</h1>
126130
<p className="text-4xl font-display max-w-lg md:max-w-full py-1 text-center text-secondary dark:text-primary-dark leading-snug self-center">
@@ -489,7 +493,13 @@ export function HomeContent() {
489493
</div>
490494

491495
<div className="mt-20 px-5 lg:px-0 mb-6 max-w-4xl text-center text-opacity-80">
492-
<Logo className="text-link dark:text-link-dark w-24 lg:w-28 mb-10 lg:mb-8 mt-12 h-auto mx-auto self-start" />
496+
<div className="uwu-visible flex justify-center">
497+
<img
498+
className="uwu-visible mb-10 lg:mb-8 h-24 lg:h-32"
499+
src="/images/uwu.png"
500+
/>
501+
</div>
502+
<Logo className="uwu-hidden text-link dark:text-link-dark w-24 lg:w-28 mb-10 lg:mb-8 mt-12 h-auto mx-auto self-start" />
493503
<Header>
494504
Welcome to the <br className="hidden lg:inline" />
495505
React community

src/components/Layout/TopNav/TopNav.tsx

+19-10
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,25 @@ export default function TopNav({
249249
{isMenuOpen ? <IconClose /> : <IconHamburger />}
250250
</button>
251251
<div className="f">
252-
<NextLink
253-
href="/"
254-
className={`active:scale-95 overflow-hidden transition-transform relative items-center text-primary dark:text-primary-dark p-1 whitespace-nowrap outline-link rounded-full 3xl:rounded-xl inline-flex text-lg font-normal gap-2`}>
255-
<Logo
256-
className={cn(
257-
'text-sm me-0 w-10 h-10 text-link dark:text-link-dark flex origin-center transition-all ease-in-out'
258-
)}
259-
/>
260-
<span className="sr-only 3xl:not-sr-only">React</span>
261-
</NextLink>
252+
<div className="uwu-visible">
253+
<NextLink
254+
href="/"
255+
className={`active:scale-95 mt-0.5 overflow-hidden transition-transform relative items-center justify-center text-primary dark:text-primary-dark p-1 whitespace-nowrap outline-link rounded-full 3xl:rounded-xl inline-flex text-lg font-normal gap-2`}>
256+
<img className="h-8" src="/images/uwu.png" />
257+
</NextLink>
258+
</div>
259+
<div className="uwu-hidden">
260+
<NextLink
261+
href="/"
262+
className={`active:scale-95 overflow-hidden transition-transform relative items-center text-primary dark:text-primary-dark p-1 whitespace-nowrap outline-link rounded-full 3xl:rounded-xl inline-flex text-lg font-normal gap-2`}>
263+
<Logo
264+
className={cn(
265+
'text-sm me-0 w-10 h-10 text-link dark:text-link-dark flex origin-center transition-all ease-in-out'
266+
)}
267+
/>
268+
<span className="sr-only 3xl:not-sr-only">React</span>
269+
</NextLink>
270+
</div>
262271
</div>
263272
<div className="flex flex-column justify-center items-center">
264273
<NextLink

src/pages/_document.tsx

+35
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,41 @@ const MyDocument = () => {
1919
}}
2020
/>
2121
<body className="font-text font-medium antialiased text-lg bg-wash dark:bg-wash-dark text-secondary dark:text-secondary-dark leading-base">
22+
<script
23+
dangerouslySetInnerHTML={{
24+
__html: `
25+
(function () {
26+
try {
27+
var preferredUwu;
28+
try {
29+
preferredUwu = localStorage.getItem('uwu');
30+
} catch (err) { }
31+
32+
const isUwuValue = window.location
33+
&& window.location.search
34+
&& window.location.search.match(/uwu=(true|false)/);
35+
36+
if (isUwuValue) {
37+
const isUwu = isUwuValue[1] === 'true';
38+
if (isUwu) {
39+
try {
40+
localStorage.setItem('uwu', true);
41+
} catch (err) { }
42+
document.documentElement.classList.add('uwu');
43+
console.log('uwu mode enabled. logo credits to @sawaratsuki1004 via https://github.com/SAWARATSUKI/ServiceLogos');
44+
} else {
45+
try {
46+
localStorage.removeItem('uwu', false);
47+
} catch (err) { }
48+
}
49+
} else if (preferredUwu) {
50+
document.documentElement.classList.add('uwu');
51+
}
52+
} catch (err) { }
53+
})();
54+
`,
55+
}}
56+
/>
2257
<script
2358
dangerouslySetInnerHTML={{
2459
__html: `

src/styles/index.css

+16
Original file line numberDiff line numberDiff line change
@@ -737,3 +737,19 @@ ol.mdx-illustration-block {
737737
transition-delay: 1s;
738738
pointer-events: none;
739739
}
740+
741+
.uwu-visible {
742+
display: none;
743+
}
744+
.uwu-hidden {
745+
display: flex;
746+
}
747+
748+
.uwu {
749+
.uwu-visible {
750+
display: flex;
751+
}
752+
.uwu-hidden {
753+
display: none;
754+
}
755+
}

0 commit comments

Comments
 (0)