Skip to content

Instantly share code, notes, and snippets.

View muks999's full-sized avatar

Muks999 muks999

View GitHub Profile
@muks999
muks999 / functions.php
Created January 7, 2018 04:36 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
@muks999
muks999 / Custom Select
Created June 14, 2018 00:43
Custom Select
let select = () => {
let selectCurrent = document.querySelectorAll('.select__current'),
selectItem = document.querySelectorAll('.select__list_item');
for (let item of selectCurrent) {
item.addEventListener('click', function () {
this.parentElement.classList.toggle('is-open');
})
}
@muks999
muks999 / fileupload
Created June 14, 2018 00:48
fileupload
.file-upload
span.file-upload__text Прикрепите файл
.file-upload__btn
label.file-upload__btn_label
input(type="file")
span.file-upload__btn_text Загрузить
.file-upload {
align-items: center;
@muks999
muks999 / Tabs Native JS
Created June 14, 2018 00:48
Tabs Native JS
(function () {
let tabNav = document.querySelectorAll('.tab-list>li'),
tabContent = document.querySelectorAll('.tab-content__item'),
tabName;
tabNav.forEach(function (item) {
item.addEventListener('click', selectTabNav)
});
function selectTabNav() {
tabNav.forEach(function (item) {
@muks999
muks999 / arrow.styl
Created June 14, 2018 00:49
arrow.styl
.arrow-up
absolute($top:-20px,$left:50%)
size(20px)
z-index 1
overflow hidden
transform translateX(-50%)
&:before
absolute($bottom:-10px,$left:50%)
size(16px)
@muks999
muks999 / Scroll to Element
Created June 14, 2018 00:50
Scroll to Element
$('.scroll-link')
.not('[href="#"]')
.not('[href="#0"]')
.click(function (event) {
if (
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
&&
location.hostname == this.hostname
) {
var target = $(this.hash);
@muks999
muks999 / stylus mixins
Created June 14, 2018 00:51
stylus mixins
absolute-center()
position absolute
top 50%
left 50%
transform translate(-50%,-50%)
absolute-all(num)
position absolute
top num
bottom num
@muks999
muks999 / Sandwich
Created June 14, 2018 00:52
Sandwich
.sandwich
.sandwich__line.sandwich__line--top
.sandwich__line.sandwich__line--middle
.sandwich__line.sandwich__line--bottom
.sandwich {
cursor: pointer;
display: none;
height: 20px;
position: relative;
@muks999
muks999 / Radio custom
Created June 14, 2018 00:52
Radio custom
label.radio
span.radio__text name
input(type="radio")
span.checkbox__custom
.radio {
display: block;
position: relative;
width: 100%;