Replace landing preview with the real mini app
This commit is contained in:
1 parent
96604dd08f
commit
d2bbb1dade
4 files changed
+21
-92
No files matched your search
+11
-28
@@ -2,22 +2,14 @@
|
||||
|
||||
.botanical { width: 83%; max-width: 390px; justify-self: end; }
|
||||
.botanical figcaption { margin: -35px 15px 0 0; }
|
||||
.practice-preview { display: grid; grid-template-columns: 180px 1fr 160px; min-height: 390px; border: 1px solid #ccd1c3; border-radius: 6px; background: #eeeee5; box-shadow: 0 12px 28px #34492e0a; padding: 22px; }
|
||||
.preview-sidebar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-right: 20px; }
|
||||
.preview-brand { display: flex; align-items: center; gap: 8px; margin: 6px 0 15px; font: 400 19px var(--serif); }
|
||||
.preview-sidebar > a { padding: 10px 15px; color: var(--ink); text-decoration: none; border-radius: 4px; font-size: 12px; }
|
||||
.preview-sidebar > a:hover, .preview-sidebar > a.selected { background: #dbe3d3; }
|
||||
.breath-scene { padding: 28px 15px; border-radius: 5px; background: #faf9f3; text-align: center; }
|
||||
.breath-scene .eyebrow { font-size: 8px; letter-spacing: .13em; }
|
||||
.breath-scene h2 { font-size: 29px; margin-top: 13px; }
|
||||
.breath-label { min-height: 24px; margin-top: 10px; color: var(--muted); font-size: 12px; }
|
||||
.breathing-rings { width: 166px; height: 166px; margin: 22px auto; transition: transform 4s ease-in-out; transform: scale(.83); }
|
||||
.breathing-rings.inhale { transform: scale(1); }
|
||||
.breath-time { font: 400 22px var(--serif); font-variant-numeric: tabular-nums; }
|
||||
.breath-scene .button { min-height: 38px; margin-top: 15px; padding: 7px 18px; font-size: 11px; }
|
||||
.preview-aside { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 30px; padding-left: 20px; }
|
||||
.preview-aside > span { font-size: 10px; letter-spacing: .22em; line-height: 2.2; }
|
||||
.preview-aside a { text-align: center; font-size: 10px; }
|
||||
.practice-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center; gap: 60px; padding-block: 35px; border-top: 1px solid var(--line); }
|
||||
.preview-copy { max-width: 460px; }
|
||||
.preview-copy h2 { margin: 16px 0 20px; }
|
||||
.preview-description { color: var(--muted); }
|
||||
.preview-app { min-width: 0; }
|
||||
.preview-frame { height: 560px; overflow: hidden; border: 6px solid var(--sage); border-radius: 28px; background: var(--paper); }
|
||||
.preview-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
|
||||
.preview-app .small-note { text-align: center; }
|
||||
.practices { margin-top: 50px; text-align: center; }
|
||||
.practices .section-heading { margin-inline: auto; }
|
||||
.practice-symbol { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; background: #dfe6d6; border-radius: 50%; }
|
||||
@@ -49,10 +41,7 @@
|
||||
.site-header .brand { font-size: 25px; }
|
||||
.site-header .site-nav { gap: 18px; }
|
||||
.site-header .brand img { width: 32px; }
|
||||
.practice-preview { grid-template-columns: 135px 1fr 115px; padding: 16px; }
|
||||
.preview-brand { font-size: 16px; }
|
||||
.preview-brand img { display: none; }
|
||||
.preview-aside { padding-left: 13px; }
|
||||
.practice-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 30px; }
|
||||
.privacy-band { gap: 30px; }
|
||||
.migration { grid-template-columns: 32px 1fr; }
|
||||
.migration > .button { grid-column: 2; justify-self: start; }
|
||||
@@ -61,10 +50,8 @@
|
||||
.site-header .brand { margin-left: auto; }
|
||||
.site-header .site-nav { width: 100%; justify-content: center; border-top: 1px solid var(--line); padding-top: 5px; }
|
||||
.site-header { padding-bottom: 5px; }
|
||||
.practice-preview { grid-template-columns: 110px 1fr; padding: 12px; }
|
||||
.preview-sidebar { padding-right: 10px; }
|
||||
.preview-sidebar > a { padding-inline: 9px; font-size: 11px; }
|
||||
.preview-aside { display: none; }
|
||||
.practice-preview { grid-template-columns: minmax(0, 1fr); gap: 25px; }
|
||||
.preview-copy { max-width: none; }
|
||||
.download-grid { grid-template-columns: 1fr; }
|
||||
.privacy-band { grid-template-columns: 1fr; gap: 24px; }
|
||||
}
|
||||
@@ -72,10 +59,6 @@
|
||||
.botanical { width: 55% !important; max-width: 230px; margin-top: -60px !important; margin-bottom: -5px !important; }
|
||||
.hero-copy { position: relative; z-index: 1; }
|
||||
.hero .small-note { max-width: 20ch; }
|
||||
.practice-preview { grid-template-columns: 1fr; }
|
||||
.preview-sidebar { flex-direction: row; justify-content: center; padding: 0 0 10px; gap: 4px; }
|
||||
.preview-brand { display: none; }
|
||||
.breath-scene { padding-block: 24px; }
|
||||
.practices { margin-top: 35px; }
|
||||
.migration { grid-template-columns: 1fr; }
|
||||
.migration > img { display: none; }
|
||||
|
||||
+10
-10
@@ -48,16 +48,17 @@
|
||||
<figure class="hero-art botanical"><img src="/images/botanical.webp" width="1254" height="1254" alt="A delicate sage-green botanical branch, drawn in ink and watercolor" fetchpriority="high"><figcaption>A calmer you<br>lives here.</figcaption></figure>
|
||||
</section>
|
||||
<section class="practice-preview" aria-labelledby="preview-title">
|
||||
<div class="preview-sidebar"><span class="preview-brand"><img src="/assets/editorial/lotus.svg" width="26" height="22" alt="">Inner Breeze</span><a class="selected" href="#breathe-practice">Breathe</a><a href="#meditate-practice">Meditate</a><a href="#habits-practice">Habits</a></div>
|
||||
<div class="breath-scene">
|
||||
<p class="eyebrow">A gentle one-minute preview</p><h2 id="preview-title">Breathe</h2>
|
||||
<p class="breath-label" id="breath-label">Ready when you are</p>
|
||||
<div class="breathing-rings" id="breathing-rings" aria-hidden="true"></div>
|
||||
<p class="breath-time" id="breath-time" aria-label="Time remaining">01:00</p>
|
||||
<button type="button" class="button" id="preview-toggle" aria-pressed="false">Start preview</button>
|
||||
<p class="sr-only" id="preview-status" role="status"></p>
|
||||
<div class="preview-copy">
|
||||
<p class="eyebrow">A practice, right here</p>
|
||||
<h2 id="preview-title">Try Inner Breeze.</h2>
|
||||
<p class="preview-description">Choose a breathing or meditation practice and try it here. These are the same practices you will find in the full app.</p>
|
||||
<div class="actions"><a class="button button-primary" href="/build/web/index.html" target="_blank" rel="noopener">Open full app <span aria-hidden="true">↗</span></a><a class="button" href="#download">Download</a></div>
|
||||
<p class="small-note">For habits and saved history, open the full app. You can also open it directly if the mini app does not load.</p>
|
||||
</div>
|
||||
<div class="preview-app">
|
||||
<div class="preview-frame"><iframe src="/build/web/index.html?mini&theme=waozi" title="Inner Breeze: try a breathing or meditation practice" loading="lazy" allow="autoplay; clipboard-write" aria-describedby="preview-session-note"></iframe></div>
|
||||
<p class="small-note" id="preview-session-note">Your mini session is not saved.</p>
|
||||
</div>
|
||||
<div class="preview-aside"><span>Breathe<br>slower.<br>Be here<br>& now.</span><a class="text-link" href="/build/web/index.html">Find your practice →</a></div>
|
||||
</section>
|
||||
<section class="practices section" id="practices" aria-labelledby="practices-title">
|
||||
<div class="section-heading"><p class="eyebrow">Whatever you need today</p><h2 id="practices-title">Three ways to practice.</h2></div>
|
||||
@@ -154,6 +155,5 @@
|
||||
<nav class="footer-links" aria-label="More information"><a href="https://waozi.xyz">Made by Waozi</a><a href="https://github.com/waozixyz/inbe">Source</a><a href="/privacy.html">Privacy</a><a href="/legacy-converter/">Legacy converter</a><a href="/delete-account">Delete sync account</a><a href="#safety">Practice safely</a><a href="https://pass.waozi.xyz">Discover Pass ↗</a></nav>
|
||||
<div class="footer-bottom"><span>© Waozi</span><span>Version ${version} · Made with care.</span></div>
|
||||
</footer>
|
||||
<script src="/preview.js?v=${asset_version}" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -115,8 +115,6 @@ img { display: block; max-width: 100%; height: auto; }
|
||||
.pass-mark { position: relative; display: inline-block; flex: 0 0 auto; width: 23px; height: 25px; margin: 10px 5px 0; border-radius: 3px; background: var(--rust); }
|
||||
.pass-mark::before { content: ''; position: absolute; width: 13px; height: 15px; left: 5px; top: -11px; border: 2px solid var(--rust); border-bottom: 0; border-radius: 9px 9px 0 0; }
|
||||
.pass-mark::after { content: ''; position: absolute; left: 10px; top: 8px; width: 4px; height: 9px; border-radius: 6px; background: var(--paper); }
|
||||
.breathing-rings { display: grid; place-items: center; width: 170px; height: 170px; margin: 20px auto; border-radius: 50%; background: #e2e7d9; }
|
||||
.breathing-rings::before { content: ''; width: 72%; height: 72%; border-radius: 50%; border: 17px solid #d4dfca; background: #adc5a6; box-shadow: inset 0 0 0 13px #c1d3b8; }
|
||||
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
||||
[hidden] { display: none !important; }
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
(() => {
|
||||
const button = document.getElementById('preview-toggle');
|
||||
const label = document.getElementById('breath-label');
|
||||
const timer = document.getElementById('breath-time');
|
||||
const rings = document.getElementById('breathing-rings');
|
||||
const status = document.getElementById('preview-status');
|
||||
let elapsed = 0;
|
||||
let startedAt = 0;
|
||||
let interval = null;
|
||||
|
||||
function render() {
|
||||
const seconds = Math.min(60, elapsed + (interval ? (Date.now() - startedAt) / 1000 : 0));
|
||||
const remaining = Math.ceil(60 - seconds);
|
||||
timer.textContent = '0' + Math.floor(remaining / 60) + ':' + String(remaining % 60).padStart(2, '0');
|
||||
const inhale = Math.floor(seconds / 4) % 2 === 0;
|
||||
label.textContent = inhale ? 'Breathe in' : 'Breathe out';
|
||||
rings.classList.toggle('inhale', inhale);
|
||||
if (seconds >= 60) {
|
||||
clearInterval(interval);
|
||||
interval = null;
|
||||
elapsed = 0;
|
||||
rings.classList.remove('inhale');
|
||||
label.textContent = 'A little more room. Just for you.';
|
||||
button.textContent = 'Try again';
|
||||
button.setAttribute('aria-pressed', 'false');
|
||||
status.textContent = 'Your one-minute preview is complete.';
|
||||
}
|
||||
}
|
||||
|
||||
button.addEventListener('click', () => {
|
||||
if (interval) {
|
||||
elapsed += (Date.now() - startedAt) / 1000;
|
||||
clearInterval(interval);
|
||||
interval = null;
|
||||
button.textContent = 'Continue preview';
|
||||
button.setAttribute('aria-pressed', 'false');
|
||||
label.textContent = 'Take your time';
|
||||
status.textContent = 'Preview paused.';
|
||||
} else {
|
||||
startedAt = Date.now();
|
||||
interval = setInterval(render, 250);
|
||||
button.textContent = 'Pause preview';
|
||||
button.setAttribute('aria-pressed', 'true');
|
||||
status.textContent = 'Preview started. Breathe at a comfortable pace.';
|
||||
render();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
if (document.hidden && interval) button.click();
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user