Przejdź do treści
<code>pen.pl

NOON — kawa i rytuał parzenia

Landing page

Podgląd

Ładowanie podglądu…

Ciepły projekt produktowy z wyborem profilu kawy i metody parzenia.

0,0 / 5 Brak ocen

Kod źródłowy

Licencja MIT — także do użytku komercyjnego. Zachowaj informacje o autorze i licencji.

HTML
<header id="top"><a class="brand" href="#top">noon.</a><nav aria-label="Nawigacja"><a href="#kolekcja">Nasze kawy</a><a href="#o-nas">Rytuał</a></nav></header><main><section class="coffee-hero"><div class="coffee-intro" data-reveal><p class="eyebrow">Dobra pora na przerwę</p><h1>Najpierw<br>kawa.</h1><p>Otwórz paczkę. Zmiel ziarna. Przez chwilę nie rób niczego innego.</p><a href="#kolekcja" class="button">Znajdź swój profil</a></div><div class="coffee-display"><div class="coffee-bag" data-coffee="0"><svg viewBox="0 0 400 440" role="img" aria-label="Opakowanie kawy Noon" xmlns="http://www.w3.org/2000/svg"><rect width="400" height="440" fill="#edcfa9"></rect><ellipse cx="210" cy="397" rx="117" ry="18" fill="#3b2615" opacity=".12"></ellipse><path d="M108 80H286L312 386H87Z" fill="#7a3729"></path><path d="M108 80l18-30h145l15 30Z" fill="#ac8968"></path><path d="M108 80h178M102 98h188" stroke="#2d211b" stroke-width="3"></path><rect x="113" y="141" width="168" height="172" fill="#f4e4cc"></rect><text x="130" y="193" fill="#7a3729" font-family="Georgia" font-size="47">noon.</text><circle cx="197" cy="238" r="25" fill="#7a3729"></circle><path d="M184 248q30-15 25-31" stroke="#f4e4cc" stroke-width="3" fill="none"></path><text x="136" y="287" fill="#7a3729" font-family="monospace" font-size="12">DAILY / CHOCOLATE</text><text x="176" y="357" fill="#f4e4cc" font-family="monospace" font-size="14">250 g</text></svg></div><div class="coffee-bag" data-coffee="1" hidden><svg viewBox="0 0 400 440" role="img" aria-label="Opakowanie kawy Noon" xmlns="http://www.w3.org/2000/svg"><rect width="400" height="440" fill="#c5d6b9"></rect><ellipse cx="210" cy="397" rx="117" ry="18" fill="#3b2615" opacity=".12"></ellipse><path d="M108 80H286L312 386H87Z" fill="#345447"></path><path d="M108 80l18-30h145l15 30Z" fill="#ac8968"></path><path d="M108 80h178M102 98h188" stroke="#2d211b" stroke-width="3"></path><rect x="113" y="141" width="168" height="172" fill="#f4e4cc"></rect><text x="130" y="193" fill="#345447" font-family="Georgia" font-size="47">noon.</text><circle cx="197" cy="238" r="25" fill="#345447"></circle><path d="M184 248q30-15 25-31" stroke="#f4e4cc" stroke-width="3" fill="none"></path><text x="136" y="287" fill="#345447" font-family="monospace" font-size="12">GARDEN / FLORAL</text><text x="176" y="357" fill="#f4e4cc" font-family="monospace" font-size="14">250 g</text></svg></div><div class="coffee-bag" data-coffee="2" hidden><svg viewBox="0 0 400 440" role="img" aria-label="Opakowanie kawy Noon" xmlns="http://www.w3.org/2000/svg"><rect width="400" height="440" fill="#d1c3db"></rect><ellipse cx="210" cy="397" rx="117" ry="18" fill="#3b2615" opacity=".12"></ellipse><path d="M108 80H286L312 386H87Z" fill="#494166"></path><path d="M108 80l18-30h145l15 30Z" fill="#ac8968"></path><path d="M108 80h178M102 98h188" stroke="#2d211b" stroke-width="3"></path><rect x="113" y="141" width="168" height="172" fill="#f4e4cc"></rect><text x="130" y="193" fill="#494166" font-family="Georgia" font-size="47">noon.</text><circle cx="197" cy="238" r="25" fill="#494166"></circle><path d="M184 248q30-15 25-31" stroke="#f4e4cc" stroke-width="3" fill="none"></path><text x="136" y="287" fill="#494166" font-family="monospace" font-size="12">NIGHT / BERRIES</text><text x="176" y="357" fill="#f4e4cc" font-family="monospace" font-size="14">250 g</text></svg></div><div class="coffee-label"><span>Paleta smaków</span><strong id="coffee-note">Czekolada / orzech</strong></div></div></section><section class="section" id="kolekcja"><h2>Co lubisz w filiżance?</h2><div class="coffee-choices" role="group" aria-label="Profil kawy"><button type="button" data-flavour="0" aria-pressed="true"><b>Daily</b><span>Czekolada / orzech</span></button><button type="button" data-flavour="1" aria-pressed="false"><b>Garden</b><span>Kwiaty / cytrusy</span></button><button type="button" data-flavour="2" aria-pressed="false"><b>Night</b><span>Jagody / kakao</span></button></div><p id="selection-status" role="status">Wybrano: Daily</p></section><section class="section split" id="o-nas"><h2>Twój mały<br>rytuał.</h2><div><div class="brew-tabs" role="group" aria-label="Sposób parzenia"><button type="button" data-brew="Drip" aria-pressed="true">Drip</button><button type="button" data-brew="French press" aria-pressed="false">French press</button></div><p id="brew-description" role="status">Zwilż filtr, wsyp zmieloną kawę i wlewaj wodę małymi porcjami. Obserwuj czas oraz smak i dopasuj kolejne parzenie.</p><button class="button" type="button" data-open="O smaku" data-description="Opis profilu to wskazówka do własnych poszukiwań. Smak zmienia się wraz z wodą, mieleniem i sposobem parzenia.">Jak czytać profil?</button></div></section></main><footer><span>noon. / kolekcja koncepcyjna</span><a href="#top">Na górę</a></footer><dialog aria-labelledby="dialog-title" aria-describedby="dialog-description"><h2 id="dialog-title">Szczegóły</h2><p id="dialog-description"></p><form method="dialog"><button class="button" type="submit">Zamknij</button></form></dialog>
CSS
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.5 Arial,Helvetica,sans-serif}button,input,select{font:inherit;border-radius:0}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a{color:inherit;text-underline-offset:5px}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid var(--focus,var(--ink));outline-offset:5px}button:disabled{cursor:default;opacity:.5}h1,h2,h3,p,figure{margin:0}h1,h2{line-height:1;letter-spacing:-.055em}h1{font-size:clamp(54px,8vw,120px)}h2{font-size:clamp(34px,5vw,70px)}h3{font-size:22px;line-height:1.15}p{max-width:60ch}svg{display:block;width:100%;height:auto}header{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:22px 4vw;border-bottom:1px solid var(--line)}.brand{font-size:24px;font-weight:800;text-decoration:none;letter-spacing:-1px}nav{display:flex;gap:24px;flex-wrap:wrap}nav a{min-height:44px;display:inline-flex;align-items:center;text-decoration:none;font-size:14px}nav a:hover{text-decoration:underline}.eyebrow{font:12px/1.4 monospace;letter-spacing:.08em;text-transform:uppercase}.button{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:11px 22px;border:1px solid var(--ink);background:var(--ink);color:var(--paper);text-decoration:none}.button:hover{background:var(--paper);color:var(--ink)}.outline{background:transparent;color:var(--ink)}.section{padding:70px 4vw;border-top:1px solid var(--line)}.section>p{margin:22px 0}.section-head{display:flex;justify-content:space-between;align-items:end;gap:30px;margin-bottom:32px}.section-head p{max-width:36ch}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.arrow{width:48px;height:48px;background:transparent;border:1px solid var(--ink);color:var(--ink);font-size:24px}.arrow:hover{background:var(--ink);color:var(--paper)}.muted{color:var(--muted)}.status{font-size:14px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}footer{display:flex;justify-content:space-between;gap:20px;padding:28px 4vw;border-top:1px solid var(--line);font-size:13px}dialog{padding:32px;border:1px solid var(--ink);max-width:540px;width:calc(100% - 40px);background:var(--paper);color:var(--ink)}dialog::backdrop{background:#1119}dialog h2{font-size:36px;letter-spacing:-.03em}dialog p{margin:24px 0}dialog form{display:flex;justify-content:end}[hidden]{display:none!important}.split{display:grid;grid-template-columns:1fr 1fr;gap:40px}.list{list-style:none;padding:0;margin:0}.list li{padding:22px 0;border-bottom:1px solid var(--line)}.list li b{display:block;font-size:20px}.list li span{color:var(--muted)}@media(max-width:640px){header{padding:14px 5vw;gap:10px;flex-wrap:wrap}nav{gap:18px}.brand{font-size:21px}h1{font-size:clamp(46px,13vw,80px)}.section{padding:44px 5vw}.section-head{align-items:start;flex-direction:column;gap:16px}.split{grid-template-columns:1fr}.button{padding:10px 16px}.section-head h2{font-size:42px}footer{flex-wrap:wrap}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}
body{--paper:#f2e1c8;--ink:#4e2a22;--line:#c9ac8e;--muted:#795345}.brand{font:italic 38px Georgia}.coffee-hero{display:grid;grid-template-columns:1fr 1fr;min-height:590px}.coffee-intro{padding:70px 6vw;align-self:center}.coffee-intro h1{font-family:Georgia,serif;font-weight:400;font-size:clamp(65px,8.8vw,130px);margin:16px 0 28px}.coffee-intro p:last-of-type{max-width:29ch;margin-bottom:28px}.coffee-display{overflow:hidden;position:relative;background:#edcfa9;padding:25px}.coffee-bag svg{max-height:530px;transform:rotate(7deg);transition:transform .5s}.coffee-display:hover svg{transform:rotate(0)}.coffee-label{position:absolute;bottom:28px;left:30px;display:grid;gap:5px;padding:13px 20px;background:#f2e1c8;border:1px solid #4e2a22}.coffee-label span{font:11px monospace;text-transform:uppercase}.coffee-choices{display:flex;margin:40px 0 20px;border-block:1px solid var(--ink)}.coffee-choices button{flex:1;padding:28px 20px;background:transparent;color:var(--ink);text-align:left;border:0;border-right:1px solid var(--line)}.coffee-choices b{display:block;font:38px Georgia}.coffee-choices span{display:block;margin-top:12px;font-size:14px}.coffee-choices button[aria-pressed=true]{background:#4e2a22;color:#f2e1c8}.brew-tabs{display:flex;gap:10px}.brew-tabs button{background:transparent;border:1px solid var(--ink);padding:10px 16px;min-height:44px;color:var(--ink)}.brew-tabs button[aria-pressed=true]{background:var(--ink);color:var(--paper)}#brew-description{margin:25px 0}@media(max-width:640px){.coffee-hero{grid-template-columns:1fr}.coffee-intro{padding:36px 5vw}.coffee-display{height:420px}.coffee-bag svg{height:350px}.coffee-label{bottom:15px}.coffee-choices{flex-direction:column}.coffee-choices button{border-right:0;border-bottom:1px solid var(--line);padding:20px}.coffee-choices b{font-size:32px}}
JavaScript
const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches;
const dialog = document.querySelector('dialog');
$('[data-open]').on('click', function () {
  $('#dialog-title').text($(this).attr('data-open'));
  $('#dialog-description').text($(this).attr('data-description'));
  dialog.showModal();
});
if (!reduced) document.querySelectorAll('[data-reveal]').forEach((el, i) => el.animate([{opacity:0,transform:'translateY(24px)'},{opacity:1,transform:'translateY(0)'}],{duration:650,delay:i*70,easing:'cubic-bezier(.2,.7,.2,1)'}));

const coffees=['Daily','Garden','Night'],notes=['Czekolada / orzech','Kwiaty / cytrusy','Jagody / kakao'];$('[data-flavour]').on('click',function(){let i=Number(this.dataset.flavour);$('[data-flavour]').attr('aria-pressed','false');$(this).attr('aria-pressed','true');$('[data-coffee]').prop('hidden',true).filter(`[data-coffee="${i}"]`).prop('hidden',false);$('#coffee-note').text(notes[i]);$('#selection-status').text('Wybrano: '+coffees[i]);});$('[data-brew]').on('click',function(){$('[data-brew]').attr('aria-pressed','false');$(this).attr('aria-pressed','true');$('#brew-description').text(this.dataset.brew==='Drip'?'Zwilż filtr, wsyp zmieloną kawę i wlewaj wodę małymi porcjami. Obserwuj czas oraz smak i dopasuj kolejne parzenie.':'Wsyp grubiej zmieloną kawę, zalej wodą i odczekaj. Powoli opuść tłok, a napar przelej do filiżanki. Dopasuj ilość kawy do własnego smaku.');});
Biblioteki

JavaScript

Edytuj swój pen

Podaj adres e-mail użyty przy zapisie. Wyślemy link do edycji.

Link jest ważny przez 30 minut.