rozbuduj to zmieniając GUI na dużo ładniejsze i stylowe w terminalu:
const fs = window.require ? window.require('fs') : null;
const path = window.require ? window.require('path') : null;
const os = window.require ? window.require('os') : null;

const APP_DATA_DIR = 'FapZoneApp';
const SETTINGS_FILE_NAME = 'settings.json';

function getSettingsPath() {
  if (!os || !path || !fs) {
    console.warn("Node.js modules not available for settings.");
    return null;
  }
  const appData = os.homedir() + (process.platform === 'win32' ? '/AppData/Roaming' : '/.config');
  const settingsDir = path.join(appData, APP_DATA_DIR);
  const settingsPath = path.join(settingsDir, SETTINGS_FILE_NAME);

  // Ensure directory exists
  try {
    if (!fs.existsSync(settingsDir)) {
      fs.mkdirSync(settingsDir, { recursive: true });
    }
  } catch (e) {
    console.error("Failed to create settings directory:", e);
    return null;
  }

  return settingsPath;
}

function loadClientSettings() {
  const settingsPath = getSettingsPath();
  if (!settingsPath || !fs) return { theme: 'dark', animations: true, thumbsize: 'normal', volume: 80, osd: true, autoplay: false, loop: false, autoLogin: false, username: '', password: '' };

  try {
    if (fs.existsSync(settingsPath)) {
      const settingsData = fs.readFileSync(settingsPath, 'utf-8');
      const settings = JSON.parse(settingsData);
      // Provide default values if not found in file
      return {
        theme: settings.theme ?? 'dark',
        animations: settings.animations ?? true,
        thumbsize: settings.thumbsize ?? 'normal',
        volume: settings.volume ?? 80,
        osd: settings.osd ?? true,
        autoplay: settings.autoplay ?? false,
        loop: settings.loop ?? false,
        autoLogin: settings.autoLogin ?? false,
        username: settings.username ?? '',
        password: settings.password ?? '' // Store password ONLY if autoLogin is true AND user confirms
      };
    }
  } catch (e) {
    console.error("Failed to load client settings:", e);
  }
  // Return default settings if file doesn't exist or load fails
  return { theme: 'dark', animations: true, thumbsize: 'normal', volume: 80, osd: true, autoplay: false, loop: false, autoLogin: false, username: '', password: '' };
}

function saveClientSettings(settings) {
  const settingsPath = getSettingsPath();
  if (!settingsPath || !fs) {
    console.warn("Failed to save client settings: Node.js modules not available or path invalid.");
    return;
  }

  // Ensure directory exists (redundant if getSettingsPath works, but safe)
   try {
    if (!fs.existsSync(path.dirname(settingsPath))) {
      fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
    }
  } catch (e) {
    console.error("Failed to ensure settings directory for saving:", e);
    return;
  }

  try {
    // Clean up settings object before saving sensitive data (password)
    const settingsToSave = { ...settings };
     if (!settingsToSave.autoLogin) {
         settingsToSave.username = '';
         settingsToSave.password = ''; // Do NOT save password if auto-login is off
     }

    fs.writeFileSync(settingsPath, JSON.stringify(settingsToSave, null, 2), 'utf-8');
    console.log("Client settings saved successfully.");
  } catch (e) {
    console.error("Failed to save client settings:", e);
  }
}

// Add functions to window object so they can be accessed by renderer processes
window.clientSettings = {
    load: loadClientSettings,
    save: saveClientSettings
};

i daj cały kod