Skip to content

Instantly share code, notes, and snippets.

View Ivanopalas's full-sized avatar

Ivan Ivanopalas

  • Aksalan
  • Donetsk
View GitHub Profile
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-portait-only {
@media (min-width: 600px) and (max-width: 899px) { @content; }
}
@mixin for-tablet-landscape-up {
/*--------------------------------
Media Queries
used for outputting content either between media query tags, or without (for fixed-width.scss)
example: basic usage
.element {
width: 50%;
@include mq("tablet-small") {
width: 20%;
}
}
function parallax() {
var layer = $('.parallax').find('.parallax__layer');
$(window).on('mousemove', function (e) {
var mouseX = e.pageX;
var mouseY = e.pageY;
var w = (window.innerWidth / 2) - mouseX;
var h = (window.innerHeight / 2) - mouseY;
@Ivanopalas
Ivanopalas / index.jade
Created August 8, 2016 11:00
Horizontal line around title
h1.has-lines Example Title
$tablet-width: 768px;
$desktop-width: 1200px;
$xl-desctop-width: 1800px;
@mixin tablet {
@media (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) {
@content;
}
}
@Ivanopalas
Ivanopalas / scopes.txt
Created June 8, 2016 07:06 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
.container {
height: 0;
padding-bottom: 20%;
position: relative;
}
.container div {
border: 2px dashed #ddd;
height: 100%;
left: 0;
@Ivanopalas
Ivanopalas / scifi.html
Last active January 20, 2016 10:15 — forked from anonymous/scifi.html
Задание для https://goo.gl/WGrXbu
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Sci-Fi</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://fb.me/react-0.14.3.js"></script>
<script src="https://fb.me/react-dom-0.14.3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
</head>
$(function() {
scrolllinks = $("a[href^=#]"),
scrolllinks.click(function(e){
var shref = $(this).attr("href"),
offTop = shref === "#" ? 0 : $(shref).offset().top;
$('html, body').stop().animate({
scrollTop: offTop
}, 500);
e.preventDefault();
});
// The basic check
if(document.readyState === 'complete') {
// good to go!
}
// Polling for the sake of my intern tests
var interval = setInterval(function() {
if(document.readyState === 'complete') {
clearInterval(interval);
done();