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 const declOfNum = (number: number, titles: string[]) => { | |
| const cases = [2, 0, 1, 1, 1, 2]; | |
| return titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[number % 10 < 5 ? number % 10 : 5]]; | |
| }; |
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
| <div class="mouse_icon"> | |
| <div class="wheel"></div> | |
| </div> | |
| // SASS | |
| #main | |
| position: relative | |
| width: 100% | |
| height: 100vh |
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
| // получаем URL параметры | |
| // var allVars = $.getUrlVars(); | |
| // получаем значение параметра по его имени | |
| // var byName = $.getUrlVar('name'); | |
| $.extend({ | |
| getUrlVars: function(){ | |
| var vars = [], hash; |
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
| <div class="top" title="Наверх"><i class="fa fa-angle-double-up"></i></div> | |
| .top | |
| position: fixed | |
| bottom: 25px | |
| background-color: #E0E0E0 | |
| border-radius: 10em | |
| color: #666 | |
| font-size: 26px | |
| width: 50px |
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
| $('a[href^="#"]').click(function(){ | |
| var el = $(this).attr('href'); | |
| $('body,html').animate({ | |
| scrollTop: $(el).offset().top}, 700); | |
| return false; | |
| }); |
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
| $(".scroll-next").click(function() { | |
| var cls = $(this).closest(".section").next().offset().top; | |
| $("html, body").animate({scrollTop: cls}, "slow"); | |
| }); |