Skip to content

Web project using the DOM (HTML, CSS, & Vanilla Javascript), hosted on GitHub Pages.

Notifications You must be signed in to change notification settings

pwong09/affirmations-cookie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

affirmations-cookie

a browser generator

when a user navigates to the browser:
onclick - generate a random affirmation
the affirmation message appears on the screen

assets used

kawaii fortune cookie image fortune cookie
credit: Dj Tripti

some of the fortune cookie messages

pseudo code

//constants
array of affirmations

//state variables
ourMessage

//cached elements
affirm me button message element

//event listeners
document onload
btn click

//functions
init (onload)
make a random index
make ourMessage equal to the affirmation array at random index's value render function

render()
change the message element's inner text to ourMessage

handleclick()
make another random index make ourMessage equal to the affirmation array at random index's value render function

About

Web project using the DOM (HTML, CSS, & Vanilla Javascript), hosted on GitHub Pages.

Topics

Resources

Stars

Watchers

Forks