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
| .sr-only { | |
| border: 0 !important; | |
| clip: rect(1px, 1px, 1px, 1px) !important; | |
| -webkit-clip-path: inset(50%) !important; | |
| clip-path: inset(50%) !important; | |
| height: 1px !important; | |
| margin: -1px !important; | |
| overflow: hidden !important; | |
| padding: 0 !important; | |
| position: absolute !important; |
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
| display: -webkit-box; | |
| -webkit-box-orient: vertical; | |
| -webkit-line-clamp: 2; |
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
| const capitalize = ([first, ...rest], lowerRest = false) => | |
| first.toUpperCase() + (lowerRest ? rest.join('').toLowerCase() : rest.join('')); |
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
| const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); |
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
| const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0'); |
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
| export default (el) => { | |
| const $el = $(el); | |
| const top = $el.offset().top - 250; | |
| const bottom = top + $el.height(); | |
| const scroll = $(window).scrollTop(); | |
| return scroll > top && scroll < bottom; | |
| } |
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
| function random(min, max) { | |
| return Math.random() * (max - min) + min; | |
| } |
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
| function isAnyPartOfElementInViewport(el) { | |
| const rect = el.getBoundingClientRect(); | |
| // DOMRect { x: 8, y: 8, width: 100, height: 100, top: 8, right: 108, bottom: 108, left: 8 } | |
| const windowHeight = (window.innerHeight || document.documentElement.clientHeight); | |
| const windowWidth = (window.innerWidth || document.documentElement.clientWidth); | |
| // http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap | |
| const vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0); | |
| const horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0); |
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
| isElementInViewport(el) { | |
| const rect = el.getBoundingClientRect(); | |
| return ( | |
| rect.top >= 0 && | |
| rect.left >= 0 && | |
| rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | |
| rect.right <= (window.innerWidth || document.documentElement.clientWidth) | |
| ); | |
| } |
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
| function checkVisibility(el) { | |
| var dTop = $(window).scrollTop(), | |
| dBot = dTop + $(window).height(), | |
| elTop = el.offset().top, | |
| elBot = elTop + el.height(); | |
| return ((elTop <= dBot) && (elBot >= dTop)); | |
| } |
NewerOlder