Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @author ZeRRoCull
* @copyright 2016
*/
function br($ret=true) {
if (!$ret) echo "<br>";
else return "<br>";
}
@ZeRRoCull
ZeRRoCull / optimized.js
Last active September 10, 2016 06:37
Оптимизированная загрузка JS-библиотек
<script>var scr = {"scripts":[
{"src" : "js/libs.min.js", "async" : false},
{"src" : "js/common.js", "async" : false}
]};!function(t,n,r){"use strict";var c=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return!1;for(var r=0;r<t.length;r++){var c=n.createElement("script"),e=t[r];c.src=e.src,c.async=e.async,n.body.appendChild(c)}return!0};t.addEventListener?t.addEventListener("load",function(){c(r.scripts);},!1):t.attachEvent?t.attachEvent("onload",function(){c(r.scripts)}):t.onload=function(){c(r.scripts)}}(window,document,scr);
</script>
@ZeRRoCull
ZeRRoCull / main_header.sass
Created September 6, 2016 00:32
Main headers style
body
font-size: 16px
font-family: $default-font
line-height: 1.5
min-width: 320px
position: relative
overflow-x: hidden
color: #000
@ZeRRoCull
ZeRRoCull / superfish_style.sass
Last active September 10, 2016 06:35
Переназначаем стили менюшки superFish
.sf-menu
ul
background-color: $main-color
>li
border-bottom: lighten($main-color, 5%) 1px solid
border-left: lighten($main-color, 5%) 1px solid
a
padding: 12px 25px 12px
text-align: left
color: #fff
@ZeRRoCull
ZeRRoCull / carousel_settings.js
Last active September 10, 2016 06:34
Минимальные настройки js - плагина owlCarousel
@ZeRRoCull
ZeRRoCull / carousel_nav_trigger.js
Last active May 13, 2023 19:22
Owl Carousel: переназначаем кнопки по умолчанию
@ZeRRoCull
ZeRRoCull / mobile-menu.sass
Last active September 10, 2016 06:31
Стили SASS для иконки в виде бутера (icon)
//Mobile menu
.toggle-mnu
display: block
width: 28px
height: 28px
float: left
span:after, span:before
content: ""
position: absolute
@ZeRRoCull
ZeRRoCull / mmenu_js_code.js
Created September 10, 2016 06:28
Настройка mmenu и бутера
//JS бутерброда, делегация нажатия тегу контейнеру
$(".mobile-mnu").click(function() {
var thiss=$(this).find(".toggle-mnu");
thiss.toggleClass("on");
$(".main-mnu").slideToggle();
return false;
});
//$("#clone-menu").clone().appendTo("#my-menu");
//====================================================
//mobile menu
@ZeRRoCull
ZeRRoCull / owl_carousel_all_code.js
Created September 17, 2016 18:18
owl.Carousel переназначение всех кнопок
@ZeRRoCull
ZeRRoCull / Hyphen.js
Created October 2, 2016 12:54
Hyphen
//=================================================================
//Hyphen
function provideHyphenation(hyphenate, id) {
var el = document.getElementById(id);
el.innerHTML = hyphenate(el.innerHTML);
}
provideHyphenation(createHyphenator(hyphenationPatternsRu), 'text-ru-01');
provideHyphenation(createHyphenator(hyphenationPatternsRu), 'text-ru-02');
//=================================================================