Skip to content

Instantly share code, notes, and snippets.

View hatamsoyunov's full-sized avatar

Hatam hatamsoyunov

View GitHub Profile
@hatamsoyunov
hatamsoyunov / declOfNum.ts
Last active December 10, 2020 10:17 — forked from realmyst/gist:1262561
Склонение числительных в javascript
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]];
};
@hatamsoyunov
hatamsoyunov / mousewheel-icon.html
Last active December 5, 2017 18:36 — forked from agragregra/mousewheel-icon.html
Mouse Wheel Animation CSS Icon | http://jsfiddle.net/cmajo9h6/
<div class="mouse_icon">
<div class="wheel"></div>
</div>
// SASS
#main
position: relative
width: 100%
height: 100vh
@hatamsoyunov
hatamsoyunov / gist:96fe25b80db235b865a1b310d1c3c34a
Created June 28, 2017 18:32 — forked from dmitrymomot/gist:4654524
Получение в jquery get-параметра с url страницы
// получаем URL параметры
// var allVars = $.getUrlVars();
// получаем значение параметра по его имени
// var byName = $.getUrlVar('name');
$.extend({
getUrlVars: function(){
var vars = [], hash;
@hatamsoyunov
hatamsoyunov / scroll-top.html
Created April 8, 2017 19:01 — forked from agragregra/scroll-top.html
Scroll Top Button
<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
@hatamsoyunov
hatamsoyunov / slowscroll.js
Last active June 7, 2018 01:30 — forked from Burick/slowscroll.js
Плавный скролл до якоря
$('a[href^="#"]').click(function(){
var el = $(this).attr('href');
$('body,html').animate({
scrollTop: $(el).offset().top}, 700);
return false;
});
@hatamsoyunov
hatamsoyunov / scroll-next.js
Created April 8, 2017 18:51 — forked from agragregra/scroll-next.js
jQuery Scroll To Next Section
$(".scroll-next").click(function() {
var cls = $(this).closest(".section").next().offset().top;
$("html, body").animate({scrollTop: cls}, "slow");
});
@hatamsoyunov
hatamsoyunov / button.sass
Last active November 14, 2017 09:59 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600