Auf Transparenz effect gewechselt

This commit is contained in:
jafreli
2025-07-19 00:07:04 +02:00
parent ff4c0825e8
commit 84c026ca9b
2 changed files with 42 additions and 9 deletions

View File

@@ -585,10 +585,10 @@ function applyCompletionStyling(element, currentCount, targetCount, color) {
// Fully completed - solid color
element.classList.add('completed');
} else {
// Partially completed - gradient
// Partially completed - transparency overlay
element.classList.add('partial');
const percentage = Math.round((currentCount / targetCount) * 100);
element.style.setProperty('--completion-percentage', `${percentage}%`);
const opacity = currentCount / targetCount; // 0.0 to 1.0
element.style.setProperty('--completion-opacity', opacity);
element.style.setProperty('--habit-color', color);
}
}
@@ -607,14 +607,14 @@ function applyModalCompletionStyling(element, currentCount, targetCount, color)
const contrastColor = getContrastColor(color);
element.style.setProperty('color', contrastColor);
} else {
// Partially completed - gradient with smart text color
// Partially completed - transparency overlay with smart text color
element.classList.add('partial');
const percentage = Math.round((currentCount / targetCount) * 100);
element.style.setProperty('--completion-percentage', `${percentage}%`);
const opacity = currentCount / targetCount; // 0.0 to 1.0
element.style.setProperty('--completion-opacity', opacity);
element.style.setProperty('--current-habit-color', color);
// For partial completion, use contrast color if more than 50% completed
if (percentage > 50) {
if (opacity > 0.5) {
const contrastColor = getContrastColor(color);
element.style.setProperty('color', contrastColor);
} else {