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
<style> | |
@import url('https://fonts.googleapis.com/css2?family=Festive&display=swap'); | |
</style> | |
<div id='box'> | |
<div id='bg'></div> | |
<img id='product' src='https://source.unsplash.com/dcPNZeSY3yk'> | |
<img id='person' src='https://source.unsplash.com/UOavP_Z38lE/800x450'> | |
<div id='tagline' class="text">Spring Sale!</div> | |
<div id='cta' class="btn btn-lg btn-outline-dark bg-light">Don't Miss It!</div> |
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
/** | |
* Make a bag of string constants, kind of like a Java enum. | |
* e.g. var Kind = new Enum('TEXT PERSON'); | |
* gives you Kind.TEXT == 'TEXT', Kind.PERSON = 'PERSON' | |
* | |
* Each of the constants has an isCONSTANT() function added, so you can write: | |
* Kind.isTEXT(myvar) -- which has the advantage that it will create a noisy error if | |
* Kind.TEXT ceased to be a valid value, or if myvar is invalid. | |
* | |
* Use-case: It's safer than using strings for constants, especially around refactoring. |