Skip to content

Instantly share code, notes, and snippets.

View andreystarkov's full-sized avatar
:electron:
<3

Andrei Starcow andreystarkov

:electron:
<3
View GitHub Profile
@andreystarkov
andreystarkov / gist:3200590
Created July 29, 2012 17:53
iPad Orientation CSS
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">
<h1 id="portrait">You're Viewing in Portrait Mode</h1>
<h1 id="landscape">You're Viewing in Landscape</h1>
#landscape {display:none}
landscape.css: #landscape {display:none}
portrait.css: #landscape {display:none}
{
"auto_complete": false,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"draw_white_space": "all",
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
img:hover {
-webkit-filter: grayscale(0%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(0%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(0%);
-o-transition: .5s ease-in-out;
}
img {
@andreystarkov
andreystarkov / css-resize-background-image.css
Created February 4, 2014 05:48
resize background-image css
#resize-image {
/* Just imagine that the image_1.png is 200x400px */
background:url(image_1.png) top left no-repeat;
-moz-background-size: 100px 200px;
-o-background-size: 100px 200px;
-webkit-background-size: 100px 200px;
}
@andreystarkov
andreystarkov / css-font-face.css
Created February 4, 2014 05:49
css font-face
@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot?') format('eot'),
url('myfont-webfont.woff') format('woff'),
url('myfont-webfont.ttf') format('truetype'),
url('myfont-webfont.svg#svgFontName') format('svg');
}
@andreystarkov
andreystarkov / css-flipping-image.css
Created February 4, 2014 05:50
css flipping image
img.flip {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
@andreystarkov
andreystarkov / jquery-slide-top.js
Created February 4, 2014 06:17
jquery slide top button
// Back To Top
$('a.top').click(function(){
$(document.body).animate({scrollTop : 0},800);
return false;
});
//Create an anchor tag
<a class=”top” href=”#”>Back to top</a>
@andreystarkov
andreystarkov / jquery-is-img-loaded.js
Created February 4, 2014 06:19
jquery is images loaded
$(‘img’).load(function() {
console.log(‘image load successful’);
});
@andreystarkov
andreystarkov / zebra-stripped.js
Created February 4, 2014 06:21
zebra striped
$('li:odd').css('background', '#E8E8E8’);
@andreystarkov
andreystarkov / gist:8999365
Created February 14, 2014 11:09
scrollSomething
function scrollSomething($sidebar, $window, topPadding){
var offset = $sidebar.offset();
$window.scroll(function() {
if ($window.scrollTop() > offset.top) {
$sidebar.stop().animate({
marginTop: $window.scrollTop() - offset.top + topPadding
}, {duration: 700, easing: 'easeOutCubic'});
} else {
$sidebar.stop().animate({
marginTop: 0