Skip to content

Commit e44cebc

Browse files
author
takuma-hmng8
committed
demo update
1 parent 6bb6870 commit e44cebc

File tree

5 files changed

+38
-11
lines changed

5 files changed

+38
-11
lines changed

app/_home/index.module.scss

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,38 @@
2323
justify-content: center;
2424
mix-blend-mode: difference;
2525
pointer-events: none;
26-
gap: 12px;
2726
}
2827

2928
.title {
3029
font-size: 40px;
3130
font-weight: 500;
3231
pointer-events: none;
3332
@media (max-width: 560px) {
34-
font-size: 32px;
33+
font-size: 9vw;
3534
}
3635
}
3736

3837
.install {
3938
font-size: 16px;
39+
pointer-events: auto;
40+
cursor: pointer;
41+
display: flex;
42+
align-items: baseline;
43+
gap: 8px;
44+
&.copied {
45+
pointer-events: none;
46+
opacity: 0.24;
47+
}
4048
}
4149

4250
.link {
43-
margin-top: 16px;
44-
font-size: 16px;
51+
margin-top: 24px;
52+
font-size: 18px;
4553
a {
4654
pointer-events: auto;
4755
text-decoration: underline;
4856
margin-left: 8px;
4957
}
50-
@media (max-width: 560px) {
51-
font-size: 13px;
52-
}
5358
}
5459

5560
.input {
@@ -58,6 +63,7 @@
5863
align-items: center;
5964
justify-content: center;
6065
font-size: 16px;
66+
margin-top: 16px;
6167
p {
6268
width: 64px;
6369
}
@@ -71,6 +77,7 @@
7177
@media (max-width: 560px) {
7278
text-align: left;
7379
padding: 0 16px;
80+
width: 120px;
7481
}
7582
}
7683
}

app/_home/index.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,27 @@ import { EasingTypes } from "@/packages/use-shader-fx/src";
77
import Image from "next/image";
88
import s from "./index.module.scss";
99

10+
const Install = () => {
11+
const [copied, setIsCopied] = useState(false);
12+
return (
13+
<button
14+
onClick={(e) => {
15+
const target = e.target as HTMLButtonElement;
16+
navigator?.clipboard?.writeText(target.innerText).then(() => {
17+
setIsCopied(true);
18+
});
19+
}}
20+
className={`${s.install} ${copied ? s.copied : ""}`}>
21+
npm install @funtech-inc/use-shader-fx
22+
<Image src="copy.svg" alt="Copy" width={12} height={12} />
23+
</button>
24+
);
25+
};
26+
1027
export default function Page() {
1128
const [bpm, setBpm] = useState(120);
1229
const [easing, setEasing] = useState<EasingTypes>("easeOutQuad");
30+
1331
const easingTypes: EasingTypes[] = [
1432
"easeInSine",
1533
"easeOutSine",
@@ -42,6 +60,7 @@ export default function Page() {
4260
"easeOutBounce",
4361
"easeInOutBounce",
4462
];
63+
4564
return (
4665
<div className={s.wrapper}>
4766
<div className={s.canvas}>
@@ -51,9 +70,9 @@ export default function Page() {
5170
</div>
5271
<div className={s.content}>
5372
<h1 className={s.title}>⚡️ More FXs, Less GLSL</h1>
54-
<p className={s.install}>npm install @funtech-inc/use-shader-fx</p>
73+
<Install />
5574
<p className={s.link}>
56-
Oh, right, u can download the background gradient from
75+
Oh, right, u can download the gradient from
5776
<a href="/gradation" target="_blank">
5877
here 👉
5978
</a>

public/copy.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/css/index.module.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/css/index.module.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)