Skip to content

Instantly share code, notes, and snippets.

@Web-doc
Web-doc / style.sass
Created June 23, 2017 08:25
Генерируемое содержимое
.main-navigation li::after
content: ''
width: 2px
height: 2px
background-color: #ddd
position: absolute
top: 25px
left: 0
@Web-doc
Web-doc / media.sass
Created May 17, 2017 06:49
Медиазапросы для Unyson
@import "bourbon"
/* Medium devices (desktops) */
@media (min-width: 993px) and (max-width: 1199px)
.fw-hidden-md
display: none
/* Small devices (tablets) */
@media (min-width: 767px) and (max-width: 992px)
.fw-hidden-sm
display: none
.zoom_toggle_mnu {
text-align: center;
}
button.toggle_mnu {
-webkit-box-shadow: none;
box-shadow: none;
}
.toggle_mnu
{
background-color: transparent;
@Web-doc
Web-doc / gulpfile.js
Created March 30, 2017 12:19 — forked from jx107/gulpfile.js
gulpfile.js
// Ссылка на страницу скрипта https://github.com/agragregra/gulp-lesson/blob/master/gulpfile.js
// Автор Алексей agragregra https://github.com/agragregra
var gulp = require('gulp'), // Подключаем Gulp
sass = require('gulp-sass'), //Подключаем Sass пакет,
browserSync = require('browser-sync'), // Подключаем Browser Sync
concat = require('gulp-concat'), // Подключаем gulp-concat (для конкатенации файлов)
uglify = require('gulp-uglifyjs'), // Подключаем gulp-uglifyjs (для сжатия JS)
cssnano = require('gulp-cssnano'), // Подключаем пакет для минификации CSS
rename = require('gulp-rename'), // Подключаем библиотеку для переименования файлов
del = require('del'), // Подключаем библиотеку для удаления файлов и папок
@Web-doc
Web-doc / Parallax.js
Created March 30, 2017 12:16
Parallax Effect / по средствам анимации
$(window).scroll(function() {
var st = $(this).scrollTop() /10;
$(".object").css({
"transform" : "translate3d(0px, " + st + "%, 0px)",
"-webkit-transform" : "translate3d(0px, " + st + "%, 0px)"
});
});
@Web-doc
Web-doc / index.php
Created March 24, 2017 13:07
Всплывающие окна, плагин magnificPopup
//Подключаем jquery.js, magnific-popup.css и jquery.mixitup.min.js
<a href="#popup_content_1" class="open-popup" target="_blank">
<span class="list-title">Сайт-визитка</span>
</a>
//Контент всплывающего окна
<div id="popup_content_1" class="white-popup mfp-hide">
Popup content
</div>
/*!
* Simple jQuery Equal Heights
*
* Copyright (c) 2013 Matt Banks
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
* @version 1.5.1
*/
@Web-doc
Web-doc / functions.php
Created February 25, 2017 22:58
Разрешённые типы файлов в WordPress
$mimes = get_allowed_mime_types();
echo "<pre>"; print_r($mimes); die();
@Web-doc
Web-doc / functions.php
Created February 25, 2017 13:51
Поддержка svg в WordPress
//Добавляет поддержку svg
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $mimes ) {
// Добавляет расширение 'svg' и его mime type 'mime/svg-xml'
$mimes['svg'] = 'image/svg-xml';
return $mimes;
}
@Web-doc
Web-doc / functions.php
Created February 24, 2017 14:28
Разрешаем действие желаемому пользователю WordPress
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
if ( 1 == $current_user->ID ) {
// do staff.
} else {
// do staff.
}
}