Description of changes
None
( add screenshot here )
<div class="grid"> | |
<header>Header</header> | |
<aside>Aside</aside> | |
<main>Main</main> | |
<footer>Footer</footer> | |
</div> |
Description of changes
None
( add screenshot here )
const getUrlParamsObj = (queryString) => { | |
const paramsArray = (window.location.search.charAt(0) === "?") | |
? window.location.search.substr(1).split('&') | |
: window.location.search.split('&') | |
return paramsArray.reduce((mainObj, val) => { | |
const valArray = val.split('=') | |
return Object.assign(mainObj, {[valArray[0]]: valArray[1]}) | |
}, {}) | |
} |
const myObj = { | |
list: [ | |
{name: 'bill'}, | |
{name: 'fred'}. | |
], | |
}; | |
const newObj = { | |
...myObj, | |
list: myObj.list.concat({name: 'sam'}) |
// A method withn an es2015 Class | |
// requires animate.css (https://daneden.github.io/animate.css/) | |
// animation defaults to "pulse" | |
// call it, watch animation, end event binds and unbinds after one use, removing animate classes. | |
animateElement($element, animationType) { | |
// animate.css animate type | |
animationType = animationType || "pulse"; | |
let animationClasses = 'animated ' + animationType; | |
let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; | |
$element.addClass(animationClasses).one(animationEnd,function() { |
// 1120px | |
@mixin bp-xlarge {@media only screen and (min-width: 80em) {@content;}} | |
// 960px | |
@mixin bp-large {@media only screen and (min-width: 64em) {@content;}} | |
// 640px | |
@mixin bp-medium {@media only screen and (min-width: 40em) {@content;}} | |
// 480px | |
@mixin bp-small {@media only screen and (min-width: 30em) {@content;}} | |
// special for header (840px) | |
@mixin bp-header {@media only screen and (min-width: 53em){@content;}} |
# Still working on this. | |
# the element with the class 'hero-paralax' will be targeted, setting the variable | |
$hero_paralax = $('.hero-paralax') | |
# watching for scrolling | |
$(@).scroll () => | |
# set scroll top position | |
scroll_top = $(@).scrollTop() | |
# set new bg position (moves down at half the speed of scrolling |
# start at the top | |
scroll_top = 0 | |
# on the scroll | |
$(@).scroll () => | |
scroll_top = $(@).scrollTop() | |
# log it | |
console.log scroll_top |
# just copy and paste and you have the quick bones for a CoffeeScript Swtich statement | |
# 'day' is the variable you are checking | |
switch day | |
when "Fri" then 'yeah' | |
else 'dang' |
// just pass in the attribute and the attribute slug | |
// and the return value is the attribute's name | |
// example : (assuming attribute size has the option of "Extra Small" withe the slug of "extra-small") | |
// echo attribute_slug_to_title('attribute_pa_size', 'extra-small'); | |
// returns | |
// "Extra Small" | |
// code reworked from woocommerce/classes/class-wc-cart.php |