-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🎨 style: ヒーローセクション SP実装 * 🎨 style: ヒーローセクション PC実装 * 🐛 fix: アニメーション名ミスタイプ修正 * 🐛 fix: ヒーローセクション絵文字ランダム選択のロジックのミス修正 * 🐛 fix: デバック用コードの削除 * 🐛 fix: 不要なフラグメントの削除 コンソールに、Warningでkey関連のエラーとdivを使ってねといった記述があり、フラグメントを取り除いたところ解決。 * 🐛 fix: 不明瞭、間違った定数名の変更、統一
- Loading branch information
1 parent
a3be167
commit 892316d
Showing
3 changed files
with
179 additions
and
48 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,131 @@ | ||
import { Noto_Emoji } from "next/font/google"; | ||
|
||
const emojiFont = Noto_Emoji({ | ||
subsets: ["emoji"], | ||
weight: "300", | ||
display: "swap", | ||
}); | ||
|
||
const EmojiShower: React.FC = () => { | ||
const emojis = [ | ||
"😊", | ||
"😂", | ||
"❤️", | ||
"👍", | ||
"🎉", | ||
"🥳", | ||
"😎", | ||
"💖", | ||
"👏", | ||
"🤔", | ||
"😆", | ||
"🔥", | ||
"✨", | ||
"🥺", | ||
"🤗", | ||
"😁", | ||
"😅", | ||
"🙌", | ||
"😇", | ||
"🍕", | ||
"🎈", | ||
"🎶", | ||
"🌟", | ||
"🍰", | ||
"💪", | ||
"🌸", | ||
"🎂", | ||
"🎁", | ||
"🌞", | ||
"🍔", | ||
"🎨", | ||
"💃", | ||
"🎊", | ||
"🕺", | ||
"🚀", | ||
"🌈", | ||
"🌍", | ||
"🧁", | ||
"🎵", | ||
"🍿", | ||
"🏆", | ||
"🧸", | ||
"🎮", | ||
"👑", | ||
"🍓", | ||
"🎲", | ||
"🚴", | ||
"🍟", | ||
"🦄", | ||
"🌺", | ||
]; | ||
|
||
const randomEmojis = []; | ||
|
||
for (let i = 1; i <= 7; i++) { | ||
const randomNumber = Math.floor(Math.random() * 50); | ||
randomEmojis.push(emojis[randomNumber]); | ||
} | ||
|
||
const textRainbowColors = [ | ||
"text-rose-500", | ||
"text-orange-500", | ||
"text-yellow-500", | ||
"text-lime-500", | ||
"text-sky-500", | ||
"text-indigo-500", | ||
"text-purple-500", | ||
]; | ||
|
||
const bgRainbowColors = [ | ||
"bg-rose-100", | ||
"bg-orange-100", | ||
"bg-yellow-100", | ||
"bg-lime-100", | ||
"bg-sky-100", | ||
"bg-indigo-100", | ||
"bg-purple-100", | ||
]; | ||
|
||
const animationsSp = [ | ||
"animate-[topToBottomAtHeroSp_6s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_6.5s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_7s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_7.5s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_8s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_8.5s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_9s_linear_infinite]", | ||
"animate-[topToBottomAtHeroSp_9.5s_linear_infinite]", | ||
]; | ||
|
||
const animationsPc = [ | ||
"lg:animate-[topToBottomAtHeroPc_6s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_6.5s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_7s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_7.5s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_8s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_8.5s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_9s_linear_infinite]", | ||
"lg:animate-[topToBottomAtHeroPc_9.5s_linear_infinite]", | ||
]; | ||
|
||
return ( | ||
<div className=" absolute -right-2 -top-8 z-0 flex h-[150vh] rotate-12 lg:-top-[15vh] lg:right-4 lg:rotate-[25deg]"> | ||
{randomEmojis.map((emoji, index) => { | ||
return ( | ||
<div | ||
key={index} | ||
className={`${emojiFont.className} ${textRainbowColors[index]} ${bgRainbowColors[index]} | ||
px-1 text-3xl lg:px-2 lg:text-6xl`} | ||
> | ||
<div className={`${animationsSp[index]} ${animationsPc[index]}`}> | ||
{emoji} | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default EmojiShower; |
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