/
Valya-commits
/
project
Обзор
Документация
Войти
/
Valya-commits
/
project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
css/style.css
414 строк
7 KB
Осадчая Валентина
07. Content: Full layout with articles, categories, about, subscribe and footer
28 мар 2026, 10:14
28 мар 2026, 10:14
8b336b1
Код
Авторство
О чём код?
* { margin: 0; padding: 0; box-sizing: border-box; } /* CSS Variables */ :root { --primary: #1a1a2e; --secondary: #7a16d7; --accent: #0f3460; --text: #16213e; --bg: #ffffff; --light-bg: #f8f9fa; --border: #e9ecef; --font-heading: 'Playfair Display', serif; --font-body: 'Roboto', sans-serif; --spacing: 1rem; --container-width: 1200px; } body { font-family: var(--font-body); font-size: 1rem; line-height: 1.6; color: var(--text); background-color: var(--bg); } /* Container */ .container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; } /* Header */ .header { background-color: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem 0; position: sticky; top: 0; z-index: 100; } .header-container { display: flex; justify-content: space-between; align-items: center; } .logo { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; } .nav-list { display: flex; list-style: none; gap: 2rem; } .nav-list a { text-decoration: none; color: var(--text); font-weight: 500; transition: color 0.2s ease; } .nav-list a:hover { color: var(--secondary); } /* Hero */ .hero { padding: 3rem 0; background-color: var(--light-bg); } .hero-container { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; } .hero-content { flex: 1; } .hero-image { flex: 1; } .hero-image img { width: 100%; height: auto; border-radius: 8px; object-fit: cover; } .hero-category { display: inline-block; background-color: var(--secondary); color: white; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; margin-bottom: 1rem; } .hero-meta { display: flex; gap: 1rem; margin: 1rem 0; font-size: 0.9rem; color: #6c757d; } /* Кнопки */ .btn { display: inline-block; padding: 0.75rem 1.5rem; text-decoration: none; border-radius: 4px; transition: background-color 0.2s ease; font-weight: 500; } .btn-primary { background-color: var(--primary); color: white; } .btn-primary:hover { background-color: var(--secondary); } /* Заголовки */ h1 { font-size: 2.5rem; margin-bottom: 1rem; font-family: var(--font-heading); font-weight: 700; line-height: 1.2; } .lead { font-size: 1.2rem; font-weight: 300; } /* Latest Articles Grid */ .latest-articles { padding: 4rem 0; } .articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; } .article-card { background: var(--bg); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: transform 0.2s ease; } .article-card:hover { transform: translateY(-4px); } .article-card img { width: 100%; height: 200px; object-fit: cover; } .article-card h3 { padding: 1rem 1rem 0.5rem; font-family: var(--font-heading); } .article-card p { padding: 0 1rem; color: #555; } .article-meta { padding: 0.5rem 1rem 1rem; font-size: 0.8rem; color: #6c757d; } /* Categories */ .categories { padding: 2rem 0; background-color: var(--light-bg); } .categories-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; } .category { display: inline-block; padding: 0.5rem 1.5rem; background-color: white; border: 1px solid var(--border); border-radius: 30px; text-decoration: none; color: var(--primary); font-weight: 500; transition: all 0.2s ease; } .category:hover { background-color: var(--primary); color: white; border-color: var(--primary); } /* About */ .about { padding: 4rem 0; } .about-container { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; } .about-text { flex: 1; } .about-text h2 { text-align: left; } .about-author { margin-top: 1rem; font-style: italic; border-left: 3px solid var(--secondary); padding-left: 1rem; } .about-image { flex: 1; } .about-image img { width: 100%; height: auto; border-radius: 8px; } /* Subscribe */ .subscribe { padding: 3rem 0; background-color: var(--primary); color: white; text-align: center; } .subscribe h2 { color: white; margin-bottom: 1rem; } .subscribe-form { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; } .subscribe-form input { padding: 0.75rem 1rem; border: none; border-radius: 4px; width: 280px; font-family: inherit; } .subscribe-form button { background-color: var(--secondary); border: none; cursor: pointer; } .subscribe-form button:hover { background-color: var(--accent); } /* Footer */ .footer { background-color: #1e2a36; color: #ccc; padding: 3rem 0 0; } .footer-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; } .footer-col { flex: 1; min-width: 180px; } .footer-logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: white; } .footer-col h4 { color: white; margin-bottom: 1rem; font-size: 1.1rem; } .social-links { list-style: none; } .social-links li { margin-bottom: 0.5rem; } .social-links a { color: #ccc; text-decoration: none; transition: color 0.2s ease; } .social-links a:hover { color: var(--secondary); } .footer-bottom { border-top: 1px solid #2c3e50; padding: 1.5rem 0; text-align: center; font-size: 0.9rem; } /* Responsive */ @media (max-width: 768px) { .header-container { flex-direction: column; gap: 1rem; } .nav-list { flex-wrap: wrap; justify-content: center; gap: 1rem; } .hero-container { flex-direction: column; text-align: center; } .hero-meta { justify-content: center; } .about-container { flex-direction: column; text-align: center; } .about-text h2 { text-align: center; } .footer-container { flex-direction: column; text-align: center; } .subscribe-form { flex-direction: column; align-items: center; } .subscribe-form input, .subscribe-form button { width: 100%; max-width: 300px; } }