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
/* Where the magic begins: */ | |
.shiny { | |
background-image: -webkit-linear-gradient(left, white 25%, #fde071 37.5%, #ef9671, #996a6e 62.5%, white 75%); | |
background-image: linear-gradient(90deg, white 25%, #fde071 37.5%, #ef9671, #996a6e 62.5%, white 75%); | |
background-position: right center; | |
background-size: 400% auto; | |
-webkit-background-clip: text; | |
background-clip: text; | |
color: white; |
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
/* Where the magic begins: */ | |
.shiny { | |
background-image: -webkit-linear-gradient(left, white 25%, #fde071 37.5%, #ef9671, #996a6e 62.5%, white 75%); | |
background-image: linear-gradient(90deg, white 25%, #fde071 37.5%, #ef9671, #996a6e 62.5%, white 75%); | |
background-position: right center; | |
background-size: 400% auto; | |
color: white; | |
} |
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
/* Just for flavour: */ | |
@import url('https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700,700i,900,900i'); | |
html, body { | |
height: 100%; | |
margin: 0; | |
} | |
body { |
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
/* < ES2018 */ | |
var catMaru = { name: 'Maru', mittens: true, color: 'tabby' }; | |
var name = catMaru.name; | |
var coat = {}; | |
coat.mittens = catMaru.mittens; | |
coat.color = catMaru.color; | |
/* >= ES2018 */ | |
var catMaru = { name: 'Maru', mittens: true, color: 'tabby' }; | |
var { name, ...coat } = catMaru; |
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
/* ES5 */ | |
var catMaru = { name: 'Maru', mittens: true }; | |
var name = catMaru.name; | |
var mittens = catMaru.mittens; | |
var likes = catMaru.likes === undefined ? 'boxes' : catMaru.likes; | |
/* >= ES6 */ | |
var catMaru = { name: 'Maru', mittens: true }; | |
var { name, mittens, likes = 'boxes' } = catMaru; |
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
/* ES5 */ | |
var catMaru = { | |
name: 'Maru', | |
appearance: { | |
mittens: true, | |
coat: 'tabby' | |
} | |
}; | |
var name = catMaru.name; | |
var color = catMaru.appearance.coat; |
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
/* ES5 */ | |
var catMaru = { name: 'Maru', mittens: true, likes: 'boxes' }; | |
var name = catMaru.name; | |
var mittens = catMaru.mittens; | |
var likes = catMaru.likes; | |
/* >= ES6 */ | |
var catMaru = { name: 'Maru', mittens: true, likes: 'boxes' }; | |
var { name, mittens, likes } = catMaru; |
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
/* ES5 */ | |
var cats = [ 'Maru', 'Colonel Meow' ]; | |
var yayCat = cats[0]; | |
var lolCat = cats[2] === undefined ? 'Grumpy Cat' : cats[2]; | |
/* >= ES6 */ | |
var cats = [ 'Maru', 'Colonel Meow' ]; | |
var [ yayCat, , lolCat = 'GrumpyCat' ] = cats; |
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
/* ES5 */ | |
var cats = [ 'Maru', 'Colonel Meow', 'Grumpy Cat' ]; | |
var yayCat = cats[0], lolCat = cats[2]; | |
var tmpCat = yayCat; | |
yayCat = lolCat; | |
lolCat = tmpCat; | |
/* >= ES6 */ | |
var cats = [ 'Maru', 'Colonel Meow', 'Grumpy Cat' ]; | |
var [ yayCat, , lolCat ] = cats; |
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
/* ES5 */ | |
var actions = [ 'Slash', 'Hiss', 'Yowl']; | |
catFight.apply(undefined, actions); | |
// > 'Slash! Hiss! Yowl!' | |
/* >= ES6 */ | |
var actions = [ 'Slash', 'Hiss', 'Yowl']; | |
catFight(...actions); | |
// > 'Slash! Hiss! Yowl!' |
NewerOlder