Skip to content

Instantly share code, notes, and snippets.

View hsnaydd's full-sized avatar

Hasan Aydoğdu hsnaydd

View GitHub Profile
@hsnaydd
hsnaydd / oncssanimationend.js
Created June 29, 2015 12:10
Detecting CSS Animation and Transition End with JavaScript
/*
By Osvaldas Valutis, www.osvaldas.info
Available for use under the MIT License
*/
;( function ( document, window, index ){
var s = document.body || document.documentElement, s = s.style, prefixAnimation = '', prefixTransition = '';
if( s.WebkitAnimation == '' ) prefixAnimation = '-webkit-';
if( s.MozAnimation == '' ) prefixAnimation = '-moz-';
@hsnaydd
hsnaydd / javascript-offset.coffee
Created April 20, 2015 12:47
Javascript offset() function
getOffsetSum = (elem)->
top = 0
left = 0
while ( elem )
top = top + parseInt( elem.offsetTop )
left = left + parseInt( elem.offsetLeft )
elem = elem.offsetParent
return { top: top, left: left }
@hsnaydd
hsnaydd / whichTransitionEvent.js
Created February 17, 2015 09:57
which transition Event js
/* From Modernizr */
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'OTransition':'oTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
@hsnaydd
hsnaydd / analytics.class.php
Created May 19, 2014 11:06
Google Analytics PHP API
<?php
/**
* Google Analytics PHP API
*
* This class can be used to retrieve data from the Google Analytics API with PHP
* It fetches data as array for use in applications or scripts
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@hsnaydd
hsnaydd / css-media-queries.css
Created May 1, 2014 13:18
Boilerplate CSS Media Queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-width : 320px)
and (max-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
[
{
"name":"Adana",
"slug":"adana",
"plate_code":1,
"districts":[
{
"name":"Alada\u011f",
"slug":"aladag"
},
@hsnaydd
hsnaydd / vertical-align.scss
Created January 25, 2014 20:33
Vertical align anything with just 3 lines of CSS
%vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.element p {
@extend %vertical-align;
@hsnaydd
hsnaydd / css3-fade-in.css
Created January 24, 2014 23:04
Css animation fade in
@keyframes fadeIn{
0% { opacity: 0 }
100% { opacity: 1 }
}
.fadeIn {
animation-name: fadeIn;
animation-duration: 1s;
animation-fill-mode: forwards;
}
@hsnaydd
hsnaydd / css-marquee.css
Created November 25, 2013 10:39
marquee with css3
p.marquee{
-webkit-animation-name: marquee;
-webkit-animation-timing-function: linear;
-webkit-animation-duration:10s;
-webkit-animation-iteration-count: infinite;
margin: 0;
padding: 0;
overflow: hidden;
display: block;
white-space: nowrap;
@hsnaydd
hsnaydd / socialShare.js
Last active October 15, 2023 14:15
Sosyal Medya İçerik Paylaş Fonksiyonu
/**
* Sosyal medya paylaş fonksiyonu
*
* @param string sharingSite : Paylaşımın hangi ortamda yapılacağını belirleyen değişken
* @param string url : paylaşılacak sayfa adresi
* @param string title : paylaşılacak sayfa başlığı
*
* Nasıl Çalışır :
* Bu javascript fonksiyonunu sayfanızın herhangi bir yerine <script> </script> tagları içerisinde yerleştirin
* Daha sonra Paylaş butonlarınızı dilediğiniz şekilde ayarlayın