This file contains hidden or 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 getBgImageUrl($el) { | |
var el = $el instanceof HTMLElement ? $el : (window.jQuery && $el instanceof window.jQuery && $el.get(0)) | |
if (!el) { | |
return '' | |
} | |
var backgroundImage = getComputedStyle(el).backgroundImage | |
if (!backgroundImage || backgroundImage === 'none') { |
This file contains hidden or 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
<html> | |
<head> | |
<meta property="og:url" content="http://site.url/" /> | |
<meta property="og:site_name" content="Site Name" /> | |
<meta property="og:title" content="Page title" /> | |
<meta property="og:description" content="Page desc" /> | |
<meta property="og:image" content="/image/share-image.jpg" /> | |
</head> | |
<body> | |
<a href="http://www.facebook.com/dialog/feed?app_id=123456789&link=%og:url%&picture=%og:image%&name=%og:title%&description=%og:description%&display=popup&redirect_uri=%origin%/static/html/self-close.html" title="Facebook" target="_blank" class="social-icon social-icon--fb socialIcon"></a> |
This file contains hidden or 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('click', function (e) { | |
if (e.target.hasAttribute('data-ga')) { | |
catchGaEvent(e) | |
} | |
}) | |
function catchGaEvent(e) { | |
var el = e.target | |
var event = el.getAttribute('data-ga'), |
This file contains hidden or 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
add_shortcode('template', function ($templates = array()) { | |
$templates_render_result = ''; | |
foreach ($templates AS $key => $template) | |
{ | |
if (is_numeric($key) AND $template) | |
{ | |
$template = sanitize_file_name($template); | |
if ($template_path = get_template_directory() . "/parts/templates/$template.html" AND is_readable($template_path)) |
This file contains hidden or 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
add_filter('embed_oembed_html', function ($oembed) { | |
return "<div class='video-wrapper'>$oembed</div>"; | |
}, 10); |
This file contains hidden or 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.formatMoney = function formatMoney(money) { | |
money = parseInt(money) | |
money = isFinite(money) ? money : 0 | |
return String(money).replace(/./g, function(c, i, a) { | |
return i && c !== '.' && ((a.length - i) % 3 === 0) ? ' ' + c : c | |
}) | |
} |
This file contains hidden or 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
var _animationEndEventName; | |
function animationEndEventName() { | |
if (_animationEndEventName !== undefined) { | |
return _animationEndEventName | |
} | |
var detectedAnimation, | |
el = document.createElement('animationdetector'), | |
animations = { |
This file contains hidden or 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="pt-perspective"> | |
<div class="pt-page"></div> | |
<div class="pt-page"></div> | |
<div class="pt-page"></div> | |
</div> | |
<script> | |
var $pages = $('.pt-page') | |
transition.init($('.pt-page')) | |
This file contains hidden or 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
var lessSourceFiles = '../../static/less/*.less' | |
var cssOutPath = '../../static/css' | |
var gulp = require('gulp') | |
var watch = require('gulp-watch') | |
var less = require('gulp-less-sourcemap') | |
var path = require('path') | |
var gutil = require('gulp-util') | |
var notifier = require('node-notifier') | |
var postcss = require('gulp-postcss') |
This file contains hidden or 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.hasVerticalScroll = function hasVerticalScroll(node) { | |
return hasScroll(node, 'vertical') | |
} | |
window.hasHorizontalScroll = function hasVerticalScroll(node) { | |
return hasScroll(node, 'horizontal') | |
} | |
window.hasScroll = function hasVerticalScroll(node, axis) { | |
axis = axis ? String(axis).toLowerCase() : '' |