const init = () => { const app = document.querySelector('#app'); app.classList.add('ready'); }
function render(node, props){ return Object.assign(node.style, props); }
<section class="hero"><h1>InterWeb</h1><p>Webs profesionales</p></section>
:root { --teal: #0A8C8C; --orange: #F5A623; --bg: #10141a; --radius: 12px; }
export async function fetchData(url){ const r = await fetch(url); return r.json(); }
@media (max-width: 768px) { .grid { grid-template-columns: 1fr; gap: 16px; } }
const items = data.filter(i => i.active).map(i => ({ ...i, slug: i.id }));
if (window.innerWidth < 640) { document.body.classList.add('is-mobile'); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-2px); }
npm install @google/genai react react-dom typescript --save-dev
git commit -m "feat(landing): hero animations + responsive grid"
SELECT id, name, price FROM products WHERE active = 1 ORDER BY created_at DESC;
const observer = new IntersectionObserver(cb, { threshold: 0.1, rootMargin: '0px' });
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
function debounce(fn, ms = 200){ let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }
const palette = ['#0A8C8C','#F5A623','#10141a','#dfe2eb','#181c22'];
:is(button, a, input):focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
export default function Page() { return <Layout><Hero /><Services /></Layout>; }
git push origin main · git rebase -i HEAD~3 · git stash pop · git fetch --all
navigator.serviceWorker.register('/sw.js').then(r => console.log('SW', r.scope));
const re = /^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/; if (!re.test(email)) reject();
:root { color-scheme: dark; font-synthesis: none; -webkit-font-smoothing: antialiased; }
fetch('/api/contact', { method: 'POST', body: JSON.stringify(form) }).then(r => r.json());
uuid: 9f3e2b1c-7d4a-4e8a-b1f2-3c9d8e2a5f7b · token: eyJhbGciOiJIUzI1NiJ9...
2xx OK · 3xx Redirect · 4xx Client Error · 5xx Server Error · 200 · 301 · 404 · 500
npx tsc --noEmit · npx eslint . --fix · npx prettier --write "src/**/*.{ts,tsx,css}"
<!DOCTYPE html><html lang="es"><head><meta charset="UTF-8"></head>
const router = createBrowserRouter([{ path: '/', element: <Home /> }]);
.card { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
let total = items.reduce((acc, x) => acc + x.price * x.qty, 0).toFixed(2);
addEventListener('scroll', () => { requestAnimationFrame(updateNav); }, { passive: true });
type User = { id: string; name: string; email: string; role: 'admin' | 'user' };
console.log(`Build complete in ${(performance.now() - t0).toFixed(2)}ms`);
<img src="/img/hero.webp" alt="" loading="lazy" decoding="async" width="640" height="360">
const [state, dispatch] = useReducer(reducer, initialState);
position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center;
try { await db.transaction(async tx => { await tx.commit(); }); } catch(e){ logger.error(e); }
module.exports = { plugins: ['@tailwindcss/typography', 'autoprefixer'] };
const sha = crypto.createHash('sha256').update(buf).digest('hex');
aria-label="Cargando" · role="status" · aria-busy="true" · aria-hidden="true"
RewriteEngine On · RewriteCond %{HTTPS} off · RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
0xDEADBEEF · 0xCAFEBABE · 0xFEEDFACE · 0xC0FFEE · 127.0.0.1:3000 · ::1
SELECT COUNT(*) FROM orders WHERE status = 'paid' AND created_at >= NOW() - INTERVAL 30 DAY;
function clamp(v, min, max){ return Math.min(Math.max(v, min), max); }
animation: codigo-cae 2.4s linear infinite; transform: translateY(-100%);
const ws = new WebSocket('wss://api.interweb.es/realtime'); ws.onmessage = handle;
border-radius: 999px; box-shadow: 0 0 14px rgba(10,140,140,0.5); backdrop-filter: blur(12px);
<meta property="og:image" content="https://interweb.es/imagen-preview.jpg" />
const map = new Map(); map.set('teal', '#0A8C8C'); map.set('orange', '#F5A623');
:is(button, a, input):focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
export default function Page() { return <Layout><Hero /><Services /></Layout>; }
git push origin main · git rebase -i HEAD~3 · git stash pop · git fetch --all
navigator.serviceWorker.register('/sw.js').then(r => console.log('SW', r.scope));
const re = /^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/; if (!re.test(email)) reject();
:root { color-scheme: dark; font-synthesis: none; -webkit-font-smoothing: antialiased; }
fetch('/api/contact', { method: 'POST', body: JSON.stringify(form) }).then(r => r.json());
uuid: 9f3e2b1c-7d4a-4e8a-b1f2-3c9d8e2a5f7b · token: eyJhbGciOiJIUzI1NiJ9...
2xx OK · 3xx Redirect · 4xx Client Error · 5xx Server Error · 200 · 301 · 404 · 500
npx tsc --noEmit · npx eslint . --fix · npx prettier --write "src/**/*.{ts,tsx,css}"
document.documentElement.classList.add('is-loading'); window.addEventListener('load', leave);
<script src="/static/app.js" defer></script> <noscript>Activa JS</noscript>
const id = setInterval(() => tick(), 1000); return () => clearInterval(id);
filter: drop-shadow(0 0 18px rgba(10,140,140,0.35)); will-change: transform, opacity;
const palette = await import('./palette.json', { assert: { type: 'json' } });
0 1 0 1 1 0 1 0 0 1 1 1 0 1 0 1 1 0 1 1 0 0 1 0 1
SELECT * FROM clients WHERE city LIKE '%Madrid%' OR city LIKE '%Barcelona%' LIMIT 50;
const env = process.env.NODE_ENV ?? 'development'; if (env === 'production') minify();
useEffect(() => { const ctrl = new AbortController(); fetchData(ctrl.signal); return () => ctrl.abort(); }, []);
linear-gradient(90deg, #0A8C8C 0%, #F5A623 100%); background-size: 220% 100%;
<link rel="canonical" href="https://interweb.es/" /> <meta name="robots" content="index,follow">
const fmt = new Intl.NumberFormat('es-ES', { style: 'currency', currency: 'EUR' });
SHA-256: 4f5d8b3c... · MD5: e99a18c4... · CRC32: 0x1a2b3c4d · ETag: "33a64df5"
cubic-bezier(.16,1,.3,1) · ease-in-out · linear · steps(12, end)
throw new Error(`Unexpected token "${tok}" at line ${line}:${col}`);
npm run build · npm run dev · npm run lint · npm run test:e2e · npm run preview
function throttle(fn, wait){ let last=0; return (...a)=>{ const n=Date.now(); if(n-last>wait){last=n; fn(...a);} } }
<form action="/api/contact" method="POST" enctype="multipart/form-data">
const cache = new WeakMap(); function memo(fn){ return x => cache.get(x) ?? cache.set(x, fn(x)).get(x); }
display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh;
const stripe = require('stripe')(process.env.STRIPE_SECRET); await stripe.charges.create({...});
aria-controls="menu-list" · aria-expanded="false" · aria-haspopup="true"
const dpr = Math.min(window.devicePixelRatio || 1, 2); ctx.scale(dpr, dpr);
SELECT u.id, u.name, COUNT(o.id) FROM users u LEFT JOIN orders o ON o.user_id=u.id GROUP BY u.id;
<path d="M12 2L2 22h20L12 2z" fill="currentColor" stroke="none" />
const tween = gsap.to('.box', { x: 200, duration: 1, ease: 'power3.out' });
RewriteRule ^old-page$ /new-page [R=301,L]
function* range(start, end){ for(let i=start; i<end; i++) yield i; }
0x00 0xFF 0xA0 0x3C 0x7E 0x42 · ESC[31m · ESC[0m · \r\n \t \\ \"
color-mix(in oklch, var(--teal) 60%, white 40%) · oklch(0.7 0.15 200)
const stream = fs.createReadStream('./data.json', { encoding: 'utf-8', highWaterMark: 64 * 1024 });
const html = `<article class="post">${escape(title)}</article>`;
border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent); backdrop-filter: blur(8px);
const eq = (a, b) => JSON.stringify(a) === JSON.stringify(b);
npm audit fix --force · npm outdated · npm dedupe · npm prune
switch (event.type) { case 'click': handleClick(event); break; case 'keydown': handleKey(event); break; }
SELECT name, email FROM contacts WHERE created_at BETWEEN ? AND ? ORDER BY id DESC LIMIT ?, ?;
const sigma = arr => arr.reduce((a,b) => a+b, 0); const mean = arr => sigma(arr) / arr.length;
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"></svg>
const ctx = canvas.getContext('2d', { alpha: false, desynchronized: true });
process.on('SIGTERM', async () => { await server.close(); process.exit(0); });
:host { contain: layout style paint; container-type: inline-size; }
const port = parseInt(process.env.PORT, 10) || 3000;
const seed = (s) => () => (s = (s * 9301 + 49297) % 233280) / 233280;
0xCAFE 0xBABE 0xDEAD 0xBEEF · pid 4231 · uid 1000 · gid 1000
aspect-ratio: 16 / 9; object-fit: cover; object-position: center 30%;
const t0 = performance.now(); doWork(); const dt = performance.now() - t0;
function escapeHtml(s){ return s.replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); }
:where(button, a) { transition: color .2s, background .2s, transform .2s; }
const blob = new Blob([buffer], { type: 'application/octet-stream' });
git tag -a v1.4.0 -m "release: 1.4.0" · git push --tags · git describe --tags
SELECT product_id, SUM(qty) AS total FROM line_items GROUP BY product_id HAVING total > 100;
document.fonts.ready.then(() => document.body.classList.add('fonts-loaded'));
const dx = x2 - x1, dy = y2 - y1; const dist = Math.hypot(dx, dy);
position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px) saturate(1.1);
fetch(url, { signal, credentials: 'include', headers: { 'X-CSRF-Token': token } });
const slug = str => str.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/\s+/g, '-');
<meta name="theme-color" content="#0A8C8C" media="(prefers-color-scheme: dark)">
requestIdleCallback(() => analytics.flush(), { timeout: 2000 });
const tree = parse(source); walk(tree, { enter, leave });
response.headers.set('Cache-Control', 'public, max-age=31536000, immutable');
localStorage.setItem('theme', 'dark'); document.documentElement.dataset.theme = 'dark';
const promise = new Promise((res, rej) => setTimeout(res, 500, 'ok'));
<input type="email" required autocomplete="email" inputmode="email" />
const fps = 1000 / (now - lastFrame); lastFrame = now;
SELECT id FROM sessions WHERE token = ? AND expires_at > NOW();
border-image: linear-gradient(45deg, #0A8C8C, #F5A623) 1;
const sorted = [...arr].sort((a,b) => a.priority - b.priority);
<link rel="modulepreload" href="/assets/main.js" />
throw new RangeError(`Index ${i} out of bounds [0, ${len})`);
const ws = require('ws'); const server = new ws.Server({ port: 8080 });
git switch -c feature/preloader · git merge --no-ff · git log --graph --oneline
const dec = new TextDecoder('utf-8'); const enc = new TextEncoder();
:root { --space-1: .25rem; --space-2: .5rem; --space-3: 1rem; --space-4: 1.5rem; }
0b1010 0b1100 0b1111 · 0o755 0o644 · 0xC0DE 0xFADE 0xACED
console.table(rows.map(({id, name, qty}) => ({ id, name, qty })));