From 422fed554e5fbb4dbf8d03a025d32c20bea9f95b Mon Sep 17 00:00:00 2001 From: ploszukiwacz Date: Sun, 2 Feb 2025 22:25:49 +0100 Subject: [PATCH] Femboy pink :3 (and save/load beta :3) --- startpage/index.html | 1 + startpage/js/modules/SettingsManager.js | 73 ------------------------- startpage/styles.css | 72 ++++-------------------- 3 files changed, 11 insertions(+), 135 deletions(-) diff --git a/startpage/index.html b/startpage/index.html index 6ac6f03..2a70c74 100755 --- a/startpage/index.html +++ b/startpage/index.html @@ -57,6 +57,7 @@ +
diff --git a/startpage/js/modules/SettingsManager.js b/startpage/js/modules/SettingsManager.js index e41ab5a..11d60af 100755 --- a/startpage/js/modules/SettingsManager.js +++ b/startpage/js/modules/SettingsManager.js @@ -10,7 +10,6 @@ export class SettingsManager { init() { this.attachEventListeners(); this.loadSavedSettings(); - this.setupDataManagement(); } attachEventListeners() { @@ -71,78 +70,6 @@ export class SettingsManager { customStyle.textContent = customCSSEditor.value; document.head.appendChild(customStyle); } - - setupDataManagement() { - document.getElementById('exportData').addEventListener('click', () => this.exportAllData()); - document.getElementById('importData').addEventListener('click', () => { - document.getElementById('importDataFile').click(); - }); - document.getElementById('importDataFile').addEventListener('change', (e) => { - if (e.target.files[0]) this.importAllData(e.target.files[0]); - }); - } - - async exportAllData() { - const data = { - version: '1.0.0', - exportDate: new Date().toISOString(), - settings: { - theme: localStorage.getItem('theme'), - layout: localStorage.getItem('layout'), - font: localStorage.getItem('font'), - linkSize: localStorage.getItem('linkSize'), - username: localStorage.getItem('username'), - background: localStorage.getItem('background'), - customCSS: localStorage.getItem('customCSS') - }, - links: JSON.parse(localStorage.getItem('customLinks') || '{}'), - shortcuts: JSON.parse(localStorage.getItem('shortcuts') || '{}'), - searchEngines: JSON.parse(localStorage.getItem('searchEngines') || '[]'), - customIcons: JSON.parse(localStorage.getItem('customIcons') || '{}') - }; - - const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }); - const url = URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = `startpage-backup-${new Date().toISOString().split('T')[0]}.json`; - a.click(); - URL.revokeObjectURL(url); - } - - async importAllData(file) { - try { - const text = await file.text(); - const data = JSON.parse(text); - - if (!data.version) { - throw new Error('Invalid backup file format'); - } - - // Confirm import - if (!confirm('This will override all your current settings. Continue?')) { - return; - } - - // Import settings - Object.entries(data.settings).forEach(([key, value]) => { - if (value !== null) localStorage.setItem(key, value); - }); - - // Import data - localStorage.setItem('customLinks', JSON.stringify(data.links)); - localStorage.setItem('shortcuts', JSON.stringify(data.shortcuts)); - localStorage.setItem('searchEngines', JSON.stringify(data.searchEngines)); - localStorage.setItem('customIcons', JSON.stringify(data.customIcons)); - - // Reload page to apply changes - alert('Settings imported successfully. The page will now reload.'); - window.location.reload(); - } catch (error) { - console.error('Failed to import data:', error); - alert('Failed to import settings. Make sure the file is a valid backup.'); - } - } } class ThemeManager { diff --git a/startpage/styles.css b/startpage/styles.css index 59987b9..d13ae61 100755 --- a/startpage/styles.css +++ b/startpage/styles.css @@ -35,6 +35,15 @@ --latte-blue: #1e66f5; --latte-pink: #ea76cb; + /* Femboy Pink Theme */ + --femboy-pink-base: #ffebf0; + --femboy-pink-base-rgb: 255, 235, 240; + --femboy-pink-surface0: #ffccd5; + --femboy-pink-surface1: #ffb3c1; + --femboy-pink-text: #ff5e78; + --femboy-pink-blue: #5e5eff; + --femboy-pink-pink: #ff5e78; + /* Default theme (Mocha) */ --base: var(--mocha-base); --base-rgb: var(--mocha-base-rgb); @@ -129,26 +138,9 @@ body { } .category a { - display: inline-flex; - align-items: center; - gap: 0.5rem; color: var(--text); text-decoration: none; - transition: all 0.2s; - font-size: calc(var(--link-size, 16px) * 0.9); - line-height: 1.5; - padding: 0.25rem 0; -} - -.category a i, -.category a img.custom-link-icon { - width: var(--link-size, 16px); - height: var(--link-size, 16px); - min-width: var(--link-size, 16px); - display: flex; - align-items: center; - justify-content: center; - font-size: calc(var(--link-size, 16px) * 0.8); + transition: color 0.2s; } .category a:hover { @@ -850,47 +842,3 @@ body { transform: translateY(-2px); background: var(--surface0); } - -.copyright-section { - margin-top: 2rem; - padding-top: 1rem; - border-top: 1px solid var(--surface0); - text-align: center; - font-size: 0.95rem; - opacity: 1; - color: var(--text); -} - -.copyright-section p { - margin: 0.5rem 0; - line-height: 1.6; -} - -copyright-section a { - color: var(--blue); - text-decoration: none; - transition: all 0.2s; - font-weight: 500; - padding: 0.1rem 0.3rem; - border-radius: 4px; -} - -copyright-section a:hover { - color: var(--pink); - background: var(--surface0); -} - -copyright-footer { - margin-top: 1rem; - font-size: 0.85rem; - opacity: 0.7; - color: var(--text); -} - -.settings-note { - margin-top: 1rem; - font-size: 0.9rem; - opacity: 0.8; - color: var(--text); - text-align: center; -}