/
RoditelevVV
/
web-static-labs
Обзор
Документация
Войти
/
RoditelevVV
/
web-static-labs
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
html/lab5/task8/styles.css
312 строк
6 KB
karpov
finish lab3, lab4
12 мар 2026, 08:19
12 мар 2026, 08:19
74cd197
Код
Авторство
О чём код?
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #333; min-height: 100vh; padding: 20px; } .container { max-width: 500px; margin: 0 auto; background: rgba(255, 255, 255, 0.95); border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); overflow: hidden; } .header { background: linear-gradient(135deg, #2c3e50, #34495e); color: white; padding: 30px; text-align: center; } .header h1 { font-size: 2.2rem; margin-bottom: 8px; } .subtitle { font-size: 1rem; opacity: 0.9; } .main-content { padding: 30px; } /* Форма */ .registration-form { background: white; padding: 25px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); margin-bottom: 25px; } .form-group { margin-bottom: 25px; } .form-label { display: block; font-weight: 600; color: #2c3e50; margin-bottom: 8px; font-size: 1rem; } .hint { font-weight: 400; color: #7f8c8d; font-size: 0.85rem; margin-left: 5px; } .form-input, .form-select { width: 100%; padding: 12px 15px; border: 2px solid #e9ecef; border-radius: 8px; font-size: 1rem; transition: all 0.3s ease; background: white; } .form-input:focus, .form-select:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } /* Стили для валидных полей */ .form-input:valid:not(:focus):not(:placeholder-shown), .form-select:valid { border-color: #00b09b; background: #f8fff9; } /* Стили для невалидных полей */ .form-input:invalid:not(:focus):not(:placeholder-shown), .form-select:invalid { border-color: #e74c3c; background: #fff5f5; } /* Специальные стили для поля возраста (необязательного) */ #age:placeholder-shown { border-color: #e9ecef; background: white; } #age:valid { border-color: #00b09b; background: #f8fff9; } #age:invalid:not(:focus):not(:placeholder-shown) { border-color: #e74c3c; background: #fff5f5; } /* Сообщения об ошибках */ .error-message { color: #e74c3c; font-size: 0.85rem; margin-top: 5px; min-height: 20px; opacity: 0; transition: opacity 0.3s ease; } .form-input:invalid:not(:focus):not(:placeholder-shown) ~ .error-message, .form-select:invalid ~ .error-message { opacity: 1; } /* Кнопки */ .form-buttons { display: flex; gap: 15px; margin-top: 30px; } .submit-btn, .reset-btn { flex: 1; padding: 15px 20px; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; } .submit-btn { background: linear-gradient(135deg, #00b09b, #96c93d); color: white; } .submit-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 176, 155, 0.3); } .submit-btn:active { transform: translateY(0); } .reset-btn { background: linear-gradient(135deg, #95a5a6, #7f8c8d); color: white; } .reset-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(149, 165, 166, 0.3); } .reset-btn:active { transform: translateY(0); } /* Результат валидации */ .validation-result { background: white; padding: 25px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); min-height: 80px; display: flex; align-items: center; justify-content: center; text-align: center; color: #7f8c8d; font-style: italic; } .validation-result.success { background: linear-gradient(135deg, #00b09b, #96c93d); color: white; font-style: normal; font-weight: 600; } .validation-result.error { background: linear-gradient(135deg, #ff416c, #ff4b2b); color: white; font-style: normal; font-weight: 600; } /* Футер */ .footer { background: #f8f9fa; padding: 20px 30px; text-align: center; border-top: 1px solid #e9ecef; color: #6c757d; } .footer small { font-size: 0.9rem; } /* Кастомный внешний вид для select */ .form-select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 15px center; background-size: 16px; padding-right: 45px; } /* Стили для disabled option */ .form-select option[disabled] { color: #95a5a6; } /* Анимации */ @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } } .form-input:invalid:not(:focus):not(:placeholder-shown), .form-select:invalid { animation: shake 0.3s ease; } /* Адаптивность */ @media (max-width: 768px) { .container { margin: 10px; border-radius: 15px; } .header { padding: 20px; } .header h1 { font-size: 1.8rem; } .main-content { padding: 20px; } .registration-form { padding: 20px; } .form-buttons { flex-direction: column; } .submit-btn, .reset-btn { width: 100%; } } @media (max-width: 480px) { .registration-form { padding: 15px; } .form-group { margin-bottom: 20px; } .form-input, .form-select { padding: 10px 12px; font-size: 16px; /* Предотвращает zoom в iOS */ } .validation-result { padding: 20px 15px; font-size: 0.9rem; } } /* Стили для состояний загрузки */ .submit-btn:disabled { background: #95a5a6; cursor: not-allowed; transform: none; box-shadow: none; } .submit-btn:disabled:hover { transform: none; box-shadow: none; }