Ticket met afscheurstrook New
Event ticket with cut-out notches and a perforated edge; the button tears off the stub with the barcode and announces via aria-live what to show at the entrance. For order confirmations and the ticket page of a theatre, festival or workshop. Notches via CSS mask, no images; no animation with reduced motion.
Jazz op het Vrijthof
Maastricht · za 14 november, 20:00
Staanplaats€ 27,50
Ingang B
482 107
How to use it
- Paste the HTML where the components should appear.
- Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
- Add the JavaScript and call init() with the element that contains the HTML.
<!-- Ticket met afscheurstrook · NedDev · eigen werk. -->
<div class="jouw-container">
<div class="tka">
<div class="tka__ticket">
<div class="tka__main">
<h3 class="tka__t">Jazz op het Vrijthof</h3>
<p class="tka__w">Maastricht · za 14 november, 20:00</p>
<p class="tka__d"><span>Staanplaats</span><strong>€ 27,50</strong></p>
</div>
<div class="tka__stub">
<svg class="tka__bar" viewBox="0 0 49 30" preserveAspectRatio="none" aria-hidden="true"><rect x="0" y="0" width="2" height="30"/><rect x="3" y="0" width="1" height="30"/><rect x="7" y="0" width="1" height="30"/><rect x="10" y="0" width="2" height="30"/><rect x="13" y="0" width="1" height="30"/><rect x="15" y="0" width="3" height="30"/><rect x="20" y="0" width="1" height="30"/><rect x="22" y="0" width="2" height="30"/><rect x="27" y="0" width="1" height="30"/><rect x="30" y="0" width="1" height="30"/><rect x="32" y="0" width="3" height="30"/><rect x="36" y="0" width="1" height="30"/><rect x="39" y="0" width="2" height="30"/><rect x="42" y="0" width="1" height="30"/><rect x="46" y="0" width="1" height="30"/></svg>
<p class="tka__code">Ingang B<br><span>482 107</span></p>
</div>
</div>
<div class="tka__row"><button class="tka__btn" type="button" aria-pressed="false">Scheur strook af</button><p class="tka__st" aria-live="polite"></p></div>
</div>
</div>/* Ticket met afscheurstrook · NedDev · eigen werk. */
.tka{position:absolute;inset:0;container-type:size;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:12px;font-family:'Switzer',system-ui,sans-serif;color:#0a0a0a;background:#f4f3f1;text-align:left}
.tka *{box-sizing:border-box}
.tka__ticket{display:flex;width:min(100%,360px);height:124px;filter:drop-shadow(0 6px 14px rgba(10,10,10,.13))}
.tka__main{flex:1;min-width:0;padding:13px 14px;background:#fff;border-radius:8px 0 0 8px;display:flex;flex-direction:column;-webkit-mask:radial-gradient(circle 9px at 100% 0,#0000 97%,#000) top/100% 51% no-repeat,radial-gradient(circle 9px at 100% 100%,#0000 97%,#000) bottom/100% 51% no-repeat;mask:radial-gradient(circle 9px at 100% 0,#0000 97%,#000) top/100% 51% no-repeat,radial-gradient(circle 9px at 100% 100%,#0000 97%,#000) bottom/100% 51% no-repeat}
.tka__t{margin:0;font-size:17px;line-height:1.15;font-weight:700;letter-spacing:-.015em}
.tka__w{margin:5px 0 0;font-size:12.5px;line-height:1.35;color:#4a4a4a}
.tka__d{margin:auto 0 0;display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:12.5px;padding-top:8px;border-top:1px solid rgba(10,10,10,.12)}
.tka__d strong{font-size:15px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.tka__d span{min-width:0}
.tka__stub{position:relative;width:96px;flex:none;padding:14px 12px 12px 14px;background:#0a0a0a;color:#fff;border-radius:0 8px 8px 0;display:flex;flex-direction:column;justify-content:space-between;transform-origin:0 100%;transition:transform .55s cubic-bezier(.3,1.3,.5,1);-webkit-mask:radial-gradient(circle 9px at 0 0,#0000 97%,#000) top/100% 51% no-repeat,radial-gradient(circle 9px at 0 100%,#0000 97%,#000) bottom/100% 51% no-repeat;mask:radial-gradient(circle 9px at 0 0,#0000 97%,#000) top/100% 51% no-repeat,radial-gradient(circle 9px at 0 100%,#0000 97%,#000) bottom/100% 51% no-repeat}
.tka__stub::before{content:'';position:absolute;left:0;top:12px;bottom:12px;width:2px;background:radial-gradient(circle 1.4px,#f4f3f1 95%,#0000) 0 0/2px 7px repeat-y}
.tka__bar{width:100%;height:34px;fill:#fff}
.tka__code{margin:0;font-size:12px;line-height:1.3;font-weight:600}
.tka__code span{white-space:nowrap;font-weight:400;color:#cfccc6;font-variant-numeric:tabular-nums}
.tka.is-los .tka__stub{transform:translate(16px,8px) rotate(9deg)}
.tka__row{display:flex;align-items:center;gap:12px;width:min(100%,360px);min-height:36px}
.tka__btn{flex:none;min-height:36px;padding:0 14px;border:1px solid #0a0a0a;border-radius:4px;background:#0a0a0a;color:#fff;font:600 13px/1 'Switzer',system-ui,sans-serif;cursor:pointer;transition:background-color .15s,color .15s}
.tka__btn:hover{background:#F5480F;border-color:#F5480F;color:#0a0a0a}
.tka__btn:focus-visible{outline:2px solid #F5480F;outline-offset:2px}
.tka__st{margin:0;font-size:12px;line-height:1.3;color:#3a3a3a}
@container (max-width:380px){.tka__stub{width:80px;padding:12px 10px 10px 12px}.tka__main{padding:11px 12px}.tka__t{font-size:16px}.tka__ticket{height:122px}}
@media (prefers-reduced-motion:reduce){.tka__stub{transition:none}}// Ticket met afscheurstrook · NedDev · eigen werk.
// root = het element waarin de HTML staat
function init(root){
var w = root.querySelector('.tka'), b = w.querySelector('.tka__btn'), st = w.querySelector('.tka__st');
b.addEventListener('click', function () {
var los = !w.classList.contains('is-los');
w.classList.toggle('is-los', los);
b.setAttribute('aria-pressed', String(los));
b.textContent = los ? 'Zet strook terug' : 'Scheur strook af';
st.textContent = los ? 'Strook bewaard. Laat de code zien bij ingang B.' : '';
});
}
init(document.querySelector('.jouw-container'));
More components
Seen something you like?
Add it to your selection and send it over. We build your site around it, in your brand.
Get in touch →