diff --git a/.gitignore b/.gitignore index 3bfa397..088d27e 100644 Binary files a/.gitignore and b/.gitignore differ diff --git a/css/index.css b/css/index.css index b3ca57a..3218961 100644 --- a/css/index.css +++ b/css/index.css @@ -53,7 +53,7 @@ } @media (prefers-color-scheme: dark) { - :root { + :root:not([data-theme="light"]) { --color-background-primary: #181816; --color-background-secondary: #20201e; --color-background-tertiary: #272725; @@ -83,6 +83,42 @@ } } +:root[data-theme="dark"] { + --color-background-primary: #181816; + --color-background-secondary: #20201e; + --color-background-tertiary: #272725; + --color-text-primary: #efede5; + --color-text-secondary: #a3a198; + --color-text-tertiary: #73726c; + --color-border-tertiary: rgba(255, 255, 255, 0.06); + --color-border-secondary: rgba(255, 255, 255, 0.12); + --color-border-primary: rgba(255, 255, 255, 0.22); +} + +:root[data-theme="amoled"] { + --color-background-primary: #000000; + --color-background-secondary: #0a0a0a; + --color-background-tertiary: #111111; + --color-text-primary: #ffffff; + --color-text-secondary: #aaaaaa; + --color-text-tertiary: #777777; + --color-border-tertiary: rgba(255, 255, 255, 0.1); + --color-border-secondary: rgba(255, 255, 255, 0.15); + --color-border-primary: rgba(255, 255, 255, 0.25); +} + +:root[data-theme="light"] { + --color-background-primary: #ffffff; + --color-background-secondary: #f7f7f5; + --color-background-tertiary: #efefec; + --color-text-primary: #1a1a18; + --color-text-secondary: #6b6b66; + --color-text-tertiary: #9c9a92; + --color-border-tertiary: rgba(0, 0, 0, 0.08); + --color-border-secondary: rgba(0, 0, 0, 0.15); + --color-border-primary: rgba(0, 0, 0, 0.30); +} + body { font-family: var(--font-sans); background: var(--color-background-tertiary); @@ -5013,3 +5049,72 @@ body { @keyframes slideDown { to { opacity: 0; transform: translateY(10px); } } + +/* Profile Customization Styles */ +:root { + --accent-color: var(--color-text-primary); + --dashboard-bg-color: var(--color-background-primary); +} + +.btn-primary { + background: var(--accent-color) !important; +} + +.app { + background: var(--dashboard-bg-color) !important; +} + +.profile-input::placeholder { + color: var(--color-text-tertiary); + opacity: 0.7; +} + +.color-option { + width: 32px; + height: 32px; + border-radius: 50%; + cursor: pointer; + border: 2px solid transparent; + transition: transform 0.2s, border-color 0.2s; +} + +.color-option.active { + transform: scale(1.1); + border-color: var(--color-text-primary); +} + +.preset-cover { + height: 80px; + border-radius: 8px; + background-size: cover; + background-position: center; + cursor: pointer; + transition: transform 0.2s, box-shadow 0.2s; + border: 2px solid transparent; +} + +.preset-cover:hover { + transform: scale(1.05); + box-shadow: var(--shadow-md); +} + +.preset-cover.active { + border-color: var(--accent-color); +} + +.theme-btn { + border: 1px solid var(--color-border-secondary); + background: var(--color-background-primary); + color: var(--color-text-primary); +} + +.theme-btn.active { + border-color: var(--color-text-primary); + box-shadow: 0 0 0 1px var(--color-text-primary); +} + + +/* Profile Banner Transition */ +#profile-banner { + transition: object-position 0.15s ease-out; +} diff --git a/database.js b/database.js index 6fc7bec..ddeeffa 100644 --- a/database.js +++ b/database.js @@ -40,6 +40,32 @@ function initDb() { } }); + // Users Table (for persistence) + db.run(`CREATE TABLE IF NOT EXISTS users ( + email TEXT PRIMARY KEY, + password TEXT NOT NULL, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + )`); + + // User Profiles Table + db.run(`CREATE TABLE IF NOT EXISTS user_profiles ( + email TEXT PRIMARY KEY, + display_name TEXT, + bio TEXT, + academic_details TEXT, + social_links TEXT, + avatar_url TEXT, + banner_url TEXT, + banner_position_y TEXT DEFAULT '50%', + theme_mode TEXT DEFAULT 'dark', + accent_color TEXT, + font_family TEXT DEFAULT 'Inter', + dashboard_bg TEXT, + dashboard_layout TEXT DEFAULT '{"calendar":true,"tasks":true,"focus":true,"statistics":true,"order":["greeting","calendar","tasks","focus","statistics"]}', + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (email) REFERENCES users(email) + )`); + // Pre-populate some subjects if empty db.get('SELECT COUNT(*) as count FROM subjects', (err, row) => { if (row && row.count === 0) { diff --git a/index.html b/index.html index cd7ef13..64e6c2c 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + @@ -61,7 +61,7 @@

StudyPlan

- +
@@ -197,6 +197,110 @@

StudyPlan

+ + +
+

Study Statistics

+
+
+
0h
+
Total Focus Time
+
+
+
0
+
Tasks Completed
+
+
+
+ + + @@ -303,7 +407,7 @@

+