Gratis
Demo
Vinylo Demo
A demo block extracted from the Vinylo template, available in Tailwind CSS.
0
23
A demo block extracted from the Vinylo template, available in Tailwind CSS.
Descarga gratis · hasta 5 bloques al día. Ilimitado con All-Access
<!DOCTYPE html>
<html lang="en">
<head>
<script>
window.FontAwesomeConfig = { autoReplaceSvg: 'nest' };
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vinylo Demo | Tailwind CSS UI Block</title>
<meta name="description" content="A demo block extracted from the Vinylo template, available in Tailwind CSS.">
<meta name="keywords" content="Vinylo, Tailwind CSS template, HTML website template, ecommerce template, toy shop website, collectible toys store, designer toys, online shop template, product page, shopping cart">
<meta name="author" content="Let's templates">
<link rel="canonical" href="">
<meta property="og:type" content="product">
<meta property="og:site_name" content="Let's templates">
<meta property="og:locale" content="en_US">
<meta property="og:url" content="">
<meta property="og:title" content="Vinylo | Tailwind CSS Ecommerce Template">
<meta property="og:description" content="A playful Tailwind CSS ecommerce template for collectible toy shops, with a size scale viewer, a filterable catalogue and a working cart.">
<meta property="og:image" content="">
<meta property="og:image:alt" content="Vinylo template preview">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="">
<meta name="twitter:title" content="Vinylo | Tailwind CSS Ecommerce Template">
<meta name="twitter:description" content="A playful Tailwind CSS ecommerce template for collectible toy shops, with a size scale viewer, a filterable catalogue and a working cart.">
<meta name="twitter:image" content="">
<meta name="twitter:image:alt" content="Vinylo template preview">
<script src="https://cdn.tailwindcss.com/3.4.17"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@600&family=Outfit:wght@300;400;500;600&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
colors: { ink: '#0d0d0d', paper: '#f4f2ee', blush: '#f6dde2', mint: '#dcece4', lime: '#d8e64b', cobalt: '#2147a6', grape: '#9b5bc0' },
fontFamily: { sans: ['Outfit', 'sans-serif'], hand: ['Caveat', 'cursive'] }
}
}
}
</script>
<style>
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms ease-out both page-fade-out; }
::view-transition-new(root) { animation: 220ms ease-in both page-fade-in; }
@keyframes page-fade-out { to { opacity: 0; } }
@keyframes page-fade-in { from { opacity: 0; } }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
.glow { background: radial-gradient(60% 50% at 30% 0%, #f6dde2 0%, transparent 70%), radial-gradient(50% 60% at 70% 70%, #dcece4 0%, transparent 70%), #f4f2ee; }
.maze { background-color: #0d0d0d; background-image: repeating-radial-gradient(circle at 30% 40%, transparent 0 6px, #f4f2ee 6px 8px), repeating-radial-gradient(circle at 70% 70%, transparent 0 7px, #f4f2ee 7px 9px); background-blend-mode: difference; }
.slide-fig { transition: opacity .6s ease, transform .6s ease; }
.slide-fig:not(.is-active) { opacity: 0; transform: translateY(16px) scale(.97); }
.float-a { animation: float 7s ease-in-out infinite; }
.float-b { animation: float 9s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translateY(-10px) rotate(var(--r, 0deg)); } }
.scale-fig { transition: height .6s cubic-bezier(.2,.8,.2,1); }
.reveal-ready [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--reveal-delay, 0ms); }
.reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
.float-a, .float-b { animation: none; }
.slide-fig, .scale-fig { transition: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
</style>
</head>
<body class="bg-paper font-sans text-ink antialiased">
<!-- block:start demo -->
<section id="scale" class="bg-ink text-paper" data-scale-viewer>
<div class="mx-auto grid max-w-7xl items-center gap-12 px-5 py-20 md:px-10 md:py-28 lg:grid-cols-[1fr_1.3fr]">
<div>
<p class="font-hand text-3xl text-lime">size guide</p>
<h2 class="mt-2 text-5xl font-medium leading-none md:text-6xl">How big is big?</h2>
<p class="mt-6 max-w-md text-paper/70">Most of our figures come in three editions. Pick one to see it next to a hand and an average adult.</p>
<div class="mt-10 grid grid-cols-3 border border-paper/30" role="radiogroup" aria-label="Edition size">
<button type="button" role="radio" aria-checked="false" data-scale="0" class="border-paper/30 px-3 py-4 text-left transition hover:bg-paper/10 aria-checked:bg-lime aria-checked:text-ink ">
<span class="block text-2xl font-medium">100%</span>
<span class="block text-sm opacity-70">7 cm</span>
</button>
<button type="button" role="radio" aria-checked="true" data-scale="1" class="border-paper/30 px-3 py-4 text-left transition hover:bg-paper/10 aria-checked:bg-lime aria-checked:text-ink border-l">
<span class="block text-2xl font-medium">400%</span>
<span class="block text-sm opacity-70">28 cm</span>
</button>
<button type="button" role="radio" aria-checked="false" data-scale="2" class="border-paper/30 px-3 py-4 text-left transition hover:bg-paper/10 aria-checked:bg-lime aria-checked:text-ink border-l">
<span class="block text-2xl font-medium">1000%</span>
<span class="block text-sm opacity-70">70 cm</span>
</button>
</div>
<p class="mt-6 text-lg" aria-live="polite"><span data-scale-height>28 cm</span> · <span data-scale-note>Shelf star</span></p>
</div>
<div class="relative flex h-[26rem] items-end justify-center gap-10 border-b border-paper/30 md:h-[30rem]">
<svg class="h-[92%] w-auto text-paper/15" viewBox="0 0 60 170" aria-hidden="true"><circle cx="30" cy="14" r="12" fill="currentColor"/><path d="M14 32h32l6 60h-10l-2 76h-10l-1-60-1 60H18l-2-76H6z" fill="currentColor"/></svg>
<svg class="mb-0 h-[16%] w-auto text-paper/25" viewBox="0 0 60 80" aria-hidden="true"><path d="M8 78V40c0-6 8-6 8 0v-26c0-6 8-6 8 0v-8c0-6 8-6 8 0v10c0-6 8-6 8 0v10c0-6 8-6 8 0v30c0 14-10 22-22 22z" fill="currentColor"/></svg>
<img src="https://images.unsplash.com/photo-1546776310-eef45dd6d63c?auto=format&fit=crop&w=700&q=80" alt="Tin Robot No. 7 shown at the selected size" data-scale-figure class="scale-fig w-auto rounded-xl object-contain" style="height: 46%" loading="lazy">
<span data-scale-value="0" data-height="7 cm" data-note="Fits in your palm" data-percent="18" hidden></span><span data-scale-value="1" data-height="28 cm" data-note="Shelf star" data-percent="46" hidden></span><span data-scale-value="2" data-height="70 cm" data-note="Living room statement" data-percent="92" hidden></span>
<p class="absolute -bottom-8 left-0 text-xs text-paper/50">Silhouettes to scale: adult 170 cm, hand 19 cm.</p>
</div>
</div>
</section>
<!-- block:end demo -->
<script>
document.querySelectorAll('[data-menu-toggle]').forEach((button) => {
const menu = document.getElementById(button.getAttribute('aria-controls'));
if (!menu) return;
button.addEventListener('click', () => {
const open = button.getAttribute('aria-expanded') === 'true';
button.setAttribute('aria-expanded', String(!open));
menu.classList.toggle('hidden', open);
});
});
document.querySelectorAll('[data-hero-slider]').forEach((hero) => {
const slides = [...hero.querySelectorAll('[data-hero-slide]')];
const dots = [...hero.querySelectorAll('[data-hero-dot]')];
let current = 0;
let timer;
const show = (index) => {
current = (index + slides.length) % slides.length;
slides.forEach((slide, i) => { slide.classList.toggle('is-active', i === current); slide.toggleAttribute('aria-hidden', i !== current); });
dots.forEach((dot, i) => dot.setAttribute('aria-pressed', String(i === current)));
};
const restart = () => { clearInterval(timer); if (!matchMedia('(prefers-reduced-motion: reduce)').matches) timer = setInterval(() => show(current + 1), 5000); };
dots.forEach((dot, i) => dot.addEventListener('click', () => { show(i); restart(); }));
restart();
});
document.querySelectorAll('[data-scale-viewer]').forEach((viewer) => {
const figure = viewer.querySelector('[data-scale-figure]');
viewer.querySelectorAll('[data-scale]').forEach((button) => {
button.addEventListener('click', () => {
const data = viewer.querySelector(`[data-scale-value="${button.dataset.scale}"]`);
viewer.querySelectorAll('[data-scale]').forEach((other) => other.setAttribute('aria-checked', String(other === button)));
figure.style.height = `${data.dataset.percent}%`;
viewer.querySelector('[data-scale-height]').textContent = data.dataset.height;
viewer.querySelector('[data-scale-note]').textContent = data.dataset.note;
});
});
});
document.querySelectorAll('[data-filter-group]').forEach((group) => {
const items = document.querySelectorAll(group.dataset.filterGroup);
group.querySelectorAll('[data-filter]').forEach((chip) => {
chip.addEventListener('click', () => {
group.querySelectorAll('[data-filter]').forEach((other) => other.setAttribute('aria-pressed', String(other === chip)));
items.forEach((item) => { item.hidden = chip.dataset.filter !== 'all' && item.dataset.category !== chip.dataset.filter; });
});
});
});
const cartCount = () => document.querySelectorAll('[data-cart-count]');
document.querySelectorAll('[data-add-to-cart]').forEach((button) => {
button.addEventListener('click', () => {
cartCount().forEach((badge) => { badge.textContent = Number(badge.textContent) + 1; });
const label = button.textContent;
button.textContent = 'added ✓';
setTimeout(() => { button.textContent = label; }, 1400);
});
});
document.querySelectorAll('[data-switcher]').forEach((root) => {
root.addEventListener('click', (event) => {
const button = event.target.closest('[data-switch]');
if (!button) return;
root.querySelectorAll('[data-switch]').forEach((other) => other.setAttribute('aria-selected', String(other === button)));
root.querySelectorAll('[data-switch-panel]').forEach((panel) => { panel.hidden = panel.dataset.switchPanel !== button.dataset.switch; });
});
});
document.querySelectorAll('[data-review-filter]').forEach((root) => {
const items = [...root.querySelectorAll('[data-stars]')];
const count = root.querySelector('[data-review-count]');
root.querySelectorAll('[data-stars-filter]').forEach((button) => {
button.addEventListener('click', () => {
const value = button.dataset.starsFilter;
root.querySelectorAll('[data-stars-filter]').forEach((other) => other.setAttribute('aria-pressed', String(other === button && value !== 'all')));
items.forEach((item) => { item.hidden = value !== 'all' && item.dataset.stars !== value; });
count.textContent = items.filter((item) => !item.hidden).length;
});
});
});
document.querySelectorAll('[data-facets]').forEach((facets) => {
const grid = document.querySelector(facets.dataset.facets);
const count = document.querySelector('[data-facet-count]');
const price = facets.querySelector('[data-price-max]');
const priceLabel = facets.querySelector('[data-price-label]');
const apply = () => {
const types = [...facets.querySelectorAll('[name="type"]')].filter((box) => box.checked).map((box) => box.value);
const inStock = facets.querySelector('[name="stock"]')?.checked;
const max = Number(price.value);
if (priceLabel) priceLabel.textContent = `$${max}`;
let shown = 0;
grid.querySelectorAll('[data-product]').forEach((item) => {
const match = (!types.length || types.includes(item.dataset.type)) && Number(item.dataset.price) <= max && (!inStock || item.dataset.stock === 'true');
item.hidden = !match;
if (match) shown += 1;
});
count.textContent = shown;
};
facets.addEventListener('input', apply);
facets.addEventListener('change', apply);
facets.querySelector('[data-facets-reset]')?.addEventListener('click', () => { facets.reset(); setTimeout(apply); });
apply();
});
document.querySelectorAll('[data-product-page]').forEach((product) => {
const main = product.querySelector('[data-main-image]');
product.querySelectorAll('[data-thumb]').forEach((thumb) => {
thumb.addEventListener('click', () => {
main.src = thumb.dataset.thumb;
main.alt = thumb.querySelector('img').alt;
product.querySelectorAll('[data-thumb]').forEach((other) => other.setAttribute('aria-pressed', String(other === thumb)));
});
});
const priceLabel = product.querySelector('[data-product-price]');
product.addEventListener('change', (event) => {
if (event.target.name === 'size') priceLabel.textContent = event.target.dataset.price;
});
});
document.querySelectorAll('[data-qty-stepper]').forEach((stepper) => {
const input = stepper.querySelector('[data-qty-input]');
stepper.addEventListener('click', (event) => {
const button = event.target.closest('[data-qty-step]');
if (!button) return;
input.value = Math.max(Number(input.min || 0), Math.min(Number(input.max || 99), Number(input.value) + Number(button.dataset.qtyStep)));
input.dispatchEvent(new Event('input', { bubbles: true }));
});
});
document.querySelectorAll('[data-add-form]').forEach((form) => {
form.addEventListener('submit', (event) => {
event.preventDefault();
const qty = Number(form.querySelector('[data-qty-input]')?.value || 1);
cartCount().forEach((badge) => { badge.textContent = Number(badge.textContent) + qty; });
form.querySelector('[data-form-status]').textContent = `Added ${qty} to your cart.`;
});
});
document.querySelectorAll('[data-cart]').forEach((cart) => {
const money = (value) => `$${value.toFixed(2)}`;
let discount = 0;
const update = () => {
let subtotal = 0;
let pieces = 0;
cart.querySelectorAll('[data-cart-item]').forEach((item) => {
const qty = Number(item.querySelector('[data-qty-input]').value);
const line = qty * Number(item.dataset.price);
item.querySelector('[data-line-total]').textContent = money(line);
subtotal += line;
pieces += qty;
});
const shipping = subtotal === 0 || subtotal >= 150 ? 0 : 9;
const off = subtotal * discount;
cart.querySelector('[data-subtotal]').textContent = money(subtotal);
cart.querySelector('[data-shipping]').textContent = shipping ? money(shipping) : 'free';
cart.querySelector('[data-discount]').textContent = off ? `−${money(off)}` : '—';
cart.querySelector('[data-total]').textContent = money(subtotal - off + shipping);
cartCount().forEach((badge) => { badge.textContent = pieces; });
cart.querySelector('[data-cart-empty]').hidden = pieces > 0;
};
cart.addEventListener('input', update);
cart.addEventListener('click', (event) => {
const remove = event.target.closest('[data-remove]');
if (!remove) return;
remove.closest('[data-cart-item]').remove();
update();
});
cart.querySelector('[data-promo]')?.addEventListener('submit', (event) => {
event.preventDefault();
const code = String(event.target.querySelector('[name="promo"]').value || '').trim().toUpperCase();
const status = event.target.querySelector('[data-form-status]');
discount = code === 'FIRSTDROP' ? 0.1 : 0;
status.textContent = discount ? 'Code applied: 10% off.' : 'That code does not exist. Try FIRSTDROP.';
update();
});
update();
});
document.querySelectorAll('[data-orbit]').forEach((orbit) => {
const detail = orbit.querySelector('[data-orbit-detail]');
orbit.querySelectorAll('[data-orbit-step]').forEach((step) => {
step.addEventListener('click', () => {
orbit.querySelectorAll('[data-orbit-step]').forEach((other) => other.setAttribute('aria-pressed', String(other === step)));
detail.querySelector('[data-orbit-title]').textContent = step.dataset.title;
detail.querySelector('[data-orbit-text]').textContent = step.dataset.text;
});
});
});
document.querySelectorAll('[data-scrollspy]').forEach((nav) => {
const links = [...nav.querySelectorAll('a[href^="#"]')];
const sections = links.map((link) => document.querySelector(link.getAttribute('href'))).filter(Boolean);
if (!('IntersectionObserver' in window)) return;
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (!entry.isIntersecting) return;
links.forEach((link) => link.toggleAttribute('aria-current', link.getAttribute('href') === `#${entry.target.id}`));
});
}, { rootMargin: '-30% 0px -60% 0px' });
sections.forEach((section) => observer.observe(section));
});
document.querySelectorAll('[data-tabs]').forEach((tablist) => {
const tabs = [...tablist.querySelectorAll('[role="tab"]')];
const select = (tab) => tabs.forEach((other) => {
const active = other === tab;
other.setAttribute('aria-selected', String(active));
other.tabIndex = active ? 0 : -1;
document.getElementById(other.getAttribute('aria-controls')).hidden = !active;
});
tabs.forEach((tab, index) => {
tab.addEventListener('click', () => select(tab));
tab.addEventListener('keydown', (event) => {
const step = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 }[event.key];
if (!step) return;
event.preventDefault();
const next = tabs[(index + step + tabs.length) % tabs.length];
next.focus();
select(next);
});
});
});
document.querySelectorAll('[data-contact-form]').forEach((form) => {
form.addEventListener('submit', (event) => {
event.preventDefault();
const status = form.querySelector('[data-form-status]');
if (!form.checkValidity()) {
status.textContent = form.dataset.error;
form.querySelector(':invalid')?.focus();
return;
}
status.textContent = form.dataset.success;
form.reset();
});
});
document.querySelectorAll('[data-current-year]').forEach((el) => { el.textContent = new Date().getFullYear(); });
(() => {
const items = document.querySelectorAll('[data-reveal]');
const skip = navigator.webdriver || !('IntersectionObserver' in window) || matchMedia('(prefers-reduced-motion: reduce)').matches;
if (!items.length || skip) return;
document.documentElement.classList.add('reveal-ready');
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (!entry.isIntersecting) return;
entry.target.classList.add('is-visible');
observer.unobserve(entry.target);
});
}, { rootMargin: '0px 0px -10% 0px' });
items.forEach((item) => observer.observe(item));
})();
</script>
<!-- Optional credit — delete this block if you prefer a clean footer -->
<p class="lt-built-with" style="margin:0;padding:12px 16px;text-align:center;font:500 11px/1.4 system-ui,-apple-system,sans-serif;color:#9ca3af;">Built with <a href="https://letstemplates.com" style="color:#059669;text-decoration:none;">Let's templates</a></p>
</body>
</html>
Premium
Tienda online
Desbloquea toda la biblioteca de plantillas y bloques premium. Se renueva automáticamente, cancela cuando quieras.
Tailwind CSS · HTML download
Si no empieza, haz clic aquí.
¿Te gustan nuestras plantillas gratis?
Una pequeña propina nos ayuda a seguir añadiendo nuevas cada semana.
Invítanos a un café