Skip to content

Instantly share code, notes, and snippets.

Avatar
🇮🇪

T.J. Fogarty tjFogarty

🇮🇪
View GitHub Profile
@tjFogarty
tjFogarty / Overlay.js
Created Apr 6, 2015
Full-screen overlay
View Overlay.js
/*globals $, TweenLite, Power3*/
/*jshint node:true*/
'use strict';
/**
* Overlay
*
* Controls creating, showing, hiding and removing of overlays
*/
@tjFogarty
tjFogarty / srcset.html
Created Feb 25, 2015
Example of srcset and sizes
View srcset.html
<img
srcset="/path/to/slider-image-small.jpg 400w,
/path/to/slider-image-medium.jpg 800w,
/path/to/slider-image-large.jpg 1200w"
sizes="100vw"
alt="...">
@tjFogarty
tjFogarty / picture.twig
Created Feb 24, 2015
Picture element + Twig
View picture.twig
<picture>
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source srcset="{{ slide.image_desktop | tojpg | resize(1200) }}" media="(min-width: 1000px)">
<source srcset="{{ slide.image_tablet | tojpg | resize(800) }}" media="(min-width: 767px)">
<source srcset="{{ slide.image | tojpg | resize(480) }}, {{ slide.image | tojpg | resize(766) }} 2x" media="(max-width: 766px)">
<!--[if IE 9]></video><![endif]-->
<img class="slider__image" srcset="{{ slide.image_tablet | tojpg | resize(800) }}" alt="{{ slide.title }}">
@tjFogarty
tjFogarty / navigation.js
Last active Aug 29, 2015
Handle mobile navigation
View navigation.js
/*global module, $, _, matchMedia*/
'use strict';
/**
* Navigation
* Disclaimer: This is built with jQuery.mmenu in mind, and so some of the selectors and calls accommodate this
* Shouldn't be too hard to swap this out for a different menu solution
*
* @param config
View inview-call.js
/* globals $, LoadPartial, Foundation */
/* jshint node:true */
'use strict';
/**
* The Likebox is just above the footer on the homepage
* Load it once it comes into view
*/
var fb = new LoadPartial({
@tjFogarty
tjFogarty / search.html
Last active Aug 29, 2015
Rivets + Fuse search
View search.html
<div class="js-course-search">
<input type="search" placeholder="Search courses..." rv-on-keyup="search.update" autofocus>
<ul>
<li rv-each-result="search.results">
<a rv-href="result.url">
{result.name}
</a>
</li>
View ext.navee_static_menu.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ExpressionEngine - by EllisLab
*
* @package ExpressionEngine
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
* @license http://expressionengine.com/user_guide/license.html
* @link http://expressionengine.com
@tjFogarty
tjFogarty / pi.responsive_images.php
Last active Aug 29, 2015
Responsive images with CE Image
View pi.responsive_images.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Responsive Images Class
*
* @package ExpressionEngine
* @category Plugin
* @author TJ Fogarty
* @copyright Copyright (c) 2014, TJ Fogarty
* @link http://www.emagine.ie
@tjFogarty
tjFogarty / standard.html
Created Oct 17, 2014
ExpressionEngine dev check for scripts
View standard.html
{if global:env != "dev"}
{exp:minimee:js minify="yes" combine="yes"}
{/if}
<script src="/assets/scripts/vendor/jquery-1.11.1.min.js"></script>
<!-- bower:js -->
<script src="/assets/lib/modernizr/modernizr.js"></script>
<script src="/assets/lib/fastclick/lib/fastclick.js"></script>
<script src="/assets/lib/jquery.cookie/jquery.cookie.js"></script>
<script src="/assets/lib/jquery-placeholder/jquery.placeholder.js"></script>
@tjFogarty
tjFogarty / standard.html
Created Oct 17, 2014
ExpressionEngine dev check
View standard.html
{if global:env == "dev"}
<link rel="stylesheet" href="{site_url}assets/styles/css/main.css">
{if:else}
{embed="critical/index"}
{/if}