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
.text { | |
&-left { | |
text-align: left; | |
} | |
&-right { | |
text-align: right; | |
} | |
&-center { |
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
((w, d, $) => { | |
'use strict'; | |
d.addEventListener('DOMContentLoaded', () => { | |
}); | |
$(() => { | |
}); |
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
/** | |
* Copy string to the clipboard | |
* | |
* @example | |
* copy('random string'); | |
* | |
* @param {string} string | |
* @returns {void} | |
*/ | |
const copy = (string) => { |
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
/** | |
* Get date range | |
* | |
* @example | |
* getDateRange(30); | |
* | |
* @param {number} [days=1] - Number of days | |
* @returns {{start: string, end: string}} | |
*/ | |
const getDateRange = (days = 1) => { |
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
/** | |
* Selector | |
* | |
* @description | |
* Returns the first element that is a descendant of node that matches selectors. | |
* | |
* @example | |
* selector('div'); | |
* selector('div', document); | |
* |
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
/** | |
* Selector All | |
* | |
* @description | |
* Returns all element descendants of node that match selectors. | |
* | |
* @example | |
* selectorAll('div'); | |
* selectorAll('div', document); | |
* |
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
((html) => { | |
html.className = html.className.replace(/\bno-js\b/, 'js'); | |
})(document.documentElement); |
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
<!-- Let's load this in-viewport image normally --> | |
<img src="hero.jpg" alt=".."/> | |
<!-- Let's lazy-load the rest of these images --> | |
<img data-src="unicorn.jpg" loading="lazy" alt=".." class="lazyload"/> | |
<img data-src="cats.jpg" loading="lazy" alt=".." class="lazyload"/> | |
<img data-src="dogs.jpg" loading="lazy" alt=".." class="lazyload"/> | |
<script> | |
(async () => { |
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
/** | |
* Get URL Params | |
* | |
* @description String with URL parameters for using when Ajax post request | |
* | |
* @example | |
* getUrlParams({prop1: value1, prop2: value2}); | |
* | |
* @param {Object} object - object with properties and values | |
* @returns {string|null} |
OlderNewer