Spaces:
Running
Running
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- assets/css/styles.cssAdded+1041
- assets/js/script.jsAdded+328
- index.html+383-19
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041/* Reset and Base Styles */* { margin: 0; padding: 0; box-sizing: border-box;}
:root { --primary-color: #6366f1; --primary-dark: #4f46e5; --secondary-color: #ec4899; --text-dark: #1f2937; --text-light: #6b7280; --text-lighter: #9ca3af; --bg-light: #f9fafb; --bg-white: #ffffff; --border-color: #e5e7eb; --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1); --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1); --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);}
html { scroll-behavior: smooth;}
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: var(--text-dark); background-color: var(--bg-white);}
/* Container */.container { max-width: 1200px; margin: 0 auto; padding: 0 20px;}
/* Skip Link */.skip-link { position: absolute; top: -40px; left: 0; background: var(--primary-color); color: white; padding: 8px; text-decoration: none; z-index: 100; border-radius: 0 0 4px 0;}
.skip-link:focus { top: 0;}
/* Visually Hidden */.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;}
/* Header */.header { background: var(--bg-white); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 1000; transition: var(--transition);}
.header-content { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 2rem;}
.logo a { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text-dark); font-weight: 700; font-size: 1.5rem; transition: var(--transition);}
.logo a:hover { color: var(--primary-color);}
.logo i { color: var(--primary-color); font-size: 1.8rem;}
/* Navigation */.nav-list { display: flex; list-style: none; gap: 2rem;}
.nav-link { text-decoration: none; color: var(--text-dark); font-weight: 500; position: relative; transition: var(--transition); padding: 0.5rem 0;}
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary-color); transition: var(--transition);}
.nav-link:hover,.nav-link.active { color: var(--primary-color);}
.nav-link:hover::after,.nav-link.active::after { width: 100%;}
/* Search Container */.search-container { flex-shrink: 0;}
.search-form { display: flex; align-items: center; background: var(--bg-light); border-radius: 50px; padding: 0.5rem 1rem; transition: var(--transition);}
.search-form:focus-within { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);}
.search-form input { border: none; background: none; outline: none; padding: 0.25rem 0.5rem; width: 200px; font-size: 0.9rem;}
.search-form button { border: none; background: none; color: var(--text-light); cursor: pointer; padding: 0.25rem; transition: var(--transition);}
.search-form button:hover { color: var(--primary-color);}
/* Mobile Menu Toggle */.mobile-menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 0.5rem;}
.hamburger-line { width: 25px; height: 3px; background: var(--text-dark); border-radius: 2px; transition: var(--transition);}
/* Hero Section */.hero { padding: 3rem 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);}
.featured-post { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-xl); background: var(--bg-white);}
.featured-image { position: relative; height: 400px; overflow: hidden;}
.featured-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition);}
.featured-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);}
.featured-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 3rem; color: white; z-index: 1;}
.post-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem;}
.category { background: var(--secondary-color); padding: 0.25rem 0.75rem; border-radius: 20px; font-weight: 500;}
.separator { opacity: 0.7;}
.featured-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.2;}
.featured-excerpt { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: 0.95; line-height: 1.6;}
.featured-author { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem;}
.featured-author img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid white;}
.cta-button { background: var(--primary-color); color: white; border: none; padding: 1rem 2rem; border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 0.5rem;}
.cta-button:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg);}
/* Blog Section */.blog-section { padding: 4rem 0; background: var(--bg-light);}
.blog-layout { display: grid; grid-template-columns: 1fr 350px; gap: 3rem;}
.section-title { font-size: 2rem; font-weight: 700; margin-bottom: 2rem; color: var(--text-dark);}
/* Posts Grid */.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 2rem;}
.post-card { background: var(--bg-white); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); display: flex; flex-direction: column;}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg);}
.post-image { position: relative; height: 200px; overflow: hidden;}
.post-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition);}
.post-card:hover .post-image img { transform: scale(1.05);}
.post-category { position: absolute; top: 1rem; left: 1rem; background: var(--primary-color); color: white; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; font-weight: 500;}
.post-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column;}
.post-title { margin-bottom: 0.75rem;}
.post-title a { text-decoration: none; color: var(--text-dark); font-size: 1.25rem; font-weight: 600; line-height: 1.4; transition: var(--transition);}
.post-title a:hover { color: var(--primary-color);}
.post-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-light);}
.post-excerpt { color: var(--text-light); margin-bottom: 1.5rem; flex: 1; line-height: 1.6;}
.read-more { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--primary-color); text-decoration: none; font-weight: 500; transition: var(--transition);}
.read-more:hover { gap: 0.75rem; color: var(--primary-dark);}
/* Load More Button */.load-more-container { text-align: center; margin-top: 3rem;}
.load-more-btn { background: var(--bg-white); color: var(--primary-color); border: 2px solid var(--primary-color); padding: 0.75rem 2rem; border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition);}
.load-more-btn:hover { background: var(--primary-color); color: white; transform: translateY(-2px); box-shadow: var(--shadow-md);}
/* Sidebar */.sidebar { display: flex; flex-direction: column; gap: 2rem;}
.widget { background: var(--bg-white); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow-sm);}
.widget-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--text-dark); position: relative; padding-bottom: 0.75rem;}
.widget-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: var(--primary-color); border-radius: 2px;}
/* Categories Widget */.categories-list { list-style: none;}
.categories-list li { margin-bottom: 0.5rem;}
.categories-list a { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; text-decoration: none; color: var(--text-dark); border-radius: 8px; transition: var(--transition);}
.categories-list a:hover { background: var(--bg-light); color: var(--primary-color); transform: translateX(4px);}
.count { background: var(--bg-light); padding: 0.25rem 0.5rem; border-radius: 12px; font-size: 0.85rem; font-weight: 500; color: var(--text-light);}
/* Recent Posts Widget */.recent-posts-list { list-style: none;}
.recent-posts-list li { margin-bottom: 1rem;}
.recent-post { display: flex; gap: 1rem; text-decoration: none; color: var(--text-dark); transition: var(--transition);}
.recent-post:hover { transform: translateX(4px);}
.recent-post img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover;}
.recent-post-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; line-height: 1.4;}
.recent-post-content time { font-size: 0.85rem; color: var(--text-light);}
/* Popular Posts Widget */.popular-posts-list { list-style: none; counter-reset: popular-counter;}
.popular-posts-list li { counter-increment: popular-counter; margin-bottom: 0.75rem; position: relative; padding-left: 2.5rem;}
.popular-posts-list li::before { content: counter(popular-counter); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; background: var(--primary-color); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.85rem;}
.popular-posts-list a { text-decoration: none; color: var(--text-dark); font-size: 0.95rem; line-height: 1.4; transition: var(--transition);}
.popular-posts-list a:hover { color: var(--primary-color);}
/* Social Widget */.social-links { display: flex; gap: 1rem;}
.social-links a { width: 40px; height: 40px; background: var(--bg-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-dark); text-decoration: none; transition: var(--transition);}
.social-links a:hover { background: var(--primary-color); color: white; transform: translateY(-4px);}
/* Newsletter Widget */.newsletter-widget p { color: var(--text-light); margin-bottom: 1.5rem; line-height: 1.6;}
.newsletter-form { display: flex; flex-direction: column; gap: 1rem;}
.newsletter-form input { padding: 0.75rem 1rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.95rem; transition: var(--transition);}
.newsletter-form input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);}
.newsletter-form button { background: var(--primary-color); color: white; border: none; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition);}
.newsletter-form button:hover { background: var(--primary-dark); transform: translateY(-2px);}
.newsletter-message { font-size: 0.9rem; margin-top: 0.5rem; display: none;}
.newsletter-message.success { color: #10b981; display: block;}
.newsletter-message.error { color: #ef4444; display: block;}
/* Footer */.footer { background: var(--text-dark); color: white; padding: 3rem 0 1rem;}
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem;}
.footer-section h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem;}
.footer-section p { color: var(--text-lighter); margin-bottom: 1.5rem; line-height: 1.6;}
.footer-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 1.5rem; font-weight: 700;}
.footer-logo i { color: var(--primary-color);}
.footer-section ul { list-style: none;}
.footer-section ul li { margin-bottom: 0.5rem;}
.footer-section ul a { color: var(--text-lighter); text-decoration: none; transition: var(--transition);}
.footer-section ul a:hover { color: var(--primary-color);}
.footer-social { display: flex; gap: 1rem;}
.footer-social a { width: 36px; height: 36px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: var(--transition);}
.footer-social a:hover { background: var(--primary-color); transform: translateY(-4px);}
.footer-bottom { padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; color: var(--text-lighter);}
.footer-bottom a { color: var(--primary-color); text-decoration: none;}
.footer-bottom a:hover { text-decoration: underline;}
/* Responsive Design */@media (max-width: 1024px) { .blog-layout { grid-template-columns: 1fr; } .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }}
@media (max-width: 768px) { .header-content { gap: 1rem; } .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; box-shadow: var(--shadow-md); padding: 1rem 0; } .nav.active { display: block; } .nav-list { flex-direction: column; gap: 0; } .nav-link { display: block; padding: 1rem 2rem; border-bottom: 1px solid var(--border-color); } .search-container { order: 3; flex: 1; } .search-form input { width: 100%; } .mobile-menu-toggle { display: flex; order: 4; } .mobile-menu-toggle.active .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); } .mobile-menu-toggle.active .hamburger-line:nth-child(2) { opacity: 0; } .mobile-menu-toggle.active .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); } .hero { padding: 2rem 0; } .featured-image { height: 300px; } .featured-content { padding: 2rem; } .featured-title { font-size: 1.75rem; } .featured-excerpt { font-size: 1rem; } .posts-grid { grid-template-columns: 1fr; gap: 1.5rem; } .footer-content { grid-template-columns: 1fr; gap: 2rem; text-align: center; } .footer-social { justify-content: center; }}
@media (max-width: 480px) { .container { padding: 0 15px; } .featured-content { padding: 1.5rem; } .featured-title { font-size: 1.5rem; } .post-content { padding: 1rem; } .widget { padding: 1rem; }}
/* Animation Classes */@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); }}
.fade-in { animation: fadeIn 0.6s ease-out;}
/* Focus Styles for Accessibility */button:focus,a:focus,input:focus { outline: 2px solid var(--primary-color); outline-offset: 2px;}
/* Print Styles */@media print { .header, .sidebar, .footer, .load-more-container { display: none; } .main { padding: 0; } .blog-layout { grid-template-columns: 1fr; } .post-card { break-inside: avoid; box-shadow: none; border: 1px solid var(--border-color); }}
/* Dark Mode Support */@media (prefers-color-scheme: dark) { :root { --text-dark: #f3f4f6; --text-light: #d1d5db; --text-lighter: #9ca3af; --bg-light: #1f2937; --bg-white: #111827; --border-color: #374151; } .header { background: var(--bg-white); } .blog-section { background: var(--bg-white); } .widget, .post-card { background: var(--bg-light); } .search-form, .newsletter-form input { background: var(--bg-light); color: var(--text-dark); }}
/* High Contrast Mode */@media (prefers-contrast: high) { :root { --primary-color: #0000ff; --text-dark: #000000; --text-light: #333333; --bg-light: #ffffff; --bg-white: #ffffff; --border-color: #000000; } .post-card, .widget { border: 2px solid var(--border-color); } .nav-link::after { height: 3px; }}
/* Reduced Motion */@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } html { scroll-behavior: auto; }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328// Mobile Menu Toggleconst mobileMenuToggle = document.querySelector('.mobile-menu-toggle');const nav = document.querySelector('.nav');
mobileMenuToggle.addEventListener('click', () => { nav.classList.toggle('active'); mobileMenuToggle.classList.toggle('active');});
// Close mobile menu when clicking outsidedocument.addEventListener('click', (e) => { if (!nav.contains(e.target) && !mobileMenuToggle.contains(e.target)) { nav.classList.remove('active'); mobileMenuToggle.classList.remove('active'); }});
// Search Functionalityconst searchForm = document.getElementById('search-form');const searchInput = document.getElementById('search-input');const postCards = document.querySelectorAll('.post-card');
searchForm.addEventListener('submit', (e) => { e.preventDefault(); const searchTerm = searchInput.value.toLowerCase().trim(); if (searchTerm === '') { showAllPosts(); return; } filterPosts(searchTerm);});
function filterPosts(searchTerm) { let hasResults = false; postCards.forEach(card => { const title = card.querySelector('.post-title a').textContent.toLowerCase(); const excerpt = card.querySelector('.post-excerpt').textContent.toLowerCase(); const category = card.querySelector('.post-category').textContent.toLowerCase(); if (title.includes(searchTerm) || excerpt.includes(searchTerm) || category.includes(searchTerm)) { card.style.display = 'flex'; hasResults = true; } else { card.style.display = 'none'; } }); // Show message if no results const blogPosts = document.querySelector('.blog-posts'); let noResultsMessage = document.querySelector('.no-results-message'); if (!hasResults) { if (!noResultsMessage) { noResultsMessage = document.createElement('div'); noResultsMessage.className = 'no-results-message'; noResultsMessage.innerHTML = ` <div style="text-align: center; padding: 3rem; grid-column: 1 / -1;"> <i class="fas fa-search" style="font-size: 3rem; color: var(--text-lighter); margin-bottom: 1rem;"></i> <h3 style="color: var(--text-dark); margin-bottom: 0.5rem;">No articles found</h3> <p style="color: var(--text-light);">Try searching with different keywords.</p> </div> `; blogPosts.appendChild(noResultsMessage); } } else if (noResultsMessage) { noResultsMessage.remove(); }}
function showAllPosts() { postCards.forEach(card => { card.style.display = 'flex'; }); const noResultsMessage = document.querySelector('.no-results-message'); if (noResultsMessage) { noResultsMessage.remove(); }}
// Newsletter Formconst newsletterForm = document.getElementById('newsletter-form');const newsletterEmail = document.getElementById('newsletter-email');const newsletterMessage = document.querySelector('.newsletter-message');
newsletterForm.addEventListener('submit', (e) => { e.preventDefault(); const email = newsletterEmail.value.trim(); if (!validateEmail(email)) { showNewsletterMessage('Please enter a valid email address.', 'error'); return; } // Simulate subscription showNewsletterMessage('Thank you for subscribing! Check your email for confirmation.', 'success'); newsletterForm.reset(); // Hide message after 5 seconds setTimeout(() => { newsletterMessage.style.display = 'none'; }, 5000);});
function validateEmail(email) { const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return re.test(email);}
function showNewsletterMessage(message, type) { newsletterMessage.textContent = message; newsletterMessage.className = `newsletter-message ${type}`; newsletterMessage.style.display = 'block';}
// Load More Postsconst loadMoreBtn = document.querySelector('.load-more-btn');let postsLoaded = 6;
loadMoreBtn.addEventListener('click', () => { // Simulate loading more posts const postsGrid = document.querySelector('.posts-grid'); const newPosts = generateNewPosts(3); newPosts.forEach(post => { post.style.opacity = '0'; postsGrid.appendChild(post); // Animate new posts setTimeout(() => { post.style.transition = 'opacity 0.5s ease-in-out'; post.style.opacity = '1'; }, 100); }); postsLoaded += 3; // Hide button if max posts reached if (postsLoaded >= 12) { loadMoreBtn.style.display = 'none'; }});
function generateNewPosts(count) { const posts = []; const titles = [ 'Advanced CSS Techniques for Modern Websites', 'Building RESTful APIs with Node.js', 'The Psychology of Color in Web Design', 'Mobile-First Design: Best Practices', 'Introduction to TypeScript', 'Content Strategy for Bloggers', 'Web Performance Optimization Guide', 'Understanding User Experience Research', 'Cloud Computing Fundamentals', 'Creating Accessible Web Applications' ]; const categories = ['Development', 'Design', 'Technology', 'Marketing', 'Lifestyle']; const authors = ['John Doe', 'Jane Smith', 'Bob Wilson', 'Alice Brown', 'Charlie Davis']; for (let i = 0; i < count; i++) { const randomIndex = postsLoaded + i; const randomTitle = titles[Math.floor(Math.random() * titles.length)]; const randomCategory = categories[Math.floor(Math.random() * categories.length)]; const randomAuthor = authors[Math.floor(Math.random() * authors.length)]; const postCard = document.createElement('article'); postCard.className = 'post-card'; postCard.innerHTML = ` <div class="post-image"> <img src="https://picsum.photos/seed/post${randomIndex}/400/250.jpg" alt="${randomTitle}" loading="lazy"> <div class="post-category">${randomCategory}</div> </div> <div class="post-content"> <h3 class="post-title"> <a href="#">${randomTitle}</a> </h3> <div class="post-meta"> <span class="author">By ${randomAuthor}</span> <span class="separator">•</span> <time datetime="2024-01-${15 - randomIndex}">${15 - randomIndex} days ago</time> </div> <p class="post-excerpt">Discover insights and best practices in this comprehensive guide that covers essential concepts and practical applications.</p> <a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a> </div> `; posts.push(postCard); } return posts;}
// Smooth Scroll for Navigation Linksdocument.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); // Update active nav link document.querySelectorAll('.nav-link').forEach(link => { link.classList.remove('active'); }); const correspondingNavLink = document.querySelector(`.nav-link[href="${this.getAttribute('href')}"]`); if (correspondingNavLink) { correspondingNavLink.classList.add('active'); } } });});
// Header Scroll Effectlet lastScrollTop = 0;const header = document.querySelector('.header');
window.addEventListener('scroll', () => { const scrollTop = window.pageYOffset || document.documentElement.scrollTop; if (scrollTop > 100) { header.style.boxShadow = 'var(--shadow-md)'; } else { header.style.boxShadow = 'var(--shadow-sm)'; } lastScrollTop = scrollTop;});
// Add loading lazy for imagesdocument.addEventListener('DOMContentLoaded', () => { const images = document.querySelectorAll('img[loading="lazy"]'); if ('IntersectionObserver' in window) { const imageObserver = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { const img = entry.target; img.src = img.src; // Trigger loading img.classList.add('fade-in'); observer.unobserve(img); } }); }); images.forEach(img => imageObserver.observe(img)); }});
// Keyboard Navigationdocument.addEventListener('keydown', (e) => { // Press '/' to focus search if (e.key === '/' && document.activeElement !== searchInput) { e.preventDefault(); searchInput.focus(); } // Press 'Escape' to close mobile menu if (e.key === 'Escape' && nav.classList.contains('active')) { nav.classList.remove('active'); mobileMenuToggle.classList.remove('active'); }});
// Initialize tooltips and other interactive elementsdocument.addEventListener('DOMContentLoaded', () => { // Add click animation to buttons const buttons = document.querySelectorAll('button'); buttons.forEach(button => { button.addEventListener('click', function(e) { const ripple = document.createElement('span'); const rect = this.getBoundingClientRect(); const size = Math.max(rect.width, rect.height); const x = e.clientX - rect.left - size / 2; const y = e.clientY - rect.top - size / 2; ripple.style.width = ripple.style.height = size + 'px'; ripple.style.left = x + 'px'; ripple.style.top = y + 'px'; ripple.classList.add('ripple'); this.appendChild(ripple); setTimeout(() => { ripple.remove(); }, 600); }); });});
// Add ripple effect styles dynamicallyconst style = document.createElement('style');style.textContent = ` button { position: relative; overflow: hidden; } .ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transform: scale(0); animation: ripple-animation 0.6s ease-out; pointer-events: none; } @keyframes ripple-animation { to { transform: scale(4); opacity: 0; } } .no-results-message { grid-column: 1 / -1; }`;document.head.appendChild(style);12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content="A modern, stylish blog featuring articles on technology, lifestyle, and design."><meta name="keywords" content="blog, articles, technology, lifestyle, design"><meta name="author" content="Modern Blog"><title>Modern Blog - Insights & Stories</title><link rel="stylesheet" href="assets/css/styles.css"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"></head><body><!-- Skip to main content for accessibility --><a href="#main-content" class="skip-link">Skip to main content</a><!-- Header --><header class="header"><div class="container"><div class="header-content"><!-- Logo --><div class="logo"><a href="#" aria-label="Modern Blog Home"><i class="fas fa-feather-alt"></i><span>ModernBlog</span></a></div><!-- Navigation --><nav class="nav" role="navigation" aria-label="Main navigation"><ul class="nav-list"><li><a href="#home" class="nav-link active">Home</a></li><li><a href="#about" class="nav-link">About</a></li><li><a href="#blog" class="nav-link">Blog</a></li><li><a href="#categories" class="nav-link">Categories</a></li><li><a href="#contact" class="nav-link">Contact</a></li></ul></nav><!-- Search Bar --><div class="search-container"><form id="search-form" class="search-form" role="search"><inputtype="search"id="search-input"placeholder="Search articles..."aria-label="Search articles"><button type="submit" aria-label="Submit search"><i class="fas fa-search"></i></button></form></div><!-- Mobile Menu Toggle --><button class="mobile-menu-toggle" aria-label="Toggle mobile menu"><span class="hamburger-line"></span><span class="hamburger-line"></span><span class="hamburger-line"></span></button></div></div></header><!-- Main Content --><main id="main-content" class="main"><!-- Hero Section --><section class="hero" aria-labelledby="hero-title"><div class="container"><article class="featured-post"><div class="featured-image"><img src="https://picsum.photos/seed/featured/1200/600.jpg" alt="Featured article about modern web development" loading="lazy"><div class="featured-overlay"></div></div><div class="featured-content"><div class="post-meta"><span class="category">Technology</span><span class="separator">•</span><time datetime="2024-01-15">January 15, 2024</time></div><h1 id="hero-title" class="featured-title">The Future of Web Development: Trends to Watch in 2024</h1><p class="featured-excerpt">Explore the cutting-edge technologies and methodologies that are shaping the future of web development, from AI integration to progressive web apps.</p><div class="featured-author"><img src="https://picsum.photos/seed/author1/50/50.jpg" alt="Sarah Johnson" loading="lazy"><span>By Sarah Johnson</span></div><button class="cta-button">Read More</button></div></article></div></section><!-- Blog Content Section --><section class="blog-section" aria-labelledby="blog-heading"><div class="container"><div class="blog-layout"><!-- Blog Posts Grid --><div class="blog-posts"><h2 id="blog-heading" class="section-title visually-hidden">Latest Blog Posts</h2><div class="posts-grid"><!-- Post 1 --><article class="post-card"><div class="post-image"><img src="https://picsum.photos/seed/post1/400/250.jpg" alt="UI/UX design principles" loading="lazy"><div class="post-category">Design</div></div><div class="post-content"><h3 class="post-title"><a href="#">10 UI/UX Principles Every Designer Should Master</a></h3><div class="post-meta"><span class="author">By Michael Chen</span><span class="separator">•</span><time datetime="2024-01-14">January 14, 2024</time></div><p class="post-excerpt">Discover the fundamental principles that separate good design from great design, and learn how to apply them effectively.</p><a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a></div></article><!-- Post 2 --><article class="post-card"><div class="post-image"><img src="https://picsum.photos/seed/post2/400/250.jpg" alt="JavaScript performance optimization" loading="lazy"><div class="post-category">Development</div></div><div class="post-content"><h3 class="post-title"><a href="#">Optimizing JavaScript Performance in Modern Web Apps</a></h3><div class="post-meta"><span class="author">By Emily Rodriguez</span><span class="separator">•</span><time datetime="2024-01-13">January 13, 2024</time></div><p class="post-excerpt">Learn advanced techniques for improving JavaScript performance and creating lightning-fast web applications.</p><a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a></div></article><!-- Post 3 --><article class="post-card"><div class="post-image"><img src="https://picsum.photos/seed/post3/400/250.jpg" alt="Remote work productivity" loading="lazy"><div class="post-category">Lifestyle</div></div><div class="post-content"><h3 class="post-title"><a href="#">The Ultimate Guide to Remote Work Productivity</a></h3><div class="post-meta"><span class="author">By David Kim</span><span class="separator">•</span><time datetime="2024-01-12">January 12, 2024</time></div><p class="post-excerpt">Master the art of working from home with proven strategies for maintaining productivity and work-life balance.</p><a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a></div></article><!-- Post 4 --><article class="post-card"><div class="post-image"><img src="https://picsum.photos/seed/post4/400/250.jpg" alt="CSS Grid layouts" loading="lazy"><div class="post-category">Development</div></div><div class="post-content"><h3 class="post-title"><a href="#">Mastering CSS Grid: Creating Complex Layouts with Ease</a></h3><div class="post-meta"><span class="author">By Lisa Thompson</span><span class="separator">•</span><time datetime="2024-01-11">January 11, 2024</time></div><p class="post-excerpt">Dive deep into CSS Grid and learn how to create responsive, complex layouts with minimal code.</p><a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a></div></article><!-- Post 5 --><article class="post-card"><div class="post-image"><img src="https://picsum.photos/seed/post5/400/250.jpg" alt="Digital marketing strategies" loading="lazy"><div class="post-category">Marketing</div></div><div class="post-content"><h3 class="post-title"><a href="#">Digital Marketing Strategies That Actually Work in 2024</a></h3><div class="post-meta"><span class="author">By Alex Martinez</span><span class="separator">•</span><time datetime="2024-01-10">January 10, 2024</time></div><p class="post-excerpt">Explore the latest digital marketing tactics and learn how to implement them for maximum ROI.</p><a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a></div></article><!-- Post 6 --><article class="post-card"><div class="post-image"><img src="https://picsum.photos/seed/post6/400/250.jpg" alt="Machine learning basics" loading="lazy"><div class="post-category">Technology</div></div><div class="post-content"><h3 class="post-title"><a href="#">Getting Started with Machine Learning: A Beginner's Guide</a></h3><div class="post-meta"><span class="author">By Rachel Green</span><span class="separator">•</span><time datetime="2024-01-09">January 9, 2024</time></div><p class="post-excerpt">An introduction to machine learning concepts and how to start your journey into AI development.</p><a href="#" class="read-more">Read More <i class="fas fa-arrow-right"></i></a></div></article></div><!-- Load More Button --><div class="load-more-container"><button class="load-more-btn">Load More Articles</button></div></div><!-- Sidebar --><aside class="sidebar" role="complementary"><!-- Categories Widget --><section class="widget categories-widget"><h3 class="widget-title">Categories</h3><ul class="categories-list"><li><a href="#"><span>Technology</span><span class="count">24</span></a></li><li><a href="#"><span>Design</span><span class="count">18</span></a></li><li><a href="#"><span>Development</span><span class="count">32</span></a></li><li><a href="#"><span>Marketing</span><span class="count">15</span></a></li><li><a href="#"><span>Lifestyle</span><span class="count">21</span></a></li></ul></section><!-- Recent Posts Widget --><section class="widget recent-posts-widget"><h3 class="widget-title">Recent Posts</h3><ul class="recent-posts-list"><li><a href="#" class="recent-post"><img src="https://picsum.photos/seed/recent1/80/80.jpg" alt="Recent post thumbnail" loading="lazy"><div class="recent-post-content"><h4>Building Scalable React Applications</h4><time datetime="2024-01-08">2 days ago</time></div></a></li><li><a href="#" class="recent-post"><img src="https://picsum.photos/seed/recent2/80/80.jpg" alt="Recent post thumbnail" loading="lazy"><div class="recent-post-content"><h4>The Art of Minimalist Design</h4><time datetime="2024-01-07">3 days ago</time></div></a></li><li><a href="#" class="recent-post"><img src="https://picsum.photos/seed/recent3/80/80.jpg" alt="Recent post thumbnail" loading="lazy"><div class="recent-post-content"><h4>SEO Best Practices for 2024</h4><time datetime="2024-01-06">4 days ago</time></div></a></li></ul></section><!-- Popular Posts Widget --><section class="widget popular-posts-widget"><h3 class="widget-title">Popular Posts</h3><ol class="popular-posts-list"><li><a href="#">Understanding Web3 and Its Impact</a></li><li><a href="#">The Complete Guide to Responsive Design</a></li><li><a href="#">How to Build a Personal Brand Online</a></li><li><a href="#">JavaScript Frameworks Comparison</a></li><li><a href="#">Color Theory for Web Designers</a></li></ol></section><!-- Social Media Widget --><section class="widget social-widget"><h3 class="widget-title">Follow Us</h3><div class="social-links"><a href="#" aria-label="Follow on Facebook"><i class="fab fa-facebook-f"></i></a><a href="#" aria-label="Follow on Twitter"><i class="fab fa-twitter"></i></a><a href="#" aria-label="Follow on Instagram"><i class="fab fa-instagram"></i></a><a href="#" aria-label="Follow on LinkedIn"><i class="fab fa-linkedin-in"></i></a><a href="#" aria-label="Follow on YouTube"><i class="fab fa-youtube"></i></a></div></section><!-- Newsletter Widget --><section class="widget newsletter-widget"><h3 class="widget-title">Newsletter</h3><p>Subscribe to get the latest articles delivered to your inbox.</p><form id="newsletter-form" class="newsletter-form"><inputtype="email"id="newsletter-email"placeholder="Enter your email"requiredaria-label="Email for newsletter"><button type="submit">Subscribe</button></form><p class="newsletter-message"></p></section></aside></div></div></section></main><!-- Footer --><footer class="footer"><div class="container"><div class="footer-content"><div class="footer-section"><div class="footer-logo"><i class="fas fa-feather-alt"></i><span>ModernBlog</span></div><p>Sharing insights, stories, and knowledge to inspire and educate our readers.</p><div class="footer-social"><a href="#" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a><a href="#" aria-label="Twitter"><i class="fab fa-twitter"></i></a><a href="#" aria-label="Instagram"><i class="fab fa-instagram"></i></a><a href="#" aria-label="LinkedIn"><i class="fab fa-linkedin-in"></i></a></div></div><div class="footer-section"><h4>Quick Links</h4><ul><li><a href="#">About Us</a></li><li><a href="#">Contact</a></li><li><a href="#">Write for Us</a></li><li><a href="#">Advertise</a></li></ul></div><div class="footer-section"><h4>Categories</h4><ul><li><a href="#">Technology</a></li><li><a href="#">Design</a></li><li><a href="#">Development</a></li><li><a href="#">Marketing</a></li></ul></div><div class="footer-section"><h4>Legal</h4><ul><li><a href="#">Privacy Policy</a></li><li><a href="#">Terms of Service</a></li><li><a href="#">Cookie Policy</a></li><li><a href="#">Disclaimer</a></li></ul></div></div><div class="footer-bottom"><p>© 2024 ModernBlog. All rights reserved. | Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" rel="noopener">anycoder</a></p></div></div></footer><script src="assets/js/script.js"></script></body></html>
assets/css/styles.cssAdded+1041
assets/js/script.jsAdded+328
index.html+383-19