Skip to content

jhamyle823/jhamyle823

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

"ewin"; import { useState } from "react";

export default function Page() { const [noCount, setNoCount] = useState(0); const [yesPressed, setYesPressed] = useState(false); const yesButtonSize = noCount * 20 + 16;

const handleNoClick = () => { setNoCount(noCount + 1); };

const getNoButtonText = () => { const phrases = [ "No", "Are you sure?", "Really sure?", "Think again!", "Last chance!", "Surely not?", "You might regret this!", "Give it another thought!", "Are you absolutely certain?", "This could be a mistake!", "Have a heart!", "Don't be so cold!", "Change of heart?", "Wouldn't you reconsider?", "Is that your final answer?", "You're breaking my heart ;(", ];

return phrases[Math.min(noCount, phrases.length - 1)];

};

return (

{yesPressed ? ( <>
Ok yay!!!
</> ) : ( <>

Will you be my Valentine?

<button className={bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded mr-4} style={{ fontSize: yesButtonSize }} onClick={() => setYesPressed(true)} > Yes {noCount === 0 ? "No" : getNoButtonText()}
</> )}
); }

About

Config files for my GitHub profile.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published