Skip to content

Instantly share code, notes, and snippets.

View adikahorvath's full-sized avatar
🏠
Working from home

Adam Horvath adikahorvath

🏠
Working from home
View GitHub Profile
@adikahorvath
adikahorvath / vertical-text-rotation.css
Created March 4, 2015 21:12
vertical text rotation
.rotate {
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
@adikahorvath
adikahorvath / user-select.css
Last active August 29, 2015 14:16
user select CSS
.dont-select {
-webkit-user-select: none; /* Chrome all / Safari all */
-moz-user-select: none; /* Firefox all */
-ms-user-select: none; /* IE 10+ */
/* No support for these yet, use at own risk */
-o-user-select: none;
user-select: none;
}
@adikahorvath
adikahorvath / sticky.css
Last active August 29, 2015 14:07
sticky
.sticky {
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 100;
}
@adikahorvath
adikahorvath / cover.css
Created October 14, 2014 14:16
background cover
html {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@adikahorvath
adikahorvath / scroll.js
Created September 29, 2014 09:28
change scroll direction
$(function() {
var lastScrollTop = 0;
$(window).scroll(function(e){
var st = $(this).scrollTop();
if (st > lastScrollTop){
// downscroll code
$('.navigation').hide();
html {
-ms-word-break: break-all;
word-break: break-all;
/* Non standard for webkit */
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
@adikahorvath
adikahorvath / greyscale.css
Created April 14, 2014 10:27
greyscale images
img {
filter: url(filters.svg#grayscale); /* Firefox */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Webkit */
}
img:hover {
filter: none;
-webkit-filter: grayscale(0);
}
@adikahorvath
adikahorvath / meta.html
Created March 17, 2014 08:36
minimal UI for Safari iOS7.1
<meta name="viewport" content="width=device-width, minimal-ui" />
@adikahorvath
adikahorvath / retina.js
Created March 7, 2014 13:21
measure retina display
if (window.devicePixelRatio > 1) {
var retinaValue = window.devicePixelRatio;
console.log(retinaValue);
_gaq.push(['_trackEvent', 'retinaValue', retinaValue]);
}
@adikahorvath
adikahorvath / scan-orientation.js
Created February 26, 2014 09:23
measure mobile / tablet device orientation
function scanOrientation() {
var width = window.innerWidth;
var height = window.innerHeight;
if (width < height){
// _gaq.push(['_trackEvent', 'Orientation', 'Portrait']);
console.log("Portrait: " + width + "x" + height);
}
if (width > height){
// _gaq.push(['_trackEvent', 'Orientation', 'Landscape']);