forked from Saamiya96/frontend-devDuel
-
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
gwaarb
committed
Jul 10, 2023
1 parent
20c998b
commit 5acba13
Showing
11 changed files
with
323 additions
and
180 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 was deleted.
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { useState } from "react"; | ||
import { motion } from "framer-motion"; | ||
|
||
const buttonStyling = "p-2 h-10 bg-red-500 text-white hover:animate-pulse hover:bg-blue-600 hover:text-white"; | ||
const itemStyling = "p-3 text-xs hover:animate-pulse hover:bg-blue-600 hover:text-white"; | ||
|
||
const itemVariants = { | ||
open: { | ||
opacity: 1, | ||
y: 0, | ||
transition: { type: "spring", stiffness: 300, damping: 24 } | ||
}, | ||
closed: { | ||
opacity: 0, | ||
y: 20, | ||
transition: { duration: 0.2 } | ||
} | ||
}; | ||
|
||
function Rules() { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
return ( | ||
<motion.nav | ||
initial={false} | ||
animate={isOpen ? "open" : "closed"} | ||
className="menu" | ||
> | ||
<div className="flex justify-center"> | ||
<motion.button | ||
className={buttonStyling} | ||
whileTap={{ scale: 0.97 }} | ||
onClick={() => setIsOpen(!isOpen)} | ||
> | ||
README.md | ||
<motion.div | ||
variants={{ | ||
open: { rotate: 180 }, | ||
closed: { rotate: 0 } | ||
}} | ||
transition={{ duration: 0.2 }} | ||
style={{ originY: 0.55 }} | ||
></motion.div> | ||
</motion.button> | ||
</div> | ||
<motion.ul | ||
className="text-center border-2 border-red-500" | ||
variants={{ | ||
open: { | ||
clipPath: "inset(0% 0% 0% 0%)", | ||
transition: { | ||
type: "spring", | ||
bounce: 0, | ||
duration: 0.7, | ||
delayChildren: 0.3, | ||
staggerChildren: 0.05 | ||
} | ||
}, | ||
closed: { | ||
clipPath: "inset(10% 50% 90% 50%)", | ||
transition: { | ||
type: "spring", | ||
bounce: 0, | ||
duration: 0.3 | ||
} | ||
} | ||
}} | ||
style={{ pointerEvents: isOpen ? "auto" : "none" }} | ||
> | ||
<motion.li className={itemStyling} variants={itemVariants}> | ||
Players take turns selecting card stats. | ||
</motion.li> | ||
<motion.li className={itemStyling} variants={itemVariants}> | ||
The player with the highest value wins the round. | ||
</motion.li> | ||
<motion.li className={itemStyling} variants={itemVariants}> | ||
The winner collects the opponent's card. | ||
</motion.li> | ||
<motion.li className={itemStyling} variants={itemVariants}> | ||
The game continues until one player has all the cards. | ||
</motion.li> | ||
</motion.ul> | ||
</motion.nav> | ||
); | ||
} | ||
|
||
export default Rules; |
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,5 +1,19 @@ | ||
import { motion } from "framer-motion"; | ||
|
||
function About() { | ||
return <h1>About Page</h1>; | ||
return ( | ||
<motion.div | ||
className="w-max mx-auto flex flex-col items-center" | ||
initial={{ opacity: 0, y: -10 }} | ||
animate={{ | ||
opacity: 1, | ||
y: 0, | ||
transition: { duration: 0.5, ease: "easeInOut" }, | ||
}} | ||
> | ||
<h1>About</h1> | ||
</motion.div> | ||
) | ||
} | ||
|
||
export default About; |
Oops, something went wrong.