Skip to content

Instantly share code, notes, and snippets.

View ziqq's full-sized avatar
💻
Coding

AntØn UstinØff ziqq

💻
Coding
  • beauty box
  • Georgia
View GitHub Profile
@ziqq
ziqq / tabs.sass
Created July 18, 2017 09:53
Tabs only on CSS
// HTML
<div class="product__tabs tabs">
<input type="radio" class="tabs__input" name="tab" id="tab-1" checked>
<label for="tab-1" class="tabs__label">Описание</label>
<input type="radio" class="tabs__input" name="tab" id="tab-2">
<label for="tab-2" class="tabs__label">Характеристики</label>
<input type="radio" class="tabs__input" name="tab" id="tab-3">
<label for="tab-3" class="tabs__label">Отзывы</label>
@ziqq
ziqq / no_animate.css
Created July 25, 2017 06:39
Turn OFF Animate.css on Mobile Devices
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
-o-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
@ziqq
ziqq / replace-svg.js
Created July 25, 2017 06:44
// Replace all SVG images with inline SVG
// Replace all SVG images with inline SVG
$('img.img-svg').each(function(){ //.img-svg add img class
var $img = $(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
$.get(imgURL, function(data) {
// Get the SVG tag, ignore the rest
var $svg = $(data).find('svg');
@ziqq
ziqq / tabs.js
Created November 30, 2017 06:49
tabs js
//HTML
<!-- begin tabs -->
<div class="tab__wrap">
<div class="tab__titles">
<div class="tab__title is-active" data-tab="0">tab 1</div>
<div class="tab__title" data-tab="1">tab 2</div>
<div class="tab__title" data-tab="2">tab 3</div>
</div>
<div class="tab__contentes">
<div class="tab__content" style="display: block;">content 1content 1content 1content 1content 1content 1content 1content 1content 1content 1</div>
@ziqq
ziqq / imageResize.js
Created March 16, 2018 05:59
mage Resize + Watermark + Thumbnails
var src = "___library/7-kazan/1/*";
var dst = "_ready";
var gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
cache = require('gulp-cache'),
del = require('del'),
imageResize = require('gulp-image-resize'),
watermark = require("gulp-watermark"),
rename = require("gulp-rename");
sass-convert -F scss -T sass application_styles.css.scss application_styles.css.sass
@ziqq
ziqq / lazyloadImage.js
Created January 24, 2020 06:22
Lazy load images
/**
* @param {HTMLElement} element
* @param {Object} settings
*/
function _initLazyLoadImage(element, settings) {
let images;
let s = settings || {};
if (element !== undefined) {
@ziqq
ziqq / detectBrowserType.js
Last active January 24, 2020 06:32
Test browser type
function _detectBrowserType() {
const html = document.querySelector('html');
const isChrome = !!window.chrome && !isOpera;
const isFirefox = typeof window.InstallTrigger !== 'undefined';
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
const isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
const isExplorer = typeof document !== 'undefined' && !!document.documentMode && !isEdge;
// if (/windows phone/i.test(userAgent)) {
@ziqq
ziqq / .stylelintrc
Created January 24, 2020 06:34
Style lint confing with order sorting
{
"plugins": [
"stylelint-scss",
"stylelint-selector-bem-pattern",
"stylelint-order"
],
"rules": {
"property-case": "lower",
"selector-type-case": "lower",
"indentation": 4,
@ziqq
ziqq / .pretierrc
Created January 24, 2020 06:35
Pretier config
{
"useTabs": false,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"tabWidth": 4,
"semi": true
}