Skip to content

Instantly share code, notes, and snippets.

View Nikolasgrizli's full-sized avatar
🏠
Working from home

Nikolay Evsukov Nikolasgrizli

🏠
Working from home
  • Ukraine
View GitHub Profile
$(".city-input").keyup(function() {
filter(this);
});
function filter(element) {
var value = $(element).val().toLowerCase();
$("[data-filter]").each(function () {
var $this = $(this),
lower = $this.data("filter").toLowerCase();
if (lower.indexOf(value) > -1) {
$this.show();
@Nikolasgrizli
Nikolasgrizli / window-resize-end.js
Created March 19, 2018 05:34 — forked from agragregra/window-resize-end.js
Window resize-end function
//Resize Window
function onResize() {
};
var doit;
doit = setTimeout(onResize, 400);
window.onresize = function() {
clearTimeout(doit);
doit = setTimeout(onResize, 400);
};
@Nikolasgrizli
Nikolasgrizli / js
Last active May 9, 2018 21:16
Окончание слова связанного с количеством
// html - <a href="'.$cart_url.'"><span class="cart-count">'.count($woo_cart_list).'</span><span class="end-count" id="end-count" >Товаров</span>в корзине</a>
(function($) {
$(document).ready(function(){
setTimeout(function() {
var numberCounter = $('.cart-count').text();
number = Math.abs(numberCounter);
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
@Nikolasgrizli
Nikolasgrizli / haml.json
Last active January 23, 2018 21:56
https://gist.github.com/akella/9757676 snippets ported for vscode HAML
{
"Block (with comment HAML)": {
"prefix": ".",
"body": [
"/ begin ${1}",
".${1}",
"\t${2}",
"/ end ${1}"
]
}
@for $i from 1 through $n {
&:nth-child(#{$i}) {
animation: loadIn 2s #{$i*0.11}s $easeOutSine forwards;
}
}
background: linear-gradient(49deg, #070707, #5a615f, #4fddb4, #44f0be);
background-size: 800% 800%;
-webkit-animation: AnimationName 16s ease infinite;
-moz-animation: AnimationName 16s ease infinite;
-o-animation: AnimationName 16s ease infinite;
animation: AnimationName 16s ease infinite;
@-webkit-keyframes AnimationName {
0%{background-position:10% 0%}