├── .DS_Store ├── .prettierignore ├── Ecommerce └── ecommerce.js ├── Forms ├── forms.html ├── forms.js └── utm.js ├── README.md ├── analytics └── analytics.html ├── cms-image.jpg ├── cms ├── cms.html └── cms.js ├── codepen.io_rileyrichter-the-encoder_full_BaYgmEq (5).png ├── css ├── basics.css └── css.js ├── filtering └── filter.js ├── finsweet └── finsweet-filters.js ├── glider.css ├── glider.js ├── jason-llewellyn.jpeg ├── jayden-rowe.jpeg ├── js ├── countdown.js ├── jqueryget.js ├── old-write.html ├── this.json ├── typewriter.js ├── write-items-part-two.html ├── write-items.html └── write-items.js ├── loading-attribute-polyfill.min.js ├── lsep.js ├── memberstack ├── like.html ├── like.js ├── memberstack.html └── memberstack.js ├── no-code └── no-code.js ├── owl ├── init.js ├── owl.carousel.min.css ├── owl.carousel.min.js └── owl.theme.default.css ├── prism ├── prism.css └── prism.js ├── record-vector.svg ├── rob-cursor.png ├── smiling1.jpg ├── smiling1.mp4 ├── smiling2.mp4 ├── snippet.html ├── sunset.jpg ├── swiper-bundle.min.js.map ├── swiper.css ├── swiper.js ├── test └── webflow.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rileyrichter/snippets/84d137585592f3b8f53945fd30340c02bbca30ba/.DS_Store -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | swiper-bundle.min.js.map -------------------------------------------------------------------------------- /Ecommerce/ecommerce.js: -------------------------------------------------------------------------------- 1 | // Get the total of an order on the checkout page 2 | setTimeout(function () { 3 | let myTotal = document.querySelector( 4 | ".w-commerce-commercecheckoutsummarytotal" 5 | ).textContent; 6 | console.log(myTotal); 7 | localStorage.setItem("Total", myTotal); 8 | }, 1000); 9 | -------------------------------------------------------------------------------- /Forms/forms.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 20 | 21 | 22 |
23 | 25 | 26 | 27 |
28 | 29 | 41 | 42 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Forms/forms.js: -------------------------------------------------------------------------------- 1 | // Refresh the page on form submit 2 | $(document).on("submit", "form", function () { 3 | // Refresh page after 2000 milliseconds 4 | setTimeout(function () { 5 | location.reload(true); 6 | }, 2000); 7 | }); 8 | 9 | // Clear local storage on submit 10 | $(document).on("submit", "form", function () { 11 | localStorage.clear(); 12 | }); 13 | 14 | // Pass form input values through to the success state of the form 15 | $("#submitButtonId").click(function () { 16 | let firstName = $("#firstNameField").val(); 17 | let lastName = $("#lastNameField").val(); 18 | $("#firstNameResult").html(firstName); 19 | $("#lastNameResult").html(lastName); 20 | }); 21 | 22 | // Pass form input values through to the success state of the form without jQuery 23 | let submitButton = document.getElementById("submitButtonId"); 24 | submitButton.addEventListener("click", passSuccess); 25 | function passSuccess() { 26 | let firstName = document.getElementById("firstNameField").value; 27 | let lastName = document.getElementById("lastNamefield").value; 28 | document.getElementById("firstNameResult").textContent = firstName; 29 | document.getElementById("lastNameResult").textContent = lastName; 30 | } 31 | 32 | // Mask a phone number 33 | $(document).ready(function () { 34 | $("#phone").mask("999-999-9999", { 35 | placeholder: "XXX-XXX-XXXX", 36 | }); 37 | }); 38 | 39 | // This adds all input values that are text as local storage items 40 | $("#submitButton").on("click", function () { 41 | $('input[type="text"]').each(function () { 42 | let id = $(this).attr("id"); 43 | let value = $(this).val(); 44 | localStorage.setItem(id, value); 45 | }); 46 | }); 47 | 48 | // This adds all input values as local storage items 49 | $("#submitButton").on("click", function () { 50 | $("input").each(function () { 51 | let id = $(this).attr("id"); 52 | let value = $(this).val(); 53 | localStorage.setItem(id, value); 54 | }); 55 | }); 56 | 57 | // When a person upvotes a product, use a unique ID and set it to true in local storage 58 | function myVote(shortcode) { 59 | $(document).on("submit", "form", function () { 60 | // Set product in local storage 61 | localStorage.setItem(shortcode, "true"); 62 | // Refresh page after 3000 milliseconds 63 | setTimeout(function () { 64 | location.reload(true); 65 | }, 3000); 66 | }); 67 | } 68 | 69 | // If an item has been set in local storage, then hide an element from the user 70 | for (let i = 0; i < localStorage.length; i++) { 71 | if (document.getElementById(localStorage.key(i)) === null) { 72 | console.log("not on this page"); 73 | } else { 74 | document.getElementById(localStorage.key(i)).style.display = "none"; 75 | } 76 | } 77 | 78 | // Show the number of characters remaining 79 | // When the document is ready to execute code 80 | $(document).ready(function () { 81 | // Set the max number of characters 82 | var text_max = 140; 83 | // Write the max number of characters to the element witn an id of #title_feedback 84 | $("#title_feedback").html(text_max); 85 | // When someone types into the input with an id of #title 86 | $("#title").keyup(function () { 87 | // Set a variable of text_length to the length of the input with an id of #title 88 | var text_length = $("#title").val().length; 89 | // Set a variable that is the max length of text - the current length 90 | var text_remaining = text_max - text_length; 91 | // Write the number of characters remaining to the #title_feedback element 92 | $("#title_feedback").html(text_remaining); 93 | // Set a backgroundColor variable 94 | let backgroundColor = "#38d996"; 95 | // if the text is less than or equal to 5 characters set a warning color 96 | if (text_remaining <= 5) { 97 | backgroundColor = "#ff6382"; 98 | } 99 | // else if the count is equal to 40 reminaing or lower set a caution color 100 | else if (text_remaining <= 40) { 101 | backgroundColor = "#ffab9d"; 102 | } 103 | // Set the background color of the element with an id of charbox based on the rules above 104 | document.getElementById("charbox").style.backgroundColor = backgroundColor; 105 | }); 106 | }); 107 | 108 | // Show the number of characters in an input 109 | // #idea is the id of the input where you want to count characters 110 | $("#idea").keyup(function () { 111 | // Get the # of characters that are in the input 112 | var charCount = $("#idea").val().length; 113 | // Write the # of characters in the input to the element with an id of #charcount 114 | $("#charcount").html(charCount); 115 | }); 116 | 117 | // Show the number of words in an input 118 | // Set the input with the id of #idea as a variable 119 | let countTarget = document.querySelector("#idea"); 120 | // Set the element with an id of #word-cout as wordCount 121 | let wordCount = document.querySelector("#word-count"); 122 | // Set count as a function 123 | let count = function () { 124 | // Set characters at the value of the #idea input 125 | let characters = countTarget.value; 126 | // Set characterLength as the lenght of characters 127 | let characterLength = characters.length; 128 | // Use regex to get the number of words 129 | let words = characters.split(/[\n\r\s]+/g).filter(function (word) { 130 | return word.length > 0; 131 | }); 132 | // Write the number of words to the element with an id of #word-count 133 | wordCount.innerHTML = words.length; 134 | }; 135 | // Call count function above 136 | count(); 137 | // Add an event lister to the page 138 | window.addEventListener( 139 | // Look for inputs, but only run on input with an id of #idea 140 | "input", 141 | function (event) { 142 | if (event.target.matches("#idea")) { 143 | count(); 144 | } 145 | }, 146 | false 147 | ); 148 | 149 | // Redirect the user based on the radio selection 150 | $("#submitButton").on("click", function () { 151 | let value = $("input[name=myRadio]:checked").val(); 152 | if (value == "visual-dev") { 153 | window.location.assign("https://www.visualdev.fm"); 154 | } else if (value == "google") { 155 | window.location.assign("https://www.google.com"); 156 | } 157 | }); 158 | -------------------------------------------------------------------------------- /Forms/utm.js: -------------------------------------------------------------------------------- 1 | const queryForm = function (settings) { 2 | let reset = settings && settings.reset ? settings.reset : false; 3 | let self = window.location.toString(); 4 | let querystring = self.split("?"); 5 | if (querystring.length > 1) { 6 | let pairs = querystring.split("&"); 7 | pairs.forEach(function (pairs) { 8 | let keyval = pairs.split("="); 9 | if (reset || sessionStorage.getItem(keyval) === null) { 10 | sessionStorage.setItem(keyval, decodeURIComponent(keyval)); 11 | } 12 | }); 13 | } 14 | let hiddenFields = document.querySelectorAll( 15 | "input[type=hidden], input[type=text]" 16 | ); 17 | hiddenFields.forEach(function (field) { 18 | let name = field.name; 19 | let param = sessionStorage.getItem(name); 20 | if (param) document.getElementById(name).value = param; 21 | }); 22 | }; 23 | setTimeout(function () { 24 | queryForm(); 25 | }, 3000); 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Webflow Snippets 2 | 3 | These are the snippets I use a lot with Webflow sites. I wanted a place I could store all my code and make it easy to access not just for me, but for everyone. 4 | 5 | Some of this code I wrote all by myself. Some of it comes from searching forums and what not. Some of it is code I found elsewhere that I use often. I'll try to credit where credit is due, but know I am not claiming any of this as my sole work. 6 | -------------------------------------------------------------------------------- /analytics/analytics.html: -------------------------------------------------------------------------------- 1 | // Google Analytics tracking to track clicks on your site 2 | 7 | 8 | Button Text 9 | 10 | 19 | -------------------------------------------------------------------------------- /cms-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rileyrichter/snippets/84d137585592f3b8f53945fd30340c02bbca30ba/cms-image.jpg -------------------------------------------------------------------------------- /cms/cms.html: -------------------------------------------------------------------------------- 1 | 2 | Tweet to STATTIONPILL! 4 | 5 | -------------------------------------------------------------------------------- /cms/cms.js: -------------------------------------------------------------------------------- 1 | // Tweet to share template 2 | function tweetArticle() { 3 | const author = "AUTHORPILL"; 4 | const article = "ARTICLENAMEPILL"; 5 | const slug = "SLUGPILL"; 6 | const fullUrl = `https://somedomain.com/post/${slug}`; 7 | const tweetCopy = `Hey! I just read this great article by ${author}! Check it out here!`; 8 | const copyUnescaped = tweetCopy 9 | .replace(/&/g, "&") 10 | .replace(/</g, "<") 11 | .replace(/>/g, ">") 12 | .replace(/"/g, '"') 13 | .replace(/'/, "'"); 14 | window.open( 15 | "http://twitter.com/share?url=" + 16 | encodeURIComponent(fullUrl) + 17 | "&text=" + 18 | encodeURIComponent(copyUnescaped).replace(/'/g, "%27") 19 | ); 20 | } 21 | 22 | // Setup where you share an item when passing through a parameter 23 | function tweetRad(twitterhandle) { 24 | const rrartistmaster = "ARTISTPILL"; 25 | const rrsongmaster = "SONGNAMEPILL"; 26 | const rrslugmaster = "SLUGPILL"; 27 | const radurl = "https://rapperradio.com/song/" + rrslugmaster; 28 | const rad = 29 | "Hey, " + 30 | twitterhandle + 31 | "! I want to hear " + 32 | rrartistmaster + 33 | "'s " + 34 | rrsongmaster + 35 | " on air!"; 36 | const radunescaped = rad 37 | .replace(/&/g, "&") 38 | .replace(/</g, "<") 39 | .replace(/>/g, ">") 40 | .replace(/"/g, '"') 41 | .replace(/'/, "'"); 42 | window.open( 43 | "http://twitter.com/share?url=" + 44 | encodeURIComponent(radurl) + 45 | "&text=" + 46 | encodeURIComponent(radunescaped).replace(/'/g, "%27") 47 | ); 48 | $.post("https://breaksocial.herokuapp.com/req", { 49 | itemId: "ITEMID", 50 | verificationToken: "XXXXXXXXXXXXXXXXX", 51 | }); 52 | } 53 | 54 | // Add the current selector a menu item if in a specific directory/directories 55 | $(document).ready(function () { 56 | if (window.location.href.indexOf("category") > -1) { 57 | setTimeout(function () { 58 | let myLink = document.getElementById("on-demand"); 59 | myLink.className += " w--current"; 60 | }, 100); 61 | } 62 | if (window.location.href.indexOf("breakout-sessions") > -1) { 63 | setTimeout(function () { 64 | let myLink = document.getElementById("on-demand"); 65 | myLink.className += " w--current"; 66 | }, 100); 67 | } 68 | if (window.location.href.indexOf("tags") > -1) { 69 | setTimeout(function () { 70 | let myLink = document.getElementById("on-demand"); 71 | myLink.className += " w--current"; 72 | }, 100); 73 | } else { 74 | console.log(`ready`); 75 | } 76 | }); 77 | 78 | // Adding more here soon! 79 | -------------------------------------------------------------------------------- /codepen.io_rileyrichter-the-encoder_full_BaYgmEq (5).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rileyrichter/snippets/84d137585592f3b8f53945fd30340c02bbca30ba/codepen.io_rileyrichter-the-encoder_full_BaYgmEq (5).png -------------------------------------------------------------------------------- /css/basics.css: -------------------------------------------------------------------------------- 1 | /* I use this on containers that hold blog posts, etc. It keeps content from overflowing the page */ 2 | .postcontain { 3 | word-break: break-word; 4 | } 5 | /* I use to keep description text uniform */ 6 | .keynote-description { 7 | display: -webkit-box; 8 | -webkit-line-clamp: 3; 9 | -webkit-box-orient: vertical; 10 | overflow: hidden; 11 | } -------------------------------------------------------------------------------- /css/css.js: -------------------------------------------------------------------------------- 1 | // get link by ID and add the current selector class 2 | 3 | setTimeout(function () { 4 | let myLink = document.getElementById("on-demand"); 5 | myLink.className += " w--current"; 6 | }, 100); 7 | -------------------------------------------------------------------------------- /filtering/filter.js: -------------------------------------------------------------------------------- 1 | // Filter through items 2 | $(document).ready(function () { 3 | $("#wrapperid").on("keyup", function () { 4 | let value = $(this).val().toLowerCase(); 5 | $(".classToFilter").filter(function () { 6 | $(this) 7 | .parent() 8 | .toggle($(this).text().toLowerCase().indexOf(value) > -1); 9 | }); 10 | }); 11 | }); 12 | $(document).on("keyup", "#inputIdOfSearch", function (e) { 13 | if (e.keyCode == 13) { 14 | $("input").blur(); 15 | Foundation.libs.topbar.toggle(); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /finsweet/finsweet-filters.js: -------------------------------------------------------------------------------- 1 | // Counting the number of items returned after the filter function 2 | var Webflow = Webflow || []; 3 | Webflow.push(function () { 4 | let itemCount = $(".blog-item").length; 5 | $("#item-count").html(itemCount); 6 | }); 7 | 8 | //Update item count on filter change 9 | $(".filter-button").click(function () { 10 | setTimeout(function () { 11 | var allElems = document.getElementsByClassName("blog-item"); 12 | var count = 0; 13 | for (var i = 0; i < allElems.length; i++) { 14 | var thisElem = allElems[i]; 15 | if (thisElem.style.display != "none") count++; 16 | document.getElementById("item-count").innerHTML = count; 17 | } 18 | }, 500); 19 | }); 20 | 21 | //Update item count on filter reset 22 | $(".filter-reset-main").click(function () { 23 | setTimeout(function () { 24 | var allElems = document.getElementsByClassName("blog-item"); 25 | var count = 0; 26 | for (var i = 0; i < allElems.length; i++) { 27 | var thisElem = allElems[i]; 28 | if (thisElem.style.display != "none") count++; 29 | document.getElementById("item-count").innerHTML = count; 30 | } 31 | }, 500); 32 | }); 33 | 34 | // F'in sweet CMS Library for Webflow 35 | 36 | (function () { 37 | var fsComponent = new FsLibrary(".blog-posts"); 38 | 39 | var myFilters = [ 40 | { 41 | filterWrapper: ".filter-wrapper", 42 | filterType: "multi", 43 | }, 44 | ]; 45 | 46 | fsComponent.filter({ 47 | filterArray: myFilters, 48 | activeClass: "filter-button-active", 49 | filterReset: ".filter-reset-main", 50 | animation: { 51 | enable: true, 52 | duration: 300, 53 | easing: "ease-in", 54 | effects: "fade ", 55 | }, 56 | }); 57 | })(); 58 | -------------------------------------------------------------------------------- /glider.css: -------------------------------------------------------------------------------- 1 | .glider-contain { 2 | width: 100%; 3 | margin: 0 auto; 4 | position: relative; 5 | } 6 | .glider { 7 | margin: 0 auto; 8 | position: relative; 9 | overflow-y: hidden; 10 | -webkit-overflow-scrolling: touch; 11 | -ms-overflow-style: none; 12 | transform: translateZ(0); 13 | } 14 | .glider-track { 15 | transform: translateZ(0); 16 | width: 100%; 17 | margin: 0; 18 | padding: 0; 19 | display: flex; 20 | z-index: 1; 21 | } 22 | .glider.draggable { 23 | user-select: none; 24 | cursor: -webkit-grab; 25 | cursor: grab; 26 | } 27 | .glider.draggable .glider-slide img { 28 | user-select: none; 29 | pointer-events: none; 30 | } 31 | .glider.drag { 32 | cursor: -webkit-grabbing; 33 | cursor: grabbing; 34 | } 35 | .glider-slide { 36 | user-select: none; 37 | justify-content: center; 38 | align-content: center; 39 | width: 100%; 40 | } 41 | .glider-slide img { 42 | max-width: 100%; 43 | } 44 | .glider::-webkit-scrollbar { 45 | opacity: 0; 46 | height: 0; 47 | } 48 | .glider-slide { 49 | min-width: 150px; 50 | } 51 | .glider-hide { 52 | opacity: 0; 53 | } 54 | .glider-dots { 55 | user-select: none; 56 | display: flex; 57 | flex-wrap: wrap; 58 | justify-content: center; 59 | margin: 0 auto; 60 | padding: 0; 61 | } 62 | .glider-dot { 63 | border: 0; 64 | padding: 0; 65 | user-select: none; 66 | outline: none; 67 | display: block; 68 | cursor: pointer; 69 | color: #ccc; 70 | border-radius: 999px; 71 | background: #ccc; 72 | width: 12px; 73 | height: 12px; 74 | margin: 7px; 75 | } 76 | .glider-dot:hover, 77 | .glider-dot:focus, 78 | .glider-dot.active { 79 | background: #a89cc8; 80 | } 81 | @media (max-width: 36em) { 82 | .glider::-webkit-scrollbar { 83 | opacity: 1; 84 | -webkit-appearance: none; 85 | width: 7px; 86 | height: 3px; 87 | } 88 | .glider::-webkit-scrollbar-thumb { 89 | opacity: 1; 90 | border-radius: 99px; 91 | background-color: rgba(156, 156, 156, 0.25); 92 | box-shadow: 0 0 1px rgba(255, 255, 255, 0.25); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /glider.js: -------------------------------------------------------------------------------- 1 | /* @preserve 2 | _____ __ _ __ _ 3 | / ___// /(_)___/ /___ ____ (_)___ 4 | / (_ // // // _ // -_)/ __/_ / /(_-< 5 | \___//_//_/ \_,_/ \__//_/ (_)__/ //___/ 6 | |___/ 7 | 8 | Version: 1.7.4 9 | Author: Nick Piscitelli (pickykneee) 10 | Website: https://nickpiscitelli.com 11 | Documentation: http://nickpiscitelli.github.io/Glider.js 12 | License: MIT License 13 | Release Date: October 25th, 2018 14 | 15 | */ 16 | 17 | /* global define */ 18 | 19 | (function (factory) { 20 | typeof define === 'function' && define.amd 21 | ? define(factory) 22 | : typeof exports === 'object' 23 | ? (module.exports = factory()) 24 | : factory() 25 | })(function () { 26 | ('use strict') // eslint-disable-line no-unused-expressions 27 | 28 | /* globals window:true */ 29 | var _window = typeof window !== 'undefined' ? window : this 30 | 31 | var Glider = (_window.Glider = function (element, settings) { 32 | var _ = this 33 | 34 | if (element._glider) return element._glider 35 | 36 | _.ele = element 37 | _.ele.classList.add('glider') 38 | 39 | // expose glider object to its DOM element 40 | _.ele._glider = _ 41 | 42 | // merge user setting with defaults 43 | _.opt = Object.assign( 44 | {}, 45 | { 46 | slidesToScroll: 1, 47 | slidesToShow: 1, 48 | resizeLock: true, 49 | duration: 0.5, 50 | // easeInQuad 51 | easing: function (x, t, b, c, d) { 52 | return c * (t /= d) * t + b 53 | } 54 | }, 55 | settings 56 | ) 57 | 58 | // set defaults 59 | _.animate_id = _.page = _.slide = 0 60 | _.arrows = {} 61 | 62 | // preserve original options to 63 | // extend breakpoint settings 64 | _._opt = _.opt 65 | 66 | if (_.opt.skipTrack) { 67 | // first and only child is the track 68 | _.track = _.ele.children[0] 69 | } else { 70 | // create track and wrap slides 71 | _.track = document.createElement('div') 72 | _.ele.appendChild(_.track) 73 | while (_.ele.children.length !== 1) { 74 | _.track.appendChild(_.ele.children[0]) 75 | } 76 | } 77 | 78 | _.track.classList.add('glider-track') 79 | 80 | // start glider 81 | _.init() 82 | 83 | // set events 84 | _.resize = _.init.bind(_, true) 85 | _.event(_.ele, 'add', { 86 | scroll: _.updateControls.bind(_) 87 | }) 88 | _.event(_window, 'add', { 89 | resize: _.resize 90 | }) 91 | }) 92 | 93 | var gliderPrototype = Glider.prototype 94 | gliderPrototype.init = function (refresh, paging) { 95 | var _ = this 96 | 97 | var width = 0 98 | 99 | var height = 0 100 | 101 | _.slides = _.track.children; 102 | 103 | [].forEach.call(_.slides, function (_, i) { 104 | _.classList.add('glider-slide') 105 | _.setAttribute('data-gslide', i) 106 | }) 107 | 108 | _.containerWidth = _.ele.clientWidth 109 | 110 | var breakpointChanged = _.settingsBreakpoint() 111 | if (!paging) paging = breakpointChanged 112 | 113 | if ( 114 | _.opt.slidesToShow === 'auto' || 115 | typeof _.opt._autoSlide !== 'undefined' 116 | ) { 117 | var slideCount = _.containerWidth / _.opt.itemWidth 118 | 119 | _.opt._autoSlide = _.opt.slidesToShow = _.opt.exactWidth 120 | ? slideCount 121 | : Math.max(1, Math.floor(slideCount)) 122 | } 123 | if (_.opt.slidesToScroll === 'auto') { 124 | _.opt.slidesToScroll = Math.floor(_.opt.slidesToShow) 125 | } 126 | 127 | _.itemWidth = _.opt.exactWidth 128 | ? _.opt.itemWidth 129 | : _.containerWidth / _.opt.slidesToShow; 130 | 131 | // set slide dimensions 132 | [].forEach.call(_.slides, function (__) { 133 | __.style.height = 'auto' 134 | __.style.width = _.itemWidth + 'px' 135 | width += _.itemWidth 136 | height = Math.max(__.offsetHeight, height) 137 | }) 138 | 139 | _.track.style.width = width + 'px' 140 | _.trackWidth = width 141 | _.isDrag = false 142 | _.preventClick = false 143 | 144 | _.opt.resizeLock && _.scrollTo(_.slide * _.itemWidth, 0) 145 | 146 | if (breakpointChanged || paging) { 147 | _.bindArrows() 148 | _.buildDots() 149 | _.bindDrag() 150 | } 151 | 152 | _.updateControls() 153 | 154 | _.emit(refresh ? 'refresh' : 'loaded') 155 | } 156 | 157 | gliderPrototype.bindDrag = function () { 158 | var _ = this 159 | _.mouse = _.mouse || _.handleMouse.bind(_) 160 | 161 | var mouseup = function () { 162 | _.mouseDown = undefined 163 | _.ele.classList.remove('drag') 164 | if (_.isDrag) { 165 | _.preventClick = true 166 | } 167 | _.isDrag = false 168 | } 169 | 170 | var events = { 171 | mouseup: mouseup, 172 | mouseleave: mouseup, 173 | mousedown: function (e) { 174 | e.preventDefault() 175 | e.stopPropagation() 176 | _.mouseDown = e.clientX 177 | _.ele.classList.add('drag') 178 | }, 179 | mousemove: _.mouse, 180 | click: function (e) { 181 | if (_.preventClick) { 182 | e.preventDefault() 183 | e.stopPropagation() 184 | } 185 | _.preventClick = false 186 | } 187 | } 188 | 189 | _.ele.classList.toggle('draggable', _.opt.draggable === true) 190 | _.event(_.ele, 'remove', events) 191 | if (_.opt.draggable) _.event(_.ele, 'add', events) 192 | } 193 | 194 | gliderPrototype.buildDots = function () { 195 | var _ = this 196 | 197 | if (!_.opt.dots) { 198 | if (_.dots) _.dots.innerHTML = '' 199 | return 200 | } 201 | 202 | if (typeof _.opt.dots === 'string') { 203 | _.dots = document.querySelector(_.opt.dots) 204 | } else _.dots = _.opt.dots 205 | if (!_.dots) return 206 | 207 | _.dots.innerHTML = '' 208 | _.dots.classList.add('glider-dots') 209 | 210 | for (var i = 0; i < Math.ceil(_.slides.length / _.opt.slidesToShow); ++i) { 211 | var dot = document.createElement('button') 212 | dot.dataset.index = i 213 | dot.setAttribute('aria-label', 'Page ' + (i + 1)) 214 | dot.setAttribute('role', 'tab') 215 | dot.className = 'glider-dot ' + (i ? '' : 'active') 216 | _.event(dot, 'add', { 217 | click: _.scrollItem.bind(_, i, true) 218 | }) 219 | _.dots.appendChild(dot) 220 | } 221 | } 222 | 223 | gliderPrototype.bindArrows = function () { 224 | var _ = this 225 | if (!_.opt.arrows) { 226 | Object.keys(_.arrows).forEach(function (direction) { 227 | var element = _.arrows[direction] 228 | _.event(element, 'remove', { click: element._func }) 229 | }) 230 | return 231 | } 232 | ['prev', 'next'].forEach(function (direction) { 233 | var arrow = _.opt.arrows[direction] 234 | if (arrow) { 235 | if (typeof arrow === 'string') arrow = document.querySelector(arrow) 236 | if (arrow) { 237 | arrow._func = arrow._func || _.scrollItem.bind(_, direction) 238 | _.event(arrow, 'remove', { 239 | click: arrow._func 240 | }) 241 | _.event(arrow, 'add', { 242 | click: arrow._func 243 | }) 244 | _.arrows[direction] = arrow 245 | } 246 | } 247 | }) 248 | } 249 | 250 | gliderPrototype.updateControls = function (event) { 251 | var _ = this 252 | 253 | if (event && !_.opt.scrollPropagate) { 254 | event.stopPropagation() 255 | } 256 | 257 | var disableArrows = _.containerWidth >= _.trackWidth 258 | 259 | if (!_.opt.rewind) { 260 | if (_.arrows.prev) { 261 | _.arrows.prev.classList.toggle( 262 | 'disabled', 263 | _.ele.scrollLeft <= 0 || disableArrows 264 | ) 265 | _.arrows.prev.classList.contains('disabled') 266 | ? _.arrows.prev.setAttribute('aria-disabled', true) 267 | : _.arrows.prev.setAttribute('aria-disabled', false) 268 | } 269 | if (_.arrows.next) { 270 | _.arrows.next.classList.toggle( 271 | 'disabled', 272 | Math.ceil(_.ele.scrollLeft + _.containerWidth) >= 273 | Math.floor(_.trackWidth) || disableArrows 274 | ) 275 | _.arrows.next.classList.contains('disabled') 276 | ? _.arrows.next.setAttribute('aria-disabled', true) 277 | : _.arrows.next.setAttribute('aria-disabled', false) 278 | } 279 | } 280 | 281 | _.slide = Math.round(_.ele.scrollLeft / _.itemWidth) 282 | _.page = Math.round(_.ele.scrollLeft / _.containerWidth) 283 | 284 | var middle = _.slide + Math.floor(Math.floor(_.opt.slidesToShow) / 2) 285 | 286 | var extraMiddle = Math.floor(_.opt.slidesToShow) % 2 ? 0 : middle + 1 287 | if (Math.floor(_.opt.slidesToShow) === 1) { 288 | extraMiddle = 0 289 | } 290 | 291 | // the last page may be less than one half of a normal page width so 292 | // the page is rounded down. when at the end, force the page to turn 293 | if (_.ele.scrollLeft + _.containerWidth >= Math.floor(_.trackWidth)) { 294 | _.page = _.dots ? _.dots.children.length - 1 : 0 295 | } 296 | 297 | [].forEach.call(_.slides, function (slide, index) { 298 | var slideClasses = slide.classList 299 | 300 | var wasVisible = slideClasses.contains('visible') 301 | 302 | var start = _.ele.scrollLeft 303 | 304 | var end = _.ele.scrollLeft + _.containerWidth 305 | 306 | var itemStart = _.itemWidth * index 307 | 308 | var itemEnd = itemStart + _.itemWidth; 309 | 310 | [].forEach.call(slideClasses, function (className) { 311 | /^left|right/.test(className) && slideClasses.remove(className) 312 | }) 313 | slideClasses.toggle('active', _.slide === index) 314 | if (middle === index || (extraMiddle && extraMiddle === index)) { 315 | slideClasses.add('center') 316 | } else { 317 | slideClasses.remove('center') 318 | slideClasses.add( 319 | [ 320 | index < middle ? 'left' : 'right', 321 | Math.abs(index - (index < middle ? middle : extraMiddle || middle)) 322 | ].join('-') 323 | ) 324 | } 325 | 326 | var isVisible = 327 | Math.ceil(itemStart) >= Math.floor(start) && 328 | Math.floor(itemEnd) <= Math.ceil(end) 329 | slideClasses.toggle('visible', isVisible) 330 | if (isVisible !== wasVisible) { 331 | _.emit('slide-' + (isVisible ? 'visible' : 'hidden'), { 332 | slide: index 333 | }) 334 | } 335 | }) 336 | if (_.dots) { 337 | [].forEach.call(_.dots.children, function (dot, index) { 338 | dot.classList.toggle('active', _.page === index) 339 | }) 340 | } 341 | 342 | if (event && _.opt.scrollLock) { 343 | clearTimeout(_.scrollLock) 344 | _.scrollLock = setTimeout(function () { 345 | clearTimeout(_.scrollLock) 346 | // dont attempt to scroll less than a pixel fraction - causes looping 347 | if (Math.abs(_.ele.scrollLeft / _.itemWidth - _.slide) > 0.02) { 348 | if (!_.mouseDown) { 349 | // Only scroll if not at the end (#94) 350 | if (_.trackWidth > _.containerWidth + _.ele.scrollLeft) { 351 | _.scrollItem(_.getCurrentSlide()) 352 | } 353 | } 354 | } 355 | }, _.opt.scrollLockDelay || 250) 356 | } 357 | } 358 | 359 | gliderPrototype.getCurrentSlide = function () { 360 | var _ = this 361 | return _.round(_.ele.scrollLeft / _.itemWidth) 362 | } 363 | 364 | gliderPrototype.scrollItem = function (slide, dot, e) { 365 | if (e) e.preventDefault() 366 | 367 | var _ = this 368 | 369 | var originalSlide = slide 370 | ++_.animate_id 371 | 372 | if (dot === true) { 373 | slide = slide * _.containerWidth 374 | slide = Math.round(slide / _.itemWidth) * _.itemWidth 375 | } else { 376 | if (typeof slide === 'string') { 377 | var backwards = slide === 'prev' 378 | 379 | // use precise location if fractional slides are on 380 | if (_.opt.slidesToScroll % 1 || _.opt.slidesToShow % 1) { 381 | slide = _.getCurrentSlide() 382 | } else { 383 | slide = _.slide 384 | } 385 | 386 | if (backwards) slide -= _.opt.slidesToScroll 387 | else slide += _.opt.slidesToScroll 388 | 389 | if (_.opt.rewind) { 390 | var scrollLeft = _.ele.scrollLeft 391 | slide = 392 | backwards && !scrollLeft 393 | ? _.slides.length 394 | : !backwards && 395 | scrollLeft + _.containerWidth >= Math.floor(_.trackWidth) 396 | ? 0 397 | : slide 398 | } 399 | } 400 | 401 | slide = Math.max(Math.min(slide, _.slides.length), 0) 402 | 403 | _.slide = slide 404 | slide = _.itemWidth * slide 405 | } 406 | 407 | _.scrollTo( 408 | slide, 409 | _.opt.duration * Math.abs(_.ele.scrollLeft - slide), 410 | function () { 411 | _.updateControls() 412 | _.emit('animated', { 413 | value: originalSlide, 414 | type: 415 | typeof originalSlide === 'string' ? 'arrow' : dot ? 'dot' : 'slide' 416 | }) 417 | } 418 | ) 419 | 420 | return false 421 | } 422 | 423 | gliderPrototype.settingsBreakpoint = function () { 424 | var _ = this 425 | 426 | var resp = _._opt.responsive 427 | 428 | if (resp) { 429 | // Sort the breakpoints in mobile first order 430 | resp.sort(function (a, b) { 431 | return b.breakpoint - a.breakpoint 432 | }) 433 | 434 | for (var i = 0; i < resp.length; ++i) { 435 | var size = resp[i] 436 | if (_window.innerWidth >= size.breakpoint) { 437 | if (_.breakpoint !== size.breakpoint) { 438 | _.opt = Object.assign({}, _._opt, size.settings) 439 | _.breakpoint = size.breakpoint 440 | return true 441 | } 442 | return false 443 | } 444 | } 445 | } 446 | // set back to defaults in case they were overriden 447 | var breakpointChanged = _.breakpoint !== 0 448 | _.opt = Object.assign({}, _._opt) 449 | _.breakpoint = 0 450 | return breakpointChanged 451 | } 452 | 453 | gliderPrototype.scrollTo = function (scrollTarget, scrollDuration, callback) { 454 | var _ = this 455 | 456 | var start = new Date().getTime() 457 | 458 | var animateIndex = _.animate_id 459 | 460 | var animate = function () { 461 | var now = new Date().getTime() - start 462 | _.ele.scrollLeft = 463 | _.ele.scrollLeft + 464 | (scrollTarget - _.ele.scrollLeft) * 465 | _.opt.easing(0, now, 0, 1, scrollDuration) 466 | if (now < scrollDuration && animateIndex === _.animate_id) { 467 | _window.requestAnimationFrame(animate) 468 | } else { 469 | _.ele.scrollLeft = scrollTarget 470 | callback && callback.call(_) 471 | } 472 | } 473 | 474 | _window.requestAnimationFrame(animate) 475 | } 476 | 477 | gliderPrototype.removeItem = function (index) { 478 | var _ = this 479 | 480 | if (_.slides.length) { 481 | _.track.removeChild(_.slides[index]) 482 | _.refresh(true) 483 | _.emit('remove') 484 | } 485 | } 486 | 487 | gliderPrototype.addItem = function (ele) { 488 | var _ = this 489 | 490 | _.track.appendChild(ele) 491 | _.refresh(true) 492 | _.emit('add') 493 | } 494 | 495 | gliderPrototype.handleMouse = function (e) { 496 | var _ = this 497 | if (_.mouseDown) { 498 | _.isDrag = true 499 | _.ele.scrollLeft += 500 | (_.mouseDown - e.clientX) * (_.opt.dragVelocity || 3.3) 501 | _.mouseDown = e.clientX 502 | } 503 | } 504 | 505 | // used to round to the nearest 0.XX fraction 506 | gliderPrototype.round = function (double) { 507 | var _ = this 508 | var step = _.opt.slidesToScroll % 1 || 1 509 | var inv = 1.0 / step 510 | return Math.round(double * inv) / inv 511 | } 512 | 513 | gliderPrototype.refresh = function (paging) { 514 | var _ = this 515 | _.init(true, paging) 516 | } 517 | 518 | gliderPrototype.setOption = function (opt, global) { 519 | var _ = this 520 | 521 | if (_.breakpoint && !global) { 522 | _._opt.responsive.forEach(function (v) { 523 | if (v.breakpoint === _.breakpoint) { 524 | v.settings = Object.assign({}, v.settings, opt) 525 | } 526 | }) 527 | } else { 528 | _._opt = Object.assign({}, _._opt, opt) 529 | } 530 | 531 | _.breakpoint = 0 532 | _.settingsBreakpoint() 533 | } 534 | 535 | gliderPrototype.destroy = function () { 536 | var _ = this 537 | 538 | var replace = _.ele.cloneNode(true) 539 | 540 | var clear = function (ele) { 541 | ele.removeAttribute('style'); 542 | [].forEach.call(ele.classList, function (className) { 543 | /^glider/.test(className) && ele.classList.remove(className) 544 | }) 545 | } 546 | // remove track 547 | replace.children[0].outerHTML = replace.children[0].innerHTML 548 | clear(replace); 549 | [].forEach.call(replace.getElementsByTagName('*'), clear) 550 | _.ele.parentNode.replaceChild(replace, _.ele) 551 | _.event(_window, 'remove', { 552 | resize: _.resize 553 | }) 554 | _.emit('destroy') 555 | } 556 | 557 | gliderPrototype.emit = function (name, arg) { 558 | var _ = this 559 | 560 | var e = new _window.CustomEvent('glider-' + name, { 561 | bubbles: !_.opt.eventPropagate, 562 | detail: arg 563 | }) 564 | _.ele.dispatchEvent(e) 565 | } 566 | 567 | gliderPrototype.event = function (ele, type, args) { 568 | var eventHandler = ele[type + 'EventListener'].bind(ele) 569 | Object.keys(args).forEach(function (k) { 570 | eventHandler(k, args[k]) 571 | }) 572 | } 573 | 574 | return Glider 575 | }) 576 | -------------------------------------------------------------------------------- /jason-llewellyn.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rileyrichter/snippets/84d137585592f3b8f53945fd30340c02bbca30ba/jason-llewellyn.jpeg -------------------------------------------------------------------------------- /jayden-rowe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rileyrichter/snippets/84d137585592f3b8f53945fd30340c02bbca30ba/jayden-rowe.jpeg -------------------------------------------------------------------------------- /js/countdown.js: -------------------------------------------------------------------------------- 1 | // Set the date we're counting down to, the time in PST 2 | const countDownDate = new Date("Sep 2, 2020 17:00:00 GMT"); 3 | 4 | // Update the count down every 1 second 5 | const x = setInterval(function () { 6 | // Get today's date and time 7 | const now = new Date().getTime(); 8 | 9 | // Find the distance between now and the count down date 10 | const distance = countDownDate - now; 11 | 12 | // Time calculations for days, hours, minutes and seconds and use minimumInteger to make sure all elements have 2 digits 13 | const days = Math.floor( 14 | distance / (1000 * 60 * 60 * 24) 15 | ).toLocaleString(undefined, { minimumIntegerDigits: 2 }); 16 | const hours = Math.floor( 17 | (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) 18 | ).toLocaleString(undefined, { minimumIntegerDigits: 2 }); 19 | const minutes = Math.floor( 20 | (distance % (1000 * 60 * 60)) / (1000 * 60) 21 | ).toLocaleString(undefined, { minimumIntegerDigits: 2 }); 22 | const seconds = Math.floor( 23 | (distance % (1000 * 60)) / 1000 24 | ).toLocaleString(undefined, { minimumIntegerDigits: 2 }); 25 | 26 | // Display the result in the elements with id="days", id="hours", id="minutes", and id = "seconds" 27 | 28 | document.getElementById("days").innerHTML = days; 29 | document.getElementById("hours").innerHTML = hours; 30 | document.getElementById("minutes").innerHTML = minutes; 31 | document.getElementById("seconds").innerHTML = seconds; 32 | 33 | // If the count down is finished, remove the countdown element and copy, remove a combo class to reveal launch message 34 | if (distance < 0) { 35 | clearInterval(x); 36 | const itsTime = document.getElementById("itshere"); 37 | const timeWrapper = document.getElementById("gone"); 38 | timeWrapper.remove(); 39 | itsTime.classList.remove("itshere"); 40 | } 41 | }, 500); 42 | -------------------------------------------------------------------------------- /js/jqueryget.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $.get("https://deckofcardsapi.com/api/deck/new/draw/?count=1", function ( 3 | data 4 | ) { 5 | const suit = data.cards[0].suit; 6 | const value = data.cards[0].value; 7 | const image = data.cards[0].images.svg; 8 | console.log(suit); 9 | console.log(value); 10 | console.log(image); 11 | document.getElementById("suit").innerHTML = suit; 12 | document.getElementById("value").innerHTML = value; 13 | document.getElementById("image").src = image; 14 | }); 15 | }); 16 | function newCard() { 17 | location.reload(); 18 | } 19 | -------------------------------------------------------------------------------- /js/old-write.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Static Template 8 | 12 | 17 | 21 | 30 | 36 | 46 | 47 | 48 |
49 |
50 |
51 | 117 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /js/this.json: -------------------------------------------------------------------------------- 1 | { 2 | "success": true, 3 | "deck_id": "nwu7589ziqef", 4 | "cards": [ 5 | { 6 | "code": "2D", 7 | "image": "https://deckofcardsapi.com/static/img/2D.png", 8 | "images": { 9 | "svg": "https://deckofcardsapi.com/static/img/2D.svg", 10 | "png": "https://deckofcardsapi.com/static/img/2D.png" 11 | }, 12 | "value": "2", 13 | "suit": "DIAMONDS" 14 | } 15 | ], 16 | "remaining": 51 17 | } 18 | -------------------------------------------------------------------------------- /js/typewriter.js: -------------------------------------------------------------------------------- 1 | function shuffle(array) { 2 | let currentIndex = array.length, 3 | randomIndex; 4 | 5 | // While there remain elements to shuffle... 6 | while (currentIndex != 0) { 7 | // Pick a remaining element... 8 | randomIndex = Math.floor(Math.random() * currentIndex); 9 | currentIndex--; 10 | 11 | // And swap it with the current element. 12 | [array[currentIndex], array[randomIndex]] = [ 13 | array[randomIndex], 14 | array[currentIndex], 15 | ]; 16 | } 17 | 18 | return array; 19 | } 20 | 21 | const typeWriter = [ 22 | "sentence ending number one.", 23 | "sentence ending number two.", 24 | "sentence ending number three.", 25 | "sentence ending number four.", 26 | "sentence ending number five.", 27 | "sentence ending number six.", 28 | "sentence ending number seven.", 29 | "sentence ending number eight.", 30 | ]; 31 | 32 | shuffle(typeWriter); 33 | console.log(typeWriter); 34 | 35 | const instance = new Typewriter("#typewriter", { 36 | strings: typeWriter, 37 | autoStart: true, 38 | loop: true, 39 | }); 40 | -------------------------------------------------------------------------------- /js/write-items-part-two.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Static Template 8 | 12 | 17 | 21 | 30 | 36 | 46 | 47 | 48 |
49 |
50 |
51 | 117 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /js/write-items.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 10 |
11 |
12 |
This is some text inside of a div block.
13 |

Heading

14 |
Full-Time/USA
15 |
16 |
17 |
18 | Apply Now 19 |
20 |
21 | -------------------------------------------------------------------------------- /js/write-items.js: -------------------------------------------------------------------------------- 1 | // This is some code I wrote to use No Code API, Airtable, and Webflow to write to the DOM 2 | // instead of using the CMS. No Code API is a cheat code and this was fun to build. 3 | // The write-items.html file is the HTML structure this is based on. You can see the 4 | // live version on a Webflow site here: https://airtable-job-board.webflow.io/ 5 | 6 | // Get our container with an ID of listing and set it as listing 7 | const listing = document.getElementById("listing"); 8 | 9 | // On document ready, let's fetch some data 10 | $(document).ready(function () { 11 | const handleError = (response) => { 12 | if (!response.ok) { 13 | throw Error(` ${response.status} ${response.statusText}`); 14 | } else { 15 | return response.json(); 16 | } 17 | }; //handler function that throws any encountered error 18 | 19 | fetch( 20 | "https://v1.nocodeapi.com/rileyrichter/airtable/oBStoMqdqFOwtxwb?tableName=Job%20Postings" 21 | ) 22 | .then(handleError) // skips to .catch if error is thrown 23 | .then((data) => { 24 | data.records.forEach((record) => { 25 | let posting = document.createElement("div"); 26 | posting.setAttribute("class", "posting-wrapper"); 27 | listing.appendChild(posting); 28 | let postcontent = document.createElement("div"); 29 | postcontent.setAttribute("class", "post-content-wrapper"); 30 | posting.appendChild(postcontent); 31 | let logowrapper = document.createElement("div"); 32 | logowrapper.setAttribute("class", "company-logo-wrapper"); 33 | postcontent.appendChild(logowrapper); 34 | let companylogo = document.createElement("img"); 35 | companylogo.setAttribute("class", "company-logo"); 36 | companylogo.setAttribute("src", record.fields.company_logo); 37 | companylogo.setAttribute("alt", record.fields.company_name + "logo"); 38 | companylogo.setAttribute("loading", "lazy"); 39 | logowrapper.appendChild(companylogo); 40 | let listingcontent = document.createElement("div"); 41 | listingcontent.setAttribute("class", "listing-content-wrapper"); 42 | postcontent.appendChild(listingcontent); 43 | let companyname = document.createElement("div"); 44 | companyname.setAttribute("class", "company-name"); 45 | companyname.textContent = record.fields.company_name; 46 | listingcontent.appendChild(companyname); 47 | let listingname = document.createElement("h3"); 48 | listingname.setAttribute("class", "post-name"); 49 | listingname.textContent = record.fields.Name; 50 | listingcontent.appendChild(listingname); 51 | let jobtype = document.createElement("div"); 52 | jobtype.setAttribute("class", "company-name"); 53 | jobtype.textContent = "Full-Time/USA"; 54 | listingcontent.appendChild(jobtype); 55 | let applywrapper = document.createElement("div"); 56 | applywrapper.setAttribute("class", "post-apply-wrapper"); 57 | posting.appendChild(applywrapper); 58 | let applybutton = document.createElement("a"); 59 | applybutton.setAttribute("class", "button w-button"); 60 | applybutton.setAttribute("href", record.fields.apply_link); 61 | applybutton.setAttribute("target", "_blank"); 62 | let link = document.createTextNode("Apply Now"); 63 | applybutton.appendChild(link); 64 | applywrapper.appendChild(applybutton); 65 | }); 66 | }) 67 | .catch(function writeError(err) { 68 | // catches the error and logs it 69 | let writeWrapper = document.createElement("div"); 70 | writeWrapper.style.textAlign = "center"; 71 | let writeLineOne = document.createElement("p"); 72 | writeLineOne.textContent = "Job listings could not be loaded"; 73 | let writeLineTwo = document.createElement("p"); 74 | writeLineTwo.textContent = err; 75 | writeWrapper.appendChild(writeLineOne); 76 | writeWrapper.appendChild(writeLineTwo); 77 | listing.appendChild(writeWrapper); 78 | }) 79 | .finally(() => { 80 | // removes the loading element 81 | document.getElementById("loading").remove(); 82 | }); 83 | }); 84 | -------------------------------------------------------------------------------- /loading-attribute-polyfill.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Loading attribute polyfill - https://github.com/mfranzke/loading-attribute-polyfill 3 | * @license Copyright(c) 2019 by Maximilian Franzke 4 | * Credits for the initial kickstarter / script to @Sora2455, and supported by @cbirdsong, @eklingen, @DaPo, @nextgenthemes, @diogoterremoto, @dracos, @Flimm, @TomS- and @vinyfc93 - many thanks for that ! 5 | */ 6 | !function(e,t){"use strict";var r,a,o={rootMargin:"256px 0px",threshold:.01,lazyImage:'img[loading="lazy"]',lazyIframe:'iframe[loading="lazy"]'},n={loading:"loading"in HTMLImageElement.prototype&&"loading"in HTMLIFrameElement.prototype,scrolling:"onscroll"in window};function i(e){var t,r,a=[];"picture"===e.parentNode.tagName.toLowerCase()&&(t=e.parentNode,(r=t.querySelector("source[data-lazy-remove]"))&&t.removeChild(r),a=Array.prototype.slice.call(e.parentNode.querySelectorAll("source"))),a.push(e),a.forEach((function(e){e.hasAttribute("data-lazy-srcset")&&(e.setAttribute("srcset",e.getAttribute("data-lazy-srcset")),e.removeAttribute("data-lazy-srcset"))})),e.setAttribute("src",e.getAttribute("data-lazy-src")),e.removeAttribute("data-lazy-src")}function c(e){var t=document.createElement("div");for(t.innerHTML=function(e){var t=e.textContent||e.innerHTML,a="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((t.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((t.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return!n.loading&&n.scrolling&&(void 0===r?t=t.replace(/(?:\r\n|\r|\n|\t| )src=/g,' lazyload="1" src='):("picture"===e.parentNode.tagName.toLowerCase()&&(t=''+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+a+'" data-lazy-src='))),t}(e);t.firstChild;)n.loading||!n.scrolling||void 0===r||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||r.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function d(){document.querySelectorAll("noscript."+e).forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(o.lazyImage+"[data-lazy-src],"+o.lazyIframe+"[data-lazy-src]").forEach((function(e){i(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(r=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var r=e.target;t.unobserve(r),i(r)}}))}),o)),a="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?a(d):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){a(d)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&d()}))}("loading-lazy"); -------------------------------------------------------------------------------- /lsep.js: -------------------------------------------------------------------------------- 1 | // run in console to find LSEP 2 | 3 | $("body") 4 | .children() 5 | .each(function () { 6 | $(this).html( 7 | $(this) 8 | .html() 9 | .replace(/\u2028/g, "LSEP") 10 | ); 11 | }); 12 | -------------------------------------------------------------------------------- /memberstack/like.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | -------------------------------------------------------------------------------- /memberstack/like.js: -------------------------------------------------------------------------------- 1 | // Home page or where the items are listed from https://webflow.com/website/Like-save-favorite-bookmark-etc 2 | 3 | MemberStack.onReady.then(async function (member) { 4 | if (!member.loggedIn) { 5 | document.querySelectorAll("[data-item]").forEach(function (element) { 6 | var likeButton = element.querySelector("[likeButton]"); 7 | likeButton.classList.remove("saved"); 8 | }); 9 | document.querySelector(".like-loader").style.display = "none"; 10 | return; 11 | } 12 | //get member metadata 13 | var metadata = await member.getMetaData(); 14 | 15 | var favorites = metadata.favorites; 16 | 17 | if (!favorites) favorites = []; 18 | 19 | document.querySelectorAll("[data-item]").forEach(function (element) { 20 | var link = element.querySelector("[data-link]"); 21 | var url = new URL(link.href).pathname; 22 | var likeButton = element.querySelector("[likeButton]"); 23 | if (!favorites.includes(url)) likeButton.classList.remove("saved"); 24 | 25 | likeButton.addEventListener("click", function (event) { 26 | event.preventDefault(); 27 | if (!favorites.includes(url)) { 28 | favorites.push(url); 29 | likeButton.classList.add("saved"); 30 | } else { 31 | var index = favorites.indexOf(url); 32 | if (index > -1) { 33 | favorites.splice(index, 1); 34 | } 35 | likeButton.classList.remove("saved"); 36 | } 37 | member.updateMetaData({ favorites: favorites }); 38 | }); 39 | }); 40 | document.querySelector(".like-loader").style.display = "none"; 41 | }); 42 | 43 | // For the favorites page 44 | 45 | document.addEventListener("DOMContentLoaded", function (event) { 46 | document.querySelectorAll("[data-image]").forEach(function (image) { 47 | image.dataset.imgsrc = image.src; 48 | image.src = ""; 49 | }); 50 | }); 51 | 52 | MemberStack.onReady.then(async function (member) { 53 | if (!member.loggedIn) { 54 | document.querySelectorAll("[data-item]").forEach(function (element) { 55 | var likeButton = element.querySelector("[likeButton]"); 56 | likeButton.classList.remove("saved"); 57 | }); 58 | return; 59 | } 60 | 61 | //get member metadata 62 | var metadata = await member.getMetaData(); 63 | 64 | var favorites = metadata.favorites; 65 | 66 | if (!favorites) favorites = []; 67 | 68 | document.querySelectorAll("[data-item]").forEach(function (element) { 69 | var link = element.querySelector("[data-link]"); 70 | var url = new URL(link.href).pathname; 71 | var likeButton = element.querySelector("[likeButton]"); 72 | if (!favorites.includes(url)) { 73 | element.remove(); 74 | document.querySelector(".like-loader").style.display = "none"; 75 | return; 76 | } else { 77 | var image = element.querySelector("[data-image]"); 78 | image.src = image.dataset.imgsrc; 79 | } 80 | 81 | likeButton.addEventListener("click", function (event) { 82 | event.preventDefault(); 83 | if (!favorites.includes(url)) { 84 | favorites.push(url); 85 | likeButton.classList.add("saved"); 86 | } else { 87 | var index = favorites.indexOf(url); 88 | if (index > -1) { 89 | favorites.splice(index, 1); 90 | } 91 | likeButton.classList.remove("saved"); 92 | } 93 | member.updateMetaData({ favorites: favorites }); 94 | }); 95 | document.querySelector(".like-loader").style.display = "none"; 96 | }); 97 | }); 98 | 99 | // For the template collection page 100 | 101 | MemberStack.onReady.then(async function (member) { 102 | if (!member.loggedIn) { 103 | var likeButton = document.querySelector("[likeButton]"); 104 | likeButton.classList.remove("saved"); 105 | return; 106 | } 107 | 108 | //get member metadata 109 | var metadata = await member.getMetaData(); 110 | 111 | var books = metadata.books; 112 | 113 | if (!books) books = []; 114 | 115 | var url = window.location.pathname; 116 | var likeButton = document.querySelector("[likeButton]"); 117 | if (!books.includes(url)) likeButton.classList.remove("saved"); 118 | 119 | likeButton.addEventListener("click", function (event) { 120 | event.preventDefault(); 121 | if (!books.includes(url)) { 122 | books.push(url); 123 | likeButton.classList.add("saved"); 124 | } else { 125 | var index = books.indexOf(url); 126 | if (index > -1) { 127 | books.splice(index, 1); 128 | } 129 | likeButton.classList.remove("saved"); 130 | } 131 | member.updateMetaData({ books: books }); 132 | }); 133 | }); 134 | -------------------------------------------------------------------------------- /memberstack/memberstack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Static Template 9 | 10 | 11 |

12 | This code comes from the sandbox in 13 | Memberstack's API Docs 14 |

15 | Uncomment methods in index.js
17 | and check the console below! 🚀 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /memberstack/memberstack.js: -------------------------------------------------------------------------------- 1 | // All of this code is copied from the Memberstack API Sandbox in their docs at https://docs.memberstack.com/ 2 | 3 | // Add your API key here. 4 | const API_KEY = "..."; 5 | const FREE_PLAN_ID = "..."; 6 | const USER_ID_TO_FETCH = "..."; 7 | const USER_ID_TO_UPDATE = "..."; 8 | const USER_ID_TO_DELETE = "..."; 9 | 10 | console.log("✨ Uncomment methods to start interacting with the API!"); 11 | 12 | /*----*/ 13 | /* Uncomment this method to receive all members of your website */ 14 | // getMembers(); 15 | /*------*/ 16 | 17 | /*------*/ 18 | /* Uncomment this method to receive the member with the passed id. */ 19 | /* ✨ Don't forget to add a value for USER_ID */ 20 | // getMember() 21 | /*------*/ 22 | 23 | /*------*/ 24 | /* Uncomment this method to add a member to your website. */ 25 | /* ✨ Don't forget to add a value for email, password, and a free plan id! */ 26 | // addMember() 27 | /*------*/ 28 | 29 | /*------*/ 30 | /* Uncomment this method to update a member's data. */ 31 | /* ✨ Don't forget to add a value for USER_ID */ 32 | // updateMember() 33 | /*------*/ 34 | 35 | /*------*/ 36 | /* Uncomment this method to delete a member. */ 37 | // ✨ Don't forget to add a value for USER_ID 38 | // ⚠️ Careful: The user with this id will be permanently deleted! ⚠️ 39 | // deleteMember() 40 | /*------*/ 41 | 42 | async function getMembers() { 43 | const res = await fetch("https://api.memberstack.com/v1/members", { 44 | headers: { "X-API-KEY": API_KEY }, 45 | }); 46 | 47 | const getMembersResponse = await res.json(); 48 | console.log(getMembersResponse); 49 | return getMembersResponse; 50 | } 51 | 52 | async function getMember() { 53 | const res = await fetch( 54 | `https://api.memberstack.com/v1/members/${USER_ID_TO_FETCH}`, 55 | { 56 | headers: { "X-API-KEY": API_KEY }, 57 | } 58 | ); 59 | 60 | const getMemberResponse = await res.json(); 61 | console.log(getMemberResponse); 62 | return getMemberResponse; 63 | } 64 | 65 | async function addMember() { 66 | const res = await fetch("https://api.memberstack.com/v1/members", { 67 | method: "POST", 68 | headers: { 69 | "X-API-KEY": API_KEY, 70 | "Content-Type": "application/json", 71 | }, 72 | body: JSON.stringify({ 73 | email: "...", 74 | password: "...", 75 | plan: FREE_PLAN_ID, 76 | }), 77 | }); 78 | 79 | const addMemberResponse = await res.json(); 80 | console.log(addMemberResponse); 81 | return addMemberResponse; 82 | } 83 | 84 | async function updateMember() { 85 | const res = await fetch( 86 | `https://api.memberstack.com/v1/members/${USER_ID_TO_UPDATE}`, 87 | { 88 | method: "POST", 89 | headers: { "X-API-KEY": API_KEY }, 90 | body: { email: "..." }, 91 | } 92 | ); 93 | 94 | const updateMemberResponse = await res.json(); 95 | console.log(updateMemberResponse); 96 | return updateMemberResponse; 97 | } 98 | 99 | async function deleteMember() { 100 | const res = await fetch( 101 | `https://api.memberstack.com/v1/members/${USER_ID_TO_DELETE}`, 102 | { 103 | method: "DELETE", 104 | headers: { "X-API-KEY": API_KEY }, 105 | } 106 | ); 107 | 108 | const deleteMemberResponse = await res.json(); 109 | console.log(deleteMemberResponse); 110 | return deleteMemberResponse; 111 | } 112 | -------------------------------------------------------------------------------- /no-code/no-code.js: -------------------------------------------------------------------------------- 1 | // This is javascript I use in Zapier code blocks fairly often 2 | 3 | // Generate a password or random string 4 | function randomStr(len, arr) { 5 | var ans = ""; 6 | for (var i = len; i > 0; i--) { 7 | ans += arr[Math.floor(Math.random() * arr.length)]; 8 | } 9 | return ans; 10 | } 11 | 12 | output = [{ password: randomStr(8, "123456789abcdefghijklmnopqrstuvwxyz") }]; 13 | 14 | // Convert an object or line item to a string 15 | const lineItem = String(); 16 | return { lineref: lineItem }; 17 | 18 | // If passing through a string of multireference items, remove the last comma and space 19 | const str = inputData.ref; 20 | const newStr = str.substring(0, str.length - 2); 21 | return { refs: newStr }; 22 | -------------------------------------------------------------------------------- /owl/init.js: -------------------------------------------------------------------------------- 1 | // We'll need to init 6 lists and also add custom styling via CSS to the nav 2 | $(document).ready(function () { 3 | $(".feature").owlCarousel({ 4 | loop: true, 5 | margin: 30, 6 | autoplayHoverPause: true, 7 | responsive: { 8 | // breakpoint from 0 up 9 | 0: { 10 | items: 1, 11 | }, 12 | // breakpoint from 480 up 13 | 478: { 14 | items: 2, 15 | }, 16 | // breakpoint from 768 up 17 | 767: { 18 | items: 3, 19 | }, 20 | // breakpoint from 991 up 21 | 991: { 22 | items: 4, 23 | }, 24 | }, 25 | }); 26 | $(".recent").owlCarousel({ 27 | loop: true, 28 | autoplayHoverPause: true, 29 | items: 1, 30 | }); 31 | }); 32 | // We'll lose this since we'll be using the native nav items from Owl 33 | $(".slider-nav-left").on("click", function () { 34 | setTimeout(function () { 35 | $(".owl-prev").triggerHandler("click"); 36 | }); 37 | }); 38 | $(".slider-nav-right").on("click", function () { 39 | setTimeout(function () { 40 | $(".owl-next").triggerHandler("click"); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /owl/owl.carousel.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Owl Carousel v2.3.4 3 | * Copyright 2013-2018 David Deutsch 4 | * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 5 | */ 6 | .owl-carousel,.owl-carousel .owl-item{-webkit-tap-highlight-color:transparent;position:relative}.owl-carousel{display:none;width:100%;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y;touch-action:manipulation;-moz-backface-visibility:hidden}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0,0,0)}.owl-carousel .owl-item,.owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.owl-carousel .owl-item{min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%}.owl-carousel .owl-dots.disabled,.owl-carousel .owl-nav.disabled{display:none}.no-js .owl-carousel,.owl-carousel.owl-loaded{display:block}.owl-carousel .owl-dot,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel .owl-nav button.owl-next,.owl-carousel .owl-nav button.owl-prev,.owl-carousel button.owl-dot{background:0 0;color:inherit;border:none;padding:0!important;font:inherit}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-ms-touch-action:pan-y;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.owl-carousel .animated{animation-duration:1s;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height .5s ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity .4s ease}.owl-carousel .owl-item .owl-lazy:not([src]),.owl-carousel .owl-item .owl-lazy[src^=""]{max-height:0}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform .1s ease}.owl-carousel .owl-video-play-icon:hover{-ms-transform:scale(1.3,1.3);transform:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity .4s ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%} -------------------------------------------------------------------------------- /owl/owl.carousel.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Owl Carousel v2.3.4 3 | * Copyright 2013-2018 David Deutsch 4 | * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 5 | */ 6 | !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("
",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&bi-g-f&&b",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a":return d?ac;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='
',d=k.lazyLoad?a("
",{class:"owl-video-tn "+j,srcType:c}):a("
",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("
",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a(''),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('
').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1, 7 | animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('
'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"
")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['',''],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("
").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('