notque/vexjoy-agent / skills/frontend/frontend
frontend
UnverifiedFrontend: UI design, distinctive visual styles, HTML artifacts, Three.js 3D, TypeScript/React/Next.js apps, e-commerce, portfolios, React Native, web performance.
templates/components/scrollytelling.js
View on GitHub/* === Scrollytelling Component === */
document.addEventListener('DOMContentLoaded', () => {
// --- IntersectionObserver for .reveal, .fade-in, .slide-left ---
const observer = new IntersectionObserver(
(entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target); // fire once
}
}
},
{ threshold: 0.15, rootMargin: '0px' }
);
document.querySelectorAll('.reveal, .fade-in, .slide-left, .stagger-group')
.forEach(el => observer.observe(el));
// --- Animated Counters ---
const counters = document.querySelectorAll('.counter');
if (counters.length > 0) {
const counterObserver = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
const el = entry.target;
const target = parseInt(el.dataset.target, 10);
const suffix = el.dataset.suffix || '';
const duration = 800;
const start = performance.now();
function tick(now) {
const elapsed = now - start;
const progress = Math.min(elapsed / duration, 1);
const eased = 1 - Math.pow(1 - progress, 3); // ease-out cubic
el.textContent = Math.round(target * eased).toLocaleString() + suffix;
if (progress < 1) requestAnimationFrame(tick);
}
requestAnimationFrame(tick);
counterObserver.unobserve(el);
}
}
}, { threshold: 0.3 });
counters.forEach(el => counterObserver.observe(el));
}
// --- Reading Progress Bar ---
const progressFill = document.getElementById('progress-fill');
if (progressFill) {
window.addEventListener('scroll', () => {
const scrollTop = window.scrollY;
const docHeight = document.documentElement.scrollHeight - window.innerHeight;
const progress = docHeight > 0 ? Math.min((scrollTop / docHeight) * 100, 100) : 0;
progressFill.style.width = progress + '%';
}, { passive: true });
}
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |