Skip to content

Instantly share code, notes, and snippets.

View muks999's full-sized avatar

Muks999 muks999

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / jquery.Plugin.js
Last active January 6, 2018 21:08
jQuery Plugin Start
(function($) {
$.fn.myParallax = function(){
return this.each(function() {
var ths = $(this);
ths
.css({
"min-height" : "400px",
@muks999
muks999 / auto-enable-divi-page-builder-cpt
Created January 6, 2018 17:42 — forked from SJ-James/auto-enable-divi-page-builder-cpt
Auto-enable Divi Page Builder on all public custom post types (WooCommerce, LearnPress etc)
<?php
// copy function into functions.php
function dpb_all_post_types( $post_types ) {
$args = array(
'public' => true,
'_builtin' => false
);
@muks999
muks999 / related-posts.php
Last active January 6, 2018 17:41 — forked from SJ-James/related-posts.php
Display related posts by category on single-post template...
@muks999
muks999 / facebook_warning.php
Created January 6, 2018 17:41 — forked from SJ-James/facebook_warning.php
Facebook Browser Warning | Divi
<?php
if ( !function_exists( 'fb_browser_warning' ) ) {
function fb_browser_warning() {
?>
<style>
.fb_browser_warning {
position: relative;
background: #3B5998;
padding: 20px 20px 20px 80px;