/*! Waypoints - 4.0.1 Copyright © 2011-2016 Caleb Troughton Licensed under the MIT license. https://ift.tt/4Sur9I0 */ !function(){"use strict";function t(n){if(!n)throw new Error("No options passed to Waypoint constructor");if(!n.element)throw new Error("No element option passed to Waypoint constructor");if(!n.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,n),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=n.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var n in i)e.push(i[n]);for(var o=0,r=e.length;r>o;o++)e[o][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=o.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,n[t.waypointContextKey]=this,i+=1,o.windowContext||(o.windowContext=!0,o.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,n={},o=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete n[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,o.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||o.isTouch)&&(e.didScroll=!0,o.requestAnimationFrame(t))})},e.prototype.handleResize=function(){o.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var n=e[i],o=n.newScroll>n.oldScroll,r=o?n.forward:n.backward;for(var s in this.waypoints[i]){var l=this.waypoints[i][s];if(null!==l.triggerPoint){var a=n.oldScroll=l.triggerPoint,p=a&&h,u=!a&&!h;(p||u)&&(l.queueTrigger(r),t[l.group.id]=l.group)}}}for(var d in t)t[d].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?o.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?o.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var n=0,o=t.length;o>n;n++)t[n].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),n={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var l in this.waypoints[r]){var a,h,p,u,d,f=this.waypoints[r][l],c=f.options.offset,w=f.triggerPoint,y=0,g=null==w;f.element!==f.element.window&&(y=f.adapter.offset()[s.offsetProp]),"function"==typeof c?c=c.apply(f):"string"==typeof c&&(c=parseFloat(c),f.options.offset.indexOf("%")>-1&&(c=Math.ceil(s.contextDimension*c/100))),a=s.contextScroll-s.contextOffset,f.triggerPoint=Math.floor(y+a-c),h=w
=s.oldScroll,u=h&&p,d=!h&&!p,!g&&u?(f.queueTrigger(s.backward),n[f.group.id]=f.group):!g&&d?(f.queueTrigger(s.forward),n[f.group.id]=f.group):g&&s.oldScroll>=f.triggerPoint&&(f.queueTrigger(s.forward),n[f.group.id]=f.group)}}return o.requestAnimationFrame(function(){for(var t in n)n[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in n)n[t].refresh()},e.findByElement=function(t){return n[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},o.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},o.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),n[this.axis][this.name]=this}var n={vertical:{},horizontal:{}},o=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var n=this.triggerQueues[i],o="up"===i||"left"===i;n.sort(o?e:t);for(var r=0,s=n.length;s>r;r+=1){var l=n[r];(l.options.continuous||r===n.length-1)&&l.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=o.Adapter.inArray(e,this.waypoints),n=i===this.waypoints.length-1;return n?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=o.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=o.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return n[t.axis][t.name]||new i(t)},o.Group=i}(),function(){"use strict";function t(t){return t===t.window}function e(e){return t(e)?e:e.defaultView}function i(t){this.element=t,this.handlers={}}var n=window.Waypoint;i.prototype.innerHeight=function(){var e=t(this.element);return e?this.element.innerHeight:this.element.clientHeight},i.prototype.innerWidth=function(){var e=t(this.element);return e?this.element.innerWidth:this.element.clientWidth},i.prototype.off=function(t,e){function i(t,e,i){for(var n=0,o=e.length-1;o>n;n++){var r=e[n];i&&i!==r||t.removeEventListener(r)}}var n=t.split("."),o=n[0],r=n[1],s=this.element;if(r&&this.handlers[r]&&o)i(s,this.handlers[r][o],e),this.handlers[r][o]=[];else if(o)for(var l in this.handlers)i(s,this.handlers[l][o]||[],e),this.handlers[l][o]=[];else if(r&&this.handlers[r]){for(var a in this.handlers[r])i(s,this.handlers[r][a],e);this.handlers[r]={}}},i.prototype.offset=function(){if(!this.element.ownerDocument)return null;var t=this.element.ownerDocument.documentElement,i=e(this.element.ownerDocument),n={top:0,left:0};return this.element.getBoundingClientRect&&(n=this.element.getBoundingClientRect()),{top:n.top+i.pageYOffset-t.clientTop,left:n.left+i.pageXOffset-t.clientLeft}},i.prototype.on=function(t,e){var i=t.split("."),n=i[0],o=i[1]||"__default",r=this.handlers[o]=this.handlers[o]||{},s=r[n]=r[n]||[];s.push(e),this.element.addEventListener(n,e)},i.prototype.outerHeight=function(e){var i,n=this.innerHeight();return e&&!t(this.element)&&(i=window.getComputedStyle(this.element),n+=parseInt(i.marginTop,10),n+=parseInt(i.marginBottom,10)),n},i.prototype.outerWidth=function(e){var i,n=this.innerWidth();return e&&!t(this.element)&&(i=window.getComputedStyle(this.element),n+=parseInt(i.marginLeft,10),n+=parseInt(i.marginRight,10)),n},i.prototype.scrollLeft=function(){var t=e(this.element);return t?t.pageXOffset:this.element.scrollLeft},i.prototype.scrollTop=function(){var t=e(this.element);return t?t.pageYOffset:this.element.scrollTop},i.extend=function(){function t(t,e){if("object"==typeof t&&"object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}for(var e=Array.prototype.slice.call(arguments),i=1,n=e.length;n>i;i++)t(e[0],e[i]);return e[0]},i.inArray=function(t,e,i){return null==e?-1:e.indexOf(t,i)},i.isEmptyObject=function(t){for(var e in t)return!1;return!0},n.adapters.push({name:"noframework",Adapter:i}),n.Adapter=i}(); let pD = new Array ( '-1%', '23%', '0', '50%', '-1%', '77%' ); let pM = new Array ( '-1%', '50px', '0', '350px', '1%', '650px', '0', '950px' ); let cardContent = new Array( '', '', 'true', '', '
', 'true', '', '', 'false' ); let mobile = false; navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && ((mobile = !0)); function buildCards() { let o = document.getElementById("tmp-cards"); let a = document.getElementsByClassName("tmp-card"); let combo = ""; let afunc = ""; let exClass = "tmp-card"; for (let i = 0; i < cardContent.length/3; i++) { // tmp-card let aid = ["c" + i]; let flippy = cardContent[(i*3)+2]; if (flippy == "true") { afunc = ["flipCard(" + i + ")"]; exClass = "tmp-card tmp-extra-class"; } else { afunc = ""; } // tmp-card-inner let bid = ["c" + i + "f"]; // tmp-card-front let cid = ["c" + i + "a"]; // tmp-card-back let did = ["c" + i + "b"]; combo = combo + "
" + cardContent[i*3] + "
" + cardContent[(i*3)+1] + "
"; } o.innerHTML = combo; adjustForDevices(); } function adjustTablets() { const a = document.getElementsByClassName("tmp-pop"); a[0].classList.add("dtmp-pop"); const b = document.getElementsByClassName("tmp-scroller-container"); b[0].classList.add("dtmp-scroller-container"); const c = document.getElementsByClassName("tmp-scroller"); c[0].classList.add("dtmp-scroller"); const d = document.getElementsByClassName("tmp-card"); d[0].classList.add("dtmp-card"); d[1].classList.add("dtmp-card"); d[2].classList.add("dtmp-card"); const e = document.getElementsByClassName("tmp-marker"); e[0].classList.ad("dtmp-marker"); } function adjustForDevices() { if (mobile == true) { if (window.innerWidth > 767) { adjustTablets(); } } } function setupWaypoints() { if (Waypoint) { var waySticky = new Waypoint({ element: document.getElementById('tmp-card-marker-line'), handler: function(direction) { if (direction == 'down') { //openGamePop(); dealCards(); } if (direction == 'up') { undealCards(); } } }); } } function moveLeft() { const o = document.getElementsByClassName("tmp-scroller"); let pos = o[0].scrollLeft; let w = o[0].offsetWidth; o[0].scrollLeft = pos - w; unflipCard(); } function moveRight() { const o = document.getElementsByClassName("tmp-scroller"); let pos = o[0].scrollLeft; let w = o[0].offsetWidth; o[0].scrollLeft = pos + w; unflipCard(); } function scrollMonitor() { // Scroller const o = document.getElementsByClassName("tmp-scroller"); let pos = o[0].scrollLeft; let w = (o[0].offsetWidth); // Dots const a = document.getElementById("tmp-dot-1"); const b = document.getElementById("tmp-dot-2"); const c = document.getElementById("tmp-dot-3"); if (pos (w-100)) { if (pos > (w+150)) { a.style.backgroundColor = "#d2d2d2"; b.style.backgroundColor = "#d2d2d2"; c.style.backgroundColor = "#888888"; } else { a.style.backgroundColor = "#d2d2d2"; b.style.backgroundColor = "#888888"; c.style.backgroundColor = "#d2d2d2"; } } // Arrows const e = document.getElementById("tmp-arrow-left"); const f = document.getElementById("tmp-arrow-right"); if (pos 20) { if (pos > ((w*2)-250)) { e.style.display = "block"; f.style.display = "none"; } else { e.style.display = "block"; f.style.display = "block"; } } } function setupScrolling() { const s1 = document.getElementById("tmp-scroller"); if (mobile == true) { s1.addEventListener("scroll", function() { scrollMonitor(); }, false); } } // Cards function cardAnim(id,top,left,del,rot,dur) { let aid = ["c" + id]; let a = document.getElementById(aid); a.style.top = [top]; a.style.left = [left]; a.style.transform = [rot]; a.style.transition = [dur]; a.style.WebkitTransition = [dur]; a.style.transitionDelay = [del]; a.style.WebkitTransitionDelay = [del]; } function dealCards() { if (window.innerWidth > 768) { cardAnim('0','-1%',pD[1],'0.1s','rotate(-3deg)','all 0.9s ease-in-out'); cardAnim('1','0%',pD[3],'0.15s','rotate(0deg)','all 0.9s ease-in-out'); cardAnim('2','-1%',pD[5],'0.2s','rotate(3deg)','all 0.9s ease-in-out'); } } function undealCards() { if (window.innerWidth > 768) { cardAnim('0','1%','49.8%','0.00s','rotate(-1.5deg)','all 0.9s ease-in-out'); cardAnim('1','2%','50.0%','0.00s','rotate(-1deg)','all 0.9s ease-in-out'); cardAnim('2','1%','50.2%','0.00s','rotate(0deg)','all 0.9s ease-in-out'); } } function openGamePop() { const wait = setTimeout(function(){ clearTimeout(wait); //dealCards(); }, 200); } function flipCard(id) { let aid = ["c" + id]; let a = document.getElementById(aid); a.style.zIndex = "9999"; a.style.transition = "0s"; a.style.WebkitTransition = "0s"; a.style.transitionDelay = "0s"; a.style.WebkitTransitionDelay = "0s"; let b = document.getElementsByClassName("tmp-card-inner"); b[id].style.transform = "rotateY(180deg)"; } function unflipCard() { let a = document.getElementsByClassName("tmp-card"); let b = document.getElementsByClassName("tmp-card-inner"); for (let i = 0; i 767) { setupWaypoints(); } } buildCards(); setupScrolling(); } // Preload document.onmouseleave = function() { window.isReady = false } window.addEventListener("resize", function() {window.isReady = false}); function ready(fn) { if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") { fn(); } else { document.addEventListener('DOMContentLoaded', fn); } } window.isReady = window.isReady === undefined ? false : window.isReady; ready(function () { var imagesLoadedInterval = setInterval(function(){ if(window.imagesLoaded) { imagesLoaded( '#tmp-load', { background: true }, function() { window.isReady = false; clearInterval(imagesLoadedInterval); }); clearInterval(imagesLoadedInterval); } }, 100) if (window.isReady === false) { window.isReady = true; } else { return; } const wait = setTimeout(function(){ clearTimeout(wait); setup(); }, 500); })
Like what you see? How about some more R29 goodness, right here?
from Refinery29 https://www.refinery29.com/en-us/beauty-school-colorism-inclusivity-makeup?utm_source=feed&utm_medium=rss
via IFTTT