This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var fadeStart=1 // 100px scroll or less will equiv to 1 opacity | |
,fadeUntil=500 // 200px scroll or more will equiv to 0 opacity | |
,fading = $('#fading') | |
; | |
$(window).bind('scroll', function(){ | |
var offset = $(document).scrollTop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('DOMContentLoaded', () => { | |
const ends = document.querySelectorAll('#ends'); | |
if (ends.length) { | |
window.addEventListener('scroll', () => { | |
const t = ends[0].getBoundingClientRect().top - window.innerHeight; | |
if (window.pageYOffset > t) { | |
const myClass = document.querySelectorAll('.myClass'); | |
myClass.forEach(elem => elem.style.display = 'block'); | |
} else { | |
const myClass = document.querySelectorAll('.myClass'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', () => { | |
Array.from(document.querySelectorAll('*:contains("&")')).forEach((elem) => { | |
Array.from(elem.childNodes).forEach((node) => { | |
if (node.nodeType === Node.TEXT_NODE) { | |
const newNode = document.createElement('span'); | |
newNode.className = 'amp'; | |
newNode.textContent = node.textContent.replace(/&/g, '&'); | |
node.parentNode.replaceChild(newNode, node); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="breakit" style="position: relative;"> | |
<div class="brokeit" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0;"> | |
<img src="..." style="height:375px;"> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ){ | |
var PULLQUOTE = 'data-pullquote'; | |
$('[' + PULLQUOTE + ']').each(function(){ | |
var $parent = $(this), | |
$quote = $parent.find( $parent.data('pullquote') ); | |
if ( $quote.length > 0 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!function_exists('how_long_ago')){ | |
function how_long_ago($timestamp){ | |
$difference = current_time('timestamp') - $timestamp; | |
if($difference >= 60*60*24*365){ // if more than a year ago | |
$int = intval($difference / (60*60*24*365)); | |
$s = ($int > 1) ? 's' : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************** | |
notice how the puke cascades. | |
%%%%%% | |
%%%% = = | |
%%C > | |
_)' _( .' | |
__/ |_/\ " *. o | |
/` \_\ \/ %`= '_ . | |
/ ) \/| .^',*. , |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
swap(); | |
}); | |
var swap = function () { | |
$('.light').click(function () { | |
$(this).removeClass('light').addClass('dark').find('div').text('Darker'); | |
$('body').removeClass('darker').addClass('lighter'); | |
swap(); | |
}); | |
$('.dark').click(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blockquote { background: #f9f9f9; | |
border-left: 10px solid #ccc; | |
margin: 1.5em 10px; | |
padding: .5em 10px; | |
quotes: "\201C""\201D""\2018""\2019"; | |
} | |
blockquote:before { color: #ccc; | |
content: open-quote; | |
font-size: 4em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.tabs { position: relative; | |
clear: both; | |
margin: 25px 0; | |
min-height: 200px; | |
width: 300px; | |
font: 700 15px Arial; | |
} | |
.singleTab { float: left } |
OlderNewer