Skip to content

Real-time dashboard for monitoring global news, markets, and geopolitical events

TypeScript

Add first-visit onboarding with preset profiles

Reggie9385c6d7f356
diff --git a/index.html b/index.html
index da6f0ac..18ab0b6 100644
--- a/index.html
+++ b/index.html
@@ -50,6 +50,7 @@
<div class="settings-section-title">Layout</div>
<div class="settings-hint" style="margin-bottom: 0.5rem;">Drag panel headers to reorder</div>
<button class="settings-reset" onclick="resetPanelOrder()">Reset Layout</button>
+ <button class="settings-reset" onclick="resetOnboarding()" style="margin-top: 0.5rem;">Reconfigure Dashboard</button>
</div>
<div class="settings-section monitors-section">
<div class="settings-section-title">Custom Monitors</div>
@@ -94,6 +95,22 @@
</div>
</div>
+ <!-- Onboarding Modal -->
+ <div class="onboarding-modal" id="onboardingModal">
+ <div class="onboarding-content">
+ <div class="onboarding-header">
+ <div class="onboarding-title">Welcome to Situation Monitor</div>
+ <div class="onboarding-subtitle">Choose a profile to get started</div>
+ </div>
+ <div class="preset-cards" id="presetCards">
+ <!-- Preset cards rendered by JS -->
+ </div>
+ <div class="onboarding-footer">
+ You can change this later in Settings
+ </div>
+ </div>
+ </div>
+
<main class="dashboard">
<!-- Global Intelligence Map -->
<section class="panel" data-panel="map" style="grid-column: span 4;">
diff --git a/js/constants.js b/js/constants.js
index 0819c91..a0c8e47 100644
--- a/js/constants.js
+++ b/js/constants.js
@@ -1119,6 +1119,58 @@ export const SOURCE_TYPES = {
mainstream: ['reuters', 'ap news', 'bbc', 'cnn', 'nytimes', 'wsj', 'wapo', 'guardian', 'abc', 'nbc', 'cbs', 'fox']
};
+// Onboarding presets for first-time users
+export const PRESETS = {
+ 'news-junkie': {
+ id: 'news-junkie',
+ name: 'News Junkie',
+ icon: 'πŸ“°',
+ description: 'Stay on top of breaking news across politics, tech, and finance',
+ panels: ['politics', 'tech', 'finance', 'gov', 'ai', 'mainchar', 'map']
+ },
+ 'trader': {
+ id: 'trader',
+ name: 'Trader',
+ icon: 'πŸ“ˆ',
+ description: 'Market-focused dashboard with stocks, crypto, and commodities',
+ panels: ['markets', 'heatmap', 'commodities', 'polymarket', 'whales', 'printer', 'finance', 'map']
+ },
+ 'geopolitics': {
+ id: 'geopolitics',
+ name: 'Geopolitics Watcher',
+ icon: '🌍',
+ description: 'Global situation awareness and regional hotspots',
+ panels: ['map', 'intel', 'politics', 'gov', 'venezuela', 'greenland', 'correlation', 'narrative']
+ },
+ 'intel': {
+ id: 'intel',
+ name: 'Intelligence Analyst',
+ icon: 'πŸ”',
+ description: 'Deep analysis, pattern detection, and narrative tracking',
+ panels: ['map', 'intel', 'correlation', 'narrative', 'mainchar', 'politics']
+ },
+ 'minimal': {
+ id: 'minimal',
+ name: 'Minimal',
+ icon: '⚑',
+ description: 'Just the essentials - map, news, and markets',
+ panels: ['map', 'politics', 'markets']
+ },
+ 'everything': {
+ id: 'everything',
+ name: 'Everything',
+ icon: 'πŸŽ›οΈ',
+ description: 'Kitchen sink - all 21 panels enabled',
+ panels: Object.keys({
+ map: true, politics: true, tech: true, finance: true, gov: true,
+ heatmap: true, markets: true, monitors: true, commodities: true,
+ polymarket: true, whales: true, mainchar: true, printer: true,
+ contracts: true, ai: true, layoffs: true, venezuela: true,
+ greenland: true, intel: true, correlation: true, narrative: true
+ })
+ }
+};
+
// AI RSS feeds for arms race tracking
export const AI_FEEDS = [
{ name: 'OpenAI', url: 'https://openai.com/news/rss.xml' },
diff --git a/js/main.js b/js/main.js
index f8949eb..ce27d4f 100644
--- a/js/main.js
+++ b/js/main.js
@@ -30,6 +30,7 @@ import {
selectMonitorColor, saveMonitor, editMonitor, deleteMonitor,
renderMonitorsPanel
} from './monitors.js';
+import { initOnboarding, isFirstVisit } from './onboarding.js';
// Expose functions to window for onclick handlers
window.togglePanel = (id) => togglePanel(id, refreshAll);
@@ -253,8 +254,13 @@ document.addEventListener('DOMContentLoaded', () => {
// Initialize panels
initPanels(renderMonitorsList);
- // Initial data load
- refreshAll();
+ // Initialize onboarding (shows modal on first visit)
+ initOnboarding(refreshAll);
+
+ // Only load data if not first visit (onboarding will trigger refreshAll after preset selection)
+ if (!isFirstVisit()) {
+ refreshAll();
+ }
// Auto-refresh every hour (users can manually refresh anytime)
setInterval(refreshAll, 60 * 60 * 1000);
diff --git a/js/onboarding.js b/js/onboarding.js
new file mode 100644
index 0000000..7c5b4f6
--- /dev/null
+++ b/js/onboarding.js
@@ -0,0 +1,121 @@
+// onboarding.js - First-visit onboarding experience
+
+import { PRESETS, PANELS } from './constants.js';
+import { savePanelSettings, applyPanelSettings } from './panels.js';
+
+const STORAGE_KEY = 'onboardingComplete';
+const PRESET_KEY = 'selectedPreset';
+
+/**
+ * Check if this is the user's first visit
+ */
+export function isFirstVisit() {
+ return !localStorage.getItem(STORAGE_KEY);
+}
+
+/**
+ * Get the currently selected preset
+ */
+export function getSelectedPreset() {
+ return localStorage.getItem(PRESET_KEY) || null;
+}
+
+/**
+ * Show the onboarding modal
+ */
+export function showOnboarding() {
+ const modal = document.getElementById('onboardingModal');
+ if (modal) {
+ modal.classList.add('open');
+ document.body.style.overflow = 'hidden';
+ }
+}
+
+/**
+ * Hide the onboarding modal
+ */
+export function hideOnboarding() {
+ const modal = document.getElementById('onboardingModal');
+ if (modal) {
+ modal.classList.remove('open');
+ document.body.style.overflow = '';
+ }
+}
+
+/**
+ * Apply a preset configuration
+ */
+export function selectPreset(presetId, refreshCallback) {
+ const preset = PRESETS[presetId];
+ if (!preset) {
+ console.error('Unknown preset:', presetId);
+ return;
+ }
+
+ // Build panel settings - disable all panels first, then enable preset panels
+ const settings = {};
+ Object.keys(PANELS).forEach(panelId => {
+ settings[panelId] = preset.panels.includes(panelId);
+ });
+
+ // Save settings
+ savePanelSettings(settings);
+ localStorage.setItem(PRESET_KEY, presetId);
+ localStorage.setItem(STORAGE_KEY, 'true');
+
+ // Apply and refresh
+ applyPanelSettings();
+ hideOnboarding();
+
+ if (refreshCallback) {
+ refreshCallback();
+ }
+}
+
+/**
+ * Reset onboarding to show modal again
+ */
+export function resetOnboarding() {
+ localStorage.removeItem(STORAGE_KEY);
+ localStorage.removeItem(PRESET_KEY);
+ showOnboarding();
+}
+
+/**
+ * Render preset cards into the onboarding modal
+ */
+export function renderOnboardingCards() {
+ const container = document.getElementById('presetCards');
+ if (!container) return;
+
+ const presetOrder = ['news-junkie', 'trader', 'geopolitics', 'intel', 'minimal', 'everything'];
+
+ container.innerHTML = presetOrder.map(id => {
+ const preset = PRESETS[id];
+ return `
+ <div class="preset-card" onclick="selectPreset('${id}')">
+ <div class="preset-icon">${preset.icon}</div>
+ <div class="preset-name">${preset.name}</div>
+ <div class="preset-description">${preset.description}</div>
+ <div class="preset-panel-count">${preset.panels.length} panels</div>
+ </div>
+ `;
+ }).join('');
+}
+
+/**
+ * Initialize onboarding - call on DOMContentLoaded
+ */
+export function initOnboarding(refreshCallback) {
+ // Render preset cards
+ renderOnboardingCards();
+
+ // Expose selectPreset to window for onclick handlers
+ window.selectPreset = (presetId) => selectPreset(presetId, refreshCallback);
+ window.resetOnboarding = resetOnboarding;
+
+ // Show modal if first visit
+ if (isFirstVisit()) {
+ showOnboarding();
+ }
+}
diff --git a/styles.css b/styles.css
index bbef73d..b9101a1 100644
--- a/styles.css
+++ b/styles.css
@@ -4584,6 +4584,130 @@
color: var(--text);
}
+ /* Onboarding Modal */
+ .onboarding-modal {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 10, 5, 0.95);
+ z-index: 2000;
+ justify-content: center;
+ align-items: center;
+ }
+
+ .onboarding-modal.open {
+ display: flex;
+ }
+
+ .onboarding-content {
+ background: var(--bg);
+ border: 1px solid var(--border);
+ padding: 2rem;
+ max-width: 600px;
+ width: 90%;
+ max-height: 90vh;
+ overflow-y: auto;
+ }
+
+ .onboarding-header {
+ text-align: center;
+ margin-bottom: 1.5rem;
+ }
+
+ .onboarding-title {
+ font-size: 1.1rem;
+ font-weight: bold;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--green);
+ margin-bottom: 0.5rem;
+ }
+
+ .onboarding-subtitle {
+ font-size: 0.75rem;
+ color: var(--text-dim);
+ }
+
+ .preset-cards {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 1rem;
+ }
+
+ .preset-card {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ padding: 1.25rem;
+ cursor: pointer;
+ transition: all 0.2s;
+ text-align: center;
+ }
+
+ .preset-card:hover {
+ border-color: var(--green);
+ background: rgba(0, 255, 136, 0.05);
+ transform: translateY(-2px);
+ }
+
+ .preset-icon {
+ font-size: 2rem;
+ margin-bottom: 0.75rem;
+ }
+
+ .preset-name {
+ font-size: 0.8rem;
+ font-weight: bold;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ margin-bottom: 0.5rem;
+ color: var(--green);
+ }
+
+ .preset-description {
+ font-size: 0.65rem;
+ color: var(--text-dim);
+ line-height: 1.4;
+ margin-bottom: 0.5rem;
+ }
+
+ .preset-panel-count {
+ font-size: 0.6rem;
+ color: var(--text-dim);
+ opacity: 0.7;
+ }
+
+ .onboarding-footer {
+ text-align: center;
+ margin-top: 1.5rem;
+ font-size: 0.65rem;
+ color: var(--text-dim);
+ }
+
+ @media (max-width: 500px) {
+ .preset-cards {
+ grid-template-columns: 1fr;
+ }
+
+ .onboarding-content {
+ padding: 1.5rem;
+ width: 100%;
+ height: 100vh;
+ max-height: 100vh;
+ border: none;
+ }
+
+ .preset-card {
+ padding: 1rem;
+ }
+
+ .preset-icon {
+ font-size: 1.5rem;
+ }
+ }
+
/* Custom Hotspot (user-created) */
.custom-hotspot {
position: absolute;