Skip to content

Instantly share code, notes, and snippets.

View WebTarantul's full-sized avatar

Taras Kapusta WebTarantul

View GitHub Profile
@WebTarantul
WebTarantul / map.js
Created August 6, 2018 17:42
randomNumber(min,max)
// случайное число от и до
function getRandomNumber(min, max) {
var rand = min + Math.random() * (max + 1 - min);
rand = Math.floor(rand);
return rand;
}
@WebTarantul
WebTarantul / Untitled-2
Created July 13, 2018 07:15
add img in Magento 2
<img src="{{view url=" images/slide-bg.jpg "}}" alt="test" />
@WebTarantul
WebTarantul / use_PostHTML_svg.html
Last active June 28, 2019 07:01
use_PostHTML_svg
<!-- first in body -->
<div style="display: none;">
<include src="build/img/symbols.svg"></include>
</div>
<!-- using -->
<svg class="efect__timer" width="238" height="276">
<use xlink:href="#icon-timer"></use>
</svg>
@WebTarantul
WebTarantul / Preloader_code-pulse
Created April 26, 2018 16:29
preloader_code-pulse
$(window).on('load', function() {
$('.preloader').delay(1000).fadeOut('slow');
});
<div class="preloader"><div class="pulse"></div></div>
.preloader
position: fixed
top: 0
left: 0
@WebTarantul
WebTarantul / btnUP
Created April 26, 2018 16:27
btn-UP
$('.top').click(function() {
$('html, body').stop().animate({scrollTop: 0}, 'slow', 'swing');
});
$(window).scroll(function() {
if ($(this).scrollTop() > $(window).height()) {
$('.top').addClass("active");
} else {
$('.top').removeClass("active");
};
});
@WebTarantul
WebTarantul / gist:774540bb2583c7dbf729c23151897d46
Created March 20, 2018 12:40
.visually-hidden:not(:focus):not(:active)
.visually-hidden:not(:focus):not(:active) {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
border: 0;
padding: 0;
white-space: nowrap;
clip-path: inset(100%);
clip: rect(0 0 0 0);
@WebTarantul
WebTarantul / css-visually-hidden.css
Created March 19, 2018 16:09
CSS: Visually hidden
.visually-hidden {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
@WebTarantul
WebTarantul / button.sass
Created March 16, 2018 20:34 — 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
HTML:
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
<span class="tab">Вкладка 2</span>
<span class="tab">Вкладка 3</span>
</div>
<div class="tab_content">
<div class="tab_item">Содержимое 1</div>
<div class="tab_item">Содержимое 2</div>
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>