/* /////////////////////////////////////////////////////////////////////////////// */ /* 1. REQUIRED: Do you need a video opener? */ /* Set to 'true' if using video for the opener, if you're just using a static image, set to 'false' */ var hasVideo = true; /* /////////////////////////////////////////////////////////////////////////////// */ /* 2. REQUIRED: Whether a static image or video hero, you'll need add your hero images here. For video, this image is used as loading/low battery image */ /* Desktop & Tablet Hero image should be 2000px wide, optimized via https://squoosh.app using mozJPG at 70% compression, upload to DASH Media Library, grab url of image and paste here. */ var desktopHeroImage = "https://ift.tt/heDV9Mj"; /* Mobile Hero image should be 1280px wide, optimized via https://squoosh.app using mozJPG at 70% compression, upload to DASH Media Library, grab url of image and paste here. */ var mobileHeroImage = "https://ift.tt/kCAfXu3"; /* /// Tip: If creating a first frame image for a video opener, make a screen cap of the final uploaded JWPlayer video as JW will do it's own compression on you video and thus the color maybe different. */ /* /////////////////////////////////////////////////////////////////////////////// */ /* 3. REQUIRED: Whether video or image only, please add accessible alt text, if there is text baked into the image, you should add it here. */ var desktopHeroAltText = "29 Acts of Self Love"; var mobileHeroAltText = "29 Acts of Self Love"; /* /// Tip: If quote marks are needed in text, use " if you need an emdash use — */ /* /////////////////////////////////////////////////////////////////////////////// */ /* 4. REQUIRED FOR VIDEO: Desktop & Tablet Wide, video URL from JWPlayer, use 1920px 8:3 wide asset, mp4 is best, no audio, 6-10 second loop, do not repeat the loop in the file */ var desktopVideo = "https://ift.tt/qZs6Mau"; /* /////////////////////////////////////////////////////////////////////////////// */ /* 5. REQUIRED FOR VIDEO: Moble video URL from JWPlayer use 720px 8:3 square to tall asset, typical ratios 1:1,5:6,4:3, no audio, 6-10 second loop, do not repeat the loop in the file */ var mobileVideo = "https://ift.tt/RZTVIFQ"; /* /////////////////////////////////////////////////////////////////////////////// */ /* 6. INTRO / BOILERPLATE: Do you need an intro blurb under the hero? */ /* If yes, set to 'true'. if no, set to 'false' */ var hasIntro = true; /* Add your intro text here */ var introText = "Practicing self-love should be a daily habit, whether you’re celebrating a major milestone, like landing your dream job or moving into your first solo apartment, or simply just because. That’s why we partnered with Shane Co., purveyors of timeless fine jewelry, to explore the countless ways we can show ourselves a little gratitude each day. From gifting yourself something that sparkles to indulging in a day of pampering, click the tiles below for 29 unique “treat yourself” ideas."; /* /////////////////////////////////////////////////////////////////////////////// */ /* 7. SPONSOR / BRAND BANNER: Do you need a sponsor or brand banner? */ /* If yes, set to 'true'. if no, set to 'false' */ var hasBanner = true; /* Banner image, transparent PNG, 600x80 for Sponsored, 600x200 for Brand, be sure to use https://squoosh.app optimize with oxiPNG using Reduced Palette */ var bannerImage = "https://ift.tt/jcPwG2C"; /* REQUIRED: Add your banner's alt text here. */ var bannerImageAltText = "Created in partnership with Shane Co."; /* Need a url for click tracker etc.? Add here. Leave blank if not. */ var bannerURL = "https://ift.tt/mkevqJT"; /* /////////////////////////////////////////////////////////////////////////////// */ /* 8. CHECK: Is there a double ad showing up under the hero? */ /* Set to 'true' to remove extra ad, set to 'false' if all looks ok */ var removeExtraAd = false; /* /////////////////////////////////////////////////////////////////////////////// */ /* 9. EDIT: Rollover image transparent png. Square min 2000px x 2000px. Squooshed. */ const cardHoverImage = "https://ift.tt/62yDaXe"; /* /////////////////////////////////////////////////////////////////////////////// */ /* DO NOT ALTER */ let mobile = false; /* What device is this? */ if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { mobile = true; } // Popups let prevPop = null; function posArrow(id) { if (window.innerWidth < 1024.98) { const a = document.getElementById('tmp-arrows'); const b = document.querySelectorAll('.tmp-popup-image'); const rect = b[id].getBoundingClientRect().top; let y; if (window.innerWidth 1024) { y = (rect) + (456/2); } else { y = ((rect) + (456/2)) - 30; } } a.style.top = y + "px"; } } function setupContent() { let a = document.querySelectorAll(".tmp-card"); let b = document.querySelectorAll(".tmp-card-rollover"); let c = document.querySelectorAll(".tmp-popup"); for (let e = 0; e < a.length; e++) { // Setup cards a[e].setAttribute("id","tmp-" + e); a[e].setAttribute("onclick","openPop(" + e + ")"); // Setup Card Hovers b[e].innerHTML = ""; // Setup popups c[e].setAttribute("id","tmp-popup-" + e); } } function hideNav() { const a = document.querySelectorAll(".global-header"); a[0].style.display = "none"; } function showNav() { const a = document.querySelectorAll(".global-header"); a[0].style.display = "block"; } function openPop(id) { if (prevPop != null) { // Clean up any previous pop let ff = ["tmp-popup-" + prevPop]; let bb = document.getElementById(ff); bb.style.display = "none"; bb.style.opacity = "0.0"; } // Show new pop let e = ["tmp-popup-" + id]; let a = document.getElementById(e); a.style.display = "block"; a.style.opacity = "1.0"; const pop = document.getElementById("tmp-pop"); pop.style.display = "block"; var waitForFadein = setTimeout(function(){ clearTimeout(waitForFadein); pop.style.opacity = "1.0"; pop.style.transition = "0.3s"; pop.style.WebkitTransition = "0.3s"; // Clean up a = undefined; e = undefined; // Hide nav if(mobile) { hideNav(); } }, 50); prevPop = id; posArrow(id); } function closePop() { if (prevPop != null) { let f = ["tmp-popup-" + prevPop]; let b = document.getElementById(f); const pop = document.getElementById("tmp-pop"); pop.style.opacity = "0.0"; pop.style.transition = "0.3s"; pop.style.WebkitTransition = "0.3s"; var waitForFadeout = setTimeout(function(){ clearTimeout(waitForFadeout); b.style.display = "none"; pop.style.display = "none"; // Clean up b = undefined; f = undefined; // Show nav if(mobile) { showNav(); } }, 200); } } // Next and previous let nextID; let prevID; function nextPopup() { // Current one let h = ["tmp-popup-" + prevPop]; let d = document.getElementById(h); // Next one if (prevPop 0) { prevID = prevPop - 1; } else { prevID = 28; } let q = ["tmp-popup-" + prevID]; let r = document.getElementById(q); // Fade out current one m.style.opacity = "0.0"; // Fade in next one r.style.display = "block"; r.style.opacity = "1.0"; // Hide current one m.style.display = "none"; // Clean up n = undefined; m = undefined; q = undefined; r = undefined; // Store it prevPop = prevID; } function setupGridTitle() { if (mobile == true) { let o = document.getElementsByClassName("tmp-layer-title"); for (e = 0; e < o.length; e++) { o[e].style.opacity = "1.0"; o[e].style.bottom = "5px"; } } } // Tools const toolsOn = false; function tempNumbers() { let e, t = document.querySelectorAll(".tmp-card .tmp-card-rollover"); for (e = 0; e < t.length; e++) { if ((t[e].setAttribute("id", ["image" + e]), 1 == toolsOn)) { let n = document.createElement("DIV"); t[e].appendChild(n), (n.innerHTML = "
" + (e+1) + "
"); } } } function setupMobileClicks() { if (mobile == true) { let o = document.getElementsByClassName("tmp-card"); for (let e = 0; e < a.length; e++) { //a[e].style. } } } function initOther() { setupGridTitle(); setupContent(); setupMobileClicks(); } function showHero(){let t=document.getElementById("tmp"), s=document.getElementById("tmp-extra"), a=document.getElementById("tmp-loading"); t.style.opacity="0.0";t.style.display="block"; s.style.display="block"; const e=setTimeout(function (){clearTimeout(e), (t.style.opacity="1.0"), (t.style.transition="all 0.5s"), (t.style.WebkitTransition="all 0.5s"), (s.style.opacity="1.0"), (s.style.transition="all 0.5s"), (s.style.WebkitTransition="all 0.5s"), (a.style.display="none");}, 500);}function setupBanner(){let e;""!=bannerURL?(e='',urlend=""):(e="",urlend="");let n=e+''+urlend,t=document.getElementById("tmp-blurb");t.innerHTML="
"+introText+"
",1==hasIntro?t.style.display="block":t.style.display="none";let l=document.getElementById("tmp-banner");l.innerHTML=n,1==hasBanner?l.style.display="block":l.style.display="none"}function loadVideo(){var e=document.getElementById("tmp-video-hero-desktop"), t=document.getElementById("tmp-video-hero-mobile"); window.innerWidth > 960 && ((e.src=desktopVideo), e.load()), window.innerWidth > 767 && window.innerWidth < 961 && ((e.src=desktopVideo), e.load()), window.innerWidth < 768 && ((t.src=mobileVideo), t.load());}function setupVideo(){(document.getElementById("tmp-content").innerHTML=''), loadVideo();}function setupStatic(){document.getElementById("tmp-content").innerHTML='';}function setup(e){1==e ? setupVideo() : setupStatic(); showHero();}function manageAds(e){if (1==e){let e=document.getElementsByClassName("row-ad"); (e[0].style.display="none"), (e=void 0), delete e;}}function ready(e){(document.attachEvent ? "complete"===document.readyState : "loading" !==document.readyState) ? e() : document.addEventListener("DOMContentLoaded", e);}(document.onmouseleave=function (){window.isReady=!1;}), window.addEventListener("resize", function (){window.isReady=!1;}), (window.isReady=void 0 !==window.isReady && window.isReady), ready(function (){var e=setInterval(function (){window.imagesLoaded && (imagesLoaded("#tmp-load",{background: !0}, function (){(window.isReady=!1), clearInterval(e);}), clearInterval(e));}, 100); if (!1 !==window.isReady) return; window.isReady=!0; const t=setTimeout(function (){clearTimeout(t), setup(hasVideo), setupBanner(), initOther(), manageAds(removeExtraAd);}, 500);});Like what you see? How about some more R29 goodness, right here?
No comments:
Post a Comment