Elffuss BraidHub

kikocis/osiris public

feat: enhance Japan intelligence coverage and add resizable/maximized HUD panels
Changeset8a1033cc1793a214e5c0d3bcc924b24b05c2e36c7eb1fd5a0aa0ae925711e31b
AuthorIida <iidam@qunie.local> · 2026-05-27 19:19 +09:00
CommitterIida <iidam@qunie.local> · 2026-05-27 19:19 +09:00
Parentsef132afed5cd

Browse the files at this changeset

7 files changed

added src/app/api/cctv/japan.ts +45 −0
@@ -0,0 +1,45 @@
1+import type { CctvCamera } from './types';
2+
3+const JAPAN_CAMERAS: CctvCamera[] = [
4+ {
5+ id: 'jp-shibuya-crossing',
6+ lat: 35.6595, lng: 139.7005,
7+ name: 'Shibuya Scramble Crossing',
8+ city: 'Tokyo', country: 'Japan',
9+ stream_url: 'https://www.youtube.com/embed/HpdO5Kq3o7Y?autoplay=1&mute=1',
10+ stream_type: 'iframe',
11+ source: 'ANN News / YouTube',
12+ },
13+ {
14+ id: 'jp-tokyo-tower',
15+ lat: 35.6586, lng: 139.7454,
16+ name: 'Tokyo Tower Live Cam',
17+ city: 'Tokyo', country: 'Japan',
18+ stream_url: 'https://www.youtube.com/embed/cbJ03Xk_eLQ?autoplay=1&mute=1',
19+ stream_type: 'iframe',
20+ source: 'YouTube',
21+ },
22+ {
23+ id: 'jp-mt-fuji',
24+ lat: 35.3606, lng: 138.7274,
25+ name: 'Mt. Fuji Live',
26+ city: 'Shizuoka/Yamanashi', country: 'Japan',
27+ stream_url: 'https://www.youtube.com/embed/5aLh8R2HqOQ?autoplay=1&mute=1',
28+ stream_type: 'iframe',
29+ source: 'YouTube',
30+ },
31+ {
32+ id: 'jp-osaka-dotonbori',
33+ lat: 34.6687, lng: 135.5013,
34+ name: 'Dotonbori Live Cam',
35+ city: 'Osaka', country: 'Japan',
36+ stream_url: 'https://www.youtube.com/embed/m6J9w94oBXY?autoplay=1&mute=1',
37+ stream_type: 'iframe',
38+ source: 'YouTube',
39+ }
40+];
41+
42+export async function fetchJapanCameras(): Promise<CctvCamera[]> {
43+ // Static cameras don't need a fetch, we just return them wrapped in a Promise
44+ return JAPAN_CAMERAS;
45+}
modified src/app/api/cctv/route.ts +4 −0
@@ -7,6 +7,7 @@
77 import { fetchTurkeyCameras } from './turkey';
88 import { fetchRomaniaCameras } from './romania';
99 import { fetchAustraliaCameras } from './australia';
10+import { fetchJapanCameras } from './japan';
1011
1112 /**
1213 * OSIRIS — Worldwide CCTV Camera API v2
@@ -323,6 +324,9 @@
323324 if (inRomania) regions.push('romania');
324325 if (inTurkey) regions.push('turkey');
325326
327+ // Japan
328+ if (lat > 24 && lat < 46 && lng > 122 && lng < 154) regions.push('japan');
329+
326330 // Asia (includes Middle East, SE Asia, overriding parts of china but that's ok they can both load)
327331 if ((lat > -10 && lat < 60 && lng > 60 && lng < 150)) regions.push('asia');
328332 // Australia explicitly
modified src/app/api/maritime/route.ts +15 −0
@@ -16,6 +16,19 @@
1616 { name: 'Busan', country: 'KR', lat: 35.10, lng: 129.04, type: 'container', volume: '22.7M TEU', rank: 6 },
1717 { name: 'Qingdao', country: 'CN', lat: 36.07, lng: 120.38, type: 'container', volume: '22.0M TEU', rank: 7 },
1818 { name: 'Rotterdam', country: 'NL', lat: 51.90, lng: 4.50, type: 'container', volume: '14.5M TEU', rank: 8 },
19+ { name: 'Tokyo', country: 'JP', lat: 35.61, lng: 139.79, type: 'container', volume: '4.5M TEU' },
20+ { name: 'Yokohama', country: 'JP', lat: 35.45, lng: 139.66, type: 'container', volume: '2.9M TEU' },
21+ { name: 'Kobe', country: 'JP', lat: 34.67, lng: 135.21, type: 'container', volume: '2.8M TEU' },
22+ { name: 'Nagoya', country: 'JP', lat: 35.08, lng: 136.87, type: 'container', volume: '2.6M TEU' },
23+ { name: 'Osaka', country: 'JP', lat: 34.63, lng: 135.41, type: 'container', volume: '2.1M TEU' },
24+ { name: 'Hakata (Fukuoka)', country: 'JP', lat: 33.60, lng: 130.40, type: 'container', volume: '0.9M TEU' },
25+ { name: 'Kitakyushu', country: 'JP', lat: 33.91, lng: 130.93, type: 'container', volume: '0.5M TEU' },
26+ { name: 'Shimizu', country: 'JP', lat: 35.00, lng: 138.50, type: 'container', volume: '0.5M TEU' },
27+ { name: 'Tomakomai', country: 'JP', lat: 42.63, lng: 141.63, type: 'container', volume: '0.4M TEU' },
28+ { name: 'Niigata', country: 'JP', lat: 37.95, lng: 139.06, type: 'container', volume: '0.2M TEU' },
29+ { name: 'Sendai', country: 'JP', lat: 38.27, lng: 141.02, type: 'container', volume: '0.2M TEU' },
30+ { name: 'Mizushima', country: 'JP', lat: 34.50, lng: 133.72, type: 'energy', volume: 'Industrial' },
31+ { name: 'Yokkaichi', country: 'JP', lat: 34.95, lng: 136.65, type: 'energy', volume: 'Industrial' },
1932 { name: 'Dubai (Jebel Ali)', country: 'AE', lat: 25.01, lng: 55.06, type: 'container', volume: '14.0M TEU', rank: 9 },
2033 { name: 'Port Klang', country: 'MY', lat: 2.99, lng: 101.39, type: 'container', volume: '13.2M TEU', rank: 10 },
2134 { name: 'Antwerp', country: 'BE', lat: 51.30, lng: 4.40, type: 'container', volume: '12.0M TEU', rank: 11 },
@@ -103,6 +116,8 @@
103116 APIKey: apiKey,
104117 // Target specific high-value SCM areas to ensure data delivery on free tier
105118 BoundingBoxes: [
119+ // Tokyo Bay
120+ [[34.8, 139.5], [35.7, 140.2]],
106121 // Hormuz
107122 [[25.0, 54.0], [27.5, 57.5]],
108123 // Suez Canal
modified src/app/api/news/route.ts +2 −1
@@ -36,7 +36,8 @@
3636 'iran': [32.427, 53.688], 'lebanon': [33.854, 35.862], 'syria': [34.802, 38.996],
3737 'yemen': [15.552, 48.516], 'china': [35.861, 104.195], 'taiwan': [23.697, 120.960],
3838 'north korea': [40.339, 127.510], 'south korea': [35.907, 127.766],
39- 'japan': [36.204, 138.252], 'afghanistan': [33.939, 67.709], 'pakistan': [30.375, 69.345],
39+ 'japan': [36.204, 138.252], 'tokyo': [35.689, 139.692], 'osaka': [34.693, 135.502], 'okinawa': [26.212, 127.681], 'hokkaido': [43.061, 141.354],
40+ 'afghanistan': [33.939, 67.709], 'pakistan': [30.375, 69.345],
4041 'india': [20.593, 78.962], 'sudan': [12.862, 30.217], 'nigeria': [9.082, 8.675],
4142 'egypt': [26.820, 30.802], 'libya': [26.335, 17.228], 'somalia': [5.152, 46.199],
4243 'ethiopia': [9.145, 40.489], 'venezuela': [7.119, -66.589], 'mexico': [23.634, -102.552],
modified src/components/LiveAlerts.tsx +8 −4
@@ -4,7 +4,7 @@
44 import { motion, AnimatePresence } from 'framer-motion';
55 import {
66 ChevronDown, ChevronUp, MapPin, ExternalLink, AlertTriangle,
7- Newspaper, Clock, Radio,
7+ Newspaper, Clock, Radio, Maximize2, Minimize2
88 } from 'lucide-react';
99
1010 interface LiveAlertsProps {
@@ -23,6 +23,7 @@
2323
2424 export default function LiveAlerts({ data, onLocate, onWatchFeed }: LiveAlertsProps) {
2525 const [expanded, setExpanded] = useState(true);
26+ const [maximized, setMaximized] = useState(false);
2627 const [filter, setFilter] = useState<'all' | 'news' | 'quakes' | 'feeds'>('all');
2728
2829 // Built-in live feeds — verified video IDs (synced with /api/live-news)
@@ -115,7 +116,7 @@
115116 initial={{ opacity: 0, x: 20 }}
116117 animate={{ opacity: 1, x: 0 }}
117118 transition={{ delay: 0.5, duration: 0.6 }}
118- className="glass-panel flex flex-col overflow-hidden pointer-events-auto"
119+ className={`glass-panel flex flex-col overflow-hidden pointer-events-auto resize-y min-h-[200px] transition-all duration-300 ${maximized ? 'fixed inset-4 z-[9999] bg-[#0a0a09]/95 backdrop-blur-3xl' : ''}`}
119120 >
120121 <button
121122 onClick={() => setExpanded(!expanded)}
@@ -129,6 +130,9 @@
129130 </div>
130131 <div className="flex items-center gap-2">
131132 <div className="w-1.5 h-1.5 rounded-full bg-[#FF4081] animate-osiris-pulse" />
133+ <button onClick={(e) => { e.stopPropagation(); setMaximized(!maximized); if (!expanded && !maximized) setExpanded(true); }} className="hover:text-white transition-colors" title={maximized ? "Restore" : "Maximize"}>
134+ {maximized ? <Minimize2 className="w-3 h-3 text-[var(--text-muted)]" /> : <Maximize2 className="w-3 h-3 text-[var(--text-muted)]" />}
135+ </button>
132136 {expanded ? <ChevronUp className="w-3.5 h-3.5 text-[var(--text-muted)]" /> : <ChevronDown className="w-3.5 h-3.5 text-[var(--text-muted)]" />}
133137 </div>
134138 </button>
@@ -140,7 +144,7 @@
140144 animate={{ height: 'auto', opacity: 1 }}
141145 exit={{ height: 0, opacity: 0 }}
142146 transition={{ duration: 0.2 }}
143- className="overflow-hidden px-2 pb-2"
147+ className="overflow-hidden px-2 pb-2 flex flex-col flex-1 h-full min-h-0"
144148 >
145149 {/* Filters */}
146150 <div className="flex gap-1 mb-2">
@@ -156,7 +160,7 @@
156160 </div>
157161
158162 {/* Alert List */}
159- <div className="space-y-0.5 max-h-[180px] overflow-y-auto styled-scrollbar">
163+ <div className="space-y-0.5 overflow-y-auto styled-scrollbar flex-1 pb-4">
160164 {filtered.map((alert, i) => {
161165 const Icon = getIcon(alert.type);
162166 const sevColor = RISK_COLORS[alert.severity] || '#FFD700';
modified src/components/MarketsPanel.tsx +3 −2
@@ -4,7 +4,7 @@
44 import { motion, AnimatePresence } from 'framer-motion';
55 import {
66 TrendingUp, TrendingDown, ChevronDown, ChevronUp, BarChart3,
7- Zap, Shield, Droplets, Gem, Bitcoin, LineChart,
7+ Zap, Shield, Droplets, Gem, Bitcoin, LineChart, Maximize2, Minimize2
88 } from 'lucide-react';
99
1010 interface MarketsPanelProps { data: any; spaceWeather?: any; }
@@ -37,6 +37,7 @@
3737
3838 export default function MarketsPanel({ data, spaceWeather }: MarketsPanelProps) {
3939 const [expanded, setExpanded] = useState(true);
40+ const [maximized, setMaximized] = useState(false);
4041 const [activeSection, setActiveSection] = useState('stocks');
4142 const markets = data.markets || {};
4243
@@ -103,7 +104,7 @@
103104 )}
104105
105106 {/* Ticker List */}
106- <div className="space-y-0.5 max-h-[200px] overflow-y-auto styled-scrollbar">
107+ <div className="space-y-0.5 overflow-y-auto styled-scrollbar mt-2">
107108 {markets[activeSection] && Object.entries(markets[activeSection]).map(([name, d]) => (
108109 <Ticker key={name} name={name} data={d} />
109110 ))}
modified src/components/ScmPanel.tsx +4 −3
@@ -2,7 +2,7 @@
22
33 import { useState } from 'react';
44 import { motion, AnimatePresence } from 'framer-motion';
5-import { Target, ChevronDown, ChevronUp, AlertTriangle, Ship, Anchor, AlertCircle } from 'lucide-react';
5+import { Target, ChevronDown, ChevronUp, AlertTriangle, Ship, Anchor, AlertCircle, Maximize2, Minimize2 } from 'lucide-react';
66
77 interface ScmPanelProps {
88 data: any;
@@ -10,6 +10,7 @@
1010
1111 export default function ScmPanel({ data }: ScmPanelProps) {
1212 const [expanded, setExpanded] = useState(true);
13+ const [maximized, setMaximized] = useState(false);
1314
1415 const suppliers = data.scm_suppliers || [];
1516 const criticalSuppliers = suppliers.filter((s: any) => s.risk_level === 'CRITICAL' || s.risk_level === 'HIGH');
@@ -41,8 +42,8 @@
4142
4243 <AnimatePresence>
4344 {expanded && (
44- <motion.div initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={{ duration: 0.2 }} className="overflow-hidden">
45- <div className="space-y-3 mt-2 max-h-[250px] overflow-y-auto styled-scrollbar pr-1">
45+ <motion.div initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={{ duration: 0.2 }} className="overflow-hidden flex flex-col flex-1 min-h-0">
46+ <div className="space-y-3 mt-2 overflow-y-auto styled-scrollbar pr-1 flex-1 pb-4">
4647
4748 {/* Market Alerts */}
4849 {marketAlerts.length > 0 && (