Skip to content

Instantly share code, notes, and snippets.

View RuslanHolovko's full-sized avatar

RuslanHolovko

View GitHub Profile
@RuslanHolovko
RuslanHolovko / style.css
Created September 19, 2016 23:17
BG with triangle
.linear{
position: relative;
top: -1109px;
z-index: -1000;
min-height: 872px;
background:linear-gradient(132deg, #d6d2c1 50%, #f0f0f0 50%);
}
.inner-linear{
text-align: center;
@RuslanHolovko
RuslanHolovko / Floating header
Created March 6, 2018 15:14
Hide header on scroll to bootom and show on scroll to top
// hide header on scroll to bootom and show header on scroll to top
var lastScrollTop = 0;
$(window).on('scroll', function(){
var winScroll = $(this).scrollTop();
var winHeight = $(this).height();
if ( winScroll > lastScrollTop ) {
@RuslanHolovko
RuslanHolovko / hover effect
Created March 6, 2018 15:26
highliting when hover
// highlighting elements when hovering over a button
$('.button').hover(function(){
$(this).parent().find('.element').css()({
'background' : '#fefefe'
});
},function(){
@RuslanHolovko
RuslanHolovko / setTimeout
Created March 6, 2018 16:10
setTimeout function
// Set time out function
$('.element').each(function(el){
setTimeout(function(){
$('.element').eq(el).toggleClass('.is-open');
}, 100 * (el + 1) );
});
@RuslanHolovko
RuslanHolovko / scroll to
Created March 6, 2018 16:32
scroll to some elements
// Scroll to element
$('.element').on('click', function(){
$('hmtl, body').animate({ scrollTop : $('.element').position().top }, 200);
});
@RuslanHolovko
RuslanHolovko / scroll to top
Created March 6, 2018 16:39
scroll page to top
// Scroll page to top
$('.element').on('click', function(){
$('hmtl, body').animate({ scrollTop : 0 }, 200);
});
@RuslanHolovko
RuslanHolovko / Accordion
Created March 6, 2018 17:05
Accordion jquery
// Accordion jquery
var all Panels = $('.panel');
$('.link').on('click', function(){
allPanels.slideUp();
$(this).parent.next.slideDown();
@RuslanHolovko
RuslanHolovko / izotop,masonry,packery
Created March 6, 2018 17:33
Izotop filter, Masonry grid, Packery draggable items
// Izotop initialize
// initialize masonrt grid
$(".masonry__grid").isotope({
itemSelector: '.masonry__item',
masonry:{
gutter: 30
}
});
@RuslanHolovko
RuslanHolovko / svg-clip-path
Created March 8, 2018 12:15
svg-clip-path-text
<svg width="104px" height="30px">
<defs>
<linearGradient id="linear-gradient" y1="-10%">
<stop offset="0%" stop-color="#70269f"></stop>
<stop offset="100%" stop-color="#35eef6"></stop>
</linearGradient>
<clipPath id="logotext">
<text x="50%" y="93%" style="font-size: 36px; font-weight: 300; font-family: 'LatoLight'; font-weight: 300;" text-anchor="middle">illusion</text>
</clipPath>
</defs>
@RuslanHolovko
RuslanHolovko / mixin.sass
Created April 7, 2018 13:40
mixin sass animate
// mixin animation
=animation( $animation, $duration, $timing-func: linear, $fill: forwards, $delay: 0 )
-webkit-animation: $duration $delay $animation $fill $timing-func
-moz-animation: $duration $delay $animation $fill $timing-func
animation: $duration $delay $animation $fill $timing-func
=keyframe($animation_name)
@-webkit-keyframes #{$animation_name}
@content