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
| .clearfix:after { | |
| content: ""; | |
| display: table; | |
| clear: both | |
| } |
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
| *, | |
| *::before, | |
| *::after { | |
| box-sizing: inherit; | |
| } | |
| html { | |
| box-sizing: border-box; | |
| } |
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 randomNumber(min, max) { | |
| return min + Math.floor(Math.random() * (max + 1 - 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 sliceText(textNodes, symbols) { | |
| textNodes.forEach(cur => { | |
| const text = cur.innerText; | |
| let sliced = text.slice(0,symbols); | |
| if (sliced.length < text.length) { | |
| sliced += '...'; | |
| cur.innerText = sliced; | |
| } | |
| }); |
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 formatDigits(str) { | |
| return str.toString().replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '); | |
| } |
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 container = document.querySelector('.scroll-container'); | |
| container.addEventListener('wheel', horizontalWheelScroll); | |
| function horizontalWheelScroll (event) { | |
| let modifier; | |
| if (event.deltaMode === event.DOM_DELTA_PIXEL) { | |
| modifier = 1; | |
| // иные режимы возможны в Firefox | |
| } else if (event.deltaMode === event.DOM_DELTA_LINE) { | |
| modifier = parseInt(getComputedStyle(this).lineHeight); |
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 getSelectedText(){ | |
| var text = ""; | |
| if (window.getSelection) { | |
| text = window.getSelection(); | |
| }else if (document.getSelection) { | |
| text = document.getSelection(); | |
| }else if (document.selection) { | |
| text = document.selection.createRange().text; | |
| } |
OlderNewer