Akaddd756's picture
Create a home screen
3d43150 verified
Raw History Blame Contribute Delete
3.63 kB
class CustomFeatures extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.feature-card {
transition: all 0.3s ease;
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}
.dark .feature-card:hover {
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}
</style>
<section id="features" class="py-20 px-4 sm:px-6 lg:px-8 bg-white dark:bg-gray-900">
<div class="max-w-7xl mx-auto">
<div class="text-center mb-16 animate-on-scroll opacity-0 transition-all duration-500">
<h2 class="text-3xl md:text-4xl font-bold text-gray-900 dark:text-white mb-4">Powerful Features</h2>
<p class="text-lg text-gray-600 dark:text-gray-300 max-w-2xl mx-auto">
Everything you need to build modern, responsive websites with ease.
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
${[1, 2, 3, 4, 5, 6].map(i => `
<div class="feature-card bg-gray-50 dark:bg-gray-800 p-8 rounded-xl border border-gray-200 dark:border-gray-700 animate-on-scroll opacity-0 transition-all duration-500 delay-${i*75}">
<div class="w-14 h-14 flex items-center justify-center rounded-lg bg-indigo-100 dark:bg-indigo-900/50 text-indigo-600 dark:text-indigo-400 mb-6">
<i data-feather="${this.getIcon(i)}" class="w-6 h-6"></i>
</div>
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-3">${this.getTitle(i)}</h3>
<p class="text-gray-600 dark:text-gray-400">
${this.getDescription(i)}
</p>
</div>
`).join('')}
</div>
</div>
</section>
`;
}
getIcon(index) {
const icons = ['code', 'layers', 'smartphone', 'zap', 'shield', 'trending-up'];
return icons[index - 1] || 'box';
}
getTitle(index) {
const titles = [
'Developer Friendly',
'Modular Components',
'Mobile First',
'Lightning Fast',
'Secure by Default',
'Performance Optimized'
];
return titles[index - 1] || 'Feature';
}
getDescription(index) {
const descriptions = [
'Clean, well-documented code that makes customization a breeze for developers of all skill levels.',
'Build with reusable components that can be mixed and matched to create unique layouts.',
'Every component is designed mobile-first and works perfectly on all device sizes.',
'Optimized for speed with minimal dependencies and efficient rendering techniques.',
'Built with security in mind, following best practices to keep your projects safe.',
'Fine-tuned for maximum performance with lazy loading and optimized assets.'
];
return descriptions[index - 1] || 'Feature description';
}
}
customElements.define('custom-features', CustomFeatures);