Files
123/habbit-style.css

357 lines
8.3 KiB
CSS

/* Базовые стили */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
color: #333;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
/* Блок container */
.container {
max-width: 1200px;
margin: 0 auto;
}
/* Блок page-header */
.page-header {
background: white;
border-radius: 20px;
padding: 40px;
margin-bottom: 30px;
text-align: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.page-header__title {
color: #4CAF50;
font-size: 2.5em;
margin-bottom: 10px;
}
.page-header__subtitle {
color: #666;
font-size: 1.2em;
margin-bottom: 30px;
}
/* Блок stats-panel */
.stats-panel {
display: flex;
gap: 20px;
justify-content: center;
flex-wrap: wrap;
}
.stats-panel__item {
background: #f8f9fa;
padding: 15px 25px;
border-radius: 10px;
text-align: center;
}
.stats-panel__value {
font-size: 2em;
font-weight: bold;
color: #4CAF50;
}
.stats-panel__label {
color: #666;
font-size: 0.9em;
}
/* Блок filters */
.filters {
display: flex;
gap: 10px;
justify-content: center;
margin-bottom: 30px;
flex-wrap: wrap;
}
.filters__button {
flex: 0 1 auto;
}
/* Блок habits-grid */
.habits-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 25px;
margin-bottom: 40px;
}
/* Блок habit-card - ОСНОВНОЙ БЛОК ДЛЯ РАБОТЫ */
.habit-card {
background: white;
border-radius: 20px;
padding: 25px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
transition: all 0.3s ease;
position: relative;
overflow: hidden;
animation: fadeInUp 0.5s ease;
border-left: 5px solid #d32f2f;
}
.habit-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.habit-card__header {
display: flex;
align-items: center;
margin-bottom: 15px;
}
.habit-card__icon {
font-size: 2.5em;
margin-right: 15px;
}
.habit-card__title {
color: #2c3e50;
font-size: 1.4em;
margin: 0;
}
.habit-card__description {
color: #666;
margin-bottom: 20px;
line-height: 1.5;
}
.habit-card__progress {
margin-bottom: 20px;
}
.habit-card__progress-info {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
font-size: 0.9em;
color: #666;
}
.habit-card__progress-bar {
background: #e0e0e0;
border-radius: 10px;
height: 8px;
overflow: hidden;
}
.habit-card__progress-fill {
background: #4CAF50;
height: 100%;
width: 0%;
transition: width 0.5s ease;
}
.habit-card__actions {
display: flex;
gap: 10px;
}
/* Блок button */
.button {
padding: 10px 20px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 0.9em;
transition: all 0.3s ease;
flex: 1;
}
.button--primary {
background: #4CAF50;
color: white;
}
.button--primary:hover {
background: #45a049;
transform: translateY(-2px);
}
.button--secondary {
background: #f0f0f0;
color: #333;
}
.button--secondary:hover {
background: #e0e0e0;
transform: translateY(-2px);
}
.button--success {
background: #4CAF50;
color: white;
}
.button--success:hover {
background: #45a049;
transform: translateY(-2px);
}
.button--danger {
background: #af0606;
color: white;
}
.button--danger:hover {
background: #750404;
transform: translateY(-2px);
}
/* Модификаторы для habit-card */
.habit-card--important {
border-left: 5px solid #ff6b6b;
}
.habit-card--completed {
opacity: 0.8;
}
.habit-card--new {
border: 2px dashed #08cf0e;
background: #8DA180;
}
.habit-card--streak {
position: relative;
}
.habit-card--streak::before {
content: '🔥';
position: absolute;
top: 10px;
right: 10px;
font-size: 1.5em;
}
/* Блок new-habit-form */
.new-habit-form {
background: white;
border-radius: 15px;
padding: 30px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.new-habit-form__title {
color: #2c3e50;
margin-bottom: 20px;
text-align: center;
}
/* Анимации */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Стили для модального окна */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
display: none;
align-items: center;
justify-content: center;
}
.modal--open {
display: flex;
}
.modal__overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal__content {
position: relative;
background: white;
border-radius: 20px;
padding: 30px;
max-width: 500px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal__close {
position: absolute;
top: 15px;
right: 15px;
background: none;
border: none;
font-size: 1.5em;
cursor: pointer;
color: #666;
}
.modal__title {
margin-bottom: 20px;
color: #2c3e50;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 5px;
color: #333;
font-weight: bold;
}
.form-control {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 1em;
}
.modal__actions {
display: flex;
gap: 10px;
justify-content: flex-end;
margin-top: 30px;
}
.new-habit-form__button {
background: none;
border: none;
width: 100%;
cursor: pointer;
padding: 0;
}
.new-habit-form__button:hover .new-habit-form__title {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}