// jQuery
$(document).ready(function() {
// code
})
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
// Setup MixItUp for card filtering | |
var mixer = mixitup('.program-card-container'); | |
if ($('.program-card-container')) { | |
var container = $('.program-card-container') | |
var mixer = mixitup(container, { | |
callbacks: { | |
onMixStart: function(state, futureState) { | |
}, | |
onMixEnd: 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
:root { | |
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53); | |
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19); | |
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22); | |
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035); | |
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335); | |
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); | |
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1); | |
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1); |
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
{# Get the categories related to my "entrySection" entries in structure order #} | |
{% set entries = craft.entries.section('entrySection') %} | |
{% set relatedCats = craft.categories.relatedTo(entries) %} | |
{# Loop the categories #} | |
{% for category in relatedCats %} | |
{{ category.title }} | |
{# Get and loop through entries related to this cat #} |
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
{# Properties #} | |
{{ craft.request.firstSegment }} | |
{{ craft.request.isAjax }} | |
{{ craft.request.isLivePreview }} | |
{{ craft.request.isSecure }} | |
{{ craft.request.lastSegment }} | |
{{ craft.request.pageNum }} | |
{{ craft.request.path }} | |
{{ craft.request.segments }} | |
{{ craft.request.serverName }} |
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 | |
add_shortcode( 'section-break', function($attributes = array(), $content = null) { | |
return '<div class="article-body-section-break"></div>'; | |
} ); | |
add_shortcode( 'email-tease', function($attributes = array(), $content = null) { | |
return Timber::compile('partials/newsletter.twig', array('context_class' => 'newsletter-signup--in-article', 'text' => $content)); | |
} ); |
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
@for $i from 1 through 6 { | |
h#{$i} { | |
font-size: modular-scale((6 - $i), 1em, 1.2); | |
} | |
} | |
// via https://github.com/thoughtbot/bitters/issues/153#issuecomment-85744338 |
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
$context = Timber::get_context(); | |
$context['slides'] = Timber::get_posts('post_type=slides'); | |
$context['pages'] = Timber::get_posts('post_type=page&posts_per_page=2'); | |
$context['portfolio'] = Timber::get_posts('post_type=portfolio'); | |
$context['posts'] = Timber::get_posts(); //leave blank for default page query | |
Timber::render('front-page.twig', $context); |
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
/** | |
* Stop an iframe or HTML5 <video> from playing | |
* @param {Element} element The element that contains the video | |
*/ | |
var stopVideo = function ( element ) { | |
var iframe = element.querySelector( 'iframe'); | |
var video = element.querySelector( 'video' ); | |
if ( iframe ) { | |
var iframeSrc = iframe.src; | |
iframe.src = iframeSrc; |
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
$('#grid').mixitup({ | |
onMixLoad: function(){ | |
var hash = window.location.hash; | |
var noHash=hash.replace("#",""); | |
if(hash){ | |
$('#grid').mixitup('filter', noHash); | |
} | |
} | |
}); |
NewerOlder