PageSourceSearch

https://www.classdojo.com/component---src-layouts-dojo-islands-welcome-route-tsx-251220f1d9c66a3564a9.js

js classdojo.com collected 2026-10-01 09:02:02 UTC 13,172 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkexternal_site=self.webpackChunkexternal_site||[]).push([[10288],{52102:function(e,s,t){t.r(s),t.d(s,{default:function(){return A}});var a=t(37682),n=t(96540),l=t(64810),i=t(29237),r=t(82130),o=t(75657),c=t(77977),d=t(17437);function m(e){var s;let{nudges:t}=e;const a=(0,c.j)(),{0:l,1:i}=(0,n.useState)(0);(0,n.useEffect)(()=>{if(a||t.length<=1)return;const e=setInterval(()=>i(e=>(e+1)%t.length),3200);return()=>clearInterval(e)},[a,t.length]);const r=null!==(s=t[l])&&void 0!==s?s:t[0];return r?(0,d.jsx)("p",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-4 text-center text-[#fff8e7]","aria-live":"polite"},(0,d.jsx)("span",{className:"text-body-2 uppercase tracking-[0.18em] text-[#ffd56b]"},"Jump back in and"),(0,d.jsx)("span",{key:l,className:"animate-welcome-swap text-headline-3"},r.emoji," ",r.text)):null}var u=t(81738);function p(e){const s=e.friendsOnline>0;return[{emoji:"🧱",text:"stack something huge in the Build Zone"},s?{emoji:"🎮",text:"team up in a minigame with your friends"}:{emoji:"🎮",text:"jump into a minigame"},{emoji:"🔨",text:"craft a new treasure at the Crafting Table"},s&&{emoji:"🏝️",text:"go visit a friend's island"},!!e.petImageUrl&&{emoji:"🐾",text:"take your pet exploring"},e.hasNewItems&&{emoji:"🎁",text:"open what's waiting for you"},e.passActive&&{emoji:"⭐",text:"grab the newest Adventure Pass gear"},"winter"===e.season&&{emoji:"❄️",text:"deck your island out for winter"},"spooky"===e.season&&{emoji:"🎃",text:"deck your island out for spooky season"}].filter(e=>!!e)}function f(e){return{className:"animate-welcome-rise",style:{animationDelay:`${e}ms`}}}function x(e){let{data:s,monsterUrl:t}=e;(0,n.useEffect)(()=>{(0,i.$s)({eventName:"web.external_page.dojo_islands.welcome_back_shown"})},[]),(0,n.useEffect)(()=>((0,r.E7)(!0),(0,r.fm)(s.passActive),document.body.classList.add("welcome-takeover"),()=>{(0,r.E7)(!1),(0,r.fm)(!1),document.body.classList.remove("welcome-takeover")}),[s.passActive]);const a=1===s.friendsOnline?"1 friend is exploring right now":s.friendsOnline>1?`${s.friendsOnline} friends are exploring right now`:null,c=1===s.pendingRequests?"A friend request is waiting":s.pendingRequests>1?`${s.pendingRequests} friend requests are waiting`:null,x=function(e){var s,t;const a=o.YY.filter(e=>"now"===e.status&&!e.placeholder);if(e){var n,l;const s="winter"===e?"winter":"spook",t=a.find(e=>`${e.slug} ${e.name}`.toLowerCase().includes(s));return{eyebrow:"Happening now",title:"winter"===e?"Winter has arrived on your island":"Spooky season is live on your island",dates:null!==(n=null==t?void 0:t.dates)&&void 0!==n?n:"For a limited time",href:t?`/dojo-islands/news/${t.slug}`:"/dojo-islands/news/",accent:"winter"===e?"#4ec3ff":"#ff8c42",imageSrc:null==t||null===(l=t.heroImage)||void 0===l?void 0:l.src,emoji:"winter"===e?"❄️":"🎃"}}const i=null!==(s=a.find(e=>e.featured))&&void 0!==s?s:a[0];return i?{eyebrow:"Happening now",title:i.name,dates:i.dates,href:`/dojo-islands/news/${i.slug}`,accent:i.accent,imageSrc:null===(t=i.heroImage)||void 0===t?void 0:t.src,emoji:i.motif}:null}(s.season),g="inline-flex items-center gap-8 rounded-full bg-[#fff8e7]/95 px-16 py-6 text-body-2 text-[#0a1f3d] shadow-[0_6px_16px_rgba(10,31,61,0.45)]";return(0,d.jsx)("div",{className:"relative z-10 mx-auto flex w-full max-w-[1280px] flex-col px-16 md:px-32 pb-24 md:pb-32 min-h-[calc(100svh-68px)] md:min-h-[calc(100svh-82px)]"},(0,d.jsx)("div",{className:"relative grid flex-1 md:grid-cols-2 items-center gap-8 md:gap-24"},(0,d.jsx)("div",{className:"relative z-10 flex flex-col items-center md:items-start gap-12 md:gap-16 text-center md:text-left pt-12 md:pt-0"},(0,d.jsx)("div",{className:f(0).className,style:f(0).style},s.islandName?(0,d.jsx)(n.Fragment,null,(0,d.jsx)("p",{className:"text-caption uppercase text-[#ffd56b] drop-shadow-[0_2px_8px_rgba(10,31,61,0.8)]"},"Welcome back to"),(0,d.jsx)("p",{className:"text-headline-1 text-[#fff8e7] text-balance drop-shadow-[0_8px_18px_rgba(10,31,61,0.7)]"},s.islandName)):(0,d.jsx)("p",{className:"text-headline-1 text-[#fff8e7] text-balance drop-shadow-[0_8px_18px_rgba(10,31,61,0.7)]"},"Welcome back!")),a&&(0,d.jsx)("div",{className:`${f(90).className}
1 flex items-center gap-14 rounded-default bg-[#fff8e7]/95 px-20 py-14 shadow-[0_14px_30px_-10px_rgba(10,31,61,0.6)] rotate-[0.8deg] max-w-[448px]`,style:f(90).style},s.friendsOnlineAvatars.length>0?(0,d.jsx)("span",{className:"flex shrink-0 -space-x-12"},s.friendsOnlineAvatars.map((e,s)=>(0,d.jsx)("span",{key:s,className:"relative grid h-48 w-48 md:h-56 md:w-56 place-items-center overflow-hidden rounded-full bg-[#67C5FF] ring-[3px] ring-[#fff8e7]"},(0,d.jsx)("img",{src:e,alt:"","aria-hidden":!0,className:"h-full w-full object-cover object-top origin-top scale-[1.15]"})))):(0,d.jsx)("span",{"aria-hidden":!0,className:"h-12 w-12 shrink-0 rounded-full bg-[#22c55e] animate-pulse"}),(0,d.jsx)("span",{className:"text-headline-3 text-[#0a1f3d] text-balance text-left"},a)),(0,d.jsx)("div",{className:"flex flex-wrap items-center justify-center md:justify-start gap-8 md:gap-10"},c&&(0,d.jsx)("span",{className:`${f(160).className} ${g} rotate-[-1.2deg]`,style:f(160).style},"💌 ",c),s.hasNewItems&&(0,d.jsx)("span",{className:`${f(210).className} ${g} rotate-[0.8deg]`,style:f(210).style},"🎁 New items are waiting for you")),x&&(0,d.jsx)(l.N_,{to:x.href,className:`${f(290).className} group flex items-center gap-14 rounded-default bg-[#fff8e7] border-2 border-[#0a1f3d] shadow-[0_4px_0_#0a1f3d] p-10 pr-20 mt-4 max-w-[448px] rotate-[0.6deg] hover:-translate-y-2 transition-transform text-left`,style:f(290).style},x.imageSrc?(0,d.jsx)("img",{src:x.imageSrc,alt:"","aria-hidden":!0,className:"h-64 w-96 md:h-80 md:w-128 shrink-0 rounded-xs object-cover"}):(0,d.jsx)("span",{"aria-hidden":!0,className:"grid h-64 w-96 md:h-80 md:w-128 shrink-0 place-items-center rounded-xs text-body-1",style:{backgroundColor:`${x.accent}33`}},x.emoji),(0,d.jsx)("span",{className:"min-w-0"},(0,d.jsx)("span",{className:"block text-[10px] md:text-[11px] font-bold uppercase tracking-[0.18em]",style:{color:x.accent}},x.eyebrow),(0,d.jsx)("span",{className:"block text-headline-3 text-[#0a1f3d] text-balance"},x.title),(0,d.jsx)("span",{className:"block mt-2 text-body-2 text-[#0a1f3d]/70"},"⏳ ",x.dates)))),(0,d.jsx)("div",{className:"relative flex h-full min-h-[240px] md:min-h-0 items-end justify-center self-stretch"},(0,d.jsx)("div",{"aria-hidden":!0,className:"animate-welcome-glow absolute bottom-[-12%] left-1/2 -translate-x-1/2 h-[70%] w-[110%] rounded-full pointer-events-none",style:{background:"radial-gradient(50% 50% at 50% 60%, rgba(255,213,107,0.35) 0%, rgba(79,224,194,0.12) 55%, transparent 75%)",filter:"blur(24px)"}}),t&&(0,d.jsx)("div",{className:f(150).className,style:f(150).style},(0,d.jsx)("div",{className:"animate-welcome-bob"},(0,d.jsx)("img",{src:t,alt:"Your monster",className:"h-208 md:h-[52svh] lg:h-[58svh] max-h-[620px] w-auto drop-shadow-[0_22px_36px_rgba(4,12,26,0.6)]"}))),s.petImageUrl&&(0,d.jsx)("div",{className:f(280).className,style:f(280).style},(0,d.jsx)("div",{className:"animate-welcome-bob",style:{animationDelay:"600ms"}},(0,d.jsx)("img",{src:s.petImageUrl,alt:"Your pet",className:"h-80 md:h-[16svh] lg:h-[18svh] max-h-[200px] w-auto drop-shadow-[0_14px_22px_rgba(4,12,26,0.55)]"}))))),(0,d.jsx)("div",{className:`${f(460).className} relative z-10 flex flex-col items-center gap-14 md:gap-16 pt-16 md:pt-20`,style:f(460).style},(0,d.jsx)(m,{nudges:p(s)}),(0,d.jsx)(u.w,{playLabel:"Play now"})))}var g=t(45195);async function h(e){try{const s=await fetch(`/api${e}`,{credentials:"include"});return s.ok?await s.json():null}catch{return null}}async function v(e){var s;const t=await h(`/studentUser/${e}/islands`),a=null==t||null===(s=t._items)||void 0===s?void 0:s.find(s=>!("homePrivate"!==s.islandType||!s.islandName||s.ownerStudentUserId&&s.ownerStudentUserId!==e));return null!=a&&a.islandName?{islandName:a.islandName,islandPhotoUrl:a.islandPhotoUrl||void 0,islandIconUrl:a.islandIconUrl||void 0}:null}async function w(e){var s;const t=await h(`/studentUser/${e}/friends`),a=(null!==(s=null==t?void 0:t._items)&&void 0!==s?s:[]).filter(e=>e.onlineStatus&&"offline"!==e.onlineStatus.status);return{count:a.length,avatars:a.map(e=>e.avatarUrl).filter(e=>!!e).slice(0,3)}}async function j(e){const s=await h(`/studentUser/${e}/friends/requests`);return null!=s&&s._items?s._items.filter(s=>{var t;return(null===(t=s.target)||void 0===t?void 0:t.entityId)===e&&"pending_kid_approval"===s.targetStatus}).length:0}async function b(e){const[s,t]=await Promise.all([h(`/monsterverse/studentUser/${e}/home/playerInventory/hasNew`),h(`/monsterverse/studentUser/${e}/global/playerInventory/hasNew`)]);return!(null==s||!s.hasNewItems)||!(null==t||!t.hasNewItems)}async function y(){var e,s,t;const a=await h("/monsterverseConfig"),n=null==a?void 0:a.homeSeasonalContent;return{season:null!=n&&null!==(e=n.winterSeason)&&void 0!==e&&e.showContent?"winter":null!=n&&null!==(s=n.spookySeason)&&void 0!==s&&s.showContent?"spooky":null,passActive:"granted"===(null==a||null===(t=a.subscriptionInfo)||void 0===t?void 0:t.access)}}async function N(e){const s=await h(`/studentUser/${e}/pet-configuration`);return null!=s&&s.hasActivePet?s.activePetImageUrl:void 0}const _="https://static.classdojo.com/img/dojo-islands/locals/tumbles.webp",k={islandName:"Maple 
1Cove",friendsOnline:3,friendsOnlineAvatars:["https://static.classdojo.com/img/dojo-islands/locals/spritz.webp","https://static.classdojo.com/img/dojo-islands/locals/rock.webp","https://static.classdojo.com/img/dojo-islands/locals/yonder.webp"],pendingRequests:1,hasNewItems:!0,season:"winter",passActive:!0,petImageUrl:"https://static.classdojo.com/img/dojo-islands/news/introducing-pets/moocan.webp"},I={friendsOnline:0,friendsOnlineAvatars:[],pendingRequests:0,hasNewItems:!1,season:null,passActive:!1};function $(){const e=(0,g.M)(),s="loggedIn"===e.status,t=s?e.studentUserId:void 0,{0:a,1:l}=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!t)return;let e=!1;return async function(e){const[s,t,a,n,l,i]=await Promise.all([v(e),w(e),j(e),b(e),y(),N(e)]);return{...null!=s?s:{},friendsOnline:t.count,friendsOnlineAvatars:t.avatars,pendingRequests:a,hasNewItems:n,season:l.season,passActive:l.passActive,petImageUrl:i}}(t).then(s=>{e||l(s)}),()=>{e=!0}},[t]),"unknown"===e.status?(0,d.jsx)("div",{className:"min-h-[calc(100svh-68px)] md:min-h-[calc(100svh-82px)]"}):s?(0,d.jsx)(x,{data:null!=a?a:I,monsterUrl:null!==(i=e.playerAvatarUrl)&&void 0!==i?i:_}):(0,d.jsx)(x,{data:k,monsterUrl:_});var i}function U(){const{0:e,1:s}=(0,n.useState)(!1);return e?null:(0,d.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 -z-10 pointer-events-none"},(0,d.jsx)("img",{src:"/welcome/keyart.webp",alt:"",onError:()=>s(!0),className:"h-full w-full object-cover object-[70%_center] opacity-35"}),(0,d.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, rgba(10,31,61,0.92) 0%, rgba(10,31,61,0.55) 45%, rgba(10,31,61,0.25) 100%)"}}),(0,d.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-1/3",style:{background:"linear-gradient(180deg, transparent 0%, rgba(10,31,61,0.7) 100%)"}}))}function C(){return(0,d.jsx)("div",{className:"flex-1"},(0,d.jsx)("section",{className:"relative isolate w-full overflow-hidden bg-[#0a1f3d] min-h-svh"},(0,d.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 -z-20",style:{background:"linear-gradient(180deg, #081831 0%, #0a1f3d 40%, #0f3054 78%, #14486b 100%)"}}),(0,d.jsx)(U,null),(0,d.jsx)($,null)))}const S=t(73849).Ep.welcome;var A=()=>(0,d.jsx)(a.K,{title:S.title,description:S.description,path:"/welcome/",noindex:!0},(0,d.jsx)(C,null))},77977:function(e,s,t){t.d(s,{j:function(){return n}});var a=t(96540);function n(){const{0:e,1:s}=(0,a.useState)(!1);return(0,a.useEffect)(()=>{const e=window.matchMedia("(prefers-reduced-motion: reduce)");s(e.matches);const t=e=>s(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),e}},81738:function(e,s,t){t.d(s,{w:function(){return c}});var a=t(29237),n=t(96535),l=t(45195),i=t(4391),r=t(71507),o=t(17437);function c(e){let{playLabel:s="Play",primaryClassName:t="btn-primary btn-lg",secondaryClassName:c="btn-secondary btn-lg",iconClassName:d="h-24 w-24",gapClassName:m="gap-12 md:gap-16"}=e;return"loggedIn"===(0,l.M)().status?(0,o.jsx)("a",{href:n.iD,onClick:e=>{e.preventDefault(),(0,r.$e)(),(0,a.$s)({eventName:"web.external_page.dojo_islands.play_now_click"}),(0,n.hb)()},className:t},(0,o.jsx)("img",{src:"https://static.classdojo.com/img/dojo-islands/icons/play.svg",alt:"","aria-hidden":!0,className:d}),s):(0,o.jsx)("div",{className:`inline-flex flex-wrap items-center justify-center ${m}`},(0,o.jsx)("button",{type:"button",onClick:()=>(0,i.ny)("web.external_page.dojo_islands.log_in_click","login"),className:c},"Log in"),(0,o.jsx)("button",{type:"button",onClick:()=>(0,i.ny)("web.external_page.dojo_islands.sign_up_click","signup"),className:t},"Sign up"))}}}]);
2//# sourceMappingURL=component---src-layouts-dojo-islands-welcome-route-tsx-251220f1d9c66a3564a9.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.