/
Nekit07
/
laba_dva
Обзор
Документация
Войти
/
Nekit07
/
laba_dva
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
css/styles.css
413 строк
8 KB
nekit987
laba 9
30 мар 2026, 23:12
30 мар 2026, 23:12
31c3271
Код
Авторство
О чём код?
* { box-sizing: border-box; margin: 0; } body { font-family: 'Monsieur La Doulaise', cursive; font-size: 3.125rem; display: flex; flex-direction: column; align-items: center; min-height: 100vh; background-color: #ab4c4c; color: hsl(0, 0%, 20%); padding: 5vh 2vw; } .empty_box { height: 20rem; width: 20rem; background-image: url("photo.jpg"); background-size: contain; background-repeat: no-repeat; } .box { display: flex; justify-content: center; align-items: center; width: 90%; max-width: 75rem; min-height: 20rem; margin: 2rem 0; padding: 1.5em; background: rgba(255, 255, 255, 0.1); border: 2px solid rgb(51, 51, 51); } .child { order: -1; flex-shrink: 50%; } h1 { color: rgb(237, 194, 19); text-align: center; line-height: 1.5; flex-shrink: 0; } p { color: #10c0b7; width: 80%; text-align: center; } a { color: bisque; text-decoration: underline dashed; transition: 0.3s; } h2 { order: 0; } .gridconteiner { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-rows: 100px 150px 100px 100px; grid-template-areas: "header header sidebar" "content main ads" "content main ." "footer footer footer"; gap: 20px; justify-content: center; align-content: center; width: 100%; max-width: 1200px; margin: 3rem 0; padding: 2rem; background: rgba(255, 255, 255, 0.05); border: 2px dashed #10c0b7; border-radius: 15px; } .grid-element { border: 2px solid rgb(236, 194, 19); border-radius: 8px; padding: 20px; font-family: Arial, sans-serif; font-size: 1.5rem; font-weight: bold; color: white; display: flex; justify-content: center; align-items: center; } .i1 { grid-area: header; background: rgba(16, 192, 183, 0.3); border-color: #10c0b7; } .i2 { grid-area: content; background: rgba(255, 255, 255, 0.2); border-color: bisque; } .i3 { grid-area: sidebar; background: rgba(171, 76, 76, 0.3); justify-self: stretch; align-self: stretch; } .i4 { grid-area: ads; background: rgba(236, 194, 19, 0.4); } .i5 { grid-area: main; background: rgba(16, 192, 183, 0.5); justify-self: center; align-self: center; } .i6 { grid-area: footer; background: rgba(255, 255, 255, 0.15); } /* Прижатие футера к низу */ body { display: flex; flex-direction: column; min-height: 100vh; } main { flex: 1 0 auto; /* Растягивает основной контент, толкая футер вниз */ width: 100%; display: flex; justify-content: center; padding: 2rem 0; } footer { flex-shrink: 0; width: 100%; text-align: center; padding: 1rem; background: rgba(0, 0, 0, 0.2); font-size: 1.5rem; } /* Стилизация ссылок */ a[href^="mailto:"]::before { content: "📧 "; } a[href^="tel:"]::before { content: "📞 "; } a:hover { color: #10c0b7; text-decoration: solid underline; } /* Стилизация формы */ .registration-form { background: rgba(255, 255, 255, 0.9); padding: 2rem; border-radius: 15px; width: 100%; max-width: 600px; font-family: Arial, sans-serif; /* Для читаемости полей */ font-size: 1rem; color: #333; } fieldset { border: 2px solid #ab4c4c; border-radius: 8px; margin-bottom: 1.5rem; padding: 1rem; } legend { font-weight: bold; padding: 0 10px; color: #ab4c4c; } .form-group { margin-bottom: 1rem; display: flex; flex-direction: column; } .form-group label { margin-bottom: 0.3rem; font-weight: 600; } input, select { padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; } input:focus { outline: none; border-color: #10c0b7; box-shadow: 0 0 5px rgba(16, 192, 183, 0.5); } .radio-group { display: flex; gap: 10px; align-items: center; } .form-buttons { display: flex; gap: 1rem; justify-content: center; } button { padding: 0.8rem 1.5rem; cursor: pointer; border: none; border-radius: 5px; transition: 0.3s; background: #10c0b7; color: white; font-weight: bold; } button:hover { filter: brightness(1.1); } button[type="reset"] { background: #666; } /* 1. Глобальные настройки и переменные */ :root { --primary-color: #10c0b7; --accent-color: #edc213; --error-color: #ff4d4d; --bg-dark: #ab4c4c; } /* Изменение стандартного выделения текста */ ::selection { background-color: var(--accent-color); color: var(--bg-dark); } /* 2. Стилизация ссылок и кнопок (состояния) */ a:link { color: bisque; } a:visited { color: #d1a7a7; } a:hover, button:hover { cursor: pointer; filter: brightness(1.2); transform: translateY(-2px); } a:active, button:active { transform: translateY(0); filter: contrast(1.5); } a:focus, input:focus, button:focus { outline: 3px solid var(--accent-color); outline-offset: 2px; } /* 3. Стилизация полей формы */ input, select, textarea { font-family: Arial, sans-serif; border: 2px solid #ccc; transition: all 0.3s ease; } /* Стилизация placeholder */ input::placeholder { color: #999; font-style: italic; opacity: 0.7; } /* Поля, обязательные для заполнения */ input:required { border-left: 5px solid var(--error-color); } /* Индикатор валидности (если заполнено верно) */ input:required:valid { border-left-color: var(--primary-color); } /* 4. Магия чекбоксов и радиокнопок */ /* Если инпут выбран (:checked), находим следующий за ним label (+) */ input[type="radio"]:checked + label, input[type="checkbox"]:checked + label { color: var(--primary-color); font-weight: bold; text-decoration: line-through; /* Вычеркиваем по ТЗ */ } /* Стилизация отключенных элементов */ input:disabled, button:disabled { background-color: #eee; cursor: not-allowed; opacity: 0.5; } /* 5. Работа со списками (группы child/type) */ /* Предположим, у нас есть список элементов в форме или подвале */ .form-group:nth-child(odd) { background: rgba(255, 255, 255, 0.05); } .form-group:nth-child(even) { background: rgba(0, 0, 0, 0.05); } /* Псевдоэлементы для оформления */ .registration-form h1::first-letter { font-size: 2em; color: var(--accent-color); text-shadow: 2px 2px 0 #000; } /* Кастомный маркер для списков (если они есть) */ li::marker { content: "🚀 "; color: var(--accent-color); } /* Фоновые цвета для элементов с изображениями */ .empty_box { background-color: #5d2929; /* Запасной цвет */ background-image: url("photo.jpg"); } /* Тени для формы на странице form.html */ .registration-form { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2); text-shadow: 1px 1px 2px rgba(0,0,0,0.1); } /* Плавные переходы для всех hover-эффектов */ a, button, .grid-element, input { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); } /* Анимация Лоадера */ .loader-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #10c0b7 0%, #ab4c4c 100%); } .loader { position: absolute; width: 50px; height: 50px; border: 5px solid white; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite, fadeOut 1s forwards 3s; /* Исчезнет через 3 сек */ } .loader-card .content { opacity: 0; animation: fadeIn 1s forwards 3.5s; /* Появится после лоадера */ } @keyframes spin { to { transform: rotate(360deg); } } @keyframes fadeOut { to { opacity: 0; visibility: hidden; } } @keyframes fadeIn { to { opacity: 1; } }