Skip to content

Commit 20b149a

Browse files
committed
addedd animated us; un:unni
1 parent 31fc087 commit 20b149a

4 files changed

Lines changed: 75 additions & 25 deletions

File tree

next.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { NextConfig } from "next";
22

3-
const isProd = process.env.NODE_ENV;
3+
const isDev = !!process.env.CODESPACE_NAME;
44

55
const nextConfig: NextConfig = {
6-
// basePath: isProd ? '/unnuo' : "",
7-
// assetPrefix: isProd ? '/unnuo' : "",
6+
basePath: isDev ? '' : '/unnuo',
7+
assetPrefix: isDev ? '' : '/unnuo',
88
output: "export", // <=== enables static exports
99
reactStrictMode: true,
1010
images: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbopack",
7-
"build": "next build --turbopack",
7+
"build": "next build",
88
"start": "next start",
99
"lint": "next lint"
1010
},

src/app/page.tsx

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1+
'use client'
2+
13
import Image from "next/image";
4+
import { useState } from "react"
5+
import { useSpring, animated, config } from '@react-spring/web'
6+
import { getAllUs } from "../lib/u_utils";
27

38
export default function Home() {
49
return (
510
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
611
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
7-
<Image
8-
className="dark:invert"
9-
src="/next.svg"
10-
alt="Next.js logo"
11-
width={180}
12-
height={38}
13-
priority
14-
/>
15-
<ol className="list-inside list-decimal text-sm/6 text-center sm:text-left font-[family-name:var(--font-geist-mono)]">
16-
<li className="mb-2 tracking-[-.01em]">
17-
Get started by editing{" "}
18-
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-[family-name:var(--font-geist-mono)] font-semibold">
19-
src/app/page.tsx
20-
</code>
21-
.
22-
</li>
23-
<li className="tracking-[-.01em]">
24-
Save and see your changes instantly.
25-
</li>
26-
</ol>
27-
12+
<Scrolling/>
13+
<hr/>
14+
<h1></h1>
15+
<p>ṵṷṹṻụủứừ⒰υṳ</p>
16+
<hr/>
17+
<h1></h1>
18+
<p>ỤỦỨỪỬῢΰῦṺṴUὺ</p>
19+
<hr/>
20+
<h1></h1>
21+
<p>ῧuṲỮỰṶṸύῠῡ</p>
22+
<hr/>
23+
<h1></h1>
24+
<p>ửữựὐὑὒὓὔὕὖὗ</p>
25+
<hr/>
26+
<Scrolling/>
2827
<div className="flex gap-4 items-center flex-col sm:flex-row">
2928
<a
3029
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto"
@@ -101,3 +100,40 @@ export default function Home() {
101100
</div>
102101
);
103102
}
103+
104+
105+
function Scrolling() {
106+
const [flip, set] = useState(false)
107+
108+
const words = getAllUs().split("");
109+
110+
const { scroll } = useSpring({
111+
scroll: (words.length - 1) * 50,
112+
from: { scroll: 0 },
113+
reset: true,
114+
reverse: flip,
115+
delay: 200,
116+
config: config.molasses,
117+
onRest: () => set(!flip),
118+
})
119+
120+
return (
121+
<animated.div
122+
style={{
123+
position: 'relative',
124+
//width: '100%',
125+
height: 60,
126+
overflow: 'hidden',
127+
fontSize: '2.5em',
128+
}}
129+
scrollTop={scroll}>
130+
{words.map((word, i) => (
131+
<div
132+
key={`${word}_${i}`}
133+
style={{ height: 50, textAlign: 'center' }}>
134+
{word}
135+
</div>
136+
))}
137+
</animated.div>
138+
)
139+
}

src/lib/u_utils.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const getRandomU = () => {
2+
const uString = ["ṵṷṹṻụủứừ⒰υṳ", "ỤỦỨỪỬῢΰῦṺṴUὺ", "ῧuṲỮỰṶṸύῠῡ", "ửữựὐὑὒὓὔὕὖὗ" ];
3+
const randomIndex = Math.floor(Math.random() * uString.length)
4+
const randomU = uString.slice(randomIndex, randomIndex + 1);
5+
return randomU;
6+
}
7+
8+
export const getAllUs = () => {
9+
return "ṵṷṹṻụủứừ⒰υṳỤỦỨỪỬῢΰῦṺṴUὺῧuṲỮỰṶṸύῠῡửữựὐὑὒὓὔὕὖὗ";
10+
}
11+
12+
export const getAllUpsideDownUs = () => {
13+
return "⒩ηṅṇṉṋἠἡἢἣἤἥἦἧὴήᾐᾑᾒᾓᾔᾕᾖᾗῂῃῄῆῇn"
14+
}

0 commit comments

Comments
 (0)