Skip to content

Instantly share code, notes, and snippets.

View evanre's full-sized avatar
👨‍💻
Code is poetry.

Yevhen Zhuchenko evanre

👨‍💻
Code is poetry.
View GitHub Profile
@evanre
evanre / superhover.scss
Last active January 25, 2016 17:52
Mixin that extends all action states :hover, :active, :focus (SASS, SCSS)
// Extends all action states :hover, :active, :focus.
@mixin superhover {
&:hover,
&:active,
&:focus {
@content;
}
}
@evanre
evanre / smooth_scrolling.js
Last active February 23, 2017 23:23
Smooth Scrolling to #anchor from Chris Coyier
$(function() {
$('a[href*="#"]:not([href="#"])').click(function () {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
@evanre
evanre / browser_specific.js
Created January 25, 2016 17:44
Browser and Device specific CSS styles with SASS
document.documentElement.setAttribute("data-browser", navigator.userAgent);
@evanre
evanre / Scroll-to-top-button.html
Last active July 14, 2016 13:24
Scroll to top button
<!--Add to footer-->
<a href="#" class="scrollup">
<span>Scroll up</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.582,12.141c-0.271,0.268-0.709,0.268-0.978,0c-0.269-0.268-0.272-0.701,0-0.969l3.908-3.83c0.27-0.268,0.707-0.268,0.979,0l3.908,3.83c0.27,0.267,0.27,0.701,0,0.969c-0.271,0.268-0.709,0.268-0.979,0L10,9L6.582,12.141z"/></svg>
</a>
<!--[if lte IE 9]>
<div class="browserupgrade__overlay">
<div class="browserupgrade">
<p class="browserupgrade__sory">Sorry, your browser is too old</p>
<p class="browserupgrade__text">It seems that you are using <strong>outdated and insecure</strong> version of
Internet Explorer. This version of the browser does not support many advanced technologies, because of which
many pages are displayed incorrectly.<br>Please, <a href="http://www.whatbrowser.org/intl/en/" target="_blank">
upgrade your browser</a>, <br> to get a better impression of the Network.</p>
<a href="http://www.whatbrowser.org/intl/en/" class="browserupgrade__btn" target="_blank">Upgrade browser</a>
</div>
@evanre
evanre / material.scss
Created June 22, 2016 18:03
Material shadow
//
// Computes a top-shadow for a card effect.
// @param {Number} $depth - depth level
// @return {List}
//
@function top-shadow($depth) {
$primary-offset: nth(1.5 3 10 14 19, $depth) * 1px;
$blur: nth(1.5 3 10 14 19, $depth) * 4px;
$color: rgba(black, nth(.12 .16 .19 .25 .30, $depth));
@evanre
evanre / wp-config.php
Created July 2, 2016 11:25
WordPress: Set WordPress site URL in the config file instead of the database
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5
@evanre
evanre / Flexbox Grid Sass.scss
Last active November 21, 2018 10:14
Generated by SassMeister.com.
/**
* Flex Grid
*/
//
// Usage
// =====
// Assuming default values:
// <div class="row">
// <div class="col-xs-6">
// A half-width column.
{
// With this option enabled, all Emmet's CSS snippets
// will be available in standard auto-complete popup
"show_css_completions": true,
// If set to `true`, Emmet will automatically insert final tabstop
// at the end of expanded abbreviation
"insert_final_tabstop": false,
///////////////////////////////
@evanre
evanre / _font-face.scss
Last active April 10, 2018 10:33
Font-face mixin
// To see how it works, copy this code and paste on http://www.sassmeister.com/
//Font-face mixin
//Generate font src string
@function font-src-list($formats, $local, $name, $path, $weight, $type) {
$string: unquote('') !default;
$i: 1;
@if $local {
@each $item in $local {
$string: $string + unquote('local("#{$item}"), ');
}