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
async function rotateText(target, texts, options={}) { | |
// target: the container of the text | |
// texts: an array with the text you want it to rotate between | |
// options: see below | |
var defaultOptions = { | |
rotateTime: 3000, | |
transitionTime: 500, | |
startText: 0, | |
appearFirst: true, | |
debug: false |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function match(string,regex) { | |
var matches = [] | |
var m; | |
// Based on example code from regex101.com | |
while ((m = regex.exec(string)) !== null) { | |
// This is necessary to avoid infinite loops with zero-width matches | |
if (m.index === regex.lastIndex) { | |
regex.lastIndex++; | |
} |
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
{ | |
"0":{ | |
"day":{ | |
"description":"Sunny", | |
"image":"http://openweathermap.org/img/wn/[email protected]" | |
}, | |
"night":{ | |
"description":"Clear", | |
"image":"http://openweathermap.org/img/wn/[email protected]" | |
} |