Files
HabitTracker/static/css/style.css
2025-07-19 00:07:04 +02:00

441 lines
7.9 KiB
CSS

body {
font-family: Arial, sans-serif;
background-color: #1a1a1a;
color: #e0e0e0;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
}
.container {
width: 100%;
max-width: 600px;
background-color: #2a2a2a;
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
h1 {
color: #4CAF50;
text-align: center;
margin-bottom: 20px;
}
.add-habit {
display: flex;
margin-bottom: 20px;
}
.add-habit input[type="text"] {
flex-grow: 1;
padding: 10px;
border: 1px solid #444;
border-radius: 5px;
background-color: #333;
color: #e0e0e0;
margin-right: 10px;
}
.add-habit button {
padding: 10px 15px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
.add-habit button:hover {
background-color: #45a049;
}
.habit-item {
background-color: #333;
border-radius: 8px;
margin-bottom: 15px;
padding: 15px;
display: flex;
flex-direction: column;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.habit-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.habit-name {
font-size: 1.2em;
font-weight: bold;
color: #e0e0e0;
}
.habit-actions button {
background: none;
border: none;
color: #e0e0e0;
font-size: 1.5em;
cursor: pointer;
margin-left: 5px;
}
.habit-actions button:hover {
color: #666;
}
.habit-actions button.completed-today {
color: var(--habit-color, #4CAF50);
}
.habit-actions button.not-completed-today {
color: #888;
}
.habit-actions button.completed-today:hover {
color: var(--habit-color, #45a049);
filter: brightness(0.9);
}
.habit-actions button.not-completed-today:hover {
color: var(--habit-color, #4CAF50);
}
.date-grid {
display: grid;
grid-template-columns: repeat(30, 1fr);
/* Adjust based on your date range */
gap: 2px;
padding: 5px 0;
overflow-x: auto;
/* Enable horizontal scrolling if dates exceed width */
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
/* Firefox */
}
/* Hide scrollbar for Chrome, Safari and Opera */
.date-grid::-webkit-scrollbar {
display: none;
}
.date-square {
width: 15px;
/* Adjust size as needed */
height: 15px;
background-color: #555;
border-radius: 2px;
cursor: pointer;
}
.date-square.completed {
background-color: var(--habit-color, #4CAF50);
}
.date-square.partial {
background-color: #555;
position: relative;
}
.date-square.partial::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--habit-color, #4CAF50);
opacity: var(--completion-opacity, 0.5);
border-radius: inherit;
}
/* Modal Styles */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
justify-content: center;
align-items: center;
}
.modal-content {
background-color: #2a2a2a;
margin: auto;
padding: 30px;
border-radius: 10px;
width: 80%;
max-width: 500px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
position: relative;
}
.close-button {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
position: absolute;
top: 10px;
right: 20px;
cursor: pointer;
}
.close-button:hover,
.close-button:focus {
color: white;
text-decoration: none;
}
#modalHabitName {
text-align: center;
color: var(--current-habit-color, #4CAF50);
margin-bottom: 20px;
}
.month-navigation {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.month-navigation button {
background-color: var(--current-habit-color, #4CAF50);
color: var(--current-habit-text-color, white);
border: none;
border-radius: 5px;
padding: 8px 12px;
cursor: pointer;
font-size: 16px;
}
.month-navigation button:hover {
background-color: var(--current-habit-color, #45a049);
color: var(--current-habit-text-color, white);
filter: brightness(0.9);
}
#currentMonthYear {
font-size: 1.2em;
font-weight: bold;
color: #e0e0e0;
}
.weekdays-header {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 5px;
margin-bottom: 10px;
text-align: center;
font-weight: bold;
color: var(--current-habit-color, #4CAF50);
}
.weekdays-header div {
padding: 5px;
}
.date-grid-modal {
display: grid;
grid-template-columns: repeat(7, 1fr);
/* 7 days a week */
gap: 5px;
margin-bottom: 20px;
}
.date-cell {
text-align: center;
padding: 8px;
border-radius: 5px;
background-color: #444;
cursor: pointer;
color: #e0e0e0;
}
.date-cell.completed {
background-color: var(--current-habit-color, #4CAF50);
color: var(--current-habit-text-color, white);
}
.date-cell.partial {
background-color: #444;
position: relative;
color: #e0e0e0;
}
.date-cell.partial::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--current-habit-color, #4CAF50);
opacity: var(--completion-opacity, 0.5);
border-radius: inherit;
z-index: 1;
}
.date-cell.partial .date-day,
.date-cell.partial .date-counter {
position: relative;
z-index: 2;
}
.date-cell.today {
border: 2px solid #007bff;
/* Highlight today */
}
.date-cell.empty {
background-color: transparent;
cursor: default;
}
.date-day {
font-size: 1em;
font-weight: bold;
line-height: 1;
}
.date-counter {
font-size: 0.7em;
opacity: 0.8;
line-height: 1;
margin-top: 2px;
}
.streak-container {
display: flex;
align-items: center;
justify-content: center;
margin-top: 10px;
padding: 5px;
background-color: #444;
border-radius: 15px;
width: fit-content;
margin-left: auto;
margin-right: auto;
}
.flame-icon {
font-size: 1.2em;
margin-right: 5px;
}
.streak-count {
color: #e0e0e0;
font-size: 0.9em;
font-weight: bold;
}
.modal-actions {
display: flex;
justify-content: space-around;
gap: 10px;
}
.modal-actions button {
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
flex-grow: 1;
}
#modalCompleteTodayBtn {
background-color: var(--current-habit-color, #4CAF50);
color: var(--current-habit-text-color, white);
}
#modalCompleteTodayBtn:hover {
background-color: var(--current-habit-color, #45a049);
color: var(--current-habit-text-color, white);
filter: brightness(0.9);
}
#modalEditBtn {
background-color: #007bff;
color: white;
}
#modalEditBtn:hover {
background-color: #0056b3;
}
#modalDeleteBtn {
background-color: #dc3545;
color: white;
}
#modalDeleteBtn:hover {
background-color: #c82333;
}
.color-picker-section {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
gap: 10px;
}
.color-picker-section label {
color: #e0e0e0;
font-weight: bold;
}
#habitColorPicker {
width: 40px;
height: 40px;
border: none;
border-radius: 50%;
cursor: pointer;
background: none;
}
.daily-target-section {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
gap: 10px;
}
.daily-target-section label {
color: #e0e0e0;
font-weight: bold;
}
#habitDailyTarget {
width: 60px;
padding: 5px;
border: 1px solid #444;
border-radius: 5px;
background-color: #333;
color: #e0e0e0;
text-align: center;
}
.daily-target-section span {
color: #e0e0e0;
}