1020 lines
28 KiB
HTML
1020 lines
28 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>내 진행 상황 - Chackly</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
/* Color Palette */
|
|
--primary: #6366f1;
|
|
--primary-light: #818cf8;
|
|
--primary-dark: #4f46e5;
|
|
--secondary: #f472b6;
|
|
--accent: #34d399;
|
|
--accent-warn: #fbbf24;
|
|
--accent-danger: #f87171;
|
|
|
|
/* Neutrals */
|
|
--bg-primary: #faf9fb;
|
|
--bg-secondary: #f3f2f7;
|
|
--bg-card: #ffffff;
|
|
--bg-overlay: rgba(99, 102, 241, 0.1);
|
|
|
|
/* Text */
|
|
--text-primary: #1e1b2e;
|
|
--text-secondary: #6b6880;
|
|
--text-muted: #9d99a8;
|
|
|
|
/* Shadows */
|
|
--shadow-sm: 0 2px 8px rgba(30, 27, 46, 0.06);
|
|
--shadow-md: 0 4px 20px rgba(30, 27, 46, 0.08);
|
|
--shadow-lg: 0 8px 40px rgba(30, 27, 46, 0.12);
|
|
--shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
|
|
|
|
/* Spacing */
|
|
--space-1: 4px;
|
|
--space-2: 8px;
|
|
--space-3: 12px;
|
|
--space-4: 16px;
|
|
--space-5: 20px;
|
|
--space-6: 24px;
|
|
--space-8: 32px;
|
|
--space-10: 40px;
|
|
--space-12: 48px;
|
|
--space-16: 64px;
|
|
|
|
/* Border Radius */
|
|
--radius-sm: 8px;
|
|
--radius-md: 12px;
|
|
--radius-lg: 20px;
|
|
--radius-xl: 28px;
|
|
--radius-full: 9999px;
|
|
|
|
/* Transitions */
|
|
--transition-fast: 150ms ease;
|
|
--transition-base: 250ms ease;
|
|
--transition-slow: 400ms ease;
|
|
--transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
}
|
|
|
|
[data-theme="dark"] {
|
|
--bg-primary: #0f0e17;
|
|
--bg-secondary: #1a1825;
|
|
--bg-card: #252336;
|
|
--bg-overlay: rgba(99, 102, 241, 0.15);
|
|
--text-primary: #f3f2f7;
|
|
--text-secondary: #a8a4b8;
|
|
--text-muted: #6b6880;
|
|
--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
--shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
|
|
--shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
min-height: 100vh;
|
|
overflow-x: hidden;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
h1, h2, h3, h4 {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Main Container */
|
|
.container {
|
|
max-width: 480px;
|
|
margin: 0 auto;
|
|
padding: var(--space-4);
|
|
padding-bottom: 100px;
|
|
}
|
|
|
|
/* Header */
|
|
.header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: var(--space-4) var(--space-6);
|
|
background: var(--bg-card);
|
|
box-shadow: var(--shadow-sm);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
border-radius: 0 0 var(--radius-lg) var(--radius-lg);
|
|
margin-bottom: var(--space-6);
|
|
}
|
|
|
|
.header-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.header-logo {
|
|
width: 40px;
|
|
height: 40px;
|
|
background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
|
|
border-radius: var(--radius-md);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.header-logo svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
fill: white;
|
|
}
|
|
|
|
.header-title {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.back-btn {
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: var(--radius-md);
|
|
background: var(--bg-secondary);
|
|
border: none;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
box-shadow: var(--shadow-sm);
|
|
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
|
}
|
|
|
|
.back-btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
.back-btn:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.back-btn svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
stroke: var(--text-primary);
|
|
fill: none;
|
|
}
|
|
|
|
/* Streak Badge (matches index.html style) */
|
|
.streak-badge {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
background: linear-gradient(135deg, var(--accent-warn) 0%, #f59e0b 100%);
|
|
color: white;
|
|
padding: var(--space-2) var(--space-4);
|
|
border-radius: var(--radius-full);
|
|
font-weight: 600;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.streak-badge svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
fill: white;
|
|
}
|
|
|
|
/* Streak Card */
|
|
.streak-card {
|
|
background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
|
|
border-radius: var(--radius-xl);
|
|
padding: var(--space-8);
|
|
text-align: center;
|
|
position: relative;
|
|
overflow: hidden;
|
|
box-shadow: var(--shadow-glow);
|
|
margin-bottom: var(--space-6);
|
|
}
|
|
|
|
.streak-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: -50%;
|
|
left: -50%;
|
|
width: 200%;
|
|
height: 200%;
|
|
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
|
|
animation: shimmer 3s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes shimmer {
|
|
0%, 100% { transform: translate(-10%, -10%) rotate(0deg); }
|
|
50% { transform: translate(10%, 10%) rotate(180deg); }
|
|
}
|
|
|
|
.streak-icon {
|
|
font-size: 3rem;
|
|
margin-bottom: var(--space-2);
|
|
animation: pulse 1.5s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0%, 100% { transform: scale(1); }
|
|
50% { transform: scale(1.1); }
|
|
}
|
|
|
|
.streak-count {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 4rem;
|
|
font-weight: 800;
|
|
color: white;
|
|
line-height: 1;
|
|
text-shadow: 0 4px 20px rgba(0,0,0,0.2);
|
|
}
|
|
|
|
.streak-label {
|
|
font-size: 1.25rem;
|
|
font-weight: 700;
|
|
color: rgba(255,255,255,0.95);
|
|
text-transform: uppercase;
|
|
letter-spacing: 2px;
|
|
margin-top: var(--space-2);
|
|
}
|
|
|
|
.streak-message {
|
|
color: rgba(255,255,255,0.9);
|
|
font-size: 0.9rem;
|
|
margin-top: var(--space-4);
|
|
}
|
|
|
|
/* Section Card */
|
|
.section-card {
|
|
background: var(--bg-card);
|
|
border-radius: var(--radius-lg);
|
|
padding: var(--space-5);
|
|
margin-bottom: var(--space-5);
|
|
box-shadow: var(--shadow-sm);
|
|
transition: transform var(--transition-base), box-shadow var(--transition-base);
|
|
}
|
|
|
|
.section-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
margin-bottom: var(--space-4);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.section-title::before {
|
|
content: '';
|
|
width: 4px;
|
|
height: 16px;
|
|
background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
/* Weekly Progress */
|
|
.weekly-progress {
|
|
margin-bottom: var(--space-4);
|
|
}
|
|
|
|
.progress-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: var(--space-3);
|
|
}
|
|
|
|
.progress-label {
|
|
font-size: 0.9rem;
|
|
color: var(--text-primary);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.progress-count {
|
|
font-size: 0.9rem;
|
|
color: var(--primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.progress-bar {
|
|
height: 12px;
|
|
background: var(--bg-secondary);
|
|
border-radius: var(--radius-full);
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.progress-fill {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
|
|
border-radius: var(--radius-full);
|
|
width: 0;
|
|
transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
|
|
position: relative;
|
|
}
|
|
|
|
.progress-fill::after {
|
|
content: '';
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 20px;
|
|
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
|
|
}
|
|
|
|
/* Week Days Grid */
|
|
.week-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr);
|
|
gap: var(--space-2);
|
|
margin-top: var(--space-4);
|
|
}
|
|
|
|
.week-day {
|
|
text-align: center;
|
|
}
|
|
|
|
.week-day-label {
|
|
font-size: 0.7rem;
|
|
color: var(--text-muted);
|
|
font-weight: 500;
|
|
margin-bottom: var(--space-2);
|
|
}
|
|
|
|
.week-day-indicator {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: var(--radius-md);
|
|
margin: 0 auto;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 1.1rem;
|
|
background: var(--bg-secondary);
|
|
transition: all var(--transition-base);
|
|
}
|
|
|
|
.week-day-indicator.completed {
|
|
background: linear-gradient(135deg, var(--accent) 0%, #10b981 100%);
|
|
color: white;
|
|
box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
|
|
}
|
|
|
|
.week-day-indicator.today {
|
|
border: 2px solid var(--primary);
|
|
box-shadow: 0 0 0 4px var(--bg-overlay);
|
|
}
|
|
|
|
/* Achievements */
|
|
.achievements-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.achievement {
|
|
position: relative;
|
|
aspect-ratio: 1;
|
|
border-radius: var(--radius-md);
|
|
background: var(--bg-secondary);
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: var(--space-1);
|
|
padding: var(--space-2);
|
|
transition: transform var(--transition-bounce), box-shadow var(--transition-base);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.achievement.unlocked {
|
|
background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
|
|
box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
|
|
}
|
|
|
|
.achievement.unlocked.gold {
|
|
background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
|
|
}
|
|
|
|
.achievement.unlocked.silver {
|
|
background: linear-gradient(135deg, #f3f4f6 0%, #d1d5db 100%);
|
|
box-shadow: 0 4px 20px rgba(156, 163, 175, 0.3);
|
|
}
|
|
|
|
.achievement.unlocked.bronze {
|
|
background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
|
|
box-shadow: 0 4px 20px rgba(251, 146, 60, 0.3);
|
|
}
|
|
|
|
.achievement.locked {
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.achievement:hover:not(.locked) {
|
|
transform: scale(1.05) translateY(-4px);
|
|
}
|
|
|
|
.achievement.locked:hover {
|
|
transform: scale(1.02);
|
|
}
|
|
|
|
.achievement.locked:hover .achievement-tooltip {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
transform: translateX(-50%) translateY(-10px);
|
|
}
|
|
|
|
.achievement-icon {
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.achievement-name {
|
|
font-size: 0.6rem;
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
text-align: center;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.achievement.locked .achievement-name {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.achievement-tooltip {
|
|
position: absolute;
|
|
bottom: calc(100% + 8px);
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(0);
|
|
background: var(--text-primary);
|
|
color: var(--bg-card);
|
|
padding: var(--space-2) var(--space-3);
|
|
border-radius: var(--radius-sm);
|
|
font-size: 0.7rem;
|
|
white-space: nowrap;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transition: all var(--transition-fast);
|
|
z-index: 10;
|
|
}
|
|
|
|
.achievement-tooltip::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
border: 6px solid transparent;
|
|
border-top-color: var(--text-primary);
|
|
}
|
|
|
|
.achievement.unlocked .achievement-tooltip {
|
|
display: none;
|
|
}
|
|
|
|
/* Unlock Animation */
|
|
@keyframes unlockPulse {
|
|
0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
|
|
50% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(251, 191, 36, 0); }
|
|
100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
|
|
}
|
|
|
|
.achievement.just-unlocked {
|
|
animation: unlockPulse 0.6s ease-out;
|
|
}
|
|
|
|
@keyframes sparkle {
|
|
0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
|
|
50% { opacity: 1; transform: scale(1) rotate(180deg); }
|
|
}
|
|
|
|
.sparkle {
|
|
position: absolute;
|
|
font-size: 1rem;
|
|
animation: sparkle 0.6s ease-out forwards;
|
|
}
|
|
|
|
/* Daily Tip */
|
|
.daily-tip {
|
|
background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
|
|
border-radius: var(--radius-md);
|
|
padding: var(--space-4);
|
|
display: flex;
|
|
gap: var(--space-3);
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.tip-icon {
|
|
font-size: 1.5rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.tip-content {
|
|
flex: 1;
|
|
}
|
|
|
|
.tip-text {
|
|
font-size: 0.9rem;
|
|
color: var(--text-primary);
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.tip-author {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
margin-top: var(--space-2);
|
|
}
|
|
|
|
/* Toggle Switch */
|
|
.toggle-container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: var(--space-4);
|
|
background: var(--bg-card);
|
|
border-radius: var(--radius-lg);
|
|
box-shadow: var(--shadow-sm);
|
|
}
|
|
|
|
.toggle-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.toggle-icon {
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.toggle-label {
|
|
font-size: 0.95rem;
|
|
font-weight: 500;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.toggle-sublabel {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.toggle-switch {
|
|
position: relative;
|
|
width: 56px;
|
|
height: 32px;
|
|
}
|
|
|
|
.toggle-switch input {
|
|
opacity: 0;
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
.toggle-slider {
|
|
position: absolute;
|
|
cursor: pointer;
|
|
inset: 0;
|
|
background: var(--bg-secondary);
|
|
border-radius: var(--radius-full);
|
|
transition: background var(--transition-base);
|
|
}
|
|
|
|
.toggle-slider::before {
|
|
content: '';
|
|
position: absolute;
|
|
height: 24px;
|
|
width: 24px;
|
|
left: 4px;
|
|
bottom: 4px;
|
|
background: white;
|
|
border-radius: 50%;
|
|
transition: transform var(--transition-bounce);
|
|
box-shadow: var(--shadow-sm);
|
|
}
|
|
|
|
.toggle-switch input:checked + .toggle-slider {
|
|
background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
|
|
}
|
|
|
|
.toggle-switch input:checked + .toggle-slider::before {
|
|
transform: translateX(24px);
|
|
}
|
|
|
|
/* Confetti */
|
|
.confetti-container {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
pointer-events: none;
|
|
z-index: 1000;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.confetti {
|
|
position: absolute;
|
|
width: 10px;
|
|
height: 10px;
|
|
opacity: 0;
|
|
}
|
|
|
|
@keyframes confettiFall {
|
|
0% {
|
|
opacity: 1;
|
|
transform: translateY(-100px) rotate(0deg);
|
|
}
|
|
100% {
|
|
opacity: 0;
|
|
transform: translateY(100vh) rotate(720deg);
|
|
}
|
|
}
|
|
|
|
/* Toast Notification */
|
|
.toast {
|
|
position: fixed;
|
|
bottom: 100px;
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(100px);
|
|
background: var(--text-primary);
|
|
color: var(--bg-card);
|
|
padding: var(--space-4) var(--space-6);
|
|
border-radius: var(--radius-full);
|
|
font-size: 0.9rem;
|
|
font-weight: 500;
|
|
box-shadow: var(--shadow-lg);
|
|
opacity: 0;
|
|
transition: all var(--transition-bounce);
|
|
z-index: 100;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.toast.show {
|
|
opacity: 1;
|
|
transform: translateX(-50%) translateY(0);
|
|
}
|
|
|
|
/* Streak Fire Animation */
|
|
@keyframes fireFlicker {
|
|
0%, 100% { transform: scaleY(1) scaleX(1); }
|
|
25% { transform: scaleY(1.1) scaleX(0.95); }
|
|
50% { transform: scaleY(0.95) scaleX(1.05); }
|
|
75% { transform: scaleY(1.05) scaleX(0.98); }
|
|
}
|
|
|
|
.streak-icon.animate {
|
|
animation: fireFlicker 0.3s ease-in-out infinite;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header class="header">
|
|
<div class="header-left">
|
|
<div class="header-logo">
|
|
<svg viewBox="0 0 24 24"><path d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/></svg>
|
|
</div>
|
|
<h1 class="header-title">내 진행 상황</h1>
|
|
</div>
|
|
<div class="header-right">
|
|
<button class="back-btn" onclick="window.location.href='index.html'">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
|
</svg>
|
|
뒤로
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="streak-card">
|
|
<div class="streak-icon" id="streakIcon">🔥</div>
|
|
<div class="streak-count" id="streakCount">0</div>
|
|
<div class="streak-label">STREAK!</div>
|
|
<div class="streak-message" id="streakMessage">오늘 시작하세요!</div>
|
|
</div>
|
|
|
|
<div class="section-card">
|
|
<div class="section-title">주간 목표</div>
|
|
<div class="weekly-progress">
|
|
<div class="progress-header">
|
|
<span class="progress-label">이번 주 완료된 일수</span>
|
|
<span class="progress-count"><span id="daysCompleted">0</span>/7</span>
|
|
</div>
|
|
<div class="progress-bar">
|
|
<div class="progress-fill" id="progressFill"></div>
|
|
</div>
|
|
</div>
|
|
<div class="week-grid" id="weekGrid">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-card">
|
|
<div class="section-title">업적</div>
|
|
<div class="achievements-grid" id="achievementsGrid">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-card">
|
|
<div class="section-title">오늘의 팁</div>
|
|
<div class="daily-tip">
|
|
<span class="tip-icon">💡</span>
|
|
<div class="tip-content">
|
|
<p class="tip-text" id="tipText">작은 걸음이 큰 변화를 만듭니다! 오늘 5분만的投资하세요.</p>
|
|
<p class="tip-author">— 오늘의 동기</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="toggle-container">
|
|
<div class="toggle-info">
|
|
<span class="toggle-icon">🔔</span>
|
|
<div>
|
|
<div class="toggle-label">습관 알림</div>
|
|
<div class="toggle-sublabel">매일 알림 받기</div>
|
|
</div>
|
|
</div>
|
|
<label class="toggle-switch">
|
|
<input type="checkbox" id="habitToggle">
|
|
<span class="toggle-slider"></span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="toast" id="toast">
|
|
<span id="toastIcon">🎉</span>
|
|
<span id="toastText">업적 달성!</span>
|
|
</div>
|
|
|
|
<div class="confetti-container" id="confettiContainer"></div>
|
|
|
|
<script>
|
|
// Data Management
|
|
const STORAGE_KEY = 'chackly_gamification';
|
|
|
|
const defaultData = {
|
|
streak: 12,
|
|
weeklyProgress: [true, true, true, true, false, false, false],
|
|
achievements: [
|
|
{ id: 'first_sort', name: '첫 정리', icon: '🏆', unlocked: true, tier: 'gold', requirement: '첫 정리 세션 완료' },
|
|
{ id: 'week_warrior', name: '주간 챌린저', icon: '🌟', unlocked: true, tier: 'gold', requirement: '7일 연속 완료' },
|
|
{ id: 'streak_7', name: '7일 스트릭', icon: '🔥', unlocked: true, tier: 'silver', requirement: '7일 스트릭 유지' },
|
|
{ id: 'diamond', name: '다이아몬드', icon: '💎', unlocked: true, tier: 'gold', requirement: '30일 스트릭 유지' },
|
|
{ id: 'organizer', name: '정리 달인', icon: '📦', unlocked: false, tier: 'silver', requirement: '100개 파일 정리' },
|
|
{ id: 'minimalist', name: '미니멀리스트', icon: '✨', unlocked: false, tier: 'bronze', requirement: '50개 파일 삭제' },
|
|
{ id: 'speed_demon', name: '스피드 데몬', icon: '⚡', unlocked: false, tier: 'gold', requirement: '하루에 50개 파일 정리' },
|
|
{ id: 'collector', name: '수집가', icon: '🗂️', unlocked: false, tier: 'silver', requirement: '5개 커스텀 폴더 생성' }
|
|
],
|
|
habitReminderEnabled: true,
|
|
lastUpdated: new Date().toISOString()
|
|
};
|
|
|
|
function loadData() {
|
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
if (stored) {
|
|
return { ...defaultData, ...JSON.parse(stored) };
|
|
}
|
|
return defaultData;
|
|
}
|
|
|
|
function saveData(data) {
|
|
data.lastUpdated = new Date().toISOString();
|
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
|
|
}
|
|
|
|
// UI Elements
|
|
const streakCount = document.getElementById('streakCount');
|
|
const streakIcon = document.getElementById('streakIcon');
|
|
const streakMessage = document.getElementById('streakMessage');
|
|
const progressFill = document.getElementById('progressFill');
|
|
const daysCompleted = document.getElementById('daysCompleted');
|
|
const weekGrid = document.getElementById('weekGrid');
|
|
const achievementsGrid = document.getElementById('achievementsGrid');
|
|
const habitToggle = document.getElementById('habitToggle');
|
|
const toast = document.getElementById('toast');
|
|
const toastIcon = document.getElementById('toastIcon');
|
|
const toastText = document.getElementById('toastText');
|
|
const confettiContainer = document.getElementById('confettiContainer');
|
|
|
|
const motivationalMessages = [
|
|
"불을 이어가세요!",
|
|
"오늘 불이 나고 있어요!",
|
|
"놀라운 일관성!",
|
|
"아무도 당신을 막을 수 없어요!",
|
|
"챔피언의 행동!"
|
|
];
|
|
|
|
const dailyTips = [
|
|
{ text: "작은 걸음이 큰 변화를 만듭니다! 오늘 5분만 투자하세요.", author: "일일 동기" },
|
|
{ text: "정돈된 공간은 정돈된 마음을 만듭니다. 작게 시작하세요!", author: "정리의 지혜" },
|
|
{ text: "정리된 모든 파일이 진보입니다.庆祝하세요!", author: "업적 달성" },
|
|
{ text: "미래의 당신이 오늘 정리한 것에 감사할 것입니다.", author: "타임 트래블러" },
|
|
{ text: "일관성이 완벽함을 이깁니다. 매일来吧!", author: "습관 마스터" }
|
|
];
|
|
|
|
// Animate streak count
|
|
function animateCount(element, target, duration = 1500) {
|
|
const start = 0;
|
|
const startTime = performance.now();
|
|
|
|
function update(currentTime) {
|
|
const elapsed = currentTime - startTime;
|
|
const progress = Math.min(elapsed / duration, 1);
|
|
const easeOut = 1 - Math.pow(1 - progress, 3);
|
|
const current = Math.floor(start + (target - start) * easeOut);
|
|
element.textContent = current;
|
|
|
|
if (progress < 1) {
|
|
requestAnimationFrame(update);
|
|
}
|
|
}
|
|
|
|
requestAnimationFrame(update);
|
|
}
|
|
|
|
// Render week grid
|
|
function renderWeekGrid(progress) {
|
|
const days = ['M', 'T', 'W', 'T', 'F', 'S', 'S'];
|
|
const today = new Date().getDay();
|
|
const mondayIndex = today === 0 ? 6 : today - 1;
|
|
|
|
weekGrid.innerHTML = days.map((day, i) => {
|
|
const completed = progress[i];
|
|
const isToday = i === mondayIndex;
|
|
return `
|
|
<div class="week-day">
|
|
<div class="week-day-label">${day}</div>
|
|
<div class="week-day-indicator ${completed ? 'completed' : ''} ${isToday ? 'today' : ''}">
|
|
${completed ? '✅' : (isToday ? '◉' : '')}
|
|
</div>
|
|
</div>
|
|
`;
|
|
}).join('');
|
|
}
|
|
|
|
// Render achievements
|
|
function renderAchievements(achievements) {
|
|
achievementsGrid.innerHTML = achievements.map(ach => `
|
|
<div class="achievement ${ach.unlocked ? `unlocked ${ach.tier}` : 'locked'}" data-id="${ach.id}">
|
|
<span class="achievement-icon">${ach.icon}</span>
|
|
<span class="achievement-name">${ach.name}</span>
|
|
<div class="achievement-tooltip">${ach.requirement}</div>
|
|
</div>
|
|
`).join('');
|
|
}
|
|
|
|
// Show toast notification
|
|
function showToast(icon, message) {
|
|
toastIcon.textContent = icon;
|
|
toastText.textContent = message;
|
|
toast.classList.add('show');
|
|
|
|
setTimeout(() => {
|
|
toast.classList.remove('show');
|
|
}, 3000);
|
|
}
|
|
|
|
// Confetti celebration
|
|
function triggerConfetti() {
|
|
const colors = ['#6366f1', '#f472b6', '#34d399', '#fbbf24', '#818cf8', '#34d399'];
|
|
const confettiCount = 50;
|
|
|
|
for (let i = 0; i < confettiCount; i++) {
|
|
const confetti = document.createElement('div');
|
|
confetti.className = 'confetti';
|
|
confetti.style.left = Math.random() * 100 + 'vw';
|
|
confetti.style.background = colors[Math.floor(Math.random() * colors.length)];
|
|
confetti.style.borderRadius = Math.random() > 0.5 ? '50%' : '0';
|
|
confetti.style.width = Math.random() * 10 + 5 + 'px';
|
|
confetti.style.height = confetti.style.width;
|
|
confetti.style.animation = `confettiFall ${Math.random() * 2 + 2}s ease-out forwards`;
|
|
confetti.style.animationDelay = Math.random() * 0.5 + 's';
|
|
|
|
confettiContainer.appendChild(confetti);
|
|
|
|
setTimeout(() => {
|
|
confetti.remove();
|
|
}, 4000);
|
|
}
|
|
}
|
|
|
|
// Trigger badge unlock animation
|
|
function animateBadgeUnlock(achievementId) {
|
|
const badge = document.querySelector(`.achievement[data-id="${achievementId}"]`);
|
|
if (badge) {
|
|
badge.classList.add('just-unlocked');
|
|
|
|
// Add sparkles
|
|
for (let i = 0; i < 6; i++) {
|
|
const sparkle = document.createElement('span');
|
|
sparkle.className = 'sparkle';
|
|
sparkle.textContent = '✨';
|
|
sparkle.style.left = Math.random() * 100 + '%';
|
|
sparkle.style.top = Math.random() * 100 + '%';
|
|
badge.appendChild(sparkle);
|
|
}
|
|
|
|
setTimeout(() => {
|
|
badge.classList.remove('just-unlocked');
|
|
badge.querySelectorAll('.sparkle').forEach(s => s.remove());
|
|
}, 600);
|
|
}
|
|
}
|
|
|
|
// Initialize page
|
|
function init() {
|
|
const data = loadData();
|
|
|
|
// Animate streak count
|
|
animateCount(streakCount, data.streak);
|
|
|
|
// Streak icon animation
|
|
if (data.streak > 0) {
|
|
streakIcon.classList.add('animate');
|
|
setTimeout(() => streakIcon.classList.remove('animate'), 1000);
|
|
}
|
|
|
|
// Update streak message
|
|
if (data.streak > 0) {
|
|
streakMessage.textContent = motivationalMessages[Math.floor(Math.random() * motivationalMessages.length)];
|
|
}
|
|
|
|
// Animate progress bar
|
|
const completedDays = data.weeklyProgress.filter(Boolean).length;
|
|
setTimeout(() => {
|
|
progressFill.style.width = (completedDays / 7 * 100) + '%';
|
|
}, 300);
|
|
daysCompleted.textContent = completedDays;
|
|
|
|
// Render week grid
|
|
renderWeekGrid(data.weeklyProgress);
|
|
|
|
// Render achievements
|
|
renderAchievements(data.achievements);
|
|
|
|
// Set habit toggle state
|
|
habitToggle.checked = data.habitReminderEnabled;
|
|
|
|
// Random daily tip
|
|
const randomTip = dailyTips[Math.floor(Math.random() * dailyTips.length)];
|
|
document.getElementById('tipText').textContent = `"${randomTip.text}"`;
|
|
document.querySelector('.tip-author').textContent = `— ${randomTip.author}`;
|
|
|
|
// Habit toggle handler
|
|
habitToggle.addEventListener('change', (e) => {
|
|
data.habitReminderEnabled = e.target.checked;
|
|
saveData(data);
|
|
showToast(e.target.checked ? '🔔' : '🔕', e.target.checked ? 'Reminders enabled!' : 'Reminders disabled');
|
|
});
|
|
|
|
// Achievement click handler (for demo unlock)
|
|
achievementsGrid.addEventListener('click', (e) => {
|
|
const achievement = e.target.closest('.achievement');
|
|
if (achievement && !achievement.classList.contains('unlocked')) {
|
|
// Simulate unlock for demo
|
|
const achId = achievement.dataset.id;
|
|
const achData = data.achievements.find(a => a.id === achId);
|
|
if (achData) {
|
|
achData.unlocked = true;
|
|
saveData(data);
|
|
animateBadgeUnlock(achId);
|
|
triggerConfetti();
|
|
showToast(achData.icon, `${achData.name} unlocked!`);
|
|
renderAchievements(data.achievements);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
// Run on load
|
|
document.addEventListener('DOMContentLoaded', init);
|
|
</script>
|
|
</body>
|
|
</html> |