This file contains hidden or 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
/* | |
* Stripe WebGl Gradient Animation | |
* All Credits to Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* https://kevinhufnagl.com | |
*/ | |
This file contains hidden or 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
// bug regex uses on chrome | |
// bug | |
const regex = /./g; | |
console.log(regex.test('a')) // true | |
console.log(regex.test('a')) // false | |
// no bug | |
const regex = /./g; | |
console.log(cloneRegex(regex).test('a')) // true |
This file contains hidden or 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
// getScrolls.js v1 | |
const getScrolls = { | |
element: window, | |
x: 'scrollX', | |
y: 'scrollY' | |
}; | |
if (!('scrollX' in window && 'scrollY' in window)) { | |
if ('pageXOffset' in window && 'pageYOffset' in window) { | |
getScrolls.x = 'pageXOffset'; | |
getScrolls.y = 'pageYOffset'; |
This file contains hidden or 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
/* flex-center.css v1 */ | |
.flex-center { | |
align-items: center; | |
display: flex; | |
justify-content: center; | |
} |
This file contains hidden or 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
/* bs4-media.css v1 */ | |
text-align: center; | |
@media all and(min-width:576px){ | |
text-align: center; | |
} | |
@media all and(min-width:768px){ | |
text-align: center; | |
} | |
@media all and(min-width:992px){ | |
text-align: center; |
This file contains hidden or 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
// setTimesout.ts v2.1 | |
export function setTimesout(fn: (timeout: number, index: number) => void, repeats = [0]) { | |
for (let index = 0; index < repeats.length; index++) { | |
const currentTimeout = repeats[index] | |
setTimeout(() => { | |
fn(currentTimeout, index) | |
}, currentTimeout) | |
} | |
} |
This file contains hidden or 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
/* mixin-bs4-width-classes.scss v1.0.1 */ | |
$widths: | |
1 | |
2 | |
3 | |
; | |
$bs4GridExtended: | |
576px | |
768px |
This file contains hidden or 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
// getScrollbarSize.js v1 | |
const cssText = '#scrollbar-size{height:99px;overflow:scroll;position:absolute;top:-9999px;width:99px}', | |
head = document.getElementsByTagName('head')[0] || document.body.parentNode.children[0], | |
style = document.createElement('style'), | |
scrollSizeDiv = document.createElement('div'), | |
scrollbarSize = undefined; | |
style.setAttribute('type', 'text/css'); | |
style.setAttribute('rel', 'stylesheet'); | |
if (!('styleSheet' in style)) { | |
style.appendChild(document.createTextNode(cssText)); |
This file contains hidden or 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
/*! | |
* is.js 0.9.0 | |
* Author: Aras Atasaygin. Adapted by Luis Lobo | |
*/ | |
// define 'is' object and current version | |
let is = {}; | |
is.VERSION = '0.9.0'; | |
// store navigator properties to use later |
This file contains hidden or 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
// capitalize.js v1 | |
function capitalize(text){ | |
return text.replace(/\w/g, function(match){ | |
return match.toUpperCase(); | |
}); | |
}; |
NewerOlder