commit 3799cf8de52ebc2dc558f2c2df96141643291174 Author: jimagie Date: Sun Nov 1 18:30:36 2026 +0500 Lettersail: online English school for kids on MODX 3 (templates, chunks, snippets, plugins, scripts) diff --git a/assets/site/admin-home.js b/assets/site/admin-home.js new file mode 100644 index 0000000..536bdd9 --- /dev/null +++ b/assets/site/admin-home.js @@ -0,0 +1,62 @@ +Ext.ComponentMgr.onAvailable("modx-resource-tabs", (tabs) => { + tabs.activeTab = "modx-panel-resource-tv"; +}); + +Ext.ComponentMgr.onAvailable("modx-resource-vtabs", (tabs) => { + const fitGrids = () => { + Ext.ComponentMgr.all.each((component) => { + if (component.migx_update && component.rendered && component.getEl().isVisible(true)) { + component.getView().fitColumns(); + } + }); + }; + tabs.on("tabchange", fitGrids); + Ext.EventManager.onWindowResize(fitGrids); +}); + +const addRowHandles = (view) => { + Array.from(view.getRows()).forEach((row) => { + if (row.querySelector(".ls-row-handle")) { + return; + } + const handle = document.createElement("span"); + handle.className = "ls-row-handle"; + handle.textContent = "\u283F"; + handle.setAttribute("aria-hidden", "true"); + row.querySelector(".x-grid3-cell-first .x-grid3-cell-inner").prepend(handle); + }); +}; + +const makeRowsSortable = (grid) => { + const view = grid.getView(); + const refreshHandles = () => addRowHandles(view); + grid.getEl().addClass("ls-sortable"); + view.on({ refresh: refreshHandles, rowsinserted: refreshHandles, rowupdated: refreshHandles }); + refreshHandles(); + new Sortable(view.mainBody.dom, { + animation: 150, + forceFallback: true, + handle: ".ls-row-handle", + draggable: ".x-grid3-row", + ghostClass: "ls-row-ghost", + onEnd: ({ oldIndex, newIndex }) => { + if (oldIndex === newIndex) { + return; + } + const store = grid.getStore(); + const record = store.getAt(oldIndex); + store.remove(record); + store.insert(newIndex, record); + grid.collectItems(); + view.refresh(); + MODx.fireResourceFormChange(); + }, + }); +}; + +Ext.ComponentMgr.all.on("add", (index, component) => { + if (component.migx_update) { + component.enableDragDrop = false; + component.on("viewready", makeRowsSortable); + } +}); diff --git a/assets/site/admin.css b/assets/site/admin.css new file mode 100644 index 0000000..17a406b --- /dev/null +++ b/assets/site/admin.css @@ -0,0 +1,6 @@ +#modx-resource-tree li:has(> [ext\:tree-node-id="web_0"]){display:none} +.ls-sortable .x-grid3-cell-first .x-grid3-cell-inner{position:relative;padding-left:28px} +.ls-row-handle{position:absolute;left:8px;top:50%;transform:translateY(-50%);color:#8a94a0;font-size:16px;line-height:1;cursor:grab;user-select:none} +.ls-row-handle:active{cursor:grabbing} +.ls-row-ghost{opacity:.4} +@media (hover:hover){.ls-row-handle:hover{color:#1e4a47}} diff --git a/assets/site/apple-touch-icon.png b/assets/site/apple-touch-icon.png new file mode 100644 index 0000000..45190b0 Binary files /dev/null and b/assets/site/apple-touch-icon.png differ diff --git a/assets/site/brand.css b/assets/site/brand.css new file mode 100644 index 0000000..f1ff10a --- /dev/null +++ b/assets/site/brand.css @@ -0,0 +1,5 @@ +.brand{display:block;width:min(800px,82vw);height:auto;overflow:visible} +.brand path{stroke:#FFF8EC} +.brand [fill="currentColor"]{fill:#FFF8EC;stroke:none} +.brand__boat{transform-box:view-box;transform-origin:84px 153px} +.brand__sail{transform-box:view-box;transform-origin:82px 120px} diff --git a/assets/site/brand.js b/assets/site/brand.js new file mode 100644 index 0000000..8302220 --- /dev/null +++ b/assets/site/brand.js @@ -0,0 +1,20 @@ +(()=>{ + const logo=document.querySelector("[data-brand]"); + if(!logo)return; + const NS="http://www.w3.org/2000/svg"; + const original=logo.querySelector("g[style]"); + const boat=document.createElementNS(NS,"g");boat.classList.add("brand__boat"); + while(original.firstChild)boat.append(original.firstChild); + original.append(boat); + const [mast,big,small,hull]=[...boat.children]; + const wrap=path=>{const g=document.createElementNS(NS,"g");g.classList.add("brand__sail");path.before(g);g.append(path);return g}; + const sails=[wrap(big),wrap(small)]; + const letters=[...logo.querySelectorAll("g[stroke-linejoin] > path")]; + if(matchMedia("(prefers-reduced-motion: reduce)").matches)return; + const run=(el,frames,opts)=>el.animate(frames,{fill:"both",easing:"cubic-bezier(.22,.8,.3,1)",...opts}); + run(hull,[{opacity:0,transform:"translateY(12px)"},{opacity:1,transform:"translateY(0)"}],{duration:700}); + const len=mast.getTotalLength(); + run(mast,[{strokeDasharray:len,strokeDashoffset:len},{strokeDasharray:len,strokeDashoffset:0}],{duration:800,delay:220}); + sails.forEach((s,i)=>run(s,[{opacity:0,transform:"scaleX(.03) skewY(10deg)"},{opacity:1,transform:"scaleX(1) skewY(0deg)"}],{duration:1050,delay:650+i*180})); + letters.forEach((p,i)=>{const n=p.getTotalLength();run(p,[{strokeDasharray:n,strokeDashoffset:n,opacity:0},{strokeDasharray:n,strokeDashoffset:n,opacity:1,offset:.02},{strokeDasharray:n,strokeDashoffset:0,opacity:1}],{duration:850,delay:900+i*105})}); +})(); diff --git a/assets/site/brush-font.js b/assets/site/brush-font.js new file mode 100644 index 0000000..2088a82 --- /dev/null +++ b/assets/site/brush-font.js @@ -0,0 +1,119 @@ +(()=>{ + const O="M42 10C18 10 12 32 12 52C12 76 22 94 42 94C62 94 72 76 72 52C72 30 64 10 42 10Z"; + const C="M58 20C50 12 42 9 34 9C18 9 10 30 10 52C10 76 20 94 36 94C46 94 54 88 58 82"; + const S="M52 18C44 10 34 8 26 10C16 13 12 22 14 32C18 48 50 48 52 66C54 82 42 94 28 92C20 91 14 87 10 80"; + const Z="M10 12L56 10L10 92L58 90"; + const E="M50 10L14 10L14 92L52 92M14 50L44 50"; + const N="M14 92L14 10L64 92L64 8"; + const Ze="M14 18C22 10 32 8 40 10C52 13 54 30 46 40C40 46 32 48 26 48C36 48 52 52 54 68C56 84 44 94 30 92C22 91 16 87 12 82"; + const acute=x=>`M${x-6} -8L${x+8} -24`; + const G={ + "A":[80,"M10 92L40 8L70 92M22 62L58 62"], + "B":[66,"M14 92L14 10C44 8 52 18 52 30C52 42 42 48 16 50C48 48 58 58 58 72C58 88 44 94 14 92"], + "C":[66,C], + "D":[72,"M14 10L14 92M14 10C50 8 64 28 64 52C64 78 48 94 14 92"], + "E":[62,E], + "F":[58,"M48 10L14 10L14 92M14 50L42 50"], + "G":[78,"M64 22C56 12 46 8 38 8C18 8 10 30 10 52C10 78 22 94 40 94C56 94 66 84 66 66L66 56L42 56"], + "H":[76,"M14 10L14 92M62 10L62 92M14 52L62 52"], + "I":[28,"M14 10L14 92"], + "J":[58,"M44 10L44 66C44 86 36 94 24 94C16 94 10 88 8 80"], + "K":[72,"M14 10L14 92M60 10L18 56M30 46L62 92"], + "L":[56,"M14 10L14 92L50 92"], + "M":[96,"M12 92L14 10L48 70L82 8L84 92"], + "N":[80,N], + "O":[84,O], + "P":[62,"M14 92L14 10C44 8 54 18 54 32C54 48 42 54 14 52"], + "Q":[84,O+"M48 70L76 100"], + "R":[66,"M14 92L14 10C46 8 56 20 56 34C56 50 44 56 16 54L58 92"], + "S":[62,S], + "T":[68,"M8 12L60 10M34 11L34 92"], + "U":[76,"M14 10L14 62C14 84 24 94 38 94C52 94 62 84 62 62L62 10"], + "V":[76,"M8 10L38 92L68 10"], + "W":[104,"M10 10L26 92L52 34L78 92L94 10"], + "X":[72,"M10 10L62 92M62 10L10 92"], + "Y":[70,"M8 10L35 52L62 10M35 52L35 92"], + "Z":[66,Z], + "Ą":[80,"M10 92L40 8L70 92M22 62L58 62M70 92Q62 102 72 108"], + "Ć":[66,C+acute(36)], + "Ę":[62,E+"M52 92Q44 102 54 108"], + "Ł":[56,"M14 10L14 92L50 92M2 66L30 46"], + "Ń":[80,N+acute(40)], + "Ó":[84,O+acute(44)], + "Ś":[62,S+acute(34)], + "Ź":[66,Z+acute(34)], + "Ż":[66,Z+"M34 -14L34 -13"], + "А":[80,"M10 92L40 8L70 92M22 62L58 62"], + "Б":[62,"M50 10L14 10L14 92C44 94 54 84 54 70C54 56 44 48 16 50"], + "В":[66,"M14 92L14 10C44 8 52 18 52 30C52 42 42 48 16 50C48 48 58 58 58 72C58 88 44 94 14 92"], + "Г":[58,"M14 92L14 10L52 10"], + "Д":[84,"M6 80L78 80M6 80L6 98M78 80L78 98M20 80C28 60 30 36 30 10L64 10L64 80"], + "Е":[62,E], + "Ё":[62,E+"M24 -10L24 -9M44 -10L44 -9"], + "Ж":[104,"M52 10L52 92M10 12L30 42Q38 52 52 52Q66 52 74 42L94 12M10 92L36 52M94 92L68 52"], + "З":[62,Ze], + "И":[76,"M14 10L14 92L62 10L62 92"], + "Й":[76,"M14 12L14 92L62 12L62 92M24 -24Q38 -10 52 -24"], + "К":[72,"M14 10L14 92M60 10L18 56M30 46L62 92"], + "Л":[76,"M8 92L24 10H61V92"], + "М":[96,"M12 92L14 10L48 70L82 8L84 92"], + "Н":[76,"M14 10L14 92M62 10L62 92M14 52L62 52"], + "О":[84,O], + "П":[76,"M14 92L14 10L62 10L62 92"], + "Р":[62,"M14 92L14 10C44 8 54 18 54 32C54 48 42 54 14 52"], + "С":[66,C], + "Т":[68,"M8 12L60 10M34 11L34 92"], + "У":[72,"M10 10L38 58M66 10L28 92"], + "Ф":[88,"M44 4L44 98M44 26C22 26 12 36 12 50C12 64 22 74 44 74C66 74 76 64 76 50C76 36 66 26 44 26Z"], + "Х":[72,"M10 10L62 92M62 10L10 92"], + "Ц":[82,"M14 10L14 90L68 90M62 10L62 90M68 90L70 108"], + "Ч":[70,"M14 10L14 38C14 52 24 58 38 58C48 58 56 54 58 48M58 10L58 92"], + "Ш":[94,"M12 10L12 92L82 92L82 10M47 10L47 92"], + "Щ":[102,"M12 10L12 90L88 90M47 10L47 90M82 10L82 90M88 90L90 108"], + "Ъ":[72,"M6 10L22 10L22 92C52 94 62 84 62 70C62 56 52 48 24 50"], + "Ы":[92,"M14 10L14 92C40 94 50 84 50 70C50 56 40 48 16 50M80 10L80 92"], + "Ь":[62,"M14 10L14 92C44 94 54 84 54 70C54 56 44 48 16 50"], + "Э":[66,"M10 20C18 12 26 9 34 9C50 9 58 30 58 52C58 76 48 94 32 94C22 94 14 88 10 82M24 52L56 52"], + "Ю":[100,"M14 10L14 92M14 52L36 52M64 10C46 10 38 30 38 52C38 76 46 94 64 94C82 94 90 76 90 52C90 30 82 10 64 10Z"], + "Я":[66,"M54 92L54 10C24 8 14 18 14 32C14 48 26 54 52 52M44 52L12 92"], + "0":[66,"M33 10C16 10 10 32 10 52C10 74 16 94 33 94C50 94 56 74 56 52C56 32 50 10 33 10Z"], + "1":[44,"M8 28L28 10L28 92"], + "2":[62,"M10 26C14 14 24 9 32 9C46 9 54 20 52 34C50 52 28 68 10 92L56 90"], + "3":[62,Ze], + "4":[66,"M44 92L44 10L8 66L60 66"], + "5":[62,"M54 10L18 10L14 46C22 40 30 38 38 40C52 44 56 58 54 72C52 88 40 94 28 92C20 91 14 86 10 80"], + "6":[66,"M52 14C44 8 36 8 30 10C16 16 12 40 12 62C12 84 22 94 36 94C50 94 58 84 58 70C58 56 50 48 36 48C24 48 14 56 12 66"], + "7":[60,"M8 10L54 10L24 92"], + "8":[62,"M32 50C18 48 14 40 14 30C14 18 22 9 32 9C42 9 50 18 50 30C50 40 46 48 32 50C16 52 10 62 10 72C10 86 20 94 32 94C44 94 54 86 54 72C54 62 48 52 32 50Z"], + "9":[66,"M54 40C52 52 44 58 34 58C20 58 12 48 12 34C12 18 22 9 34 9C48 9 56 22 54 44C52 72 44 92 18 92"], + ".":[28,"M14 90L14 91"], + ",":[28,"M16 88L10 102"], + "!":[28,"M14 10L14 64M14 90L14 91"], + "?":[56,"M10 24C14 14 22 9 30 9C42 9 50 18 50 28C50 42 30 46 30 62M30 90L30 91"], + "-":[44,"M10 52H34"], + ":":[28,"M14 40L14 41M14 90L14 91"], + "'":[24,"M12 10L12 30"], + "\"":[40,"M10 10L10 30M30 10L30 30"], + "(":[36,"M28 4C12 24 10 40 10 52C10 66 12 80 28 100"], + ")":[36,"M8 4C24 24 26 40 26 52C26 66 24 80 8 100"], + "«":[54,"M24 32L8 52L24 72M46 32L30 52L46 72"], + "»":[54,"M8 32L24 52L8 72M30 32L46 52L30 72"], + " ":[40,""] + }; + const rng=seed=>()=>{seed=(seed*1664525+1013904223)>>>0;return seed/4294967296}; + let uid=0; + window.brushWord=(text,{seed=7,shadow=true}={})=>{ + const jit=rng(seed); + const jitter=()=>`translate(0 ${((jit()-.5)*9).toFixed(1)}) rotate(${((jit()-.5)*7).toFixed(1)} 20 100) scale(1 ${(.94+jit()*.1).toFixed(3)})`; + let cx=0,h=""; + [...text.toUpperCase()].forEach(ch=>{ + const g=G[ch]||G["?"]; + if(g[1]){const t=`translate(${cx} 0) ${jitter()}`;h+=(shadow?``:"")+``} + cx+=g[0]+16; + }); + const id="bf"+(++uid); + return {w:Math.max(cx-16,1),svg:`${h}`}; + }; + window.brushGlyphs=G; + window.brushTable=(over={})=>new Proxy({},{get:(_,ch)=>{const k=String(ch).toUpperCase();if(over[k])return over[k];const g=G[k]||G["?"];return {w:g[0],d:g[1]}}}); +})(); diff --git a/assets/site/cookie-bar.js b/assets/site/cookie-bar.js new file mode 100644 index 0000000..ff1544c --- /dev/null +++ b/assets/site/cookie-bar.js @@ -0,0 +1,18 @@ +(()=>{ + const bar=document.querySelector("[data-cookie-bar]"); + if(!bar)return; + const key="lettersail-consent"; + const read=()=>{try{return localStorage.getItem(key)||""}catch(e){return ""}}; + const write=value=>{try{if(value)localStorage.setItem(key,value);else localStorage.removeItem(key)}catch(e){}}; + const set=(state,fromBar)=>{ + write(state); + bar.hidden=state!==""; + if(state===""){bar.setAttribute("tabindex","-1");bar.focus({preventScroll:true})} + else if(fromBar)document.querySelector("[data-cookie-open]")?.focus({preventScroll:true}); + document.dispatchEvent(new CustomEvent("lettersail:consent",{detail:{state}})); + }; + bar.hidden=read()!==""; + bar.querySelector("[data-cookie-accept]").addEventListener("click",()=>set("granted",true)); + bar.querySelector("[data-cookie-decline]")?.addEventListener("click",()=>set("denied",true)); + document.querySelectorAll("[data-cookie-open]").forEach(button=>button.addEventListener("click",()=>set(""))); +})(); diff --git a/assets/site/demo-bar.css b/assets/site/demo-bar.css new file mode 100644 index 0000000..be4dee3 --- /dev/null +++ b/assets/site/demo-bar.css @@ -0,0 +1,4 @@ +.demo-bar{padding:var(--space-2) var(--gutter);background:#1E4A47;text-align:center} +.demo-bar__text{margin:0;color:color-mix(in srgb,var(--color-white) 82%,transparent);font-family:"Rubik",system-ui,sans-serif;font-size:.875rem;line-height:1.45} +.demo-bar__link{color:var(--color-sand-200);text-decoration:underline;text-underline-offset:.2em} +@media (hover:hover){.demo-bar__link:hover{color:var(--color-white)}} diff --git a/assets/site/doc-popup.css b/assets/site/doc-popup.css new file mode 100644 index 0000000..a520cb5 --- /dev/null +++ b/assets/site/doc-popup.css @@ -0,0 +1,36 @@ +html:has(.docbox[open]){overflow:hidden} +.doc-link{padding:0;border:0;background:none;font:inherit;color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.2em;cursor:pointer;transition:color .15s} +.doc-link:focus-visible{outline:2px solid #3F9C96;outline-offset:2px;border-radius:2px} +@media (hover:hover){.doc-link:hover{color:#2F8C86;text-decoration-thickness:2px}} +.cookie-bar__text .doc-link{color:#2F6E6A} +.docbox{width:min(46rem,calc(100vw - 2 * var(--gutter)));max-width:none;max-height:calc(100vh - 2 * var(--space-6));padding:0;border:0;border-radius:32px 40px 36px 30px / 36px 30px 40px 32px;background:var(--color-white);color:#1F2D2C;overflow:hidden;box-shadow:-8px 8px 0 #E9CD98;animation:docbox-in .3s cubic-bezier(.3,1.2,.5,1)} +.docbox[open]{display:flex;flex-direction:column} +.docbox::backdrop{background:rgba(47,110,106,.45);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)} +@keyframes docbox-in{from{opacity:0;transform:translateY(14px) scale(.98)}} +.docbox__close{position:absolute;top:var(--space-4);right:var(--space-4);display:grid;place-items:center;width:2.75rem;height:2.75rem;border:0;border-radius:50%;background:#FCEACA;cursor:pointer;z-index:1} +.docbox__close svg{width:1.25rem;height:1.25rem;fill:none;stroke:#C5643C;stroke-width:2.5;stroke-linecap:round} +.docbox__body{flex:1;min-height:0;overflow-y:auto;margin:var(--space-6) var(--space-3) var(--space-6) 0;padding:var(--space-2) var(--space-6) var(--space-4) var(--space-8);} +.docbox__body::-webkit-scrollbar{width:10px} +.docbox__body::-webkit-scrollbar-button{display:none} +.docbox__body::-webkit-scrollbar-track{margin:48px 0 16px;background:transparent} +.docbox__body::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background:#B9DAD6;background-clip:content-box} +.docbox__body::-webkit-scrollbar-thumb:hover{background:#84CAC8;background-clip:content-box} +.docbox .doc__title{margin:0;padding-right:var(--space-12);font-family:"Neucha",var(--font-body);font-weight:400;font-size:clamp(1.75rem,3vw,2.25rem);line-height:1.1;color:#1E4A47} +.docbox .doc__updated{margin:var(--space-3) 0 0;font-family:"Rubik",system-ui,sans-serif;font-size:.9375rem;color:#4F605F} +.docbox .doc__body{margin-top:var(--space-8);font-family:"Rubik",system-ui,sans-serif;font-weight:400;font-size:1.0625rem;line-height:1.75} +.docbox .doc__body h2{margin:var(--space-8) 0 var(--space-4);font-weight:600;font-size:1.25rem;line-height:1.3;color:#1E4A47} +.docbox .doc__body h2:first-child{margin-top:0} +.docbox .doc__body p{margin:0 0 var(--space-4)} +.docbox .doc__body ul{margin:0 0 var(--space-4);padding-left:var(--space-6)} +.docbox .doc__body li{margin-bottom:var(--space-2)} +.docbox .doc__body li::marker{color:var(--color-peach-400)} +.docbox .doc__body a{color:#1E6E69;text-underline-offset:.2em} +.docbox__close:active{transform:scale(.97)} +.docbox__close:focus-visible{outline:2px solid #3F9C96;outline-offset:3px} +@media (hover:hover){.docbox__close:hover{background:#F9D9B5}} +@media (prefers-reduced-motion:reduce){.docbox{animation:none}} +.docbox__body:focus{outline:none} +@media (pointer:coarse){ +.doc-link{position:relative} +.doc-link::before{content:"";position:absolute;left:-4px;right:-4px;top:50%;height:44px;transform:translateY(-50%)} +} diff --git a/assets/site/doc-popup.js b/assets/site/doc-popup.js new file mode 100644 index 0000000..cd65adb --- /dev/null +++ b/assets/site/doc-popup.js @@ -0,0 +1,61 @@ +(()=>{ + const ui=JSON.parse(document.querySelector("[data-ui]").textContent); + const paths=ui.docs.map(url=>new URL(url,location.href).pathname); + const match=link=>{try{const url=new URL(link.href,location.href);return url.origin===location.origin&&paths.includes(url.pathname)}catch(e){return false}}; + let box=null,body=null; + const cache=new Map(); + const build=()=>{ + box=document.createElement("dialog"); + box.className="docbox"; + box.setAttribute("data-lenis-prevent",""); + box.setAttribute("aria-labelledby","docbox-title"); + box.innerHTML='
'; + body=box.querySelector(".docbox__body"); + body.tabIndex=-1; + box.querySelector(".docbox__close").addEventListener("click",()=>box.close()); + box.addEventListener("click",event=>{if(event.target===box)box.close()}); + document.body.append(box); + }; + const load=async path=>{ + if(cache.has(path))return cache.get(path); + const response=await fetch(path,{credentials:"same-origin"}); + if(!response.ok)throw new Error(response.status); + const doc=new DOMParser().parseFromString(await response.text(),"text/html"); + const main=doc.querySelector(".doc__main"); + if(!main)throw new Error("no content"); + const title=main.querySelector(".doc__title"); + if(title)title.id="docbox-title"; + const html=main.innerHTML; + cache.set(path,html); + return html; + }; + const open=async path=>{ + if(!box)build(); + body.innerHTML=await load(path); + body.scrollTop=0; + if(!box.open)box.showModal(); + body.focus({preventScroll:true}); + }; + const wanted=new URLSearchParams(location.search).get("doc"); + if(wanted&&paths.includes(wanted)&&window.HTMLDialogElement){ + history.replaceState(null,"",location.pathname); + open(wanted).catch(()=>{}); + } + document.addEventListener("click",event=>{ + const button=event.target.closest("[data-doc]"); + if(!button||!window.HTMLDialogElement)return; + event.preventDefault(); + open(button.dataset.doc).catch(()=>{location.href=button.dataset.doc}); + }); + document.addEventListener("click",async event=>{ + if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return; + const link=event.target.closest("a[href]"); + if(!link||!match(link)||!window.HTMLDialogElement)return; + event.preventDefault(); + try{ + await open(new URL(link.href,location.href).pathname); + }catch(e){ + location.href=link.href; + } + }); +})(); diff --git a/assets/site/doc.css b/assets/site/doc.css new file mode 100644 index 0000000..b49a011 --- /dev/null +++ b/assets/site/doc.css @@ -0,0 +1,22 @@ +@font-face{font-family:"Rubik";src:url("fonts/Rubik.woff2") format("woff2");font-weight:300 900;font-display:swap} +@font-face{font-family:"Rubik";src:url("fonts/Rubik-pl.woff2") format("woff2");font-weight:300 900;font-display:swap;unicode-range:U+0104-0107,U+0118-0119,U+0141-0144,U+015A-015B,U+0179-017C} +.doc{min-height:100vh;margin:0;background:var(--color-sand-100);color:#1F2D2C} +.doc__head{display:flex;align-items:center;padding:var(--space-6) clamp(var(--gutter),6vw,7rem)} +.doc__home{display:block;line-height:0;border-radius:var(--space-2)} +.doc__home svg{display:block;width:auto;height:3.5rem} +.doc__home:focus-visible{outline:2px solid #3F9C96;outline-offset:4px} +.doc__main{max-width:46rem;margin:var(--space-4) auto var(--space-12);padding:var(--space-8);border-radius:32px;background:var(--color-white);box-shadow:-6px 6px 0 #E9CD98} +.doc__title{margin:0;font-family:"Neucha",var(--font-body);font-weight:400;font-size:clamp(1.75rem,3vw,2.25rem);line-height:1.1;color:#1E4A47} +.doc__updated{margin:var(--space-3) 0 0;font-family:"Rubik",system-ui,sans-serif;font-size:.9375rem;color:#4F605F} +.doc__body{margin-top:var(--space-12);font-family:"Rubik",system-ui,sans-serif;font-weight:400;font-size:1.125rem;line-height:1.75} +.doc__body h2{margin:var(--space-12) 0 var(--space-4);font-weight:600;font-size:1.3125rem;line-height:1.3;color:#1E4A47} +.doc__body h2:first-child{margin-top:0} +.doc__body p{margin:0 0 var(--space-4)} +.doc__body ul{margin:0 0 var(--space-4);padding-left:var(--space-6)} +.doc__body li{margin-bottom:var(--space-2)} +.doc__body li::marker{color:var(--color-peach-400)} +.doc__body a{color:#1E6E69;text-underline-offset:.2em} +@media (hover:hover){.doc__body a:hover{text-decoration-thickness:2px}} +.doc__body .doc__button{display:inline-block;padding:var(--space-3) var(--space-6);border-radius:999px;background:#1E4A47;color:#fff;font-weight:500;text-decoration:none} +@media (hover:hover){.doc__body .doc__button:hover{background:#2A6560}} +.doc__body .doc__button:active{transform:scale(.97)} diff --git a/assets/site/faq.css b/assets/site/faq.css new file mode 100644 index 0000000..b24caea --- /dev/null +++ b/assets/site/faq.css @@ -0,0 +1,32 @@ +.faq{--faq-sky:#97CFCD;--faq-ink:#21504D;position:relative;display:grid;align-content:start;justify-items:center;gap:clamp(1.5rem,4vh,2.5rem);z-index:1;min-height:100vh;box-sizing:border-box;margin-top:-82vh;padding:calc(8rem + 3vh) clamp(var(--gutter),6vw,7rem) var(--space-12);background:linear-gradient(transparent 0 82vh,var(--faq-sky) 82vh);color:var(--faq-ink);font-family:"Neucha",var(--font-body)} +.faq__title{margin:0;line-height:0} +.faq__title svg{display:block;height:clamp(6rem,11vw,9.5rem);width:auto;overflow:visible} +.faq__title path{fill:none;stroke:var(--color-white);stroke-width:9px;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke} +.faq__list{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:minmax(0,1fr);gap:var(--space-4);width:100%;max-width:46rem;align-items:start} +.faq__cloud{padding:var(--space-4) var(--space-8);border-radius:48px 60px 52px 44px / 52px 44px 60px 48px;background:var(--color-white);box-shadow:-6px 6px 0 #7FBDBA} +.faq__q{display:flex;justify-content:space-between;align-items:center;gap:var(--space-4);color:#2F8C86;font-size:1.75rem;line-height:1.2;cursor:pointer;list-style:none} +.faq__q::-webkit-details-marker{display:none} +.faq__q{position:relative} +.faq__q::before{content:"";position:absolute;inset:calc(var(--space-4) * -1) calc(var(--space-8) * -1)} +.faq__q::after{content:"+";flex:none;color:#52B8B1;font-size:2rem;line-height:1;transition:transform .3s cubic-bezier(.3,1.2,.5,1)} +.faq__cloud[open] .faq__q::after{transform:rotate(45deg)} +.faq__a{margin:0;padding-top:var(--space-3);overflow:hidden;font-family:"Rubik",system-ui,sans-serif;font-weight:400;font-size:1.125rem;line-height:1.55;color:#2F4F4C} +.faq__cloud--closing .faq__q::after{transform:none} +.faq__letter,.faq__item{opacity:0} +.faq--play .faq__letter{animation:faq-drop .55s cubic-bezier(.3,1.5,.5,1) calc(.05s + var(--i) * .07s) forwards} +.faq--play .faq__item{animation:faq-rise .5s cubic-bezier(.3,1.2,.5,1) calc(.55s + var(--n) * .08s) forwards} +@keyframes faq-drop{from{opacity:0;transform:translateY(-70px)}to{opacity:1;transform:none}} +@keyframes faq-rise{0%{opacity:0;transform:translateY(30px)}100%{opacity:1;transform:none}} +@media (prefers-reduced-motion:reduce){.faq__letter,.faq__item{opacity:1;animation:none!important}} +.faq__title,.faq__list{transition:opacity .3s} +.faq--away .faq__title,.faq--away .faq__list{opacity:0} +@media (max-width:760px){ +.faq{min-height:calc(100vh - var(--foot-h,0px));margin-top:-100vh;padding:5.5rem var(--gutter) var(--space-8);gap:var(--space-4);background:linear-gradient(transparent 0 100vh,var(--faq-sky) 100vh)} +.faq__title svg{height:4.5rem} +.faq__list{gap:var(--space-3)} +.faq__cloud{padding:var(--space-3) var(--space-6);border-radius:28px 32px 30px 26px / 30px 26px 32px 28px;box-shadow:-4px 4px 0 #7FBDBA} +.faq__q{font-size:1.375rem;line-height:1.2;gap:var(--space-3)} +.faq__q::before{inset:calc(var(--space-3) * -1) calc(var(--space-6) * -1)} +.faq__q::after{font-size:1.75rem} +.faq__a{font-size:1rem;line-height:1.5} +} diff --git a/assets/site/faq.js b/assets/site/faq.js new file mode 100644 index 0000000..51f76a3 --- /dev/null +++ b/assets/site/faq.js @@ -0,0 +1,51 @@ +(()=>{ + const G={ + " ":[30,""], + "В":[50,"M12 98C9 66 10 34 13 4C34 2 40 14 38 24C36 36 24 44 14 46C40 44 48 58 46 74C44 92 30 98 12 96"], + "О":[50,"M22 6C40 2 46 28 45 52C44 78 38 98 26 98C13 98 6 78 6 52C6 28 12 8 30 4"], + "П":[52,"M10 98C8 66 9 34 11 6C24 4 34 4 44 6M44 6C43 40 43 70 45 98"], + "Р":[44,"M10 98C8 70 9 30 12 4M12 6C34 2 42 14 40 26C38 38 26 44 11 44"], + "С":[48,"M42 14C36 6 28 3 22 5C10 10 6 30 6 52C6 78 12 96 26 97C34 98 40 92 43 86"], + "Ы":[56,"M8 6C6 40 7 70 9 96C30 98 36 84 34 72C32 58 22 52 9 54M48 6C47 40 47 70 49 98"] + }; + document.querySelectorAll("[data-tall]").forEach(el=>{ + let cx=0,h=""; + [...el.dataset.tall].forEach((ch,i)=>{ + const k=ch.toUpperCase(),g=G[k]||window.brushGlyphs[k]; + if(!g)return; + if(g[1])h+=``; + cx+=g[0]*.85+14; + }); + el.querySelectorAll("svg").forEach(node=>node.remove()); + el.insertAdjacentHTML("beforeend",``); + }); + const reduce=matchMedia("(prefers-reduced-motion: reduce)").matches; + const section=document.querySelector("[data-faq]"); + if(section&&!document.querySelector("[data-stage]")){ + const io=new IntersectionObserver(entries=>entries.forEach(e=>{if(e.isIntersecting){section.classList.add("faq--play");io.disconnect()}}),{threshold:.2}); + io.observe(section); + } + document.querySelectorAll(".faq__cloud").forEach(cloud=>{ + const answer=cloud.querySelector(".faq__a"); + let closing=false; + cloud.querySelector(".faq__q").addEventListener("click",e=>{ + if(reduce||!answer.animate)return; + e.preventDefault(); + const from=cloud.open?answer.getBoundingClientRect().height:0; + const fromOpacity=cloud.open?getComputedStyle(answer).opacity:0; + answer.getAnimations().forEach(a=>a.cancel()); + if(cloud.open&&!closing){ + closing=true; + cloud.classList.add("faq__cloud--closing"); + const anim=answer.animate([{height:`${from}px`,opacity:fromOpacity},{height:"0px",paddingTop:"0px",opacity:0}],{duration:260,easing:"ease-in",fill:"forwards"}); + anim.onfinish=()=>{closing=false;cloud.open=false;cloud.classList.remove("faq__cloud--closing");anim.cancel()}; + }else{ + closing=false; + cloud.classList.remove("faq__cloud--closing"); + cloud.open=true; + const h=answer.offsetHeight; + answer.animate([{height:`${from}px`,paddingTop:from?getComputedStyle(answer).paddingTop:"0px",opacity:fromOpacity},{height:`${h}px`,opacity:1}],{duration:380,easing:"cubic-bezier(.3,1.1,.5,1)"}); + } + }); + }); +})(); diff --git a/assets/site/favicon-32.png b/assets/site/favicon-32.png new file mode 100644 index 0000000..e5a3c49 Binary files /dev/null and b/assets/site/favicon-32.png differ diff --git a/assets/site/favicon.svg b/assets/site/favicon.svg new file mode 100644 index 0000000..5a33e5c --- /dev/null +++ b/assets/site/favicon.svg @@ -0,0 +1 @@ + diff --git a/assets/site/fonts/AmaticSC-Bold.woff2 b/assets/site/fonts/AmaticSC-Bold.woff2 new file mode 100644 index 0000000..5e9f23a Binary files /dev/null and b/assets/site/fonts/AmaticSC-Bold.woff2 differ diff --git a/assets/site/fonts/AmaticSC-Regular.woff2 b/assets/site/fonts/AmaticSC-Regular.woff2 new file mode 100644 index 0000000..da829e8 Binary files /dev/null and b/assets/site/fonts/AmaticSC-Regular.woff2 differ diff --git a/assets/site/fonts/Caveat.woff2 b/assets/site/fonts/Caveat.woff2 new file mode 100644 index 0000000..4d24158 Binary files /dev/null and b/assets/site/fonts/Caveat.woff2 differ diff --git a/assets/site/fonts/Neucha-pl.woff2 b/assets/site/fonts/Neucha-pl.woff2 new file mode 100644 index 0000000..6cc6ece Binary files /dev/null and b/assets/site/fonts/Neucha-pl.woff2 differ diff --git a/assets/site/fonts/Neucha.woff2 b/assets/site/fonts/Neucha.woff2 new file mode 100644 index 0000000..145d598 Binary files /dev/null and b/assets/site/fonts/Neucha.woff2 differ diff --git a/assets/site/fonts/Rubik-pl.woff2 b/assets/site/fonts/Rubik-pl.woff2 new file mode 100644 index 0000000..a2371c6 Binary files /dev/null and b/assets/site/fonts/Rubik-pl.woff2 differ diff --git a/assets/site/fonts/Rubik.woff2 b/assets/site/fonts/Rubik.woff2 new file mode 100644 index 0000000..013f55b Binary files /dev/null and b/assets/site/fonts/Rubik.woff2 differ diff --git a/assets/site/howto.css b/assets/site/howto.css new file mode 100644 index 0000000..fccb6c3 --- /dev/null +++ b/assets/site/howto.css @@ -0,0 +1,50 @@ +.howto{position:relative;min-height:100vh;overflow:hidden;display:grid;align-content:center;gap:clamp(2rem,6vh,4rem);background:var(--color-sand-100);padding:var(--space-12) clamp(var(--gutter),6vw,7rem)} +.howto__label{position:absolute;left:var(--space-6);top:var(--space-4);z-index:3;font:600 16px/1 system-ui,sans-serif;color:var(--color-peach-700);opacity:.7} +.howto__bg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none} +.howto__head{position:relative;z-index:2;margin:0;display:flex;justify-content:center;align-items:center;gap:0 clamp(1rem,1.6vw,1.75rem);font-family:"Amatic SC",var(--font-body);font-weight:700;text-transform:uppercase;letter-spacing:.06em;line-height:1;font-size:clamp(3rem,6vw,5.5rem)} +.howto__head-ink{color:var(--color-white);text-shadow:-.045em .045em 0 var(--color-peach-500)} +.howto__head-plate{padding:.02em .25em 0;background:var(--color-peach-400);color:var(--color-white);transform:rotate(-2.5deg)} + +.howto__list{position:relative;z-index:2;list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(1rem,2.5vw,2.5rem);width:100%;max-width:76rem;justify-self:center} +.howto__step{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);text-align:center} +.howto__icon{width:clamp(5.5rem,9vw,8rem);height:auto;overflow:visible} +.howto__num{font-family:"Neucha",var(--font-body);font-size:1.125rem;color:var(--color-peach-700)} +.howto__name{margin:0;font-family:"Amatic SC",var(--font-body);font-weight:700;text-transform:uppercase;letter-spacing:.05em;font-size:clamp(2.25rem,3vw,2.75rem);line-height:1;color:#438780} +.howto__text{margin:10px 0 0;font-family:"Neucha",var(--font-body);font-size:clamp(1.125rem,1.3vw,1.3125rem);line-height:1.35;color:#243F3D;max-width:15rem} + +.howto--cards .howto__step{background:var(--color-cream-50);border-radius:var(--space-6);padding:var(--space-8) var(--space-6);box-shadow:-6px 6px 0 var(--color-sand-300)} + +.howto__line{position:absolute;left:12%;right:12%;top:clamp(3.25rem,5vw,4.5rem);height:4px;background:repeating-linear-gradient(90deg,var(--color-white) 0 10px,transparent 10px 24px);border-radius:2px} +.howto__iconwrap{display:grid;place-items:center;width:clamp(6.5rem,10vw,9rem);aspect-ratio:1;border-radius:50%;background:var(--color-cream-50);box-shadow:-5px 5px 0 var(--color-sand-300);position:relative} +.howto__iconwrap .howto__icon{width:65%} + +.howto--split{grid-template-columns:minmax(0,4fr) minmax(0,7fr);align-items:center;column-gap:clamp(2rem,5vw,6rem)} +.howto--split .howto__head{flex-direction:column;align-items:flex-start;gap:var(--space-2);font-size:clamp(3.5rem,7vw,7rem)} +.howto--split .howto__list{grid-template-columns:1fr 1fr;gap:clamp(1.5rem,4vh,2.5rem) clamp(1.5rem,3vw,3rem)} +.howto--split .howto__step{flex-direction:row;align-items:center;text-align:left;gap:var(--space-4)} +.howto--split .howto__icon{flex:none;width:clamp(4.5rem,6.5vw,6rem)} +.howto__body{display:flex;flex-direction:column;gap:.25rem} + +.howto .reveal{opacity:0} +.howto--play .reveal{animation:howto-in .5s var(--ease-soft) var(--d,0s) forwards} +@keyframes howto-in{0%{opacity:0;transform:translateY(14px)}100%{opacity:1;transform:none}} +.howto--play .howto__head-plate.reveal{animation-name:howto-plate} +@keyframes howto-plate{0%{opacity:0;transform:rotate(-2.5deg) scale(.7)}100%{opacity:1;transform:rotate(-2.5deg)}} +@media (prefers-reduced-motion:reduce){.howto .reveal{opacity:1}.howto--play .reveal{animation:none!important}} +.howto__title{margin:0;position:relative;z-index:2;display:flex;justify-content:center} +.howto__brush{display:block;height:clamp(5rem,9vw,8rem);width:auto;max-width:100%;overflow:visible} +.howto__ink{fill:none;stroke:var(--color-white);stroke-width:19;stroke-linecap:round;stroke-linejoin:round} +.howto__shadow{fill:none;stroke:var(--color-peach-500);stroke-width:19;stroke-linecap:round;stroke-linejoin:round} +.howto--split .howto__title{justify-content:flex-start} +.howto--play .howto__glyph{animation:howto-fade .35s ease-out var(--d,0s) forwards} +@keyframes howto-fade{0%{opacity:0}100%{opacity:1}} +@media (max-width:760px){ +.howto{padding:5rem var(--gutter) var(--space-6);gap:var(--space-6);align-content:center} +.howto__brush{height:4rem} +.howto__list{grid-template-columns:1fr 1fr;gap:var(--space-3)} +.howto--cards .howto__step{gap:var(--space-2);padding:var(--space-4) var(--space-3);border-radius:var(--space-4);box-shadow:-4px 4px 0 var(--color-sand-300)} +.howto__icon{width:3.5rem} +.howto__num{font-size:1.0625rem} +.howto__name{font-size:1.75rem;letter-spacing:.03em} +.howto__text{margin-top:0;font-size:1.0625rem;line-height:1.3;max-width:none} +} diff --git a/assets/site/howto.js b/assets/site/howto.js new file mode 100644 index 0000000..2e0a097 --- /dev/null +++ b/assets/site/howto.js @@ -0,0 +1,48 @@ +(()=>{ + const rng=seed=>()=>{seed=(seed*1664525+1013904223)>>>0;return seed/4294967296}; + const T="#9CCEC8",TD="#84CAC8",P="#F69971",W="#FFFFFF",C="#FCEACA"; + const ICONS={ + mail:"", + lesson:"", + group:"\n\n\n\n\n\n\n\n\n\n", + calendar:"" + }; + const sandRidge=(y,i,w)=>{ + const silhouettes=[ + 'M-350 35C-120 42 90 72 230 4C352 -56 359 -126 507 -139C680 -154 827 -71 979 -62C1122 -53 1114 -212 1242 -227C1367 -244 1464 -150 1582 -175C1735 -207 1765 -320 1930 -311C2091 -302 2229 -220 2398 -248C2531 -270 2650 -343 2950 -318L2950 -154C2670 -176 2544 -102 2385 -89C2180 -70 2075 -142 1914 -146C1737 -150 1692 -39 1558 -26C1400 -11 1339 -94 1228 -63C1119 -33 1159 94 992 104C819 114 670 28 510 51C360 72 340 150 212 179C43 216 -133 175 -350 190Z', + 'M-350 40C-131 14 63 112 238 43C380 -14 409 -91 539 -102C674 -114 772 -18 899 -47C1000 -70 1002 -186 1113 -206C1241 -229 1365 -151 1499 -164C1652 -179 1681 -285 1829 -304C1998 -325 2121 -220 2292 -255C2445 -285 2571 -366 2950 -325L2950 -165C2601 -202 2485 -113 2308 -97C2134 -82 1981 -168 1833 -122C1692 -77 1673 7 1511 16C1341 24 1233 -56 1139 -9C1063 29 1070 121 927 137C780 155 675 60 534 83C407 104 364 183 223 211C39 248 -138 178 -350 205Z' + ]; + const crest=[ + 'M-350 35C-120 42 90 72 230 4C352 -56 359 -126 507 -139C680 -154 827 -71 979 -62C1122 -53 1114 -212 1242 -227C1367 -244 1464 -150 1582 -175C1735 -207 1765 -320 1930 -311C2091 -302 2229 -220 2398 -248C2531 -270 2650 -343 2950 -318L2950 -296C2650 -321 2537 -245 2401 -225C2220 -198 2089 -279 1927 -286C1776 -293 1738 -183 1588 -150C1462 -123 1360 -219 1244 -202C1125 -184 1137 -25 982 -35C819 -27 675 -127 510 -112C372 -99 361 -27 241 31C93 101 -121 70 -350 61Z', + 'M-350 40C-131 14 63 112 238 43C380 -14 409 -91 539 -102C674 -114 772 -18 899 -47C1000 -70 1002 -186 1113 -206C1241 -229 1365 -151 1499 -164C1652 -179 1681 -285 1829 -304C1998 -325 2121 -220 2292 -255C2445 -285 2571 -366 2950 -325L2950 -304C2574 -342 2455 -260 2295 -231C2110 -196 1997 -301 1833 -276C1696 -257 1655 -152 1501 -139C1358 -124 1241 -200 1118 -180C1014 -163 1016 -41 904 -20C764 7 673 -88 541 -75C421 -63 393 10 246 69C63 140 -132 40 -350 65Z' + ]; + return ``; + }; + const sandGrains=(count,w,h,start,r)=>{let s='';for(let i=0;i`;}return s;}; + function sand(svg){ + const r=rng(+svg.dataset.seed||5);let h=""; + [290,790,1290].forEach((y,i)=>{h+=sandRidge(y,i,1920)}); + h+=sandGrains(180,1920,1080,0,r); + svg.setAttribute("viewBox","0 0 1920 1080");svg.setAttribute("preserveAspectRatio","xMidYMid slice");svg.innerHTML=h; + } + document.querySelectorAll(".howto__bg").forEach(sand); + const jit=rng(53); + const jitter=()=>`translate(0 ${((jit()-.5)*9).toFixed(1)}) rotate(${((jit()-.5)*7).toFixed(1)} 20 100) scale(1 ${(.94+jit()*.1).toFixed(3)})`; + const BRUSH=window.brushTable({}); + function brush(svg){ + const word=svg.dataset.word,start=+svg.dataset.start||0; + let cx=0,h=""; + [...word].forEach((ch,i)=>{ + const g=BRUSH[ch]; + if(g.d){const t=`translate(${cx} 0) ${jitter()}`;h+=``;} + cx+=g.w+16; + }); + svg.setAttribute("viewBox",`-24 -6 ${cx-16+48} 118`); + svg.innerHTML=`${h}`; + } + document.querySelectorAll(".howto__brush").forEach(brush); + + document.querySelectorAll(".howto [data-icon]").forEach(el=>{el.outerHTML=ICONS[el.dataset.icon].replace("`; + })(); + + if(sky){ + const W=2600,H=5200; + const step=o=>`M-300 ${120+o}C400 ${60+o} 800 ${110+o} 1150 ${330+o}S1800 ${640+o} 2900 ${600+o}L2900 ${H}L-300 ${H}Z`; + sky.innerHTML=``; + } + const seaEdge=(y,amp,seg,w,ph)=>{let d=`M-100 ${y}`;for(let x=-100;x<=w+100;x+=seg){const k=Math.sin((x/seg)*1.9+ph)*amp+Math.sin((x/seg)*.7+ph*2)*amp*.6;d+=`Q${x+seg/2} ${y+k*1.3} ${x+seg} ${y+k*.4}`}return d}; + sea.innerHTML=``; + const seaWet=sea.querySelector("[data-wet]"),seaFoam=sea.querySelector("[data-foam]"),seaWater=sea.querySelector("[data-water]"),seaClip=sea.querySelector("[data-water-clip]"),seaCopy=sea.querySelector("[data-sea-copy]"); + const progSea=stage.querySelector("[data-stage-prog] .prog__sea"); + if(progSea){seaCopy.setAttribute("viewBox",progSea.getAttribute("viewBox"));seaCopy.setAttribute("preserveAspectRatio",progSea.getAttribute("preserveAspectRatio"));seaCopy.innerHTML=progSea.innerHTML} + const seaState={f:0}; + let seaKey=""; + const drawSea=()=>{ + const f=seaState.f,W=innerWidth,H=innerHeight,key=`${f}|${W}|${H}`; + if(W<50||H<50)return; + if(key===seaKey)return; + seaKey=key; + const top=H*(1.45-1.68*f),foamTop=top-H*.2*(1-f*.5),end=`L${W+100} ${H+200}L-100 ${H+200}Z`; + seaWet.setAttribute("d",seaEdge(foamTop-H*.06,H*.05,W/3.5,W,f*1.4+.5)+end); + seaFoam.firstChild.setAttribute("d",seaEdge(foamTop,H*.07,W/4,W,f*3)+end); + seaFoam.style.opacity=f<.85?1:Math.max(0,1-(f-.85)/.15); + const wd=seaEdge(top,H*.045,W/4.3,W,f*2.2+1)+end;seaWater.setAttribute("d",wd);seaClip.setAttribute("d",wd); + seaCopy.setAttribute("y",(top-H*(1.45-1.68)).toFixed(1)); + }; + drawSea(); + addEventListener("resize",drawSea); + + let lenis=null; + if(!reduce&&!touch&&window.Lenis){ + lenis=new Lenis(); + lenis.on("scroll",ScrollTrigger.update); + gsap.ticker.add(t=>lenis.raf(t*1000)); + gsap.ticker.lagSmoothing(0); + } + + const nav=performance.getEntriesByType("navigation")[0]; + let quick=scrollY>0||(!!nav&&nav.type!=="navigate"); + let now=0; + let rush=false,rushTimer=0; + const finishAll=()=>stage.getAnimations({subtree:true}).forEach(a=>{ + const timing=a.effect&&a.effect.getComputedTiming(); + if(timing&&timing.iterations!==Infinity&&a.playState!=="finished")a.finish(); + }); + const setRush=(on,ms=0)=>{ + clearTimeout(rushTimer); + rush=on; + if(!on)return; + finishAll(); + requestAnimationFrame(()=>requestAnimationFrame(finishAll)); + if(ms)rushTimer=setTimeout(()=>{finishAll();rush=false},ms); + }; + if(quick)stage.classList.add("stage--boot"); + hero.classList.add("soft--play"); + const lockKeys=[" ","ArrowDown","ArrowUp","PageDown","PageUp","End","Home"]; + const swallow=event=>{ + event.preventDefault(); + event.stopImmediatePropagation(); + }; + const swallowKey=event=>{if(lockKeys.includes(event.key))swallow(event)}; + const introEvents=["wheel","touchstart","keydown","pointerdown"]; + const speedUpIntro=event=>{ + introEvents.forEach(type=>removeEventListener(type,speedUpIntro,true)); + const running=hero.getAnimations({subtree:true}).filter(a=>a.playState!=="finished"); + if(!running.length)return; + if(quick||now>tl.labels.fly){running.forEach(a=>a.finish());return} + running.forEach(a=>{a.playbackRate=6}); + if(event.type==="wheel")swallow(event);else if(event.type==="keydown")swallowKey(event); + addEventListener("wheel",swallow,{capture:true,passive:false}); + addEventListener("touchmove",swallow,{capture:true,passive:false}); + addEventListener("keydown",swallowKey,true); + let locked=true; + const unlock=()=>{ + if(!locked)return; + locked=false; + removeEventListener("wheel",swallow,true); + removeEventListener("touchmove",swallow,true); + removeEventListener("keydown",swallowKey,true); + }; + Promise.allSettled(running.map(a=>a.finished)).then(unlock); + setTimeout(unlock,1200); + }; + introEvents.forEach(type=>addEventListener(type,speedUpIntro,{capture:true,passive:type!=="wheel"})); + let teamTl=null; + const teamEnter=()=>{ + if(team.classList.contains("team--play"))return; + team.classList.add("team--play"); + iris.classList.add("stage__iris--closed"); + const items=[...team.querySelectorAll(".team__item")]; + if(reduce||quick||rush){gsap.set(items,{autoAlpha:1});return} + const photos=items.map(i=>i.querySelector(".team__photo")),rest=items.map(i=>[...i.children].filter(c=>!c.classList.contains("team__photo"))); + gsap.set(items,{autoAlpha:1,backgroundColor:"rgba(255,255,255,0)",borderColor:"rgba(255,255,255,0)"}); + gsap.set(rest.flat(),{autoAlpha:0,y:-12}); + gsap.set(photos,{clipPath:"circle(0% at 50% 50%)"}); + const box=stage.querySelector(".stage__sticky").getBoundingClientRect(),cx=box.width/2,cy=box.height/2; + const tl2=gsap.timeline({onComplete:()=>{teamTl=null}}); + teamTl=tl2; + photos.forEach((ph,k)=>{ + const r=ph.getBoundingClientRect(),dot=document.createElement("i"); + dot.className="stage__dot";dot.setAttribute("aria-hidden","true"); + stage.querySelector(".stage__sticky").append(dot); + const d0=.04*Math.max(innerWidth,innerHeight);gsap.set(dot,{x:cx,y:cy,xPercent:-50,yPercent:-50,width:d0,height:d0}); + tl2.to(dot,{x:r.left-box.left+r.width/2,y:r.top-box.top+r.height/2,width:24,height:24,duration:.5,ease:"power2.inOut"},k*.06) + .to(dot,{width:r.width,height:r.height,autoAlpha:0,duration:.4,ease:"power2.out",onComplete:()=>dot.remove()},.5+k*.06) + .to(ph,{clipPath:"circle(50% at 50% 50%)",duration:.45,ease:"power2.out"},.52+k*.06) + .to(items[k],{backgroundColor:"rgba(255,255,255,.16)",borderColor:"rgba(255,255,255,.45)",duration:.4},.9+k*.1) + .to(rest[k],{autoAlpha:1,y:0,duration:.4,stagger:.06,ease:"power2.out"},1+k*.1); + }); + }; + const trustIn=trust.querySelector(".trust__inner"); + gsap.set([trustIn,howto,learn,prog,team,rev,price].filter(Boolean),{autoAlpha:0}); + + let sync=()=>{}; + const ez=e=>reduce?"steps(1)":e; + const tl=gsap.timeline({ + defaults:{ease:"none"}, + scrollTrigger:{ + trigger:stage,start:"top top",end:"bottom bottom",scrub:fast?.5:true,invalidateOnRefresh:true, + onUpdate:self=>{if(Math.abs(self.getVelocity())>8000)setRush(true,350);else if(rush)finishAll();sync(self.progress*self.animation.duration())}, + onRefresh:self=>{drawSea();sync(self.progress*self.animation.duration())} + } + }); + + tl.addLabel("hero",0) + .to({},{duration:.3}) + .addLabel("fly") + .to(word,{x:()=>-.68*innerWidth,y:()=>-.6*innerHeight,scale:.8,filter:blur(8),ease:ez("power2.in"),duration:.8},"fly") + .to(word,{autoAlpha:0,duration:.25,ease:"power2.in"},"fly+=.55") + .addLabel("trust","fly+=.8") + .to({},{duration:hold},"trust") + .addLabel("toSand") + .to(trust,{x:()=>-.06*innerWidth,y:()=>-.8*innerHeight,ease:ez("power2.in"),duration:.35},"toSand") + .to(trust,{keyframes:{filter:[blur(0),blur(12),blur(0)]},duration:.35},"toSand") + .to(trust,{autoAlpha:0,duration:.1},"toSand+=.25") + .fromTo(sand,{x:0,y:()=>innerHeight+30},{x:()=>-.14*innerWidth,y:()=>-720*sand.offsetWidth/2600,ease:ez("power1.inOut"),duration:.9},"toSand") + .to(sand,{keyframes:{filter:[blur(0),blur(7),blur(0)]},duration:.9},"toSand") + .addLabel("howto","toSand+=.9") + .to({},{duration:hold},"howto") + .addLabel("toLearn") + .to(howto.children,{y:()=>-.7*innerHeight,ease:ez("power2.in"),duration:.6},"toLearn") + .to(howto.children,{autoAlpha:0,duration:.15},"toLearn+=.42") + .to(sand,{x:()=>-.08*innerWidth,y:()=>-720*sand.offsetWidth/2600-1.8*innerHeight,ease:ez("power2.inOut"),duration:.9},"toLearn") + .to(sand,{keyframes:{filter:[blur(0),blur(9),blur(0)]},duration:.9},"toLearn") + .addLabel("learn","toLearn+=.9") + .to({},{duration:hold},"learn") + .addLabel("toSea") + .fromTo(seaState,{f:0},{f:1,ease:ez("sine.inOut"),duration:.9,onUpdate:drawSea},"toSea") + .addLabel("prog","toSea+=1") + .to({},{duration:hold},"prog") + .addLabel("toTeam") + .fromTo(iris,{"--r":"62vmax"},{"--r":"2vmax",ease:ez("power1.inOut"),duration:.9,immediateRender:false},"toTeam") + .fromTo(ring,{"--r":"62vmax"},{"--r":"2vmax",ease:ez("power1.inOut"),duration:.82,immediateRender:false},"toTeam") + .addLabel("team","toTeam+=1") + .to({},{duration:hold},"team") + .addLabel("toRev") + .to(team,{y:()=>-.55*innerHeight,ease:ez("power2.in"),duration:.8},"toRev") + .to(team,{keyframes:{filter:[blur(0),blur(10),blur(0)]},duration:.8},"toRev") + .fromTo(rev,{y:()=>innerHeight*1.12},{y:0,ease:ez("power1.inOut"),duration:.9},"toRev") + .addLabel("rev","toRev+=1") + .to({},{duration:hold},"rev") + .addLabel("toPrice") + .to(rev,{y:()=>-innerHeight,ease:ez("none"),duration:.9},"toPrice") + .fromTo(price,{y:()=>innerHeight},{y:0,ease:ez("none"),duration:.9},"toPrice") + .addLabel("price","toPrice+=1") + .to({},{duration:hold},"price"); + if(sky){ + tl.addLabel("toFaq") + .to(price.querySelectorAll(".pr__title,.pr__list,.pr__cta"),{y:()=>-innerHeight,ease:ez("power1.in"),duration:.55},"toFaq") + .fromTo(sky,{x:0,y:()=>innerHeight+30},{x:()=>.14*innerWidth,y:()=>-720*sky.offsetWidth/2600,ease:ez("power1.inOut"),duration:.9},"toFaq+=.3") + .to(sky,{keyframes:{filter:[blur(0),blur(7),blur(0)]},duration:.9},"toFaq+=.3") + .addLabel("faq","toFaq+=1.2"); + } + stage.style.height=`${(tl.duration()*100).toFixed(0)}vh`; + ScrollTrigger.refresh(); + + const show=(el,d)=>{gsap.killTweensOf(el,"autoAlpha");gsap.to(el,{autoAlpha:1,duration:quick||rush?0:.35,delay:quick||rush?0:d,ease:"power1.out"})}; + const hide=el=>{gsap.killTweensOf(el,"autoAlpha");gsap.to(el,{autoAlpha:0,duration:quick||rush?0:.2,ease:"power1.in"})}; + const L=tl.labels; + const topbar=document.querySelector("[data-topbar]"); + const navLinks=topbar?[...topbar.querySelectorAll(".topbar__link")]:[]; + const waveNS="http://www.w3.org/2000/svg"; + const navWaves=navLinks.map(link=>{ + const svg=document.createElementNS(waveNS,"svg"); + svg.classList.add("topbar__wave"); + svg.setAttribute("aria-hidden","true"); + svg.setAttribute("viewBox","0 0 100 40"); + const contours=['M2 21 C18 12 30 12 49 20 C68 28 84 25 98 15 C87 29 69 31 48 24 C29 17 17 16 2 21Z', 'M11 26 C25 21 37 23 51 28 C64 32 75 33 86 30 C74 37 61 35 48 31 C34 26 23 24 11 26Z']; + contours.forEach(d=>{ + const path=document.createElementNS(waveNS,"path"); + path.setAttribute("d",d);svg.append(path); + }); + link.append(svg); + return svg; + }); + const zoneEls=topbar?[".topbar__brand",".topbar__nav",".topbar__cta"].map(q=>topbar.querySelector(q)).filter(Boolean):[]; + const setZones=()=>{ + if(!topbar)return; + const box=topbar.getBoundingClientRect(),w=box.width; + if(!w)return; + const pct=v=>Math.min(100,Math.max(0,v/w*100)).toFixed(2); + let last=0; + const stops=[]; + zoneEls.forEach(el=>{ + const r=el.getBoundingClientRect(),a=r.left-box.left-24,z=r.right-box.left+24; + stops.push(`#000 ${pct(last)}%`,`#000 ${pct(Math.max(last,a-40))}%`,`transparent ${pct(a)}%`,`transparent ${pct(z)}%`); + last=z+40; + }); + stops.push(`#000 ${pct(last)}%`,"#000 100%"); + topbar.style.setProperty("--zones",`linear-gradient(90deg,${stops.join(",")})`); + }; + setZones(); + addEventListener("resize",setZones); + if(document.fonts)document.fonts.ready.then(setZones); + let activeNav=-1; + const setNavWave=key=>{ + const next=navLinks.findIndex(link=>link.dataset.stageLink===key); + if(next===activeNav)return; + const direction=next<0||next{ + const visible=index===next; + const wasVisible=index===activeNav; + if(!visible&&!wasVisible){ + wave.getAnimations().forEach(animation=>animation.cancel()); + wave.style.clipPath="inset(0 100% 0 0)"; + return; + } + const from=visible&&!wasVisible + ?(direction>0?"inset(0 100% 0 0)":"inset(0 0 0 100%)") + :getComputedStyle(wave).clipPath; + const to=visible?"inset(0 0 0 0)" + :(direction>0?"inset(0 0 0 100%)":"inset(0 100% 0 0)"); + wave.getAnimations().forEach(animation=>animation.cancel()); + wave.style.clipPath=to; + if(!reduced)wave.animate([{clipPath:from},{clipPath:to}],{ + duration:700,easing:"cubic-bezier(.25,.65,.3,1)" + }); + }); + activeNav=next; + }; + const marks=[["prog",L.toSea+.97],["team",L.toTeam+.9],["rev",L.toRev+.05],["price",L.toPrice+.02],...(sky?[["faq",L.toFaq+1.15]]:[])]; + const targets={hero:0}; + ["prog","team","rev","price"].forEach(k=>{if(L[k]!==undefined)targets[k]=L[k]+Math.max(hold/2,.05)}); + document.querySelectorAll("[data-stage-link]").forEach(link=>link.addEventListener("click",event=>{ + const key=link.dataset.stageLink,section=key==="faq"?document.getElementById("faq"):null; + const time=targets[key]; + if(time===undefined&&!section)return; + event.preventDefault(); + const y=section?section.getBoundingClientRect().top+scrollY-(topbar?topbar.offsetHeight:0):st.start+time/tl.duration()*(st.end-st.start); + setRush(true); + if(lenis)lenis.scrollTo(y,{immediate:true,force:true});else scrollTo({top:y,behavior:"auto"}); + setRush(true,400); + })); + const rules=[ + [trustIn,L.fly+.78,L.toSand+.8], + [howto,L.toSand+.8,L.toLearn+.8], + [learn,L.toLearn+.8,L.toSea+.97], + [prog,L.toSea+.97,L.toTeam+.9], + [team,L.toTeam+.9,Infinity], + [rev,L.toRev+.05,Infinity], + [price,L.toPrice+.02,Infinity], + ]; + const shown=new Map(rules.map(r=>[r[0],false])); + const faqSection=document.querySelector("[data-faq]"); + const footEl=document.querySelector(".foot"); + const setFootH=()=>{if(footEl)document.documentElement.style.setProperty("--foot-h",`${footEl.offsetHeight}px`)}; + setFootH(); + addEventListener("resize",setFootH); + if(footEl&&window.ResizeObserver)new ResizeObserver(setFootH).observe(footEl); + const plays=[[trust,"trust--play",L.fly+.8],[howto,"howto--play",L.toSand+.85],[learn,"learn--play",L.toLearn+.85],[prog,"prog--play",L.toSea+.97],[rev,"rev--play",L.toRev+.85],[price,"pr--play",L.toPrice+.6]]; + const stageLinks=topbar?[...topbar.querySelectorAll("[data-stage-link]")]:[]; + let fadeLevel=-1,navKey,topOn,heroDone=false; + sync=time=>{ + now=time; + if(time>L.fly){ + hero.classList.add("soft--fly"); + if(!heroDone){heroDone=true;hero.getAnimations({subtree:true}).forEach(x=>{if(x.playState!=="finished")x.finish()})} + } + const fade=Math.round(Math.min(1,Math.max(0,(time-L.fly)/.25))*100)/100; + if(fade!==fadeLevel){fadeLevel=fade;if(fade===0&&!hero.classList.contains("soft--fly"))gsap.set(fades,{clearProps:"opacity,visibility"});else gsap.set(fades,{autoAlpha:1-fade})} + plays.forEach(([el,cls,from])=>{if(time>=from&&!el.classList.contains(cls))el.classList.add(cls)}); + if(faqSection&&sky){ + const onSky=time>=L.toFaq+.75; + if(onSky)faqSection.classList.add("faq--play"); + faqSection.classList.toggle("faq--away",!onSky); + } + if(time>=L.toTeam+.9)teamEnter(); + else if(teamTl){teamTl.progress(1);teamTl=null} + rules.forEach(([el,from,to],n)=>{ + const want=time>=from&&time0&&rules[n-1][2]===from; + show(el,swap?.12:0); + }else hide(el); + }); + let top=null; + rules.forEach(([el])=>{if(shown.get(el))top=el}); + rules.forEach(([el])=>{const off=el!==top;if(el.inert!==off)el.inert=off}); + prog.classList.toggle("prog--live",shown.get(prog)); + iris.classList.toggle("stage__iris--closed",time>=L.toTeam+.9); + if(topbar){ + const on=time>=L.fly+.8; + if(on!==topOn){topOn=on;topbar.classList.toggle("topbar--on",on)} + const current=[...marks].reverse().find(([,from])=>time>=from); + const key=current?.[0]; + if(key!==navKey){ + navKey=key; + setNavWave(key); + stageLinks.forEach(link=>{ + const active=link.dataset.stageLink===key; + link.classList.toggle("topbar__link--active",active); + if(active)link.setAttribute("aria-current","true");else link.removeAttribute("aria-current"); + }); + } + } + }; + const st=tl.scrollTrigger; + sync(st.progress*tl.duration()); + if(!quick){stage.classList.add("stage--ready");root.classList.add("is-ready")} + let keep=null; + addEventListener("resize",()=>{if(keep===null)keep=st.progress}); + ScrollTrigger.addEventListener("refresh",()=>{ + if(keep===null)return; + const y=st.start+keep*(st.end-st.start); + keep=null; + setRush(true,400); + if(lenis)lenis.scrollTo(y,{immediate:true,force:true});else scrollTo(0,y); + }); + + const ready=()=>{ + ScrollTrigger.refresh(); + if(quick&&scrollY===0){ + hero.querySelectorAll(".soft__glyph--done").forEach(g=>g.classList.remove("soft__glyph--done")); + hero.getAnimations({subtree:true}).forEach(a=>{a.currentTime=0;a.play()}); + }else if(quick)finishAll(); + requestAnimationFrame(()=>requestAnimationFrame(()=>{quick=false;stage.classList.add("stage--ready");root.classList.add("is-ready");stage.classList.remove("stage--boot")})); + }; + if(document.readyState==="complete")ready();else addEventListener("load",ready); +})(); diff --git a/assets/site/team.css b/assets/site/team.css new file mode 100644 index 0000000..c1c0a08 --- /dev/null +++ b/assets/site/team.css @@ -0,0 +1,48 @@ +*{box-sizing:border-box} +html{-webkit-tap-highlight-color:transparent} +body{margin:0;font-family:"Neucha",var(--font-body)} + +.team{--team-bg:#52B8B1;--team-soft:#7EC6C0;--team-deep:#3F9C96;position:relative;min-height:100vh;overflow:hidden;display:grid;align-content:center;justify-items:center;gap:clamp(1.75rem,4.5vh,3rem);background:var(--team-bg);padding:var(--space-12) clamp(var(--gutter),6vw,7rem);font-family:"Neucha",var(--font-body)} +.team__label{position:absolute;left:var(--space-6);top:var(--space-4);z-index:3;font:600 16px/1 system-ui,sans-serif;color:#fff;opacity:.85} + +.team__head{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:var(--space-6);text-align:center} +.team__kicker{margin:0;font-size:clamp(1.75rem,3vw,2.75rem);line-height:1;text-transform:uppercase;letter-spacing:.05em;color:var(--color-white)} +.team__kicker--sub{text-transform:none;letter-spacing:.02em} +.team__title{margin:0;line-height:0} +.team__brush{display:block;height:clamp(4.25rem,7vw,6.5rem);width:auto;max-width:90vw;overflow:visible} +.team__ink{fill:none;stroke:var(--color-white);stroke-width:19;stroke-linecap:round;stroke-linejoin:round} +.team__shadow{fill:none;stroke:var(--color-cream-100);stroke-width:19;stroke-linecap:round;stroke-linejoin:round} + +.team__list{position:relative;z-index:2;list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(1.5rem,3vw,3rem);width:100%;max-width:72rem;align-items:stretch} +.team__item{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);text-align:center} +.team__photo{display:block;width:clamp(10rem,14vw,12.5rem);aspect-ratio:1;border-radius:50%;overflow:hidden;margin-bottom:var(--space-3)} +.team__photo img{display:block;width:100%;height:100%;object-fit:cover} +.team__name{font-size:clamp(2rem,2.6vw,2.5rem);line-height:1;color:var(--color-white)} +.team__age{padding:.1em .45em .05em;font-size:clamp(1.25rem,1.6vw,1.5rem);line-height:1.1;color:var(--color-white);background:var(--color-peach-400);transform:rotate(-2.5deg)} +.team__text{margin-top:var(--space-1);font-size:clamp(1.25rem,1.6vw,1.5rem);line-height:1.35;color:var(--color-white);text-shadow:0 2px 10px rgba(47,110,106,.55);max-width:19rem} + +.team--bubble .team__photo{position:relative;box-shadow:0 0 0 3px rgba(255,255,255,.85)} +.team--bubble .team__photo::after{content:"";position:absolute;left:12%;top:10%;width:34%;height:34%;border-radius:50%;border-top:4px solid rgba(255,255,255,.85);border-left:4px solid rgba(255,255,255,.85);border-right:4px solid transparent;border-bottom:4px solid transparent;transform:rotate(-12deg)} + +.team--sticker .team__photo{border:8px solid var(--color-white);box-shadow:-6px 6px 0 var(--team-deep);transform:rotate(var(--r))} + +.team--glass .team__item{padding:var(--space-8) var(--space-6);border-radius:var(--space-6);background:rgba(255,255,255,.16);border:2px solid rgba(255,255,255,.45)} + +.team__head,.team__item{opacity:0} +.team--play .team__head{animation:team-in .5s ease-out .1s forwards} +.team--play .team__item{animation:team-rise .6s cubic-bezier(.3,1.2,.5,1) var(--d) forwards} +@keyframes team-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}} +@keyframes team-rise{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:none}} +@media (prefers-reduced-motion:reduce){ + .team__head,.team__item{opacity:1} + .team--play .team__head,.team--play .team__item{animation:none} +} +@media (max-width:760px){ +.team{padding:5rem var(--gutter) var(--space-6);gap:var(--space-6)} +.team__list{grid-template-columns:minmax(0,1fr);gap:var(--space-4)} +.team__item,.team--glass .team__item{display:grid;grid-template-columns:5.5rem minmax(0,1fr);grid-template-areas:"p n" "p a" "p t";column-gap:var(--space-4);row-gap:var(--space-1);align-items:center;text-align:left;padding:var(--space-3) var(--space-4)} +.team__photo{grid-area:p;width:5.5rem;margin:0} +.team__name{grid-area:n;font-size:2rem} +.team__age{grid-area:a;justify-self:start;font-size:1.125rem} +.team__text{grid-area:t;max-width:none;margin-top:0;font-size:1.0625rem;line-height:1.3} +} diff --git a/assets/site/team.js b/assets/site/team.js new file mode 100644 index 0000000..44f586f --- /dev/null +++ b/assets/site/team.js @@ -0,0 +1,15 @@ +(()=>{ + const rng=seed=>()=>{seed=(seed*1664525+1013904223)>>>0;return seed/4294967296}; + const jit=rng(31); + const jitter=()=>`translate(0 ${((jit()-.5)*9).toFixed(1)}) rotate(${((jit()-.5)*7).toFixed(1)} 20 100) scale(1 ${(.94+jit()*.1).toFixed(3)})`; + const BRUSH=window.brushTable({}); + document.querySelectorAll(".team__brush").forEach((svg,n)=>{ + let cx=0,h=""; + [...svg.dataset.word].forEach((ch,i)=>{const g=BRUSH[ch],t=`translate(${cx} 0) ${jitter()}`;h+=``;cx+=g.w+16}); + svg.setAttribute("viewBox",`-24 -6 ${cx-16+48} 118`);svg.setAttribute("role","img"); + svg.innerHTML=`${h}`; + }); + + const io=new IntersectionObserver(es=>es.forEach(e=>{if(e.isIntersecting){e.target.classList.add("team--play");io.unobserve(e.target)}}),{threshold:.3}); + document.querySelectorAll("[data-team]").forEach(s=>io.observe(s)); +})(); diff --git a/assets/site/tokens.css b/assets/site/tokens.css new file mode 100644 index 0000000..fbeab20 --- /dev/null +++ b/assets/site/tokens.css @@ -0,0 +1,63 @@ +@font-face{font-family:"Amatic SC";src:url("fonts/AmaticSC-Regular.woff2") format("woff2");font-weight:400;font-display:swap} +@font-face{font-family:"Amatic SC";src:url("fonts/AmaticSC-Bold.woff2") format("woff2");font-weight:700;font-display:swap} +@font-face{font-family:"Caveat";src:url("fonts/Caveat.woff2") format("woff2");font-weight:400 700;font-display:swap} +@font-face{font-family:"Neucha";src:url("fonts/Neucha.woff2?v=5") format("woff2");font-weight:400;font-display:swap} +@font-face{font-family:"Neucha";src:url("fonts/Neucha-pl.woff2") format("woff2");font-weight:400;font-display:swap;unicode-range:U+0104-0107,U+0118-0119,U+0141-0144,U+015A-015B,U+0179-017C} + +:root{ + --color-peach-200:#FFB292; + --color-peach-300:#F8B994; + --color-peach-400:#F69971; + --color-peach-500:#F19C77; + --color-peach-700:#C8693F; + --color-teal-800:#3E5F5C; + --color-cream-50:#FFF8EC; + --color-cream-100:#FCEACA; + --color-sand-100:#FCEACA; + --color-sand-200:#F7E4BD; + --color-sand-300:#F4DAAC; + --color-teal-200:#95D0CE; + --color-teal-300:#94CECD; + --color-teal-400:#84CAC8; + --color-teal-500:#9CCEC8; + --color-white:#FFFFFF; + + --color-bg:var(--color-peach-400); + --color-dot:var(--color-peach-200); + --color-text:var(--color-white); + --color-text-shadow:var(--color-cream-100); + --color-tag:var(--color-teal-200); + --color-accent:var(--color-white); + --color-accent-text:var(--color-peach-400); + --color-focus:var(--color-teal-400); + + --font-hand:"Amatic SC","Neucha",system-ui,sans-serif; + --font-brush:"Rubik Dirt","Neucha",system-ui,sans-serif; + --font-body:"Caveat","Neucha",system-ui,sans-serif; + + --text-lg:1.125rem; + --text-xl:1.25rem; + --text-2xl:1.5rem; + --text-5xl:3rem; + --text-6xl:3.75rem; + --text-7xl:4.5rem; + --text-8xl:6rem; + + --fs-lead:var(--text-2xl); + --fs-hand-xl:clamp(var(--text-5xl),6.2vw,var(--text-8xl)); + --fs-brush-xl:clamp(var(--text-5xl),7.4vw,7.5rem); + --fs-button:var(--text-xl); + + --space-2:.5rem; + --space-3:.75rem; + --space-4:1rem; + --space-6:1.5rem; + --space-8:2rem; + --space-12:3rem; + --gutter:var(--space-6); + + --radius-full:999px; + --ease-soft:cubic-bezier(.22,.8,.3,1); + --duration-word:.45s; +} +.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap} diff --git a/assets/site/topbar.css b/assets/site/topbar.css new file mode 100644 index 0000000..10f6f1e --- /dev/null +++ b/assets/site/topbar.css @@ -0,0 +1,101 @@ +@font-face{font-family:"Rubik";src:url("fonts/Rubik.woff2") format("woff2");font-weight:300 900;font-display:swap} +@font-face{font-family:"Rubik";src:url("fonts/Rubik-pl.woff2") format("woff2");font-weight:300 900;font-display:swap;unicode-range:U+0104-0107,U+0118-0119,U+0141-0144,U+015A-015B,U+0179-017C} +.topbar{position:fixed;top:0;left:0;right:0;z-index:60;overflow:clip;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:var(--space-8);padding:var(--space-4) clamp(var(--gutter),6vw,7rem);background:#2F6E6A;font-family:"Rubik",system-ui,sans-serif;opacity:0;visibility:hidden;transform:translateY(-110%);transition:transform .45s cubic-bezier(.3,1.2,.5,1),opacity .3s,visibility 0s .45s} +.topbar::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='100'%3E%3Ccircle cx='113' cy='13' r='3.4' fill='white' opacity='0.21'/%3E%3Ccircle cx='32' cy='41' r='5.2' fill='white' opacity='0.36'/%3E%3Ccircle cx='367' cy='24' r='3.9' fill='white' opacity='0.24'/%3E%3Ccircle cx='83' cy='14' r='2.8' fill='white' opacity='0.38'/%3E%3Ccircle cx='398' cy='78' r='4.8' fill='white' opacity='0.22'/%3E%3Ccircle cx='149' cy='62' r='4.6' fill='white' opacity='0.37'/%3E%3Ccircle cx='422' cy='12' r='4.1' fill='white' opacity='0.33'/%3E%3Ccircle cx='243' cy='20' r='3.7' fill='white' opacity='0.20'/%3E%3Ccircle cx='449' cy='84' r='3.9' fill='white' opacity='0.25'/%3E%3Ccircle cx='436' cy='57' r='5.1' fill='white' opacity='0.37'/%3E%3Ccircle cx='244' cy='42' r='4.1' fill='white' opacity='0.27'/%3E%3Ccircle cx='77' cy='32' r='4.8' fill='white' opacity='0.19'/%3E%3Ccircle cx='22' cy='62' r='3.0' fill='white' opacity='0.30'/%3E%3Ccircle cx='226' cy='36' r='5.5' fill='white' opacity='0.22'/%3E%3Ccircle cx='198' cy='23' r='4.2' fill='white' opacity='0.24'/%3E%3Ccircle cx='171' cy='73' r='3.1' fill='white' opacity='0.30'/%3E%3Ccircle cx='434' cy='13' r='2.2' fill='white' opacity='0.23'/%3E%3Ccircle cx='367' cy='61' r='2.8' fill='white' opacity='0.25'/%3E%3Ccircle cx='85' cy='46' r='2.1' fill='white' opacity='0.33'/%3E%3Ccircle cx='430' cy='92' r='4.6' fill='white' opacity='0.39'/%3E%3Ccircle cx='9' cy='31' r='5.4' fill='white' opacity='0.35'/%3E%3Ccircle cx='197' cy='91' r='4.2' fill='white' opacity='0.36'/%3E%3Ccircle cx='141' cy='22' r='3.6' fill='white' opacity='0.21'/%3E%3Ccircle cx='183' cy='92' r='3.2' fill='white' opacity='0.18'/%3E%3Ccircle cx='22' cy='20' r='4.7' fill='white' opacity='0.26'/%3E%3Ccircle cx='139' cy='13' r='5.4' fill='white' opacity='0.27'/%3E%3C/svg%3E");background-size:480px 100%;-webkit-mask-image:var(--zones,none);mask-image:var(--zones,none)} +.topbar>*{position:relative} +.topbar--on{opacity:1;visibility:visible;transform:none;transition:transform .45s cubic-bezier(.3,1.2,.5,1),opacity .3s,visibility 0s} +.topbar__brand{justify-self:start;display:block;line-height:0;border-radius:var(--space-2)} +.topbar__brand svg{display:block;width:auto;height:4rem;margin:-.5rem 0} +.topbar__brand svg g[style]{color:var(--color-white)!important} +.topbar__brand svg g[stroke]{stroke:var(--color-white)} +.topbar__nav{display:flex;gap:var(--space-12)} +.topbar__link{position:relative;padding:var(--space-2) 0;color:var(--color-white);font-size:1.25rem;font-weight:700;line-height:1;text-decoration:none;opacity:.9;transition:opacity .15s} +.topbar__link--active{opacity:1} +.topbar__cta{justify-self:end;display:inline-flex;border-radius:999px;padding:var(--space-4) var(--space-8);background:var(--color-white);color:#2F6E6A;font-size:1.125rem;font-weight:800;line-height:1;text-decoration:none;box-shadow:-3px 3px 0 #1E4A47} +.topbar__cta:active{transform:scale(.97)} +.topbar a:focus-visible{outline:2px solid var(--color-white);outline-offset:3px} +@media (hover:hover){.topbar__link:hover{opacity:1}.topbar__cta:hover{background:#E3F4F2}} +@media (prefers-reduced-motion:reduce){.topbar,.topbar--on{transition:none}} + +.foot{position:relative;z-index:1;background:#2F6E6A;color:var(--color-white)} +.foot__inner{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-4) var(--space-8);max-width:72rem;margin:0 auto;padding:var(--space-4) var(--gutter);font-family:"Rubik",system-ui,sans-serif;font-weight:400;font-size:.9375rem} +.foot__copy{margin-right:auto} +.foot__link{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.2em;transition:color .15s} +.foot__button{padding:0;border:0;background:none;font:inherit;cursor:pointer} +.foot a:focus-visible,.foot button:focus-visible{outline:2px solid var(--color-white);outline-offset:3px} +@media (hover:hover){.foot__link:hover{color:#9FD8D4}} +.topbar__wave{position:absolute;left:0;bottom:-12px;width:100%;height:24px;overflow:hidden;pointer-events:none;clip-path:inset(0 100% 0 0)} +.topbar__wave path{fill:currentColor;stroke:none} +.cookie-bar{position:fixed;inset:auto var(--space-4) var(--space-4);z-index:70;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-4) var(--space-8);max-width:62rem;margin-inline:auto;padding:var(--space-4) var(--space-6);border-radius:var(--space-6);background:var(--color-white);box-shadow:0 12px 32px rgba(47,79,76,.18);color:#2F4F4C;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;font-size:.9375rem;line-height:1.45} +.cookie-bar[hidden]{display:none} +.cookie-bar__text{flex:1 1 24rem;margin:0;text-wrap:pretty} +.cookie-bar__text a{color:#2F6E6A;text-decoration:underline;text-underline-offset:.2em} +.cookie-bar__actions{display:flex;flex-wrap:wrap;gap:var(--space-3)} +.cookie-bar__btn{border:2px solid #3F9C96;border-radius:999px;padding:var(--space-2) var(--space-6);background:var(--color-white);color:#2F6E6A;font:600 .9375rem/1.2 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;cursor:pointer} +.cookie-bar__btn--primary{background:#3F9C96;color:var(--color-white)} +.cookie-bar__btn:active{transform:scale(.97)} +.cookie-bar :focus-visible{outline:2px solid #3F9C96;outline-offset:3px} +@media (hover:hover){.cookie-bar__btn:hover{background:#E3F4F2}.cookie-bar__btn--primary:hover{background:#48A9A3}} +@media (max-width:560px){.cookie-bar{inset:auto var(--space-3) var(--space-3);padding:var(--space-4)}.cookie-bar__actions{flex-wrap:nowrap;width:100%}.cookie-bar__btn{flex:1}} +.topbar__burger{display:none} +@media (max-width:1280px){ +.topbar{overflow:visible;grid-template-columns:1fr auto auto;gap:var(--space-3);padding:var(--space-2) var(--gutter)} +.topbar__brand svg{height:2.75rem;margin:-.25rem 0} +.topbar__cta{padding:var(--space-3) var(--space-4);font-size:1rem} +.topbar__burger{display:grid;align-content:center;justify-items:center;gap:5px;width:2.75rem;height:2.75rem;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer} +.topbar__burger span{display:block;width:1.5rem;height:3px;border-radius:2px;background:var(--color-white);transition:transform .25s,opacity .2s} +.topbar--menu .topbar__burger span:nth-child(1){transform:translateY(8px) rotate(45deg)} +.topbar--menu .topbar__burger span:nth-child(2){opacity:0} +.topbar--menu .topbar__burger span:nth-child(3){transform:translateY(-8px) rotate(-45deg)} +.topbar__nav{display:none;position:absolute;left:0;right:0;top:100%;flex-direction:column;gap:var(--space-2);padding:var(--space-4) var(--gutter) var(--space-6);background:#2F6E6A} +.topbar--menu .topbar__nav{display:flex} +.topbar__link{align-self:flex-start;font-size:1.5rem;padding:var(--space-2) 0} +} +@media (max-width:980px){ +.foot__inner{gap:var(--space-2) var(--space-6)} +.foot__copy{flex-basis:100%} +} +@media (min-width:1281px) and (max-width:1600px){ +.topbar{gap:var(--space-6);padding-inline:clamp(var(--gutter),4vw,5rem)} +.topbar__nav{gap:var(--space-6)} +.topbar__lang{margin-left:var(--space-4)} +} +@media (max-width:400px){ +.topbar{gap:var(--space-2)} +.topbar__brand svg{height:2.25rem} +.topbar__cta{padding:var(--space-2) var(--space-3);font-size:.9375rem} +.topbar__burger{width:2.5rem;height:2.5rem} +} +@media (max-width:340px){ +.topbar__brand svg{height:1.875rem} +.topbar__cta{padding:var(--space-2);font-size:.875rem} +.topbar{padding-inline:var(--space-4)} +} +@media (pointer:coarse){ +.topbar__brand,.topbar__cta,.topbar__burger,.foot__link,.cookie-bar__btn{position:relative} +.topbar__brand::before,.topbar__cta::before,.topbar__burger::before,.foot__link::before,.cookie-bar__btn::before{content:"";position:absolute;left:-4px;right:-4px;top:50%;height:44px;transform:translateY(-50%)} +.topbar__burger::before{left:-2px;right:-2px} +} +@media (max-width:560px){ +.foot__inner{justify-content:center;text-align:center} +.foot__copy{margin-right:0;text-align:center} +} +.topbar--lang-open{overflow:visible} +.topbar__lang{position:relative;margin-left:var(--space-8)} +.topbar__lang-btn{display:inline-flex;align-items:center;gap:var(--space-2);padding:var(--space-2) 0;border:0;background:none;color:var(--color-white);font:inherit;font-size:1.25rem;font-weight:700;line-height:1;text-transform:uppercase;letter-spacing:.04em;opacity:.9;cursor:pointer} +.topbar__lang-btn svg{width:.6em;height:.4em;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s} +.topbar__lang--open .topbar__lang-btn svg{transform:rotate(180deg)} +.topbar__lang-list{position:absolute;top:calc(100% + var(--space-3));right:0;display:none;min-width:8rem;padding:var(--space-3);border-radius:var(--space-4);background:var(--color-white)} +.topbar__lang--open .topbar__lang-list{display:grid;gap:var(--space-2)} +.topbar__lang-link{padding:var(--space-3) var(--space-4);border-radius:var(--space-3);color:#2F6E6A;font-size:1.0625rem;font-weight:700;line-height:1.2;text-decoration:none;text-transform:uppercase;letter-spacing:.04em} +.topbar__lang-link--active{background:#E3F4F2} +@media (hover:hover){.topbar__lang-btn:hover{opacity:1}.topbar__lang-link:hover{background:#F1FAF9}} +@media (max-width:1280px){ +.topbar__lang{margin-left:0;padding-top:var(--space-2)} +.topbar__lang-btn{display:none} +.topbar__lang-list{position:static;display:flex;gap:var(--space-8);padding:0;background:none} +.topbar__lang-link{padding:var(--space-2) 0;border-radius:0;background:none;color:var(--color-white);font-size:1.5rem;opacity:.6} +.topbar__lang-link--active{background:none;opacity:1} +} + + diff --git a/assets/site/trust.css b/assets/site/trust.css new file mode 100644 index 0000000..bf6ab20 --- /dev/null +++ b/assets/site/trust.css @@ -0,0 +1,38 @@ +.trust{position:relative;min-height:100vh;overflow:hidden;display:grid;place-items:center;background:var(--color-bg);padding:var(--space-12) var(--gutter);text-align:center} +.trust__label{position:absolute;left:var(--space-6);top:var(--space-4);z-index:3;font:600 18px/1 system-ui,sans-serif;color:var(--color-white);opacity:.8} +.trust__dots{position:absolute;inset:0;width:100%;height:100%;pointer-events:none} +.trust__inner{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:var(--space-12)} +.trust__line{margin:0;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:0 .35em;font-family:"Neucha",var(--font-body);font-weight:400;font-size:clamp(2.25rem,4.2vw,3.75rem);line-height:1.1} +.trust__line--small{font-size:clamp(1.5rem,2.2vw,2rem)} +.trust__tag{display:inline-block;padding:0 .3em;background:var(--color-tag);transform:rotate(-2.5deg)} +.trust__brush{display:inline-block;height:1.5em;width:auto;overflow:visible;vertical-align:middle} +.trust__brush--big{height:clamp(6rem,12vw,10rem)} + +.trust__facts{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(1.5rem,4vw,4rem);max-width:68rem;width:100%} +.trust__fact{display:flex;flex-direction:column;align-items:center;gap:var(--space-3)} +.trust__num{display:inline-block;padding:.05em .3em;background:var(--color-tag);transform:rotate(-2.5deg);font-family:var(--font-body);font-weight:700;font-size:clamp(3rem,6vw,5rem);line-height:1} +.trust__fact:nth-child(2) .trust__num{transform:rotate(2deg)} +.trust__cap{font-family:var(--font-body);font-weight:700;font-size:clamp(1.5rem,2.2vw,2rem);line-height:1.15} + +.brush__ink{fill:none;stroke:var(--color-white);stroke-width:19;stroke-linecap:round;stroke-linejoin:round} +.brush__shadow{fill:none;stroke:var(--color-peach-500);stroke-width:19;stroke-linecap:round;stroke-linejoin:round} + +.trust .reveal{opacity:0} +.trust--play .reveal{animation:trust-pop .45s var(--ease-soft) var(--d,0s) forwards} +.trust--play .reveal--fade{animation:trust-fade .3s ease-out var(--d,0s) forwards} +.trust .reveal--pop{display:inline-block;transform-origin:50% 100%} +@keyframes trust-pop{0%{opacity:0;transform:scale(.7)}30%{opacity:1}100%{opacity:1;transform:none}} +@keyframes trust-fade{0%{opacity:0}100%{opacity:1}} +.trust--play .trust__tag.reveal,.trust--play .trust__num.reveal{animation:trust-tag .45s var(--ease-soft) var(--d,0s) forwards} +@keyframes trust-tag{0%{opacity:0;transform:rotate(-2.5deg) scale(.7)}35%{opacity:1}100%{opacity:1;transform:rotate(-2.5deg)}} + +@media (prefers-reduced-motion:reduce){ + .trust .reveal{opacity:1} + .trust--play .reveal{animation:none!important} +} + +.trust__inner{width:min(100%,72rem);gap:clamp(1.75rem,4vw,3rem)} +.trust__line{gap:.4em .35em;font-size:clamp(1.8rem,4.2vw,3.75rem)} +.trust__subline{flex-basis:100%;font-size:.88em} +.trust__brush--big{width:min(100%,64rem);height:auto} +@media(max-width:480px){.trust__line{font-size:clamp(1.5rem,7.1vw,2rem)}.trust__subline{font-size:.9em}} diff --git a/assets/site/trust.js b/assets/site/trust.js new file mode 100644 index 0000000..3009d6c --- /dev/null +++ b/assets/site/trust.js @@ -0,0 +1,31 @@ +(()=>{ + const rng=seed=>()=>{seed=(seed*1664525+1013904223)>>>0;return seed/4294967296}; + const jit=rng(77); + const jitter=()=>`translate(0 ${((jit()-.5)*9).toFixed(1)}) rotate(${((jit()-.5)*7).toFixed(1)} 20 100) scale(1 ${(.94+jit()*.1).toFixed(3)})`; + const BRUSH=window.brushTable({"Й":{w:76,d:"M14 12L14 92L62 12L62 92M24 -26Q38 -12 52 -26"}," ":{w:36,d:""}}); + function brush(svg){ + const word=svg.dataset.word,start=+svg.dataset.start||0; + let cx=0,h=""; + [...word].forEach((ch,i)=>{ + const g=BRUSH[ch]; + if(g.d){const t=`translate(${cx} 0) ${jitter()}`;h+=``;} + cx+=g.w+16; + }); + svg.setAttribute("viewBox",`-24 -6 ${cx-16+48} 118`); + const id="brush-"+word.replace(/[^\p{L}\p{N}]/gu,"").toLowerCase(); + svg.setAttribute("role","img");svg.setAttribute("aria-label",word.toUpperCase()); + svg.innerHTML=`${h}`; + } + function dots(svg){ + const r=rng(+svg.dataset.seed||7),id="t"+svg.dataset.seed; + svg.setAttribute("viewBox","0 0 1920 1080");svg.setAttribute("preserveAspectRatio","xMidYMid slice"); + let h=``,n=0; + while(n<131){let cx=r()*1920;if(r()<.45)cx=r()<.6?1920-r()*480:r()*480;const cy=r()*1080,k=1+Math.floor(r()*5); + for(let j=0;j`;} + svg.innerHTML=h; + } + document.querySelectorAll(".trust__dots").forEach(dots); + document.querySelectorAll(".trust__brush").forEach(brush); + const io=new IntersectionObserver(es=>es.forEach(e=>{if(e.intersectionRatio>=.5)e.target.classList.add("trust--play");else if(e.intersectionRatio===0)e.target.classList.remove("trust--play")}),{threshold:[0,.5]}); + document.querySelectorAll(".trust:not([data-stage] *)").forEach(s=>io.observe(s)); +})(); diff --git a/elements/chunks/ls.brand.html b/elements/chunks/ls.brand.html new file mode 100644 index 0000000..160524b --- /dev/null +++ b/elements/chunks/ls.brand.html @@ -0,0 +1 @@ + diff --git a/elements/chunks/ls.faq.html b/elements/chunks/ls.faq.html new file mode 100644 index 0000000..0fd7c41 --- /dev/null +++ b/elements/chunks/ls.faq.html @@ -0,0 +1 @@ +
  • [[+title:htmlent]]

    [[+text:htmlent]]

  • diff --git a/elements/chunks/ls.hreflang.html b/elements/chunks/ls.hreflang.html new file mode 100644 index 0000000..ba66f35 --- /dev/null +++ b/elements/chunks/ls.hreflang.html @@ -0,0 +1,2 @@ +[[+cultureKey:is=`en`:then=` +`]] diff --git a/elements/chunks/ls.lang.link.html b/elements/chunks/ls.lang.link.html new file mode 100644 index 0000000..29dab58 --- /dev/null +++ b/elements/chunks/ls.lang.link.html @@ -0,0 +1 @@ +[[+cultureKey:upper]] diff --git a/elements/chunks/ls.lead.mail.html b/elements/chunks/ls.lead.mail.html new file mode 100644 index 0000000..7af5234 --- /dev/null +++ b/elements/chunks/ls.lead.mail.html @@ -0,0 +1,12 @@ +

    Новая заявка на пробный урок.

    +

    +Имя: [[+name:htmlent]]
    +Телефон: [[+phone:htmlent]]
    +Возраст ребёнка: [[+age:htmlent]] +

    +

    +Согласие на обработку данных: да
    +Дата и время: [[+sent_at]]
    +Редакция согласия: [[+consent_version]], [[++site_url]]consent/
    +Страница отправки: [[+page:htmlent]] +

    diff --git a/elements/chunks/ls.mark.html b/elements/chunks/ls.mark.html new file mode 100644 index 0000000..63fba4f --- /dev/null +++ b/elements/chunks/ls.mark.html @@ -0,0 +1 @@ + diff --git a/elements/chunks/ls.og.alt.html b/elements/chunks/ls.og.alt.html new file mode 100644 index 0000000..ba7b5cc --- /dev/null +++ b/elements/chunks/ls.og.alt.html @@ -0,0 +1 @@ + diff --git a/elements/chunks/ls.price.html b/elements/chunks/ls.price.html new file mode 100644 index 0000000..2c56e00 --- /dev/null +++ b/elements/chunks/ls.price.html @@ -0,0 +1 @@ +
  • [[+discount:notempty=`[[+discount]]`]][[+title:htmlent]][[%ls_per_month]][[+text:htmlent]]
  • diff --git a/elements/chunks/ls.program.html b/elements/chunks/ls.program.html new file mode 100644 index 0000000..67d86e7 --- /dev/null +++ b/elements/chunks/ls.program.html @@ -0,0 +1 @@ +
  • [[+title:htmlent]][[%ls_years_short]][[+text:htmlent:nl2br]]
  • diff --git a/elements/chunks/ls.review.html b/elements/chunks/ls.review.html new file mode 100644 index 0000000..7736893 --- /dev/null +++ b/elements/chunks/ls.review.html @@ -0,0 +1 @@ +
  • [[lsStars? &rating=`[[+rating]]`]]

    [[+text:htmlent]]

    [[+title:htmlent]]

  • diff --git a/elements/chunks/ls.sitemap.alt.html b/elements/chunks/ls.sitemap.alt.html new file mode 100644 index 0000000..a5682cf --- /dev/null +++ b/elements/chunks/ls.sitemap.alt.html @@ -0,0 +1 @@ + diff --git a/elements/chunks/ls.sitemap.url.html b/elements/chunks/ls.sitemap.url.html new file mode 100644 index 0000000..c1036aa --- /dev/null +++ b/elements/chunks/ls.sitemap.url.html @@ -0,0 +1 @@ +[[+url]][[+date]][[BabelLinks? &resourceId=`[[+id]]` &tpl=`ls.sitemap.alt` &showCurrent=`1` &useRequestProperties=`0` &outputSeparator=``]] \ No newline at end of file diff --git a/elements/chunks/ls.sitemap.wrap.html b/elements/chunks/ls.sitemap.wrap.html new file mode 100644 index 0000000..1dd451b --- /dev/null +++ b/elements/chunks/ls.sitemap.wrap.html @@ -0,0 +1 @@ +[[+output]] diff --git a/elements/chunks/ls.step.html b/elements/chunks/ls.step.html new file mode 100644 index 0000000..4924fe4 --- /dev/null +++ b/elements/chunks/ls.step.html @@ -0,0 +1 @@ +
  • [[%ls_step]] [[+idx]]

    [[+title:htmlent]]

    [[+text:htmlent]]

  • diff --git a/elements/chunks/ls.teacher.html b/elements/chunks/ls.teacher.html new file mode 100644 index 0000000..b844bf4 --- /dev/null +++ b/elements/chunks/ls.teacher.html @@ -0,0 +1 @@ +
  • [[%ls_teacher_alt? &name=`[[+title:htmlent]]` &age=`[[+age:htmlent]]`]][[+title:htmlent]][[+age]][[+text:htmlent]]
  • diff --git a/elements/lexicon/en/default.inc.php b/elements/lexicon/en/default.inc.php new file mode 100644 index 0000000..03322ef --- /dev/null +++ b/elements/lexicon/en/default.inc.php @@ -0,0 +1,76 @@ +event->name === 'OnManagerPageBeforeRender') { + $modx->controller->addCss('/assets/site/admin.css?v=2'); + return; +} + +if ($modx->event->name === 'OnDocFormPrerender' && isset($resource) && (int) $resource->get('template') === (int) $modx->getOption('ls_home_template')) { + $modx->controller->addJavascript($modx->getOption('manager_url') . 'assets/lib/Sortable.min.js'); + $modx->controller->addJavascript('/assets/site/admin-home.js?v=7'); +} diff --git a/elements/plugins/lsLexicon.php b/elements/plugins/lsLexicon.php new file mode 100644 index 0000000..8da7a25 --- /dev/null +++ b/elements/plugins/lsLexicon.php @@ -0,0 +1,2 @@ +lexicon->load('lettersail:default'); diff --git a/elements/snippets/lsAltchaChallenge.php b/elements/snippets/lsAltchaChallenge.php new file mode 100644 index 0000000..2405f6d --- /dev/null +++ b/elements/snippets/lsAltchaChallenge.php @@ -0,0 +1,34 @@ +getOption('site_id', null, 'lettersail')); +$challenge = (new Altcha(hmacSignatureSecret: $secret))->createChallenge( + new CreateChallengeOptions( + algorithm: new Pbkdf2(), + cost: 2000, + counter: random_int(1000, 2000), + expiresAt: time() + 1200, + ) +)->toArray(); + +$stamp = (string) (int) (microtime(true) * 1000); +setcookie('ls_t', $stamp . '.' . hash_hmac('sha256', $stamp, $secret), [ + 'expires' => time() + 86400, + 'path' => '/', + 'secure' => true, + 'httponly' => true, + 'samesite' => 'Lax', +]); + +while (ob_get_level()) { + ob_end_clean(); +} +header('Content-Type: application/json; charset=utf-8'); +header('Cache-Control: no-store'); +header('X-Robots-Tag: noindex'); +echo json_encode($challenge, JSON_UNESCAPED_UNICODE); +exit; diff --git a/elements/snippets/lsLeadGuard.php b/elements/snippets/lsLeadGuard.php new file mode 100644 index 0000000..b512cf1 --- /dev/null +++ b/elements/snippets/lsLeadGuard.php @@ -0,0 +1,67 @@ +addError($field, $message); + return false; +}; + +$value = static fn(string $key): string => trim((string) $hook->getValue($key)); + +$host = strtolower((string) parse_url('//' . ($_SERVER['HTTP_HOST'] ?? ''), PHP_URL_HOST)); +$origin = (string) ($_SERVER['HTTP_ORIGIN'] ?? $_SERVER['HTTP_REFERER'] ?? ''); +$originHost = strtolower((string) parse_url($origin, PHP_URL_HOST)); +if ($origin === '' || $host === '' || $originHost !== $host) { + return $fail('guard', 'origin'); +} + +$secret = hash_hmac('sha256', 'lettersail-captcha', (string) $modx->getOption('site_id', null, 'lettersail')); +$cookie = explode('.', (string) ($_COOKIE['ls_t'] ?? ''), 2); +$opened = (int) ($cookie[0] ?? 0); +if ($opened <= 0 || !hash_equals(hash_hmac('sha256', (string) $opened, $secret), (string) ($cookie[1] ?? ''))) { + return $fail('guard', 'time'); +} +$elapsed = (int) (microtime(true) * 1000) - $opened; +if ($elapsed < 2500 || $elapsed > 86400000) { + return $fail('guard', 'time'); +} + +$digits = preg_replace('/\D/', '', $value('phone')); +if (strlen($digits) < 10 || strlen($digits) > 15) { + return $fail('phone', $modx->lexicon('ls_err_phone')); +} + +$raw = $value('altcha'); +if ($raw === '' || strlen($raw) > 4000) { + return $fail('guard', 'captcha'); +} +try { + $payload = Payload::fromBase64($raw); + $result = (new Altcha(hmacSignatureSecret: $secret))->verifySolution( + new VerifySolutionOptions(algorithm: new Pbkdf2(), payload: $payload) + ); +} catch (\Throwable $error) { + return $fail('guard', 'captcha'); +} +if (!$result->verified || $payload->challenge->signature === null) { + return $fail('guard', 'captcha'); +} +$used = 'altcha_' . hash('sha256', (string) $payload->challenge->signature); +$cacheOptions = [xPDO::OPT_CACHE_KEY => 'lead']; +if ($modx->cacheManager->get($used, $cacheOptions)) { + return $fail('guard', 'captcha'); +} +$one = 1; +$modx->cacheManager->set($used, $one, 3600, $cacheOptions); + +$hook->setValue('phone', '+' . $digits); +$hook->setValue('sent_at', date('d.m.Y H:i:s')); +$hook->setValue('page', mb_substr((string) ($_SERVER['HTTP_REFERER'] ?? ''), 0, 200)); +$hook->setValue('consent_version', (string) $modx->getOption('ls_consent_version', null, '22.10.2026')); + +return true; diff --git a/elements/snippets/lsLeadMail.php b/elements/snippets/lsLeadMail.php new file mode 100644 index 0000000..d5d0d1f --- /dev/null +++ b/elements/snippets/lsLeadMail.php @@ -0,0 +1,21 @@ +getOption('ls_lead_to')); +if ($to === '') { + return true; +} + +$body = $modx->getChunk('ls.lead.mail', $hook->getValues()); +$modx->getService('mail', 'mail.modPHPMailer'); +$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_BODY, $body); +$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_FROM, (string) $modx->getOption('emailsender', null, $to)); +$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_FROM_NAME, 'Lettersail'); +$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_SENDER, (string) $modx->getOption('emailsender', null, $to)); +$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_SUBJECT, 'Заявка на пробный урок'); +$modx->mail->address('to', $to); +$modx->mail->setHTML(true); +if (!$modx->mail->send()) { + $modx->log(MODX\Revolution\modX::LOG_LEVEL_ERROR, 'lsLeadMail: письмо не отправлено: ' . $modx->mail->mailer->ErrorInfo); +} +$modx->mail->reset(); + +return true; diff --git a/elements/snippets/lsLeadResult.php b/elements/snippets/lsLeadResult.php new file mode 100644 index 0000000..e490da8 --- /dev/null +++ b/elements/snippets/lsLeadResult.php @@ -0,0 +1,28 @@ +getPlaceholder('fi.error.' . $field))); + if ($message !== '') { + $errors[$field] = $message; + } +} +$success = (string) $modx->getPlaceholder('fi.success') === '1' && $errors === []; +$general = (string) $modx->getPlaceholder('fi.validation_error_message'); + +$body = ['ok' => $success]; +if (!$success) { + $field = array_key_first($errors) ?? ''; + $body['field'] = in_array($field, ['name', 'phone', 'age', 'consent'], true) ? $field : ''; + $body['message'] = $field === 'guard' ? $modx->lexicon('ls_err_guard_retry') : ($errors[$field] ?? $modx->lexicon('ls_err_save')); + $body['code'] = $field === 'guard' ? ($errors['guard'] ?? 'guard') : ''; +} + +while (ob_get_level()) { + ob_end_clean(); +} +http_response_code($success ? 200 : 422); +header('Content-Type: application/json; charset=utf-8'); +header('Cache-Control: no-store'); +header('X-Robots-Tag: noindex'); +echo json_encode($body, JSON_UNESCAPED_UNICODE); +exit; diff --git a/elements/snippets/lsLeadSave.php b/elements/snippets/lsLeadSave.php new file mode 100644 index 0000000..9ae18da --- /dev/null +++ b/elements/snippets/lsLeadSave.php @@ -0,0 +1,50 @@ +getOption('ls_leads'); +if ($parent <= 0) { + $modx->log(MODX\Revolution\modX::LOG_LEVEL_ERROR, 'lsLeadSave: не задана настройка ls_leads'); + $hook->addError('save', $modx->lexicon('ls_err_save')); + return false; +} + +$name = (string) $hook->getValue('name'); +$phone = (string) $hook->getValue('phone'); +$lines = [ + 'Имя: ' . $name, + 'Телефон: ' . $phone, + 'Возраст ребёнка: ' . (string) $hook->getValue('age'), + 'Согласие на обработку данных: да', + 'Дата и время: ' . (string) $hook->getValue('sent_at'), + 'Редакция согласия: ' . (string) $hook->getValue('consent_version'), + 'Страница отправки: ' . (string) $hook->getValue('page'), +]; + +$lead = $modx->newObject(MODX\Revolution\modDocument::class); +$lead->fromArray([ + 'context_key' => 'data', + 'parent' => $parent, + 'pagetitle' => $name . ', ' . $phone, + 'alias' => 'lead-' . date('YmdHis') . '-' . bin2hex(random_bytes(3)), + 'introtext' => (string) $hook->getValue('sent_at'), + 'content' => implode("\n", $lines), + 'published' => false, + 'hidemenu' => true, + 'searchable' => false, + 'richtext' => false, + 'template' => 0, +]); +if (!$lead->save()) { + $modx->log(MODX\Revolution\modX::LOG_LEVEL_ERROR, 'lsLeadSave: заявка не сохранена'); + $hook->addError('save', $modx->lexicon('ls_err_save')); + return false; +} + +$expired = $modx->getIterator(MODX\Revolution\modResource::class, [ + 'context_key' => 'data', + 'parent' => $parent, + 'createdon:<' => strtotime('-12 months'), +]); +foreach ($expired as $old) { + $old->remove(); +} + +return true; diff --git a/elements/snippets/lsSchema.php b/elements/snippets/lsSchema.php new file mode 100644 index 0000000..f8a9679 --- /dev/null +++ b/elements/snippets/lsSchema.php @@ -0,0 +1,140 @@ +getOption('cultureKey', null, 'ru'); +$homeId = (int) $modx->getOption('site_start'); +$siteUrl = (string) $modx->makeUrl($homeId, '', '', 'full'); +$rootUrl = 'https://' . $modx->getOption('http_host') . '/'; +$words = []; +foreach (['trial', 'trial_text', 'plan', 'per_month', 'course', 'teaches', 'job', 'catalog'] as $wordKey) { + $words[$wordKey] = (string) $modx->lexicon('ls_schema_' . $wordKey); +} + +$list = static function (string $tv) use ($modx, $homeId): array { + $modx->runSnippet('getImageList', ['tvname' => $tv, 'docid' => $homeId, 'toJsonPlaceholder' => 'ls_schema_list']); + return json_decode((string) $modx->getPlaceholder('ls_schema_list'), true) ?: []; +}; +$text = static fn(string $value): string => trim(preg_replace('/\s+/u', ' ', strip_tags($value))); + +$home = $modx->getObject(modResource::class, $homeId); +$name = 'Lettersail'; +$description = $text((string) $home->get('description')); +$title = $text((string) ($home->get('longtitle') ?: $home->get('pagetitle'))); + +$offers = []; +foreach ($list('prices') as $row) { + $offers[] = [ + '@type' => 'Offer', + '@id' => $siteUrl . '#offer-' . $row['MIGX_id'], + 'name' => $words['plan'] . $text($row['title']), + 'description' => $text($row['price'] . $words['per_month'] . $row['text']), + 'priceSpecification' => [ + '@type' => 'UnitPriceSpecification', + 'price' => (int) $row['price'], + 'priceCurrency' => 'PLN', + 'unitCode' => 'MON', + ], + ]; +} +array_unshift($offers, [ + '@type' => 'Offer', + '@id' => $siteUrl . '#offer-trial', + 'name' => $words['trial'], + 'description' => $words['trial_text'], + 'price' => 0, + 'priceCurrency' => 'PLN', +]); + +$courses = []; +foreach ($list('programs') as $index => $row) { + $age = $text($row['title']); + [$min, $max] = array_map('intval', explode('-', $age) + [1 => 0]); + $courses[] = [ + '@type' => 'Course', + 'name' => sprintf($words['course'], $age), + 'description' => $text($row['text']), + 'teaches' => $words['teaches'], + 'timeRequired' => 'PT45M', + 'audience' => ['@type' => 'PeopleAudience', 'suggestedMinAge' => $min, 'suggestedMaxAge' => $max], + 'hasCourseInstance' => ['@type' => 'CourseInstance', 'courseMode' => 'online', 'maximumAttendeeCapacity' => 6], + 'offers' => $index === 0 ? $offers : array_map(static fn(array $offer): array => ['@id' => $offer['@id']], $offers), + ]; +} + +$teachers = []; +foreach ($list('teachers') as $row) { + $teachers[] = [ + '@type' => 'Person', + 'name' => $text($row['title']), + 'jobTitle' => $words['job'] . ($language === 'ru' ? $text($row['age']) : lcfirst($text($row['age']))), + 'description' => $text($row['text']), + 'image' => $rootUrl . ltrim((string) $row['photo'], '/'), + ]; +} + +$reviews = []; +foreach ($list('reviews') as $row) { + $reviews[] = [ + '@type' => 'Review', + 'author' => ['@type' => 'Person', 'name' => $text($row['title'])], + 'reviewBody' => $text($row['text']), + 'reviewRating' => ['@type' => 'Rating', 'ratingValue' => (int) $row['rating'], 'bestRating' => 5, 'worstRating' => 1], + ]; +} + +$questions = []; +foreach ($list('faq') as $row) { + $questions[] = [ + '@type' => 'Question', + 'name' => $text($row['title']), + 'acceptedAnswer' => ['@type' => 'Answer', 'text' => $text($row['text'])], + ]; +} + +$school = [ + '@type' => 'EducationalOrganization', + '@id' => $siteUrl . '#school', + 'name' => $name, + 'url' => $siteUrl, + 'description' => $description, + 'logo' => ['@type' => 'ImageObject', 'url' => $rootUrl . 'assets/site/icon-512.png', 'width' => 512, 'height' => 512], + 'contactPoint' => [ + '@type' => 'ContactPoint', + 'contactType' => 'customer support', + 'email' => (string) $modx->getOption('ls_contact_email'), + 'availableLanguage' => $language, + ], + 'knowsLanguage' => array_values(array_unique(['en', $language])), + 'hasOfferCatalog' => ['@type' => 'OfferCatalog', 'name' => $words['catalog'], 'itemListElement' => $courses], + 'employee' => $teachers, + 'review' => $reviews, +]; + +$blocks = [ + [ + '@type' => 'WebPage', + '@id' => $siteUrl . '#webpage', + 'url' => $siteUrl, + 'name' => $title, + 'description' => $description, + 'inLanguage' => $language, + 'mainEntity' => $school, + ], + [ + '@type' => 'WebSite', + '@id' => $siteUrl . '#website', + 'url' => $siteUrl, + 'name' => $name, + 'inLanguage' => $language, + ], + [ + '@type' => 'FAQPage', + '@id' => $siteUrl . '#faq', + 'inLanguage' => $language, + 'mainEntity' => $questions, + ], +]; + +$output = ''; +foreach ($blocks as $block) { + $output .= '\n"; +} +return $output; diff --git a/elements/snippets/lsStars.php b/elements/snippets/lsStars.php new file mode 100644 index 0000000..febffd2 --- /dev/null +++ b/elements/snippets/lsStars.php @@ -0,0 +1,4 @@ +lexicon('ls_rating_label', ['n' => $rating]) . '">' . str_repeat('★', $rating) . ''; diff --git a/elements/snippets/lsText.php b/elements/snippets/lsText.php new file mode 100644 index 0000000..85825a3 --- /dev/null +++ b/elements/snippets/lsText.php @@ -0,0 +1,18 @@ + htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); + +if ($mode === 'words') { + $words = preg_split('/\s+/u', $text, -1, PREG_SPLIT_NO_EMPTY); + $out = []; + foreach ($words as $index => $word) { + $out[] = '' . $escape($word) . ''; + } + return implode(' ', $out); +} + +$lines = preg_split('/\R/u', $text); +$lines = array_map(static fn(string $line): string => $escape(trim($line)), $lines); + +return implode($mode === 'br' ? '
    ' : ' ', $lines); \ No newline at end of file diff --git a/elements/snippets/lsUi.php b/elements/snippets/lsUi.php new file mode 100644 index 0000000..d9cd851 --- /dev/null +++ b/elements/snippets/lsUi.php @@ -0,0 +1,18 @@ + (string) $modx->getOption('cultureKey'), + 'close' => $modx->lexicon('ls_close'), + 'name' => $modx->lexicon('ls_err_name'), + 'phone' => $modx->lexicon('ls_err_phone'), + 'age' => $modx->lexicon('ls_err_age'), + 'consent' => $modx->lexicon('ls_err_consent'), + 'guard' => $modx->lexicon('ls_err_guard'), + 'limit' => $modx->lexicon('ls_err_limit'), + 'network' => $modx->lexicon('ls_err_network'), + 'docs' => [ + $modx->makeUrl((int) $modx->getOption('ls_privacy_id'), '', '', 'full'), + $modx->makeUrl((int) $modx->getOption('ls_consent_id'), '', '', 'full'), + ], +]; + +return ''; diff --git a/elements/snippets/lsYear.php b/elements/snippets/lsYear.php new file mode 100644 index 0000000..784f104 --- /dev/null +++ b/elements/snippets/lsYear.php @@ -0,0 +1,2 @@ + + + + + + + +[[BabelLinks? &tpl=`ls.hreflang` &showCurrent=`1` &useRequestProperties=`0` &outputSeparator=``]] + + + + + +[[*pagetitle]] | Lettersail + + + + + + +

    [[%ls_demo_a]] jimagie [[%ls_demo_b]] [[%ls_demo_list]]. [[%ls_demo_q]] siema@jimagie.com

    +
    [[$ls.brand]]
    +
    +

    [[*pagetitle]]

    +

    [[*introtext]]

    +
    [[*content]]
    +
    + + diff --git a/elements/templates/home.html b/elements/templates/home.html new file mode 100644 index 0000000..cc0aca1 --- /dev/null +++ b/elements/templates/home.html @@ -0,0 +1,233 @@ + + + + + + +[[BabelLinks? &tpl=`ls.hreflang` &showCurrent=`1` &useRequestProperties=`0` &outputSeparator=``]] + + + + + +[[*longtitle:default=`[[*pagetitle]]`]] + + + + + + +[[BabelLinks? &tpl=`ls.og.alt` &useRequestProperties=`0` &outputSeparator=` +`]] + + + + + + +[[lsSchema]] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    [[%ls_demo_a]] jimagie [[%ls_demo_b]] [[%ls_demo_list]]. [[%ls_demo_q]] siema@jimagie.com

    + +
    +
    +
    + + +
    +
    +

    + [[$ls.brand]] + [[*hero_lead]] + [[*hero_sub]] +

    + [[*hero_button]] +
    +
    + +
    +
    +

    + [[*trust_tag]] + [[*trust_word]] + [[*trust_sub]] +

    + +
    +
    + + + +
    +

    [[*howto_title:lcase:ucfirst:htmlent]]

    +
      + [[getImageList? &tvname=`steps` &tpl=`ls.step`]] +
    +
    + +
    + + + + +

    + + + + [[*learn_thin:htmlent]] [[*learn_plate:htmlent]] [[*learn_brush:lcase:htmlent]] [[lsText? &mode=`line` &text=`[[*learn_small]]`]]

    +
    + + + +
    + +
    +

    [[lsText? &mode=`words` &text=`[[*prog_kicker]]`]]

    +

    [[*prog_title:lcase:ucfirst:htmlent]]

    +
    +
      + [[getImageList? &tvname=`programs` &tpl=`ls.program`]] +
    +
    + + + + +
    +
    +

    [[*team_title:lcase:ucfirst:htmlent]] [[*team_sub:htmlent]]

    + +
    +
      + [[getImageList? &tvname=`teachers` &tpl=`ls.teacher`]] +
    +
    + +
    +
    +

    +

    [[*rev_sub:ucfirst:htmlent]] [[*rev_title:lcase:htmlent]]

    +
    +
    +
      + [[getImageList? &tvname=`reviews` &tpl=`ls.review`]] +
    + + +
    +
    + +
    + +

    [[*price_title:lcase:ucfirst:htmlent]]

    +
      + [[getImageList? &tvname=`prices` &tpl=`ls.price`]] +
    + [[%ls_price_cta]] +
    + + + +
    +
    + +
    +

    [[*faq_title:lcase:ucfirst:htmlent]]

    +
      + [[getImageList? &tvname=`faq` &tpl=`ls.faq`]] +
    +
    +
    + +
    + [[$ls.mark]] + + [[%ls_sign_up]] + +
    + + + + +[[lsUi]] + + + + diff --git a/elements/templates/showcase.html b/elements/templates/showcase.html new file mode 100644 index 0000000..382a0d6 --- /dev/null +++ b/elements/templates/showcase.html @@ -0,0 +1,31 @@ + + + + + + + + + + + +[[*pagetitle]] | Lettersail + + + + + + + + +

    [[%ls_demo_a]] jimagie [[%ls_demo_b]] [[%ls_demo_list]]. [[%ls_demo_q]] siema@jimagie.com

    +
    + [[$ls.mark]] + + [[%ls_sign_up]] + +
    +
    [[*content]]
    + + + diff --git a/provision/content.en.php b/provision/content.en.php new file mode 100644 index 0000000..be3d26f --- /dev/null +++ b/provision/content.en.php @@ -0,0 +1,72 @@ + [ + 'pagetitle' => 'Home', + 'longtitle' => 'Lettersail: online English school for kids aged 5-12', + 'description' => 'Online English for kids: small groups of up to 6, 45-minute lessons and progress reports. Free trial lesson for children aged 5-12', + 'tv' => [ + 'hero_lead' => 'Online English school', + 'hero_sub' => 'for kids aged 5-12', + 'hero_button' => 'Free trial lesson', + 'trust_tag' => '45 minutes', + 'trust_word' => 'of English', + 'trust_sub' => 'through games and conversation', + 'trust_brush' => 'Up to 6 kids', + 'howto_title' => 'Get started', + 'learn_thin' => 'Your child', + 'learn_plate' => 'will speak', + 'learn_brush' => 'English', + 'learn_small' => "and learn to understand,\nread and write", + 'prog_kicker' => 'For every age', + 'prog_title' => 'Programme', + 'team_title' => 'Teachers', + 'team_sub' => 'of the school', + 'rev_sub' => 'what', + 'rev_title' => 'Parents say', + 'price_title' => 'Prices', + 'faq_title' => 'FAQ', + ], + ], + 'lists' => [ + 'steps' => [ + ['title' => 'Get in touch', 'text' => 'Enter your name, phone number and your child\'s age.', 'icon' => 'mail'], + ['title' => 'Trial lesson', 'text' => 'We\'ll get to know your child and check their English level. Free.', 'icon' => 'lesson'], + ['title' => 'Group', 'text' => 'We\'ll find a group of up to 6 children that matches your child\'s age and English level.', 'icon' => 'group'], + ['title' => 'Lessons', 'text' => '45-minute lessons and progress reports for parents.', 'icon' => 'calendar'], + ], + 'programs' => [ + ['title' => '5-7', 'text' => "We play, sing and watch cartoons in English.\nWe learn our first English words and simple phrases."], + ['title' => '8-10', 'text' => "We read short stories, write and build sentences.\nWe learn to talk about ourselves and keep a conversation going."], + ['title' => '11-12', 'text' => "We talk about hobbies and everyday life.\nWe work through grammar with clear examples."], + ], + 'teachers' => [ + ['title' => 'Sophie', 'text' => '6 years of experience teaching preschool children. Learning through songs and games', 'age' => 'Teaches ages 5-7', 'photo' => 'teachers/teacher-1-480.webp'], + ['title' => 'Jakub', 'text' => 'CELTA certified, 8 years of experience. Early reading and writing skills', 'age' => 'Teaches ages 8-10', 'photo' => 'teachers/teacher-2-480.webp'], + ['title' => 'Eliška', 'text' => '15 years of experience, C2 English. Speaking and grammar', 'age' => 'Teaches ages 11-12', 'photo' => 'teachers/teacher-3-480.webp'], + ], + 'reviews' => [ + ['title' => 'Anna', 'text' => 'We used to have to persuade our son to study. Now he asks when the next lesson is and teaches us new words.', 'rating' => '5'], + ['title' => 'Martin', 'text' => 'We worried our daughter would stay quiet around other kids. But the teacher involves everyone: she joins in and isn\'t afraid to make mistakes.', 'rating' => '5'], + ['title' => 'Klara', 'text' => 'Our son understands English assignments much better now. He often does his homework on his own, without our help.', 'rating' => '5'], + ['title' => 'Eva', 'text' => 'On holiday our daughter ordered ice cream in English herself. It was a big moment for her, and she talked about it all day.', 'rating' => '5'], + ['title' => 'Daniel', 'text' => 'After each lesson, we get a quick update on what went well and what needs more practice. It\'s easy to keep track of our child\'s progress.', 'rating' => '5'], + ['title' => 'Laura', 'text' => 'During the trial lesson, they checked our daughter\'s English level and recommended a group. She feels at ease, keeps up with the others and enjoys the lessons.', 'rating' => '5'], + ], + 'prices' => [ + ['title' => 'per month', 'text' => 'paid monthly', 'price' => '480', 'discount' => ''], + ['title' => 'for 3 months', 'text' => '1320 zł for 3 months', 'price' => '440', 'discount' => '−8%'], + ['title' => 'for the school year', 'text' => '3600 zł for the school year', 'price' => '400', 'discount' => '−16%'], + ], + 'faq' => [ + ['title' => 'Can my child start with no English?', 'text' => 'Yes. No prior English is needed. We start with simple words and phrases, games and songs.'], + ['title' => 'How does the free trial lesson work?', 'text' => 'The teacher gets to know your child, guides them through a few activities and checks their English level. After the lesson we suggest a suitable group.'], + ['title' => 'How do you choose a group for my child?', 'text' => 'By age and English level. Groups have up to 6 children, so everyone has time to speak and gets the teacher\'s attention.'], + ['title' => 'What do we need for online lessons?', 'text' => 'A computer or tablet with a camera and microphone, a stable internet connection and a quiet place. Headphones help your child hear the teacher more clearly.'], + ['title' => 'How will I know how my child is doing?', 'text' => 'The teacher tells you what your child has covered, what they can do well and what they need to practise.'], + ['title' => 'What if my child misses a lesson?', 'text' => 'Let the school know in advance. We tell you which topic the group covered and what to review before the next lesson.'], + ], + ], +]; diff --git a/provision/content.php b/provision/content.php new file mode 100644 index 0000000..84eaca4 --- /dev/null +++ b/provision/content.php @@ -0,0 +1,72 @@ + [ + 'pagetitle' => 'Главная', + 'longtitle' => 'Lettersail: онлайн-школа английского для детей 5-12 лет', + 'description' => 'Английский для детей онлайн: мини-группы до 6 человек, уроки по 45 минут, отчёты о прогрессе. Бесплатный пробный урок для детей 5-12 лет', + 'tv' => [ + 'hero_lead' => 'Онлайн-школа английского', + 'hero_sub' => 'для детей 5-12 лет', + 'hero_button' => 'Бесплатный пробный урок', + 'trust_tag' => '45 минут', + 'trust_word' => 'английского', + 'trust_sub' => 'через игры и общение', + 'trust_brush' => 'До 6 детей', + 'howto_title' => 'Как начать', + 'learn_thin' => 'Ребёнок', + 'learn_plate' => 'заговорит', + 'learn_brush' => 'По-английски', + 'learn_small' => "и научится понимать,\nчитать и писать", + 'prog_kicker' => 'Для каждого возраста своя', + 'prog_title' => 'Программа', + 'team_title' => 'Преподаватели', + 'team_sub' => 'школы', + 'rev_sub' => 'что говорят', + 'rev_title' => 'Родители', + 'price_title' => 'Цены', + 'faq_title' => 'Вопросы', + ], + ], + 'lists' => [ + 'steps' => [ + ['title' => 'Заявка', 'text' => 'Укажите имя, телефон и возраст ребёнка.', 'icon' => 'mail'], + ['title' => 'Пробный урок', 'text' => 'Познакомимся с ребёнком и определим уровень. Бесплатно.', 'icon' => 'lesson'], + ['title' => 'Группа', 'text' => 'Подберём мини-группу до 6 детей по возрасту и уровню.', 'icon' => 'group'], + ['title' => 'Занятия', 'text' => 'Уроки по 45 минут и отчёты о прогрессе для родителей.', 'icon' => 'calendar'], + ], + 'programs' => [ + ['title' => '5-7', 'text' => "Играем, поём и смотрим мультфильмы на английском.\nУчим первые слова и простые фразы."], + ['title' => '8-10', 'text' => "Читаем небольшие истории, пишем и составляем фразы.\nУчимся рассказывать о себе и поддерживать разговор."], + ['title' => '11-12', 'text' => "Обсуждаем увлечения и повседневную жизнь.\nРазбираемся в грамматике на понятных примерах."], + ], + 'teachers' => [ + ['title' => 'Sophie', 'text' => 'Опыт с дошкольниками 6 лет. Уроки через песни и игры', 'age' => '5-7 лет', 'photo' => 'teachers/teacher-1-480.webp'], + ['title' => 'Jakub', 'text' => 'Сертификат CELTA, опыт 8 лет. Первое чтение и письмо', 'age' => '8-10 лет', 'photo' => 'teachers/teacher-2-480.webp'], + ['title' => 'Eliška', 'text' => 'Опыт 15 лет, уровень C2. Разговор и грамматика', 'age' => '11-12 лет', 'photo' => 'teachers/teacher-3-480.webp'], + ], + 'reviews' => [ + ['title' => 'Anna', 'text' => 'Раньше сына приходилось уговаривать заниматься. Теперь спрашивает, когда следующий урок, и учит нас новым словам.', 'rating' => '5'], + ['title' => 'Martin', 'text' => 'Переживали, что дочь будет молчать за другими детьми. Но преподаватель вовлекает всех: она отвечает и не боится ошибиться.', 'rating' => '5'], + ['title' => 'Klara', 'text' => 'Сын начал лучше понимать задания по английскому. Домашнюю работу теперь чаще делает сам, без нашей помощи.', 'rating' => '5'], + ['title' => 'Eva', 'text' => 'В отпуске дочь сама заказала мороженое на английском. Для неё это было целое событие, потом весь день вспоминала.', 'rating' => '5'], + ['title' => 'Daniel', 'text' => 'После уроков получаем короткую обратную связь: что получилось и что ещё нужно потренировать. Удобно следить за прогрессом.', 'rating' => '5'], + ['title' => 'Laura', 'text' => 'На пробном уроке посмотрели уровень и предложили группу. Дочери комфортно: она успевает за остальными и занимается с интересом.', 'rating' => '5'], + ], + 'prices' => [ + ['title' => 'на месяц', 'text' => 'оплата каждый месяц', 'price' => '480', 'discount' => ''], + ['title' => 'на 3 месяца', 'text' => '1320 zł за 3 месяца', 'price' => '440', 'discount' => '−8%'], + ['title' => 'на учебный год', 'text' => '3600 zł за год', 'price' => '400', 'discount' => '−16%'], + ], + 'faq' => [ + ['title' => 'Можно ли начать с нуля?', 'text' => 'Да. Знать английский заранее не нужно. Начнём с простых слов и фраз, игр и песен.'], + ['title' => 'Как проходит бесплатный пробный урок?', 'text' => 'Преподаватель познакомится с ребёнком, предложит несколько заданий и определит уровень. После урока подберём подходящую группу.'], + ['title' => 'Как подбирают группу для ребёнка?', 'text' => 'По возрасту и уровню английского. В группе до 6 детей, чтобы каждый успевал говорить и получать внимание преподавателя.'], + ['title' => 'Что понадобится для онлайн-занятий?', 'text' => 'Компьютер или планшет с камерой и микрофоном, стабильный интернет и спокойное место. Наушники помогут лучше слышать преподавателя.'], + ['title' => 'Как родители узнают о прогрессе?', 'text' => 'Преподаватель рассказывает, какие темы освоил ребёнок, что уже получается и что ещё нужно потренировать.'], + ['title' => 'Что делать, если ребёнок пропустит урок?', 'text' => 'Предупредите школу заранее. Мы подскажем, какую тему проходила группа и что повторить перед следующим занятием.'], + ], + ], +]; diff --git a/provision/content.pl.php b/provision/content.pl.php new file mode 100644 index 0000000..62b49ee --- /dev/null +++ b/provision/content.pl.php @@ -0,0 +1,76 @@ + [ + 'pagetitle' => 'Strona główna', + 'longtitle' => 'Lettersail: angielski online dla dzieci 5-12 lat', + 'description' => 'Angielski dla dzieci online: grupy do 6 osób, lekcje po 45 minut i raporty z postępów. Bezpłatna lekcja próbna dla dzieci 5-12 lat', + 'tv' => [ + 'hero_lead' => 'Szkoła angielskiego online', + 'hero_sub' => 'dla dzieci w wieku 5-12 lat', + 'hero_button' => 'Bezpłatna lekcja próbna', + 'trust_tag' => '45 minut', + 'trust_word' => 'angielskiego', + 'trust_sub' => 'przez zabawę i rozmowę', + 'trust_brush' => 'Do 6 dzieci', + 'howto_title' => 'Jak zacząć', + 'learn_thin' => 'Dziecko', + 'learn_plate' => 'zacznie mówić', + 'learn_brush' => 'Po angielsku', + 'learn_small' => "i nauczy się rozumieć, +czytać i pisać", + 'prog_kicker' => 'Dla każdej grupy wiekowej', + 'prog_title' => 'Program', + 'team_title' => 'Nauczyciele', + 'team_sub' => 'szkoły', + 'rev_sub' => 'co mówią', + 'rev_title' => 'Rodzice', + 'price_title' => 'Cennik', + 'faq_title' => 'Pytania', + ], + ], + 'lists' => [ + 'steps' => [ + ['title' => 'Zgłoszenie', 'text' => 'Podaj imię, numer telefonu i wiek dziecka.', 'icon' => 'mail'], + ['title' => 'Lekcja próbna', 'text' => 'Poznamy dziecko i sprawdzimy jego poziom. Bezpłatnie.', 'icon' => 'lesson'], + ['title' => 'Grupa', 'text' => 'Dobierzemy grupę do 6 dzieci w podobnym wieku i na podobnym poziomie angielskiego.', 'icon' => 'group'], + ['title' => 'Zajęcia', 'text' => 'Lekcje po 45 minut i raporty z postępów dla rodziców.', 'icon' => 'calendar'], + ], + 'programs' => [ + ['title' => '5-7', 'text' => "Bawimy się, śpiewamy i oglądamy bajki po angielsku. +Uczymy się pierwszych słów i prostych zdań."], + ['title' => '8-10', 'text' => "Czytamy krótkie historie, piszemy i układamy zdania. +Uczymy się opowiadać o sobie i podtrzymywać rozmowę."], + ['title' => '11-12', 'text' => "Rozmawiamy o zainteresowaniach i życiu codziennym. +Poznajemy gramatykę na prostych przykładach."], + ], + 'teachers' => [ + ['title' => 'Sophie', 'text' => '6 lat doświadczenia w pracy z przedszkolakami. Nauka przez piosenki i zabawę', 'age' => 'Grupa 5-7 lat', 'photo' => 'teachers/teacher-1-480.webp'], + ['title' => 'Jakub', 'text' => 'Certyfikat CELTA, 8 lat doświadczenia. Pierwsze kroki w czytaniu i pisaniu', 'age' => 'Grupa 8-10 lat', 'photo' => 'teachers/teacher-2-480.webp'], + ['title' => 'Eliška', 'text' => '15 lat doświadczenia, poziom C2. Rozmowa i gramatyka', 'age' => 'Grupa 11-12 lat', 'photo' => 'teachers/teacher-3-480.webp'], + ], + 'reviews' => [ + ['title' => 'Anna', 'text' => 'Kiedyś musieliśmy namawiać syna do nauki. Teraz pyta, kiedy następna lekcja, i uczy nas nowych słów.', 'rating' => '5'], + ['title' => 'Martin', 'text' => 'Martwiliśmy się, że córka będzie milczeć wśród innych dzieci. Ale nauczyciel angażuje wszystkie dzieci. Córka odpowiada i nie boi się pomyłek.', 'rating' => '5'], + ['title' => 'Klara', 'text' => 'Syn zaczął lepiej rozumieć polecenia z angielskiego. Pracę domową częściej robi sam, bez naszej pomocy.', 'rating' => '5'], + ['title' => 'Eva', 'text' => 'Na wakacjach córka sama zamówiła lody po angielsku. Dla niej to było wielkie wydarzenie, potem wspominała je cały dzień.', 'rating' => '5'], + ['title' => 'Daniel', 'text' => 'Po lekcjach dostajemy krótką informację zwrotną: co się udało i co jeszcze trzeba poćwiczyć. Łatwo śledzić postępy.', 'rating' => '5'], + ['title' => 'Laura', 'text' => 'Na lekcji próbnej nauczyciel sprawdził poziom córki i zaproponował odpowiednią grupę. Córce jest tam dobrze: nadąża za innymi i chętnie bierze udział w zajęciach.', 'rating' => '5'], + ], + 'prices' => [ + ['title' => 'na miesiąc', 'text' => 'płatność co miesiąc', 'price' => '480', 'discount' => ''], + ['title' => 'na 3 miesiące', 'text' => '1320 zł za 3 miesiące', 'price' => '440', 'discount' => '−8%'], + ['title' => 'na rok szkolny', 'text' => '3600 zł za rok szkolny', 'price' => '400', 'discount' => '−16%'], + ], + 'faq' => [ + ['title' => 'Czy można zacząć od zera?', 'text' => 'Tak. Wcześniejsza znajomość angielskiego nie jest potrzebna. Zaczniemy od prostych słów i zdań, zabaw i piosenek.'], + ['title' => 'Jak wygląda bezpłatna lekcja próbna?', 'text' => 'Nauczyciel pozna dziecko, zaproponuje kilka zadań i określi poziom. Po lekcji dobierzemy odpowiednią grupę.'], + ['title' => 'Jak dobieracie grupę dla dziecka?', 'text' => 'Bierzemy pod uwagę wiek dziecka i jego poziom angielskiego. W grupie jest do 6 dzieci, dzięki czemu nauczyciel może poświęcić uwagę każdemu i każde ma czas na rozmowę.'], + ['title' => 'Co będzie potrzebne do zajęć online?', 'text' => 'Komputer lub tablet z kamerą i mikrofonem, stabilny internet i ciche miejsce. Słuchawki pomogą lepiej słyszeć nauczyciela.'], + ['title' => 'Skąd rodzice wiedzą o postępach?', 'text' => 'Nauczyciel opowiada, jakie tematy dziecko opanowało, co już mu wychodzi i co jeszcze warto poćwiczyć.'], + ['title' => 'Co zrobić, jeśli dziecko opuści lekcję?', 'text' => 'Daj nam wcześniej znać, że dziecka nie będzie na lekcji. Podpowiemy, jaki temat omawiała grupa i co powtórzyć przed kolejnymi zajęciami.'], + ], + ], +]; diff --git a/provision/docs/consent.en.html b/provision/docs/consent.en.html new file mode 100644 index 0000000..d84c73c --- /dev/null +++ b/provision/docs/consent.en.html @@ -0,0 +1,23 @@ +

    1. Who gives consent and to whom

    +

    By ticking the consent box in the trial lesson request form on the Lettersail online school website, a parent or legal guardian of the child freely, of their own will and in the interests of the child gives consent to the Controller, the Lettersail online school (contact: [[++ls_contact_email]]), to the processing of personal data under the terms of this document and the Privacy policy.

    +

    2. What data

    +
      +
    • name;
    • +
    • phone number;
    • +
    • child's age;
    • +
    • technical data: IP address, browser and device information.
    • +
    +

    3. Purposes of processing

    +
      +
    • contacting the user to book a trial lesson;
    • +
    • agreeing a convenient lesson time;
    • +
    • choosing a group by the child's age and level.
    • +
    +

    4. Permitted actions with the data

    +

    Collection, recording, storage, use for contact, passing to contractors to the extent necessary for the operation of the Website and message delivery, deletion.

    +

    5. Period of validity

    +

    12 months from the date the request is submitted, or until consent is withdrawn if that happens earlier.

    +

    6. Withdrawal of consent

    +

    To withdraw consent it is enough to write to [[++ls_contact_email]] asking for the data to be deleted. After withdrawal the data is deleted unless there is another lawful basis to keep it. Withdrawal does not affect the lawfulness of processing before withdrawal.

    +

    7. Proof of consent

    +

    When the form is submitted, the date and time, the consent mark, the version of this text and the page of submission are stored.

    diff --git a/provision/docs/consent.html b/provision/docs/consent.html new file mode 100644 index 0000000..2528c83 --- /dev/null +++ b/provision/docs/consent.html @@ -0,0 +1,23 @@ +

    1. Кто даёт согласие и кому

    +

    Отмечая поле согласия в форме записи на пробный урок на сайте онлайн-школы Lettersail, родитель или законный представитель ребёнка свободно, своей волей и в интересах ребёнка даёт согласие Оператору, онлайн-школе Lettersail (контакт: [[++ls_contact_email]]), на обработку персональных данных на условиях настоящего документа и Политики конфиденциальности.

    +

    2. Какие данные

    +
      +
    • имя;
    • +
    • номер телефона;
    • +
    • возраст ребёнка;
    • +
    • технические данные: IP-адрес, сведения о браузере и устройстве.
    • +
    +

    3. Цели обработки

    +
      +
    • связь с пользователем для записи на пробный урок;
    • +
    • согласование удобного времени занятия;
    • +
    • подбор группы по возрасту и уровню ребёнка.
    • +
    +

    4. Какие действия с данными разрешены

    +

    Сбор, запись, хранение, использование для связи, передача исполнителям в объёме, необходимом для работы Сайта и доставки сообщений, удаление.

    +

    5. Срок действия

    +

    12 месяцев с даты отправки заявки или до отзыва согласия, если отзыв поступит раньше.

    +

    6. Отзыв согласия

    +

    Для отзыва достаточно написать на [[++ls_contact_email]] с просьбой удалить данные. После отзыва данные удаляются, если нет другого законного основания их хранить. Отзыв не влияет на законность обработки до отзыва.

    +

    7. Подтверждение согласия

    +

    При отправке формы сохраняются дата и время, отметка о согласии, версия настоящего текста и страница отправки.

    diff --git a/provision/docs/consent.pl.html b/provision/docs/consent.pl.html new file mode 100644 index 0000000..02980b8 --- /dev/null +++ b/provision/docs/consent.pl.html @@ -0,0 +1,23 @@ +

    1. Kto i komu wyraża zgodę

    +

    Zaznaczając pole zgody w formularzu zapisu na lekcję próbną na stronie szkoły online Lettersail, rodzic lub opiekun prawny dziecka dobrowolnie, z własnej woli i w interesie dziecka wyraża Administratorowi, szkole online Lettersail (kontakt: [[++ls_contact_email]]), zgodę na przetwarzanie danych osobowych na warunkach niniejszego dokumentu i Polityki prywatności.

    +

    2. Jakie dane

    +
      +
    • imię;
    • +
    • numer telefonu;
    • +
    • wiek dziecka;
    • +
    • dane techniczne: adres IP, informacje o przeglądarce i urządzeniu.
    • +
    +

    3. Cele przetwarzania

    +
      +
    • kontakt z użytkownikiem w sprawie zapisu na lekcję próbną;
    • +
    • ustalenie dogodnego terminu zajęć;
    • +
    • dobór grupy według wieku i poziomu dziecka.
    • +
    +

    4. Dozwolone czynności na danych

    +

    Zbieranie, zapisywanie, przechowywanie, wykorzystanie do kontaktu, przekazywanie wykonawcom w zakresie niezbędnym do działania Strony i dostarczania wiadomości, usuwanie.

    +

    5. Okres obowiązywania

    +

    12 miesięcy od dnia wysłania zgłoszenia albo do odwołania zgody, jeśli nastąpi ono wcześniej.

    +

    6. Odwołanie zgody

    +

    Aby odwołać zgodę, wystarczy napisać na adres [[++ls_contact_email]] z prośbą o usunięcie danych. Po odwołaniu dane są usuwane, o ile nie istnieje inna prawna podstawa ich przechowywania. Odwołanie nie wpływa na zgodność z prawem przetwarzania dokonanego przed jego odwołaniem.

    +

    7. Potwierdzenie zgody

    +

    Podczas wysyłania formularza zapisywane są data i godzina, oznaczenie zgody, wersja niniejszego tekstu i strona wysłania.

    diff --git a/provision/docs/privacy.en.html b/provision/docs/privacy.en.html new file mode 100644 index 0000000..b2043fd --- /dev/null +++ b/provision/docs/privacy.en.html @@ -0,0 +1,34 @@ +

    1. General provisions

    +

    1.1. This Policy sets out how the personal data of users of the Lettersail online English school website (the Website) is processed and protected.

    +

    1.2. Personal data controller: the Lettersail online school. Contact for data processing matters: [[++ls_contact_email]].

    +

    1.3. This Policy applies to all personal data that the Controller receives when the Website is used.

    +

    1.4. The request is submitted by a parent or legal guardian of the child. By submitting the form, the user gives consent to the processing of personal data by a separate action. The text of the consent to personal data processing is published on a separate page.

    +

    2. What data is processed and why

    +
      +
    • Trial lesson request form. Data: name, phone number, child's age. Purposes: contacting the user to book a trial lesson, agreeing a convenient lesson time, choosing a group by the child's age and level. Retention period: 12 months from the date of submission.
    • +
    • Consent record. Data: date and time, version of the consent text, page of submission. Retention period: 12 months from the date of submission.
    • +
    • Technical data. Data: IP address, browser and device information, date and time of requests. Purpose: operation and security of the Website. Retention period: no longer than needed for security.
    • +
    +

    The IP address is not stored with the request. The data is not used for mailings unrelated to the user's request.

    +

    3. Legal basis

    +

    Data from the request form is processed on the basis of the user's consent. Technical data is processed to ensure the operation and security of the Website.

    +

    4. Cookies and third-party services

    +

    4.1. The Website uses cookies and the browser's local storage. A choice in the consent banner is required for operation. This data is not used for tracking.

    +

    4.2. Third-party services (for example maps, video, analytics) are connected only after the user's consent in the banner on the Website. Before consent there are no requests to the servers of third-party services. At the date of this edition no third-party services are connected to the Website. When one is connected, the IP address and browser information are passed to that service, and the list of services is added to this Policy.

    +

    4.3. The choice can be changed at any time with the "Consent settings" link at the bottom of the page. Cookies can be deleted or blocked in the browser settings, in which case some functions of the Website will stop working.

    +

    5. Data transfer

    +

    5.1. Personal data is not sold and is not passed to third parties for their own purposes.

    +

    5.2. Data may be received by contractors without whom the Website cannot work: the hosting provider, the mail service and message delivery services. They receive data to the extent necessary for their service and on terms of confidentiality.

    +

    5.3. Data is stored on servers located in Germany.

    +

    5.4. Data is disclosed at the request of competent authorities in cases provided by law.

    +

    6. Retention periods

    +

    The request and the consent record are stored for 12 months from the date of submission, or until consent is withdrawn if that happens earlier. After that the data is deleted.

    +

    7. User rights

    +

    7.1. The user has the right to obtain confirmation of processing and information about it, to receive a copy of their data, to demand that it be corrected, blocked or deleted, to object to processing, to withdraw consent at any time, and to lodge a complaint with the competent data protection authority or a court.

    +

    7.2. To exercise these rights it is enough to send a request to [[++ls_contact_email]]. The request is considered within the period set by law. Withdrawal of consent does not affect the lawfulness of processing before withdrawal.

    +

    8. Data protection

    +

    The Website works over HTTPS. Access to data is limited to authorised persons. The request form is protected against automated submissions and limited by request rate.

    +

    9. Changes to the Policy

    +

    The current edition is published on this page. The date of the edition is given at the start of the document.

    +

    10. Contacts

    +

    Questions about personal data processing should be sent to [[++ls_contact_email]].

    diff --git a/provision/docs/privacy.html b/provision/docs/privacy.html new file mode 100644 index 0000000..a48bf23 --- /dev/null +++ b/provision/docs/privacy.html @@ -0,0 +1,34 @@ +

    1. Общие положения

    +

    1.1. Политика определяет порядок обработки и защиты персональных данных пользователей сайта онлайн-школы английского языка Lettersail (далее Сайт).

    +

    1.2. Оператор персональных данных: онлайн-школа Lettersail. Контакт по вопросам обработки данных: [[++ls_contact_email]].

    +

    1.3. Политика применяется ко всем персональным данным, которые Оператор получает при использовании Сайта.

    +

    1.4. Заявку подаёт родитель или законный представитель ребёнка. Отправляя форму, пользователь даёт согласие на обработку персональных данных отдельным действием. Текст согласия на обработку персональных данных размещён на отдельной странице.

    +

    2. Какие данные обрабатываются и для чего

    +
      +
    • Форма записи на пробный урок. Данные: имя, номер телефона, возраст ребёнка. Цели: связь с пользователем для записи на пробный урок, согласование удобного времени занятия, подбор группы по возрасту и уровню ребёнка. Срок хранения: 12 месяцев с даты отправки.
    • +
    • Запись о согласии. Данные: дата и время, версия текста согласия, страница отправки. Срок хранения: 12 месяцев с даты отправки.
    • +
    • Технические данные. Данные: IP-адрес, сведения о браузере и устройстве, дата и время запросов. Цель: работа и безопасность Сайта. Срок хранения: не дольше срока, необходимого для безопасности.
    • +
    +

    IP-адрес с заявкой не сохраняется. Данные не используются для рассылок, не связанных с обращением пользователя.

    +

    3. Основание обработки

    +

    Данные из формы записи обрабатываются на основании согласия пользователя. Технические данные обрабатываются в целях обеспечения работы и безопасности Сайта.

    +

    4. Cookie и сторонние сервисы

    +

    4.1. Сайт использует cookie и локальное хранилище браузера. Для работы необходим выбор в плашке согласия. Эти данные не используются для отслеживания.

    +

    4.2. Сторонние сервисы (например, карты, видео, аналитика) подключаются только после согласия пользователя в плашке на Сайте. До согласия обращений к серверам сторонних сервисов нет. На дату редакции сторонние сервисы на Сайте не подключены. При подключении стороннему сервису передаются IP-адрес и сведения о браузере, а перечень сервисов добавляется в Политику.

    +

    4.3. Выбор можно изменить в любое время по ссылке «Настройки согласия» в нижней части страницы. Cookie можно удалить или запретить в настройках браузера, часть функций Сайта при этом перестанет работать.

    +

    5. Передача данных

    +

    5.1. Персональные данные не продаются и не передаются третьим лицам для их собственных целей.

    +

    5.2. Данные могут получать исполнители, без которых Сайт не работает: хостинг-провайдер, почтовый сервис, сервисы доставки сообщений. Они получают данные в объёме, необходимом для их услуги, на условиях конфиденциальности.

    +

    5.3. Данные хранятся на серверах, расположенных в Германии.

    +

    5.4. Данные раскрываются по требованию уполномоченных органов в случаях, предусмотренных законом.

    +

    6. Сроки хранения

    +

    Заявка и запись о согласии хранятся 12 месяцев с даты отправки либо до отзыва согласия, если отзыв поступит раньше. После этого данные удаляются.

    +

    7. Права пользователя

    +

    7.1. Пользователь вправе получить подтверждение обработки и сведения о ней, получить копию своих данных, потребовать их уточнения, блокирования или удаления, возражать против обработки, отозвать согласие в любой момент, а также обратиться с жалобой в уполномоченный орган по защите прав субъектов персональных данных или в суд.

    +

    7.2. Для реализации прав достаточно направить обращение на [[++ls_contact_email]]. Обращение рассматривается в срок, установленный законом. Отзыв согласия не влияет на законность обработки до отзыва.

    +

    8. Защита данных

    +

    Сайт работает по протоколу HTTPS. Доступ к данным ограничен уполномоченными лицами. Форма записи защищена от автоматических отправок и ограничена по частоте запросов.

    +

    9. Изменения Политики

    +

    Действующая редакция опубликована на этой странице. Дата редакции указана в начале документа.

    +

    10. Контакты

    +

    Вопросы об обработке персональных данных направляются на [[++ls_contact_email]].

    diff --git a/provision/docs/privacy.pl.html b/provision/docs/privacy.pl.html new file mode 100644 index 0000000..959593c --- /dev/null +++ b/provision/docs/privacy.pl.html @@ -0,0 +1,34 @@ +

    1. Postanowienia ogólne

    +

    1.1. Polityka określa zasady przetwarzania i ochrony danych osobowych użytkowników strony internetowej szkoły języka angielskiego online Lettersail (dalej Strona).

    +

    1.2. Administrator danych osobowych: szkoła online Lettersail. Kontakt w sprawach przetwarzania danych: [[++ls_contact_email]].

    +

    1.3. Polityka dotyczy wszystkich danych osobowych, które Administrator otrzymuje podczas korzystania ze Strony.

    +

    1.4. Zgłoszenie składa rodzic lub opiekun prawny dziecka. Wysyłając formularz, użytkownik wyraża zgodę na przetwarzanie danych osobowych odrębnym działaniem. Treść zgody na przetwarzanie danych osobowych znajduje się na osobnej stronie.

    +

    2. Jakie dane są przetwarzane i w jakim celu

    +
      +
    • Formularz zapisu na lekcję próbną. Dane: imię, numer telefonu, wiek dziecka. Cele: kontakt z użytkownikiem w sprawie zapisu na lekcję próbną, ustalenie dogodnego terminu zajęć, dobór grupy według wieku i poziomu dziecka. Okres przechowywania: 12 miesięcy od dnia wysłania.
    • +
    • Zapis zgody. Dane: data i godzina, wersja tekstu zgody, strona wysłania. Okres przechowywania: 12 miesięcy od dnia wysłania.
    • +
    • Dane techniczne. Dane: adres IP, informacje o przeglądarce i urządzeniu, data i godzina żądań. Cel: działanie i bezpieczeństwo Strony. Okres przechowywania: nie dłużej, niż jest to potrzebne dla bezpieczeństwa.
    • +
    +

    Adres IP nie jest zapisywany razem ze zgłoszeniem. Dane nie są używane do wysyłki wiadomości niezwiązanych z zapytaniem użytkownika.

    +

    3. Podstawa przetwarzania

    +

    Dane z formularza zapisu są przetwarzane na podstawie zgody użytkownika. Dane techniczne są przetwarzane w celu zapewnienia działania i bezpieczeństwa Strony.

    +

    4. Pliki cookie i usługi zewnętrzne

    +

    4.1. Strona korzysta z plików cookie i lokalnej pamięci przeglądarki. Do działania wymagany jest wybór w oknie zgody. Dane te nie służą do śledzenia.

    +

    4.2. Usługi zewnętrzne (na przykład mapy, wideo, analityka) są włączane dopiero po zgodzie użytkownika w oknie na Stronie. Przed zgodą nie ma żadnych zapytań do serwerów usług zewnętrznych. Na dzień tej wersji do Strony nie są podłączone żadne usługi zewnętrzne. Po podłączeniu usłudze zewnętrznej przekazywane są adres IP i informacje o przeglądarce, a lista usług jest dodawana do Polityki.

    +

    4.3. Wybór można zmienić w dowolnym momencie za pomocą linku „Ustawienia zgody” na dole strony. Pliki cookie można usunąć lub zablokować w ustawieniach przeglądarki, wtedy część funkcji Strony przestanie działać.

    +

    5. Przekazywanie danych

    +

    5.1. Dane osobowe nie są sprzedawane i nie są przekazywane osobom trzecim do ich własnych celów.

    +

    5.2. Dane mogą otrzymywać wykonawcy, bez których Strona nie działa: dostawca hostingu, usługa poczty, usługi dostarczania wiadomości. Otrzymują oni dane w zakresie niezbędnym do świadczenia usługi, na warunkach poufności.

    +

    5.3. Dane są przechowywane na serwerach znajdujących się w Niemczech.

    +

    5.4. Dane są ujawniane na żądanie uprawnionych organów w przypadkach przewidzianych prawem.

    +

    6. Okresy przechowywania

    +

    Zgłoszenie i zapis zgody są przechowywane przez 12 miesięcy od dnia wysłania albo do odwołania zgody, jeśli nastąpi ono wcześniej. Po tym czasie dane są usuwane.

    +

    7. Prawa użytkownika

    +

    7.1. Użytkownik ma prawo uzyskać potwierdzenie przetwarzania i informacje o nim, otrzymać kopię swoich danych, żądać ich sprostowania, ograniczenia lub usunięcia, sprzeciwić się przetwarzaniu, w każdej chwili odwołać zgodę, a także wnieść skargę do właściwego organu ochrony danych osobowych lub do sądu.

    +

    7.2. Aby skorzystać z tych praw, wystarczy wysłać wiadomość na adres [[++ls_contact_email]]. Wniosek jest rozpatrywany w terminie określonym przez prawo. Odwołanie zgody nie wpływa na zgodność z prawem przetwarzania dokonanego przed jej odwołaniem.

    +

    8. Ochrona danych

    +

    Strona działa w protokole HTTPS. Dostęp do danych mają wyłącznie upoważnione osoby. Formularz zapisu jest chroniony przed automatycznym wysyłaniem i ograniczony pod względem częstotliwości zapytań.

    +

    9. Zmiany Polityki

    +

    Obowiązująca wersja jest opublikowana na tej stronie. Data wersji jest podana na początku dokumentu.

    +

    10. Kontakt

    +

    Pytania dotyczące przetwarzania danych osobowych prosimy kierować na adres [[++ls_contact_email]].

    diff --git a/provision/provision.php b/provision/provision.php new file mode 100644 index 0000000..839d711 --- /dev/null +++ b/provision/provision.php @@ -0,0 +1,744 @@ +initialize('mgr'); +$modx->setLogTarget('ECHO'); +$modx->setLogLevel(modX::LOG_LEVEL_ERROR); + +$content = require __DIR__ . '/content.php'; + +function say(string $message): void +{ + echo $message, PHP_EOL; +} + +function fail(string $message): never +{ + fwrite(STDERR, $message . PHP_EOL); + exit(1); +} + +function renameContext(modX $modx, string $key, string $name): void +{ + $context = $modx->getObject(modContext::class, $key); + if ($context && $context->get('name') !== $name) { + $context->set('name', $name); + $context->save(); + } +} + +function removePackage(modX $modx, string $name): void +{ + foreach ($modx->getIterator(modTransportPackage::class, ['package_name' => $name, 'installed:IS NOT' => null]) as $package) { + $package->uninstall(); + say($name . ': удалён ' . $package->get('signature')); + } +} + +function installPackage(modX $modx, string $name, string $minimum, string $stability = 'pl'): void +{ + $provider = $modx->getObject(modTransportProvider::class, ['service_url:LIKE' => '%rest.modx.com%']); + if (!$provider) { + fail('Нет поставщика пакетов modx.com'); + } + + $versions = $provider->latest($name, '>=' . $minimum); + if (!is_array($versions) || $versions === []) { + fail($name . ' не найден у поставщика: ' . (is_string($versions) ? $versions : 'пустой ответ')); + } + $versions = array_filter($versions, static fn(array $version): bool => preg_match('/-' . $stability . '\d*$/', (string) $version['signature']) === 1); + $number = static fn(array $version): string => str_replace('-pl', '.', (string) preg_replace('/^[^-]+-/', '', (string) $version['signature'])); + usort($versions, static fn(array $a, array $b): int => version_compare($number($a), $number($b))); + $signature = (string) end($versions)['signature']; + + $installed = $modx->getObject(modTransportPackage::class, ['signature' => $signature, 'installed:IS NOT' => null]); + if ($installed) { + say($name . ': уже установлен ' . $signature); + return; + } + + $package = $provider->transfer($signature); + if (!$package instanceof modTransportPackage || !$package->install()) { + fail('Не удалось установить ' . $signature); + } + say($name . ': установлен ' . $signature); +} + +function pluginEvents(modX $modx, modPlugin $plugin, array $events): void +{ + foreach ($events as $event) { + if (!$modx->getObject(modPluginEvent::class, ['pluginid' => $plugin->get('id'), 'event' => $event])) { + $link = $modx->newObject(modPluginEvent::class); + $link->fromArray(['pluginid' => $plugin->get('id'), 'event' => $event, 'priority' => 0, 'propertyset' => 0], '', true, true); + $link->save(); + } + } +} + +function category(modX $modx, string $name, int $parent = 0, int $rank = 0): int +{ + $category = $modx->getObject(modCategory::class, ['category' => $name]); + if (!$category) { + $category = $modx->newObject(modCategory::class); + $category->set('category', $name); + } + $category->set('parent', $parent); + $category->set('rank', $rank); + $category->save(); + + return (int) $category->get('id'); +} + +function staticElement(modX $modx, string $class, string $name, string $file, int $categoryId, array $fields = []): modElement +{ + $nameField = $class === modTemplate::class ? 'templatename' : 'name'; + $path = ELEMENTS . $file; + if (!is_file($path)) { + fail('Нет файла ' . $path); + } + + $element = $modx->getObject($class, [$nameField => $name]) ?? $modx->newObject($class); + $element->fromArray(array_merge([ + $nameField => $name, + 'category' => $categoryId, + 'static' => true, + 'source' => 0, + 'static_file' => $path, + ], $fields)); + $element->setContent((string) file_get_contents($path)); + if (!$element->save()) { + fail('Не сохранился элемент ' . $name); + } + + return $element; +} + +function uploadsSource(modX $modx): int +{ + $source = $modx->getObject(modFileMediaSource::class, ['name' => 'Загрузки сайта']); + if (!$source) { + $source = $modx->newObject(modFileMediaSource::class); + $source->set('name', 'Загрузки сайта'); + $source->set('description', 'Фото и файлы, которые загружаются из админки'); + } + $source->setProperties([ + 'basePath' => ['name' => 'basePath', 'desc' => 'prop_file.basePath_desc', 'type' => 'textfield', 'options' => [], 'value' => 'assets/uploads/', 'lexicon' => 'core:source'], + 'basePathRelative' => ['name' => 'basePathRelative', 'desc' => 'prop_file.basePathRelative_desc', 'type' => 'combo-boolean', 'options' => [], 'value' => true, 'lexicon' => 'core:source'], + 'baseUrl' => ['name' => 'baseUrl', 'desc' => 'prop_file.baseUrl_desc', 'type' => 'textfield', 'options' => [], 'value' => '/assets/uploads/', 'lexicon' => 'core:source'], + 'baseUrlRelative' => ['name' => 'baseUrlRelative', 'desc' => 'prop_file.baseUrlRelative_desc', 'type' => 'combo-boolean', 'options' => [], 'value' => false, 'lexicon' => 'core:source'], + 'allowedFileTypes' => ['name' => 'allowedFileTypes', 'desc' => 'prop_file.allowedFileTypes_desc', 'type' => 'textfield', 'options' => [], 'value' => 'webp,svg', 'lexicon' => 'core:source'], + ]); + $source->save(); + + return (int) $source->get('id'); +} + +function templateVar(modX $modx, array $definition, array $templateIds, int $categoryId, int $rank): modTemplateVar +{ + $tv = $modx->getObject(modTemplateVar::class, ['name' => $definition['name']]) ?? $modx->newObject(modTemplateVar::class); + $tv->fromArray(array_merge(['category' => $categoryId, 'rank' => $rank], $definition)); + $tv->save(); + + foreach ($templateIds as $templateId) { + $link = $modx->getObject(modTemplateVarTemplate::class, ['tmplvarid' => $tv->get('id'), 'templateid' => $templateId]); + if (!$link) { + $link = $modx->newObject(modTemplateVarTemplate::class); + $link->fromArray(['tmplvarid' => $tv->get('id'), 'templateid' => $templateId], '', true, true); + } + $link->set('rank', $rank); + $link->save(); + } + + return $tv; +} + +function bindSource(modX $modx, modTemplateVar $tv, int $sourceId): void +{ + foreach (['ru', 'en', 'pl'] as $contextKey) { + $criteria = ['object_class' => modTemplateVar::class, 'object' => $tv->get('id'), 'context_key' => $contextKey]; + $link = $modx->getObject(modMediaSourceElement::class, $criteria) ?? $modx->newObject(modMediaSourceElement::class); + $link->fromArray(array_merge($criteria, ['source' => $sourceId]), '', true, true); + $link->save(); + } +} + +function setting(modX $modx, string $key, string $value): void +{ + $setting = $modx->getObject(modSystemSetting::class, ['key' => $key]) ?? $modx->newObject(modSystemSetting::class); + $setting->fromArray(['key' => $key, 'value' => $value, 'xtype' => 'textfield', 'namespace' => 'core', 'area' => 'lettersail'], '', true, true); + $setting->save(); +} + +function settingDefault(modX $modx, string $key, string $value, string $xtype = 'textfield'): void +{ + if ($modx->getObject(modSystemSetting::class, ['key' => $key])) { + return; + } + $setting = $modx->newObject(modSystemSetting::class); + $setting->fromArray(['key' => $key, 'value' => $value, 'xtype' => $xtype, 'namespace' => 'core', 'area' => 'lettersail'], '', true, true); + $setting->save(); +} + +function contextSetting(modX $modx, string $context, string $key, string $value): void +{ + $row = $modx->getObject(modContextSetting::class, ['context_key' => $context, 'key' => $key]) ?? $modx->newObject(modContextSetting::class); + $row->fromArray(['context_key' => $context, 'key' => $key, 'value' => $value, 'xtype' => 'textfield', 'namespace' => 'core', 'area' => 'language'], '', true, true); + $row->save(); +} + +function homeForm(modX $modx, int $templateId): void +{ + $profile = $modx->getObject(modFormCustomizationProfile::class, ['name' => 'Главная']) ?? $modx->newObject(modFormCustomizationProfile::class); + $profile->fromArray(['name' => 'Главная', 'description' => 'Форма главной страницы', 'active' => true]); + $profile->save(); + + $set = $modx->getObject(modFormCustomizationSet::class, ['profile' => $profile->get('id'), 'action' => 'resource/update']) ?? $modx->newObject(modFormCustomizationSet::class); + $set->fromArray(['profile' => $profile->get('id'), 'action' => 'resource/update', 'description' => 'Вкладка блоков, без пустых полей', 'active' => true, 'template' => $templateId]); + $set->save(); + + $rules = [ + ['name' => 'modx-panel-resource-tv', 'container' => 'modx-resource-tabs', 'rule' => 'tabTitle', 'value' => 'Блоки'], + ['name' => 'modx-resource-content', 'container' => 'modx-resource-tabs', 'rule' => 'tabVisible', 'value' => '0'], + ['name' => 'introtext', 'container' => 'modx-panel-resource', 'rule' => 'fieldVisible', 'value' => '0'], + ]; + foreach ($rules as $rank => $rule) { + $criteria = ['set' => $set->get('id'), 'name' => $rule['name'], 'rule' => $rule['rule']]; + $row = $modx->getObject(modActionDom::class, $criteria) ?? $modx->newObject(modActionDom::class); + $row->fromArray($rule + ['set' => $set->get('id'), 'action' => 'resource/update', 'active' => true, 'for_parent' => false, 'rank' => $rank]); + $row->save(); + } +} + +function packageSetting(modX $modx, string $key, string $value): void +{ + $row = $modx->getObject(modSystemSetting::class, ['key' => $key]); + if (!$row) { + fail('Нет настройки ' . $key); + } + $row->set('value', $value); + $row->save(); +} + +function languageDocuments(modX $modx, string $context, string $lang, modTemplate $docTemplate, modTemplate $showcaseTemplate, bool $system): void +{ + $setIds = static function (string $key, int $id) use ($modx, $context, $system): void { + if ($system) { + setting($modx, $key, (string) $id); + } else { + contextSetting($modx, $context, $key, (string) $id); + } + }; + $titles = [ + 'ru' => ['privacy' => 'Политика конфиденциальности', 'consent' => 'Согласие на обработку персональных данных', 'edition' => 'Редакция от 22 октября 2026 года'], + 'en' => ['privacy' => 'Privacy policy', 'consent' => 'Consent to personal data processing', 'edition' => 'Edition of October 22, 2026'], + 'pl' => ['privacy' => 'Polityka prywatności', 'consent' => 'Zgoda na przetwarzanie danych osobowych', 'edition' => 'Wersja z 22 października 2026 r.'], + ][$lang]; + $docIndex = 10; + foreach (['privacy', 'consent'] as $alias) { + $file = __DIR__ . '/docs/' . $alias . ($lang === 'ru' ? '' : '.' . $lang) . '.html'; + $document = $modx->getObject(modResource::class, ['context_key' => $context, 'parent' => 0, 'alias' => $alias]) ?? $modx->newObject(modDocument::class); + $document->fromArray([ + 'context_key' => $context, + 'parent' => 0, + 'pagetitle' => $titles[$alias], + 'alias' => $alias, + 'introtext' => $titles['edition'], + 'content' => (string) file_get_contents($file), + 'isfolder' => true, + 'published' => true, + 'hidemenu' => true, + 'searchable' => false, + 'richtext' => true, + 'template' => $docTemplate->get('id'), + 'menuindex' => $docIndex++, + ]); + $document->save(); + $setIds('ls_' . $alias . '_id', (int) $document->get('id')); + say($context . ': ' . $titles[$alias]); + } + + $host = (string) getenv('SITE_HOST'); + $prefix = ['en' => '/', 'ru' => '/ru/', 'pl' => '/pl/'][$context]; + $homeResourceId = $system + ? (int) $modx->getOption('site_start') + : (int) $modx->getObject(modContextSetting::class, ['context_key' => $context, 'key' => 'site_start'])->get('value'); + $adminLink = static fn(?int $id = null): string => 'https://admin.' . $host . '/demo-login.php?lang=' . $lang . ($id ? '&to=' . rawurlencode('/manager/?a=resource/update&id=' . $id) : ''); + $labels = [ + 'ru' => ['title' => 'Lettersail (страницы и административная панель)', 'lead' => 'Lettersail это одностраничный сайт детской онлайн-школы английского на MODX с формой записи на пробный урок и тремя языковыми версиями. У страницы свои поля SEO, Open Graph для соцсетей и микроразметка Schema.org.', 'admin' => 'Открыть админ-панель', 'figma' => 'Макет в Figma', 'home' => 'Главная', 'markup' => 'Проверить микроразметку', 'speed' => 'Проверить в PageSpeed', 'site' => 'На сайте', 'panel' => 'В админке'], + 'en' => ['title' => 'Lettersail (pages and admin panel)', 'lead' => 'Lettersail is a one-page website of an online English school for children, built on MODX, with a trial lesson booking form and three language versions. The page has its own SEO fields, Open Graph for social networks and Schema.org structured data.', 'admin' => 'Open the admin panel', 'figma' => 'Design in Figma', 'home' => 'Home', 'markup' => 'Check structured data', 'speed' => 'Check in PageSpeed', 'site' => 'On the site', 'panel' => 'In the admin panel'], + 'pl' => ['title' => 'Lettersail (strony i panel administracyjny)', 'lead' => 'Lettersail to jednostronicowa witryna internetowej szkoły angielskiego dla dzieci na MODX, z formularzem zapisu na lekcję próbną i trzema wersjami językowymi. Strona ma własne pola SEO, Open Graph dla sieci społecznościowych i dane strukturalne Schema.org.', 'admin' => 'Otwórz panel administracyjny', 'figma' => 'Projekt w Figmie', 'home' => 'Strona główna', 'markup' => 'Sprawdź dane strukturalne', 'speed' => 'Sprawdź w PageSpeed', 'site' => 'Na stronie', 'panel' => 'W panelu administracyjnym'], + ][$lang]; + $homeUrl = 'https://' . $host . $prefix; + $rows = [[$labels['home'], $homeUrl, $homeResourceId, true]]; + $items = ''; + foreach ($rows as [$name, $siteUrl, $resourceId, $checks]) { + $tools = $checks + ? '' . $labels['markup'] . '' . $labels['speed'] . '' + : ''; + $items .= '
  • ' . htmlspecialchars($name) . '' . $tools . '
  • '; + } + $showcase = $modx->getObject(modResource::class, ['context_key' => $context, 'parent' => 0, 'alias' => 'lettersail']) ?? $modx->newObject(modDocument::class); + $showcase->fromArray([ + 'context_key' => $context, + 'parent' => 0, + 'pagetitle' => $labels['title'], + 'alias' => 'lettersail', + 'introtext' => '', + 'content' => '

    Lettersail

    ' . htmlspecialchars($labels['lead']) . '

    ' . $labels['admin'] . '' . $labels['figma'] . '

      ' . $items . '
    ', + 'isfolder' => true, + 'published' => true, + 'hidemenu' => true, + 'searchable' => false, + 'richtext' => false, + 'template' => $showcaseTemplate->get('id'), + 'menuindex' => 20, + ]); + $showcase->save(); + say($context . ': ' . $labels['title']); + + $serviceDocuments = [ + 'lead' => '[[!FormIt? &hooks=`[[++ls_lead_hooks]]` &submitVar=`ls_lead` &validate=`name:required:minLength=^2^:maxLength=^60^,phone:required,age:required:isNumber:minValue=^5^:maxValue=^12^,consent:required,website:blank` &name.vTextRequired=`[[%ls_err_name]]` &name.vTextMinLength=`[[%ls_err_name]]` &name.vTextMaxLength=`[[%ls_err_name]]` &phone.vTextRequired=`[[%ls_err_phone]]` &age.vTextRequired=`[[%ls_err_age]]` &age.vTextIsNumber=`[[%ls_err_age]]` &age.vTextMinValue=`[[%ls_err_age]]` &age.vTextMaxValue=`[[%ls_err_age]]` &consent.vTextRequired=`[[%ls_err_consent]]`]][[!lsLeadResult]]', + 'lead-challenge' => '[[!lsAltchaChallenge]]', + ]; + $serviceIndex = 30; + foreach ($serviceDocuments as $alias => $code) { + $service = $modx->getObject(modResource::class, ['context_key' => $context, 'parent' => 0, 'alias' => $alias]) ?? $modx->newObject(modDocument::class); + $service->fromArray([ + 'context_key' => $context, + 'parent' => 0, + 'pagetitle' => $alias, + 'alias' => $alias, + 'content' => $code, + 'isfolder' => true, + 'published' => true, + 'hidemenu' => true, + 'searchable' => false, + 'cacheable' => false, + 'richtext' => false, + 'show_in_tree' => false, + 'template' => 0, + 'menuindex' => $serviceIndex++, + ]); + $service->save(); + $setIds($alias === 'lead' ? 'ls_lead_id' : 'ls_challenge_id', (int) $service->get('id')); + say($context . ': служебная страница ' . $alias); + } +} + +function listValues(array $lists): array +{ + $values = []; + foreach ($lists as $name => $rows) { + $items = []; + foreach ($rows as $index => $row) { + $items[] = ['MIGX_id' => (string) ($index + 1)] + $row; + } + $values[$name] = json_encode($items, JSON_UNESCAPED_UNICODE); + } + + return $values; +} + +function setTvValues(modResource $resource, array $values): void +{ + foreach ($values as $name => $value) { + $resource->setTVValue($name, $value); + } +} + +installPackage($modx, 'pdoTools', '3.0'); +installPackage($modx, 'FormIt', '5.0'); +installPackage($modx, 'Babel', '3.0'); +removePackage($modx, 'LangRouter'); +installPackage($modx, 'XRouting', '1.4'); +installPackage($modx, 'MIGX', '3.0', '(?:pl|beta)'); + +$categoryId = category($modx, 'Lettersail'); + +$context = $modx->getObject(modContext::class, DATA_CONTEXT); +if (!$context) { + $context = $modx->newObject(modContext::class); + $context->set('key', DATA_CONTEXT); + $context->set('name', 'Заявки'); + $context->set('description', 'Заявки из окна записи'); + $context->save(); +} + +foreach (['en' => 'English', 'ru' => 'Русский', 'pl' => 'Polski'] as $languageKey => $languageName) { + $languageContext = $modx->getObject(modContext::class, $languageKey); + if (!$languageContext) { + $languageContext = $modx->newObject(modContext::class); + $languageContext->set('key', $languageKey); + $languageContext->set('name', $languageName); + $languageContext->save(); + } + contextSetting($modx, $languageKey, 'cultureKey', $languageKey); + contextSetting($modx, $languageKey, 'base_url', $languageKey === 'en' ? '/' : '/' . $languageKey . '/'); + contextSetting($modx, $languageKey, 'http_host', (string) getenv('SITE_HOST')); +} +$siteHost = (string) getenv('SITE_HOST'); +if ($siteHost === '') { + fail('Не задана переменная SITE_HOST'); +} +contextSetting($modx, 'ru', 'site_url', 'https://' . $siteHost . '/ru/'); +contextSetting($modx, 'en', 'site_url', 'https://' . $siteHost . '/'); +contextSetting($modx, 'pl', 'site_url', 'https://' . $siteHost . '/pl/'); +packageSetting($modx, 'babel.contextKeys', 'en,pl,ru'); +settingDefault($modx, 'date_timezone', 'Europe/Warsaw'); +$timezone = $modx->getObject(modSystemSetting::class, ['key' => 'date_timezone']); +if ($timezone && $timezone->get('value') !== 'Europe/Warsaw') { + $timezone->set('value', 'Europe/Warsaw'); + $timezone->save(); +} +packageSetting($modx, 'babel.contextDefault', 'en'); + +$homeTemplate = staticElement($modx, modTemplate::class, 'Главная', 'templates/home.html', $categoryId); +$docTemplate = staticElement($modx, modTemplate::class, 'Документ', 'templates/doc.html', $categoryId); +$showcaseTemplate = staticElement($modx, modTemplate::class, 'Витрина проекта', 'templates/showcase.html', $categoryId); + +foreach (['ls.brand', 'ls.step', 'ls.program', 'ls.teacher', 'ls.review', 'ls.price', 'ls.faq', 'ls.mark', 'ls.lead.mail', 'ls.lang.link', 'ls.hreflang', 'ls.sitemap.alt', 'ls.sitemap.url', 'ls.sitemap.wrap', 'ls.og.alt'] as $chunk) { + staticElement($modx, modChunk::class, $chunk, 'chunks/' . $chunk . '.html', $categoryId); +} +foreach (['lsText', 'lsStars', 'lsYear', 'lsAltchaChallenge', 'lsLeadGuard', 'lsLeadSave', 'lsLeadMail', 'lsLeadResult', 'lsSchema', 'lsUi'] as $snippet) { + staticElement($modx, modSnippet::class, $snippet, 'snippets/' . $snippet . '.php', $categoryId); +} + +$namespace = $modx->getObject(modNamespace::class, 'lettersail') ?? $modx->newObject(modNamespace::class); +$namespace->fromArray(['name' => 'lettersail', 'path' => '{base_path}elements/', 'assets_path' => ''], '', true, true); +$namespace->save(); + +$obsoletePlugin = $modx->getObject(modPlugin::class, ['name' => 'lsProxyHttps']); +if ($obsoletePlugin) { + $obsoletePlugin->remove(); +} + +$lexiconPlugin = staticElement($modx, modPlugin::class, 'lsLexicon', 'plugins/lsLexicon.php', $categoryId, [ + 'description' => 'Подключает словарь интерфейса lettersail для текущего языка', +]); +pluginEvents($modx, $lexiconPlugin, ['OnLoadWebDocument']); + +$adminPlugin = staticElement($modx, modPlugin::class, 'lsAdmin', 'plugins/lsAdmin.php', $categoryId, [ + 'description' => 'Вид админки: скрытый системный контекст, вкладка блоков на главной', +]); +pluginEvents($modx, $adminPlugin, ['OnManagerPageBeforeRender', 'OnDocFormPrerender']); +setting($modx, 'ls_home_template', (string) $homeTemplate->get('id')); +homeForm($modx, (int) $homeTemplate->get('id')); + +$rowText = ['field' => 'text', 'caption' => 'Текст', 'inputTVtype' => 'textarea']; +$photoTv = templateVar($modx, ['name' => 'photo', 'caption' => 'Фото 480×480 (рядом должен лежать такой же файл с -800 в имени)', 'type' => 'image'], [], $categoryId, 0); +bindSource($modx, $photoTv, uploadsSource($modx)); + +$list = static function (string $caption, array $fields): array { + $columns = []; + foreach ($fields as $field) { + $width = ['title' => 180, 'text' => 380, 'photo' => 100][$field['field']] ?? 110; + $column = ['header' => $field['caption'], 'dataIndex' => $field['field'], 'width' => $width, 'sortable' => 'false']; + if (($field['inputTV'] ?? '') === 'photo') { + $column['renderer'] = 'this.renderImage'; + } + $columns[] = $column; + } + + return [$caption, 'migx', [ + 'formtabs' => json_encode([['caption' => $caption, 'fields' => $fields]], JSON_UNESCAPED_UNICODE), + 'columns' => json_encode($columns, JSON_UNESCAPED_UNICODE), + 'btntext' => 'Добавить', + 'configs' => '', + 'autoResourceFolders' => 'false', + ]]; +}; + +$homeTabs = [ + 'Первый экран' => [ + 'hero_lead' => ['Заголовок', 'text'], + 'hero_sub' => ['Подзаголовок', 'text'], + 'hero_button' => ['Текст кнопки', 'text'], + ], + 'Второй экран' => [ + 'trust_tag' => ['Заголовок: выделение', 'text'], + 'trust_word' => ['Заголовок: продолжение', 'text'], + 'trust_sub' => ['Подзаголовок', 'text'], + 'trust_brush' => ['Акцентная фраза', 'text'], + ], + 'Как начать' => [ + 'howto_title' => ['Заголовок', 'text'], + 'steps' => $list('Шаги', [ + ['field' => 'title', 'caption' => 'Заголовок'], + $rowText, + ['field' => 'icon', 'caption' => 'Значок', 'inputTVtype' => 'listbox', 'inputOptionValues' => 'Письмо==mail||Урок==lesson||Группа==group||Календарь==calendar'], + ]), + ], + 'Чему научится' => [ + 'learn_thin' => ['Заголовок: начало', 'text'], + 'learn_plate' => ['Заголовок: выделение', 'text'], + 'learn_brush' => ['Заголовок: окончание', 'text'], + 'learn_small' => ['Подзаголовок', 'textarea'], + ], + 'Программы' => [ + 'prog_kicker' => ['Надзаголовок', 'text'], + 'prog_title' => ['Заголовок', 'text'], + 'programs' => $list('Возрастные группы', [ + ['field' => 'title', 'caption' => 'Возраст'], + $rowText, + ]), + ], + 'Преподаватели' => [ + 'team_title' => ['Заголовок', 'text'], + 'team_sub' => ['Подзаголовок', 'text'], + 'teachers' => $list('Список преподавателей', [ + ['field' => 'title', 'caption' => 'Имя'], + ['field' => 'age', 'caption' => 'Возраст группы'], + $rowText, + ['field' => 'photo', 'caption' => 'Фото', 'description' => 'Файл 480×480 и рядом такой же с -800 в имени', 'inputTV' => 'photo'], + ]), + ], + 'Отзывы' => [ + 'rev_sub' => ['Надзаголовок', 'text'], + 'rev_title' => ['Заголовок', 'text'], + 'reviews' => $list('Отзывы родителей', [ + ['field' => 'title', 'caption' => 'Имя'], + $rowText, + ['field' => 'rating', 'caption' => 'Оценка', 'inputTVtype' => 'listbox', 'inputOptionValues' => '5||4||3||2||1', 'default' => '5'], + ]), + ], + 'Цены' => [ + 'price_title' => ['Заголовок', 'text'], + 'prices' => $list('Тарифы', [ + ['field' => 'title', 'caption' => 'Срок'], + ['field' => 'price', 'caption' => 'Цена в месяц', 'description' => 'Только цифры'], + ['field' => 'discount', 'caption' => 'Скидка', 'description' => 'Например −8%'], + ['field' => 'text', 'caption' => 'Оплата', 'inputTVtype' => 'textarea'], + ]), + ], + 'Вопросы' => [ + 'faq_title' => ['Заголовок', 'text'], + 'faq' => $list('Вопросы и ответы', [ + ['field' => 'title', 'caption' => 'Вопрос'], + ['field' => 'text', 'caption' => 'Ответ', 'inputTVtype' => 'textarea'], + ]), + ], +]; +$tabRank = 0; +foreach ($homeTabs as $tab => $fields) { + $tabId = category($modx, $tab, $categoryId, $tabRank++); + $rank = 0; + foreach ($fields as $name => $field) { + templateVar($modx, ['name' => $name, 'caption' => $field[0], 'type' => $field[1], 'input_properties' => $field[2] ?? [], 'description' => $field[1] === 'migx' ? 'Порядок: перетаскивание за значок' : ''], [(int) $homeTemplate->get('id')], $tabId, $rank++); + } +} + +$uploads = WEB_ROOT . 'assets/uploads/teachers/'; +if (!is_dir($uploads) && !mkdir($uploads, 0775, true)) { + fail('Не создалась папка ' . $uploads); +} +foreach ([1, 2, 3] as $number) { + foreach ([480, 800] as $size) { + $file = "teacher-{$number}-{$size}.webp"; + if (!is_file($uploads . $file)) { + copy(WEB_ROOT . 'assets/site/img/' . $file, $uploads . $file); + } + } +} + +$homeId = (int) $modx->getOption('site_start'); +$home = $modx->getObject(modResource::class, $homeId); +if (!$home) { + fail('Нет стартовой страницы ' . $homeId); +} +$isFreshHome = (int) $home->get('template') !== (int) $homeTemplate->get('id'); +$home->set('template', $homeTemplate->get('id')); +if ($isFreshHome) { + $home->fromArray(['pagetitle' => $content['home']['pagetitle'], 'longtitle' => $content['home']['longtitle'], 'content' => '']); +} +if (trim((string) $home->get('description')) === '') { + $home->set('description', $content['home']['description']); +} +$home->save(); +if ($isFreshHome) { + setTvValues($home, $content['home']['tv'] + listValues($content['lists'])); + say('Главная: заполнена'); +} + +foreach (['friendly_urls' => '1', 'use_alias_path' => '1'] as $key => $value) { + $furl = $modx->getObject(modSystemSetting::class, ['key' => $key]); + if ($furl && $furl->get('value') !== $value) { + $furl->set('value', $value); + $furl->save(); + } + $modx->setOption($key, $value); +} + +settingDefault($modx, 'ls_lead_to', ''); +settingDefault($modx, 'ls_consent_version', '22.10.2026'); +settingDefault($modx, 'ls_contact_email', 'info@lettersail.jimagie.com'); +setting($modx, 'ls_lead_hooks', 'lsLeadGuard,lsLeadSave,lsLeadMail'); +$mailHost = $modx->getObject(modSystemSetting::class, ['key' => 'mail_smtp_hosts']); +if (!$mailHost || trim((string) $mailHost->get('value')) === '') { + foreach (['mail_use_smtp' => '1', 'mail_smtp_auth' => '1', 'mail_smtp_prefix' => 'ssl', 'mail_smtp_port' => '465'] as $key => $value) { + $row = $modx->getObject(modSystemSetting::class, ['key' => $key]) ?? $modx->newObject(modSystemSetting::class); + $row->fromArray(['key' => $key, 'value' => $value, 'namespace' => 'core', 'area' => 'mail'], '', true, true); + $row->save(); + } +} + +$leadsFolder = $modx->getObject(modResource::class, ['context_key' => DATA_CONTEXT, 'parent' => 0, 'alias' => 'leads']); +if (!$leadsFolder) { + $leadsFolder = $modx->newObject(modDocument::class); + $leadsFolder->fromArray([ + 'context_key' => DATA_CONTEXT, + 'parent' => 0, + 'pagetitle' => 'Заявки', + 'alias' => 'leads', + 'isfolder' => true, + 'published' => true, + 'hidemenu' => true, + 'searchable' => false, + 'template' => 0, + 'menuindex' => 90, + ]); + $leadsFolder->save(); +} +setting($modx, 'ls_leads', (string) $leadsFolder->get('id')); + +foreach ($modx->getIterator(modResource::class, ['context_key' => 'web']) as $moved) { + $moved->set('context_key', 'ru'); + $moved->save(); +} +$staleSitemap = $modx->getObject(modResource::class, ['context_key' => 'ru', 'alias' => 'sitemap']); +if ($staleSitemap) { + $staleSitemap->remove(); +} +$modx->getContext('ru'); +contextSetting($modx, 'ru', 'site_start', (string) $homeId); +languageDocuments($modx, 'ru', 'ru', $docTemplate, $showcaseTemplate, true); + +$languageHomes = ['ru' => $homeId]; +foreach (['en' => 'English', 'pl' => 'Polski'] as $languageKey => $languageName) { + $languageContent = require __DIR__ . '/content.' . $languageKey . '.php'; + $modx->getContext($languageKey); + $languageHome = $modx->getObject(modResource::class, ['context_key' => $languageKey, 'alias' => 'home']) ?? $modx->newObject(modDocument::class); + $isFreshHome = $languageHome->isNew(); + $languageHome->fromArray([ + 'context_key' => $languageKey, + 'parent' => 0, + 'pagetitle' => $languageContent['home']['pagetitle'], + 'longtitle' => $languageContent['home']['longtitle'], + 'description' => $languageContent['home']['description'], + 'alias' => 'home', + 'template' => $homeTemplate->get('id'), + 'published' => true, + 'hidemenu' => true, + 'richtext' => false, + 'content' => '', + ]); + $languageHome->save(); + if ($isFreshHome) { + setTvValues($languageHome, $languageContent['home']['tv'] + listValues($languageContent['lists'])); + } + contextSetting($modx, $languageKey, 'site_start', (string) $languageHome->get('id')); + languageDocuments($modx, $languageKey, $languageKey, $docTemplate, $showcaseTemplate, false); + $languageHomes[$languageKey] = (int) $languageHome->get('id'); +} + +$babelTv = $modx->getObject(modTemplateVar::class, ['name' => 'babelLanguageLinks']); +if (!$babelTv) { + fail('Нет поля babelLanguageLinks (Babel)'); +} +foreach ([(int) $homeTemplate->get('id'), (int) $docTemplate->get('id')] as $templateId) { + $criteria = ['tmplvarid' => $babelTv->get('id'), 'templateid' => $templateId]; + if (!$modx->getObject(modTemplateVarTemplate::class, $criteria)) { + $templateLink = $modx->newObject(modTemplateVarTemplate::class); + $templateLink->fromArray($criteria + ['rank' => 0], '', true, true); + $templateLink->save(); + } +} +$translationGroups = [$languageHomes]; +foreach (['privacy', 'consent', 'lettersail'] as $documentAlias) { + $group = []; + foreach (['ru', 'en', 'pl'] as $languageKey) { + $languageDocument = $modx->getObject(modResource::class, ['context_key' => $languageKey, 'parent' => 0, 'alias' => $documentAlias]); + if ($languageDocument) { + $group[$languageKey] = (int) $languageDocument->get('id'); + } + } + $translationGroups[] = $group; +} +foreach ($translationGroups as $group) { + $links = implode(';', array_map(static fn(string $context, int $id): string => $context . ':' . $id, array_keys($group), $group)); + foreach ($group as $resourceId) { + $linked = $modx->getObject(modResource::class, $resourceId); + if ($linked) { + $linked->setTVValue('babelLanguageLinks', $links); + } + } +} +$xmlType = $modx->getObject(modContentType::class, ['mime_type' => 'text/xml']) ?? $modx->getObject(modContentType::class, ['mime_type' => 'application/xml']); +if (!$xmlType) { + fail('Нет типа содержимого XML'); +} +$sitemap = $modx->getObject(modResource::class, ['context_key' => 'en', 'parent' => 0, 'alias' => 'sitemap']) ?? $modx->newObject(modDocument::class); +$sitemap->fromArray([ + 'context_key' => 'en', + 'parent' => 0, + 'pagetitle' => 'sitemap', + 'alias' => 'sitemap', + 'uri' => 'sitemap.xml', + 'uri_override' => true, + 'content_type' => $xmlType->get('id'), + 'content' => '[[!pdoSitemap? &context=`en,pl,ru` &showHidden=`1` &tpl=`ls.sitemap.url` &tplWrapper=`ls.sitemap.wrap`]]', + 'isfolder' => false, + 'published' => true, + 'hidemenu' => true, + 'searchable' => false, + 'cacheable' => false, + 'richtext' => false, + 'template' => 0, + 'menuindex' => 40, +]); +$sitemap->save(); +say('Служебная страница: sitemap.xml'); + +$obsolete = $modx->getObject(modSnippet::class, ['name' => 'lsArt']); +if ($obsolete) { + $obsolete->remove(); +} + +renameContext($modx, 'web', 'Системный (не используется)'); +renameContext($modx, DATA_CONTEXT, 'Заявки'); +$modx->cacheManager->refresh(); +$modx->invokeEvent('OnSiteRefresh'); +say('Готово');