cubic-bezier(0.68, -0.55, 0.265, 1.55)
cubic-bezier(0.645, 0.045, 0.355, 1)
var inViewport = function(el, side) { | |
var win = window; | |
var viewport = { | |
top: win.scrollY, | |
left: win.scrollX | |
}; | |
viewport.right = viewport.left + win.outerWidth; | |
viewport.bottom = viewport.top + win.outerHeight; |
.video-wrapper { | |
position: relative; | |
padding-bottom: 56.25%; | |
height: 0; | |
iframe, | |
object, | |
embed { | |
position: absolute; | |
top: 0; |
// Initialize Parallax | |
var parallax_el = document.querySelectorAll('[data-parallax]'); | |
var speed = 0.25; | |
function updateElementPosition() { | |
[].slice.call(parallax_el).forEach(function(el,i) { | |
var speed = el.dataset.parallax || 0.25; | |
var offset = (-(window.pageYOffset - el.offsetTop) * speed); | |
el.style.transform = 'translate3d(0, ' + offset + 'px, 0)'; | |
el.style.OTransform = 'translate3d(0, ' + offset + 'px, 0)'; |
<?php | |
/** | |
* Check if an array key/val(optional) exist in an array and optionally return the values | |
* | |
* @param array $array The array to check for the key/val | |
* @param string $key Key to search for | |
* @param string $value Value to search for | |
* @return bool | |
*/ | |
function r_search_array($array, $key, $value=null, $return=false) { |
#!/usr/bin/env bash | |
echo "==================================================" | |
echo "Setting up Magento 2 Vagrant box with..." | |
echo "- Ubuntu 14.04 LTS" | |
echo "- Apache 2.4" | |
echo "- PHP 7.0" | |
echo "- MySQL 5.6(manual)" | |
echo "- Git" |
<?php | |
/** | |
* Include a theme partial and pass data to it. | |
* | |
* @param string $partial Partial file to include | |
* @param array $data Data to pass to the partial | |
* @return void | |
*/ | |
function theme_include( $partial, $data = [] ) { | |
if ( ! strstr( $partial, '.php' ) ) { |
<?php | |
/** | |
* Make sure a string never has a widow. | |
* | |
* @param string $text The string to dewidow | |
* @param int $min_words Minimum number of words to dewidow | |
* @return string The dewidowed string | |
*/ | |
function dewidow( $text = '', $min_words = 3 ) { | |
$return = trim( $text ); |