Femboy pink :3 (and save/load beta :3)
This commit is contained in:
parent
fb3d89a0bf
commit
422fed554e
3 changed files with 11 additions and 135 deletions
|
@ -57,6 +57,7 @@
|
|||
<option value="macchiato">Catppuccin Macchiato</option>
|
||||
<option value="frappe">Catppuccin Frappé</option>
|
||||
<option value="latte">Catppuccin Latte</option>
|
||||
<option value="femboy-pink">Femboy Pink</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-section">
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue