-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
242 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,121 @@ | ||
"use client"; | ||
import { useState } from 'react'; | ||
import { useState } from "react"; | ||
import { styled, keyframes } from "styled-components"; | ||
import { css } from "../../styled-system/css"; | ||
import { Mochiy_Pop_One } from "next/font/google"; | ||
|
||
const Mochiy = Mochiy_Pop_One({ | ||
weight: "400", | ||
subsets: ["latin"], | ||
}); | ||
|
||
const body = css({ | ||
height: "100vh", | ||
backgroundColor: "#f9f9f9", | ||
padding: "20px", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
flexDirection: "column", | ||
}); | ||
|
||
const flex = css({ | ||
display: "flex", | ||
justifyContent: "space-around", | ||
alignItems: "center", | ||
flexDirection: "column", | ||
}); | ||
|
||
const flexBox = css({ | ||
height: "10dvh", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
flexDirection: "column", | ||
margin: "20px", | ||
}); | ||
|
||
const heading = css({ | ||
fontSize: "2rem", | ||
marginBottom: "20px", | ||
color: "#333", | ||
}); | ||
|
||
const animation = keyframes` | ||
100% { background-position-x: 200%; } | ||
`; | ||
|
||
const Button = styled.button` | ||
padding: 10px 20px; | ||
font-size: 1.2rem; | ||
color: #fff; | ||
background: linear-gradient(to right, Magenta, yellow, Cyan, Magenta) 0% | ||
center/200%; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: background 0.3s ease; | ||
text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.9); | ||
animation: ${animation} 2s linear infinite; | ||
`; | ||
|
||
const textStyle = css({ | ||
margin: "20px", | ||
fontSize: "3rem", | ||
color: "#333", | ||
}); | ||
|
||
const tweetButton = css({ | ||
padding: "10px 20px", | ||
color: "#fff", | ||
background: "#1da1f2", | ||
border: "none", | ||
borderRadius: "5px", | ||
cursor: "pointer", | ||
transition: "background 0.3s ease", | ||
textDecoration: "none", | ||
display: "inline-block", | ||
"&:hover": { | ||
background: "#0d95e8", | ||
}, | ||
}); | ||
|
||
export default function Home() { | ||
const [text, setText] = useState(''); | ||
const [pushed, setPushed] = useState(false); | ||
const [text, setText] = useState(""); | ||
|
||
const generateText = () => { | ||
const part1 = Math.random() < 0.5 ? "は" : "ポ"; | ||
const part2 = Math.random() < 0.5 ? "は" : "ポ"; | ||
const part3 = Math.random() < 0.5 ? "はま寿司" : "ポポヤシ"; | ||
setText(`${part1}!${part2}!${part3}‼️`); | ||
} | ||
setPushed(true); | ||
}; | ||
return ( | ||
<div> | ||
<h1>はま寿司 or ポポヤシ</h1> | ||
<button onClick={generateText}>ガチャ</button> | ||
<p>{text}</p> | ||
<div className={body}> | ||
<div className={flex}> | ||
<div className={flexBox}> | ||
<h1 className={`${heading} ${Mochiy.className}`}> | ||
はま寿司 or ポポヤシ | ||
</h1> | ||
<Button onClick={generateText} className={Mochiy.className}> | ||
ガチャ | ||
</Button> | ||
</div> | ||
<div className={flexBox}> | ||
<p className={`${textStyle} ${Mochiy.className}`}>{text}</p> | ||
{pushed && ( | ||
<div> | ||
<a | ||
href={`https://x.com/intent/post?text=${text}&url=${encodeURI("https://hamaorpopo.iorin.io")}`} | ||
className={`${tweetButton} ${Mochiy.className}`} | ||
> | ||
ツイートする | ||
</a> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |