mirror of
https://github.com/trevor1969/teatracker.git
synced 2026-08-09 18:51:59 +00:00
Compare commits
8 Commits
073834a5dc
...
v3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| daf742e309 | |||
| c628cf2069 | |||
| f111153bde | |||
| 0baceb14c6 | |||
| 91367a7198 | |||
| 7e1f52a5b2 | |||
| 7f059c9b4c | |||
| a16da66c2d |
340
app.js
340
app.js
@ -135,7 +135,8 @@ class NextcloudStorage {
|
||||
|
||||
if (response.ok) {
|
||||
const text = await response.text();
|
||||
return text ? JSON.parse(text) : null;
|
||||
// Return empty array if file is empty, otherwise parse JSON
|
||||
return text.trim() === '' ? [] : (text ? JSON.parse(text) : null);
|
||||
} else if (response.status === 404) {
|
||||
return null;
|
||||
}
|
||||
@ -223,10 +224,21 @@ class TeeTracker {
|
||||
this.charts = {};
|
||||
this.currentBgImage = null;
|
||||
|
||||
// Tea Timer
|
||||
this.timer = null;
|
||||
this.timerSeconds = 180; // 3 minutes in seconds
|
||||
this.timerRunning = false;
|
||||
this.timerPaused = false;
|
||||
this.remainingSeconds = 180;
|
||||
|
||||
// Initialize
|
||||
this.initStorage();
|
||||
this.setupEventListeners();
|
||||
this.setupTimerListeners();
|
||||
this.loadData().then(() => {
|
||||
this.init();
|
||||
this.renderAll();
|
||||
this.initCharts();
|
||||
this.updateSettingsStats();
|
||||
});
|
||||
}
|
||||
|
||||
@ -275,17 +287,36 @@ class TeeTracker {
|
||||
await this.nextcloudStorage.ensureDirectory();
|
||||
|
||||
// Check if old files exist in root directory and migrate to data/ directory
|
||||
await this.migrateToDataDirectory();
|
||||
await this.nextcloudStorage.migrateToDataDirectory();
|
||||
|
||||
const teas = await this.nextcloudStorage.loadFile(DATA_DIRECTORY + 'teas.json');
|
||||
const entries = await this.nextcloudStorage.loadFile(DATA_DIRECTORY + 'entries.json');
|
||||
|
||||
// Always load from localStorage first as backup
|
||||
const localTeas = localStorage.getItem(STORAGE_KEY_TEAS);
|
||||
const localEntries = localStorage.getItem(STORAGE_KEY_ENTRIES);
|
||||
|
||||
// Load from Nextcloud if available, otherwise use local data
|
||||
if (teas) {
|
||||
this.teas = teas.map(tea => ({
|
||||
...tea,
|
||||
organic: tea.organic !== undefined ? tea.organic : false,
|
||||
rating: tea.rating !== undefined ? tea.rating : 3
|
||||
}));
|
||||
} else if (localTeas) {
|
||||
// Nextcloud has no teas, use local data
|
||||
try {
|
||||
this.teas = JSON.parse(localTeas).map(tea => ({
|
||||
...tea,
|
||||
organic: tea.organic !== undefined ? tea.organic : false,
|
||||
rating: tea.rating !== undefined ? tea.rating : 3
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('Error loading local teas:', error);
|
||||
this.teas = [];
|
||||
}
|
||||
} else {
|
||||
this.teas = [];
|
||||
}
|
||||
|
||||
if (entries) {
|
||||
@ -293,11 +324,19 @@ class TeeTracker {
|
||||
...entry,
|
||||
teaspoons: entry.teaspoons !== undefined ? entry.teaspoons : 1
|
||||
}));
|
||||
}
|
||||
|
||||
// If Nextcloud loading failed, fall back to localStorage
|
||||
if (!teas || !entries) {
|
||||
this.loadFromLocalStorage();
|
||||
} else if (localEntries) {
|
||||
// Nextcloud has no entries, use local data
|
||||
try {
|
||||
this.entries = JSON.parse(localEntries).map(entry => ({
|
||||
...entry,
|
||||
teaspoons: entry.teaspoons !== undefined ? entry.teaspoons : 1
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('Error loading local entries:', error);
|
||||
this.entries = [];
|
||||
}
|
||||
} else {
|
||||
this.entries = [];
|
||||
}
|
||||
} else {
|
||||
// Load from localStorage
|
||||
@ -603,7 +642,8 @@ class TeeTracker {
|
||||
// ============================================
|
||||
|
||||
init() {
|
||||
this.setupEventListeners();
|
||||
// Initialization is now handled in constructor
|
||||
// This method is kept for backward compatibility
|
||||
this.renderAll();
|
||||
this.initCharts();
|
||||
this.updateSettingsStats();
|
||||
@ -620,6 +660,23 @@ class TeeTracker {
|
||||
document.getElementById('add-tea-btn').addEventListener('click', () => this.openTeaModal());
|
||||
}
|
||||
|
||||
// Event delegation for tea action buttons (edit/delete)
|
||||
const teasListContainer = document.getElementById('teas-list');
|
||||
if (teasListContainer) {
|
||||
teasListContainer.addEventListener('click', (e) => {
|
||||
const editBtn = e.target.closest('.tea-edit-btn');
|
||||
const deleteBtn = e.target.closest('.tea-delete-btn');
|
||||
|
||||
if (editBtn) {
|
||||
const teaId = editBtn.dataset.teaId;
|
||||
if (teaId) this.editTea(teaId);
|
||||
} else if (deleteBtn) {
|
||||
const teaId = deleteBtn.dataset.teaId;
|
||||
if (teaId) this.showDeleteTeaConfirm(teaId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Tea modal
|
||||
if (document.getElementById('close-modal')) {
|
||||
document.getElementById('close-modal').addEventListener('click', () => this.closeTeaModal());
|
||||
@ -693,6 +750,39 @@ class TeeTracker {
|
||||
|
||||
// Nextcloud settings
|
||||
this.setupNextcloudListeners();
|
||||
|
||||
// Tea Timer controls
|
||||
this.setupTimerListeners();
|
||||
}
|
||||
|
||||
setupTimerListeners() {
|
||||
// Timer control buttons
|
||||
const startBtn = document.getElementById('timer-start');
|
||||
const pauseBtn = document.getElementById('timer-pause');
|
||||
const resetBtn = document.getElementById('timer-reset');
|
||||
const decreaseBtn = document.getElementById('timer-decrease');
|
||||
const increaseBtn = document.getElementById('timer-increase');
|
||||
const timerInput = document.getElementById('timer-input');
|
||||
|
||||
if (startBtn) {
|
||||
startBtn.addEventListener('click', () => this.startTimer());
|
||||
}
|
||||
if (pauseBtn) {
|
||||
pauseBtn.addEventListener('click', () => this.pauseTimer());
|
||||
}
|
||||
if (resetBtn) {
|
||||
resetBtn.addEventListener('click', () => this.resetTimer());
|
||||
}
|
||||
if (decreaseBtn) {
|
||||
decreaseBtn.addEventListener('click', () => this.decreaseTimer());
|
||||
}
|
||||
if (increaseBtn) {
|
||||
increaseBtn.addEventListener('click', () => this.increaseTimer());
|
||||
}
|
||||
if (timerInput) {
|
||||
timerInput.addEventListener('change', (e) => this.updateTimerFromInput(e));
|
||||
timerInput.addEventListener('input', (e) => this.validateTimerInput(e));
|
||||
}
|
||||
}
|
||||
|
||||
setupNextcloudListeners() {
|
||||
@ -949,30 +1039,6 @@ class TeeTracker {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load existing data from localStorage before switching to Nextcloud
|
||||
// This prevents data loss when connecting to Nextcloud for the first time
|
||||
const existingTeas = localStorage.getItem(STORAGE_KEY_TEAS);
|
||||
const existingEntries = localStorage.getItem(STORAGE_KEY_ENTRIES);
|
||||
|
||||
if (existingTeas) {
|
||||
try {
|
||||
this.teas = JSON.parse(existingTeas).map(tea => ({
|
||||
...tea,
|
||||
organic: tea.organic !== undefined ? tea.organic : false
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('Error loading existing teas:', error);
|
||||
}
|
||||
}
|
||||
|
||||
if (existingEntries) {
|
||||
try {
|
||||
this.entries = JSON.parse(existingEntries);
|
||||
} catch (error) {
|
||||
console.error('Error loading existing entries:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Save config WITHOUT password for security
|
||||
// Password will be requested each time or stored in sessionStorage
|
||||
const config = { baseUrl: url, username, path };
|
||||
@ -985,8 +1051,38 @@ class TeeTracker {
|
||||
this.nextcloudStorage = ncStorage;
|
||||
this.useNextcloud = true;
|
||||
|
||||
// Save current data to Nextcloud
|
||||
await this.saveData();
|
||||
// Load data from Nextcloud first (this is the critical fix!)
|
||||
// This will automatically fall back to localStorage if Nextcloud has no data
|
||||
await this.loadData();
|
||||
|
||||
// Only save to Nextcloud if we actually have data to save
|
||||
// This prevents overwriting existing Nextcloud data with empty arrays
|
||||
if (this.teas.length > 0 || this.entries.length > 0) {
|
||||
await this.saveData();
|
||||
} else {
|
||||
// No data to save, but check if Nextcloud has existing data
|
||||
const existingTeas = await ncStorage.loadFile(DATA_DIRECTORY + 'teas.json');
|
||||
const existingEntries = await ncStorage.loadFile(DATA_DIRECTORY + 'entries.json');
|
||||
|
||||
// If Nextcloud has data, keep it and load it
|
||||
if (existingTeas || existingEntries) {
|
||||
if (existingTeas) {
|
||||
this.teas = existingTeas.map(tea => ({
|
||||
...tea,
|
||||
organic: tea.organic !== undefined ? tea.organic : false,
|
||||
rating: tea.rating !== undefined ? tea.rating : 3
|
||||
}));
|
||||
}
|
||||
if (existingEntries) {
|
||||
this.entries = existingEntries.map(entry => ({
|
||||
...entry,
|
||||
teaspoons: entry.teaspoons !== undefined ? entry.teaspoons : 1
|
||||
}));
|
||||
}
|
||||
// Don't save, just use the existing Nextcloud data
|
||||
}
|
||||
// If Nextcloud has no data and we have no data, nothing to do
|
||||
}
|
||||
|
||||
this.showStatusMessage('✅ Konfiguration gespeichert und Daten synchronisiert!', 'success');
|
||||
} else {
|
||||
@ -1270,8 +1366,8 @@ class TeeTracker {
|
||||
${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''}
|
||||
${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''}
|
||||
<div class="tea-actions">
|
||||
<button class="tea-action-btn tea-edit-btn" onclick="window.app.editTea('${tea.id}')">Bearbeiten</button>
|
||||
<button class="tea-action-btn tea-delete-btn" onclick="window.app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
|
||||
<button class="tea-action-btn tea-edit-btn" data-tea-id="${tea.id}" data-action="edit">Bearbeiten</button>
|
||||
<button class="tea-action-btn tea-delete-btn" data-tea-id="${tea.id}" data-action="delete">Löschen</button>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
@ -1318,8 +1414,8 @@ class TeeTracker {
|
||||
${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''}
|
||||
${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''}
|
||||
<div class="tea-actions">
|
||||
<button class="tea-action-btn tea-edit-btn" onclick="window.app.editTea('${tea.id}')">Bearbeiten</button>
|
||||
<button class="tea-action-btn tea-delete-btn" onclick="window.app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
|
||||
<button class="tea-action-btn tea-edit-btn" data-tea-id="${tea.id}" data-action="edit">Bearbeiten</button>
|
||||
<button class="tea-action-btn tea-delete-btn" data-tea-id="${tea.id}" data-action="delete">Löschen</button>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
@ -1835,6 +1931,172 @@ class TeeTracker {
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Tea Timer Methods
|
||||
// ============================================
|
||||
|
||||
TeeTracker.prototype.startTimer = function() {
|
||||
if (this.timerRunning && !this.timerPaused) return;
|
||||
|
||||
if (this.timerPaused) {
|
||||
// Resume from paused state
|
||||
this.timerPaused = false;
|
||||
} else {
|
||||
// Start new timer
|
||||
const input = document.getElementById('timer-input');
|
||||
let minutes = parseInt(input.value) || 3;
|
||||
|
||||
// Clamp to valid range
|
||||
minutes = Math.max(1, Math.min(15, minutes));
|
||||
this.timerSeconds = minutes * 60;
|
||||
this.remainingSeconds = this.timerSeconds;
|
||||
input.value = minutes;
|
||||
}
|
||||
|
||||
this.timerRunning = true;
|
||||
this.updateTimerButtons();
|
||||
this.updateTimerDisplay();
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.remainingSeconds--;
|
||||
this.updateTimerDisplay();
|
||||
|
||||
if (this.remainingSeconds <= 0) {
|
||||
this.stopTimer();
|
||||
this.showTimerNotification('⏰ Timer abgelaufen! Zeit für deinen Tee!');
|
||||
|
||||
// Play notification sound if possible
|
||||
if (typeof Audio !== 'undefined') {
|
||||
try {
|
||||
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
||||
const oscillator = audioContext.createOscillator();
|
||||
const gainNode = audioContext.createGain();
|
||||
oscillator.connect(gainNode);
|
||||
gainNode.connect(audioContext.destination);
|
||||
oscillator.frequency.value = 800;
|
||||
oscillator.type = 'sine';
|
||||
gainNode.gain.setValueAtTime(0.1, audioContext.currentTime);
|
||||
oscillator.start(audioContext.currentTime);
|
||||
oscillator.stop(audioContext.currentTime + 0.5);
|
||||
} catch (e) {
|
||||
console.log('Audio notification not supported');
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
TeeTracker.prototype.pauseTimer = function() {
|
||||
if (!this.timerRunning || this.timerPaused) return;
|
||||
|
||||
this.timerPaused = true;
|
||||
this.timerRunning = false;
|
||||
this.updateTimerButtons();
|
||||
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
};
|
||||
|
||||
TeeTracker.prototype.stopTimer = function() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
this.timerRunning = false;
|
||||
this.timerPaused = false;
|
||||
this.updateTimerButtons();
|
||||
};
|
||||
|
||||
TeeTracker.prototype.resetTimer = function() {
|
||||
this.stopTimer();
|
||||
const input = document.getElementById('timer-input');
|
||||
const minutes = parseInt(input.value) || 3;
|
||||
this.timerSeconds = Math.max(1, Math.min(15, minutes)) * 60;
|
||||
this.remainingSeconds = this.timerSeconds;
|
||||
this.updateTimerDisplay();
|
||||
this.updateTimerButtons();
|
||||
};
|
||||
|
||||
TeeTracker.prototype.decreaseTimer = function() {
|
||||
const input = document.getElementById('timer-input');
|
||||
let minutes = parseInt(input.value) || 3;
|
||||
minutes = Math.max(1, minutes - 1);
|
||||
input.value = minutes;
|
||||
this.timerSeconds = minutes * 60;
|
||||
this.remainingSeconds = this.timerSeconds;
|
||||
this.updateTimerDisplay();
|
||||
};
|
||||
|
||||
TeeTracker.prototype.increaseTimer = function() {
|
||||
const input = document.getElementById('timer-input');
|
||||
let minutes = parseInt(input.value) || 3;
|
||||
minutes = Math.min(15, minutes + 1);
|
||||
input.value = minutes;
|
||||
this.timerSeconds = minutes * 60;
|
||||
this.remainingSeconds = this.timerSeconds;
|
||||
this.updateTimerDisplay();
|
||||
};
|
||||
|
||||
TeeTracker.prototype.updateTimerFromInput = function(e) {
|
||||
let minutes = parseInt(e.target.value) || 3;
|
||||
minutes = Math.max(1, Math.min(15, minutes));
|
||||
e.target.value = minutes;
|
||||
this.timerSeconds = minutes * 60;
|
||||
this.remainingSeconds = this.timerSeconds;
|
||||
this.updateTimerDisplay();
|
||||
};
|
||||
|
||||
TeeTracker.prototype.validateTimerInput = function(e) {
|
||||
let value = e.target.value;
|
||||
// Remove non-numeric characters
|
||||
value = value.replace(/\D/g, '');
|
||||
if (value === '') value = '3';
|
||||
let minutes = parseInt(value) || 3;
|
||||
minutes = Math.max(1, Math.min(15, minutes));
|
||||
e.target.value = minutes;
|
||||
};
|
||||
|
||||
TeeTracker.prototype.updateTimerDisplay = function() {
|
||||
const display = document.getElementById('timer-display');
|
||||
if (!display) return;
|
||||
|
||||
const minutes = Math.floor(this.remainingSeconds / 60);
|
||||
const seconds = this.remainingSeconds % 60;
|
||||
display.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
TeeTracker.prototype.updateTimerButtons = function() {
|
||||
const startBtn = document.getElementById('timer-start');
|
||||
const pauseBtn = document.getElementById('timer-pause');
|
||||
const resetBtn = document.getElementById('timer-reset');
|
||||
const decreaseBtn = document.getElementById('timer-decrease');
|
||||
const increaseBtn = document.getElementById('timer-increase');
|
||||
const timerInput = document.getElementById('timer-input');
|
||||
|
||||
if (startBtn) startBtn.disabled = this.timerRunning && !this.timerPaused;
|
||||
if (pauseBtn) pauseBtn.disabled = !this.timerRunning || this.timerPaused;
|
||||
if (resetBtn) resetBtn.disabled = false;
|
||||
if (decreaseBtn) decreaseBtn.disabled = this.timerRunning && !this.timerPaused;
|
||||
if (increaseBtn) increaseBtn.disabled = this.timerRunning && !this.timerPaused;
|
||||
if (timerInput) timerInput.disabled = this.timerRunning && !this.timerPaused;
|
||||
};
|
||||
|
||||
TeeTracker.prototype.showTimerNotification = function(message) {
|
||||
const notification = document.getElementById('timer-notification');
|
||||
if (notification) {
|
||||
notification.textContent = message;
|
||||
notification.className = 'timer-notification success';
|
||||
notification.style.display = 'block';
|
||||
|
||||
// Hide after 5 seconds
|
||||
setTimeout(() => {
|
||||
notification.style.display = 'none';
|
||||
}, 5000);
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize the application
|
||||
let app;
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
57
index.html
57
index.html
@ -43,6 +43,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tea Timer -->
|
||||
<div class="timer-section">
|
||||
<h3>⏱️ Tee-Timer</h3>
|
||||
<div class="timer-controls">
|
||||
<div class="timer-display" id="timer-display">03:00</div>
|
||||
<div class="timer-input-group">
|
||||
<button id="timer-decrease" class="timer-btn">-</button>
|
||||
<input type="number" id="timer-input" min="1" max="15" value="3" class="timer-input">
|
||||
<button id="timer-increase" class="timer-btn">+</button>
|
||||
<span class="timer-unit">Minuten</span>
|
||||
</div>
|
||||
<div class="timer-actions">
|
||||
<button id="timer-start" class="btn btn-primary">Start</button>
|
||||
<button id="timer-pause" class="btn btn-secondary" disabled>Pause</button>
|
||||
<button id="timer-reset" class="btn btn-secondary">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="timer-notification" class="timer-notification" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
<div class="recent-activity">
|
||||
<h3>Letzte Aktivitäten</h3>
|
||||
<div id="recent-entries" class="activity-list"></div>
|
||||
@ -181,6 +201,39 @@
|
||||
<button id="export-data" class="btn btn-secondary">📤 Daten exportieren</button>
|
||||
<button id="import-data" class="btn btn-secondary">📥 Daten importieren</button>
|
||||
<button id="clear-data" class="btn btn-danger">🗑️ Alle Daten löschen</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="settings-section">
|
||||
<h3>🎨 Hintergrundbild</h3>
|
||||
<p>Wähle ein Hintergrundbild für deine TeeTracker-App.</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bg-image-upload">Hintergrundbild hochladen:</label>
|
||||
<input type="file" id="bg-image-upload" accept="image/*">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bg-image-preview">Vorschau:</label>
|
||||
<div id="bg-image-preview" class="bg-preview" style="display: none;">
|
||||
<img id="bg-preview-img" style="max-width: 200px; max-height: 150px; border-radius: 8px; margin-top: 10px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group checkbox-group">
|
||||
<label>
|
||||
<input type="checkbox" id="bg-enabled">
|
||||
<span class="checkmark"></span>
|
||||
Hintergrundbild aktivieren
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button id="remove-bg" class="btn btn-secondary" style="display: none;">🗑️ Hintergrund entfernen</button>
|
||||
<button id="save-bg" class="btn btn-primary">💾 Hintergrund speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -353,8 +406,8 @@
|
||||
<textarea id="import-data-textarea" class="modal-textarea" placeholder="{\n \"teas\": [...],\n \"entries\": [...]\n}"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="import-data-btn" class="btn btn-primary" onclick="window.app.handleImportData()">📥 Importieren</button>
|
||||
<button id="cancel-import-btn" class="btn btn-secondary" onclick="window.app.closeImportModal()">Abbrechen</button>
|
||||
<button id="import-data-btn" class="btn btn-primary">📥 Importieren</button>
|
||||
<button id="cancel-import-btn" class="btn btn-secondary">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
99
styles.css
99
styles.css
@ -1036,3 +1036,102 @@ header p {
|
||||
box-shadow: var(--box-shadow);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/* Tea Timer Styles */
|
||||
.timer-section {
|
||||
background: var(--card-bg);
|
||||
border-radius: var(--border-radius);
|
||||
padding: 20px;
|
||||
margin-top: 20px;
|
||||
box-shadow: var(--box-shadow);
|
||||
}
|
||||
|
||||
.timer-section h3 {
|
||||
margin-bottom: 15px;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.timer-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.timer-display {
|
||||
font-size: 3rem;
|
||||
font-weight: bold;
|
||||
color: var(--primary-color);
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.timer-input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.timer-btn {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border: none;
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
font-size: 1.2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.timer-btn:hover {
|
||||
background-color: var(--primary-dark);
|
||||
}
|
||||
|
||||
.timer-btn:disabled {
|
||||
background-color: #cccccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.timer-input {
|
||||
width: 60px;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
background-color: var(--card-bg);
|
||||
}
|
||||
|
||||
.timer-unit {
|
||||
color: var(--text-light);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.timer-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.timer-notification {
|
||||
margin-top: 15px;
|
||||
padding: 10px;
|
||||
border-radius: var(--border-radius);
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
animation: pulse 1s infinite;
|
||||
}
|
||||
|
||||
.timer-notification.success {
|
||||
background-color: rgba(40, 167, 69, 0.2);
|
||||
color: var(--success-color);
|
||||
border: 1px solid var(--success-color);
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user