Skip to content

Instantly share code, notes, and snippets.

View harrynewsome's full-sized avatar

Harry Newsome harrynewsome

View GitHub Profile
var soundbouncer = {
_: {
playerFrame: false,
eventId: false,
},
init: function() {
this._.eventId = ((new Date()).getTime());
this.setPlayerFrame();
this.playTrack('1nKclWMxh7nPbrxHrteHOB');
@harrynewsome
harrynewsome / in_viewport.js
Created February 20, 2017 09:27 — forked from jjmu15/in_viewport.js
check if element is in viewport - vanilla JS. Use by adding a “scroll” event listener to the window and then calling isInViewport().
// Determine if an element is in the visible viewport
function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.innerWidth || html.clientWidth)
);
General
  • Insert redirects
  • Menu links are correctly hooked up
  • get_path_page ids are correct (failure.php, confirm.php (terms), listing-deadline)
  • Check group fields that use position are being sorted using usort($GROUP[0], 'pos_compare') Tip: Search for foreach($GROUP
  • Labels are being used where needed. E.g Headings that are not being pulled from CMS/Shop databases
  • Listing Thumbnails update on option change
  • Remove content areas and images from pagetypes that do not require them.
  • Remove bloated additional / group querys header & listing
  • Style category pagination
@harrynewsome
harrynewsome / util.is.js
Created September 19, 2016 11:59
Is Util Object
// Utils
var is = {
arr: function(a) { return Array.isArray(a) },
obj: function(a) { return Object.prototype.toString.call(a).indexOf('Object') > -1 },
svg: function(a) { return a instanceof SVGElement },
dom: function(a) { return a.nodeType || is.svg(a) },
num: function(a) { return !isNaN(parseInt(a)) },
str: function(a) { return typeof a === 'string' },
fnc: function(a) { return typeof a === 'function' },
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<div class="top-bar">
<div class="top-bar--inner">
<div class="brand">
</div>
<div class="button sel">
<div class="button--inner">
<span></span>
<strong>Follow Me (F)</strong>
/*
|--------------------------------------------------------------------------
| Importing Stylsheets / Partials
|--------------------------------------------------------------------------
*/
@import 'core';
@import 'theme';
<?php
$array = [
"children_name" => "Colour",
"children_type" => "swatch",
"children" => [
[
"value" => "Red",
"colour" => "#f00",
$(".element").each(function(i, e){
setTimeout(function() {
$(e).addClass(".anim")
}, i * 400)
});
/*
|--------------------------------------------------------------------------
| With .on Click
|--------------------------------------------------------------------------
*/
$(".parent").on('click', '.element', function() {
$('html, body').animate({
scrollTop: $("#elementtoScrollToID").offset().top
}, 2000);