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 declination of number | |
* @param {Number} number – current number | |
* @param {Array} words – words array | |
* @return {String} | |
*/ | |
export const declOfNum = (number, words) => words[(number % 100 > 4 && number % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][(number % 10 < 5) ? number % 10 : 5]]; |
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
@mixin iphoneXR() { | |
@media only screen | |
and (device-width: 414px) | |
and (device-height: 896px) | |
and (-webkit-device-pixel-ratio: 2) { | |
@content; | |
} | |
} | |
@mixin iphoneXS() { |
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 random integer | |
* @param {Number} min – min integer number | |
* @param {Number} max – max integer number | |
* @return {Number} | |
*/ | |
export const randomInteger = (min, max) => { | |
const rand = min - 0.5 + Math.random() * (max - min + 1); | |
return Math.round(rand); |
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
@mixin font-face($family, $src, $style: normal, $weight: 400, $display: swap) { | |
@font-face { | |
font-family: $family; | |
src: url('#{$src}.woff2') format('woff2'), | |
url('#{$src}.woff') format('woff'); | |
font-style: $style; | |
font-weight: $weight; | |
font-display: $display; | |
} | |
} |
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
<meta name="format-detection" content="telephone=no"> |
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
/** | |
* Check object function | |
* @param {val} | |
* @return {Boolean} | |
*/ | |
export const isObject = val => { | |
if (val === null) { | |
return false; | |
} | |
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 browser scrollbar width | |
* @return {Number} | |
*/ | |
export const getScrollbarWidth = () => { | |
const div = document.createElement('div'); | |
div.style.cssText = ` | |
height: 100px; | |
overflow: scroll; |