@gaulatti/giorgia 0.1.62 → 0.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/live-program/LiveProgram.js +50 -50
- package/dist/components/live-program/assets.d.ts +9 -9
- package/dist/components/live-program/assets.js +9 -9
- package/dist/components/live-program/components/slides/CallsignSlide.js +2 -2
- package/dist/components/live-program/segments/ArticlesSegment.js +7 -7
- package/dist/components/live-program/segments/EarthquakeSegment.js +2 -2
- package/dist/components/live-program/segments/MarketsSegment.js +2 -2
- package/dist/components/live-program/segments/WeatherSegment.js +5 -5
- package/dist/components/live-program/segments/fetchLiveEvents.js +1 -1
- package/dist/live-program-page/index.html +1 -1
- package/dist/live-program-page/live-program.css +1 -1
- package/dist/live-program-page/live-program.js +2 -2
- package/dist/outlet-config.d.ts +8 -8
- package/dist/outlet-config.js +8 -8
- package/dist/renderer.core.js +12 -12
- package/dist/renderer.node.js +11 -7
- package/package.json +1 -1
- package/src/styles/compiled.css +1 -1
- package/src/templates/layouts/link-in-bio.hbs +3 -3
- package/src/templates/partials/components/article-main.hbs +2 -2
- package/src/templates/partials/components/media/main.hbs +1 -1
- package/src/templates/partials/components/search/main.hbs +2 -2
- package/src/templates/partials/footers/footer-full.hbs +8 -14
- package/src/templates/partials/headers/header-main.hbs +13 -21
- package/src/templates/partials/shell/doc-start-404.hbs +1 -1
- package/src/templates/partials/shell/doc-start-standard.hbs +2 -2
- /package/dist/live-program-page/{fifthbell → modoitaliano}/audio/pipes.ogg +0 -0
- /package/dist/live-program-page/{fifthbell → modoitaliano}/images/berlin.jpg +0 -0
- /package/dist/live-program-page/{fifthbell/images/fifthbell.png → modoitaliano/images/modoitaliano.png} +0 -0
- /package/dist/live-program-page/{fifthbell → modoitaliano}/images/nyc.jpg +0 -0
- /package/dist/live-program-page/{fifthbell → modoitaliano}/images/nyse.jpg +0 -0
- /package/dist/live-program-page/{fifthbell → modoitaliano}/images/santiago.jpg +0 -0
- /package/dist/live-program-page/{fifthbell → modoitaliano}/images/seismograph.jpg +0 -0
- /package/dist/live-program-page/{fifthbell → modoitaliano}/images/tokyo.jpg +0 -0
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { BellRing } from 'lucide-react';
|
|
4
4
|
import { useSSE } from './hooks/useSSE.js';
|
|
5
|
-
import {
|
|
5
|
+
import { MODOITALIANO_ASSETS } from './assets.js';
|
|
6
6
|
import { MarqueeCurtain } from './components/MarqueeCurtain.js';
|
|
7
7
|
import Marquee from './components/Marquee.js';
|
|
8
8
|
import { WorldClocks, DEFAULT_WORLD_CLOCK_CITIES } from './components/WorldClocks.js';
|
|
@@ -12,12 +12,12 @@ import { fetchEvents, getCachedEvents, hasEventChanges } from './events.js';
|
|
|
12
12
|
import { createArticlesSegment, createEarthquakeSegment, createLiveEventSegment, createMarketsSegment, createWeatherSegment, fetchArticles, fetchEarthquakes, fetchLiveEvent, fetchMarketData, fetchWeatherData, usePlaylistEngine } from './segments/index.js';
|
|
13
13
|
const DEFAULT_LANGUAGE_ROTATION = ['en', 'es', 'en', 'it'];
|
|
14
14
|
const DEFAULT_CALLSIGN_PRELAUNCH_UNTIL_NYC = '2026-01-02T21:30:00';
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
15
|
+
const MODOITALIANO_COMPONENT_TYPE_CONTENT = 'modoitaliano-content';
|
|
16
|
+
const MODOITALIANO_COMPONENT_TYPE_MARQUEE = 'modoitaliano-marquee';
|
|
17
|
+
const MODOITALIANO_COMPONENT_TYPE_TONI_CLOCK = 'toni-clock';
|
|
18
|
+
const MODOITALIANO_COMPONENT_TYPE_CORNER = 'modoitaliano-corner';
|
|
19
|
+
const MODOITALIANO_COMPONENT_TYPE_LEGACY = 'modoitaliano';
|
|
20
|
+
const DEFAULT_MODOITALIANO_CONFIG = {
|
|
21
21
|
showArticles: true,
|
|
22
22
|
showWeather: true,
|
|
23
23
|
showEarthquakes: true,
|
|
@@ -148,7 +148,7 @@ function parseSceneMetadata(scene) {
|
|
|
148
148
|
return {};
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function resolveModoItalianoLayerAvailability(activeComponents) {
|
|
152
152
|
const defaultAvailability = {
|
|
153
153
|
content: true,
|
|
154
154
|
marquee: true
|
|
@@ -156,76 +156,76 @@ function resolveFifthBellLayerAvailability(activeComponents) {
|
|
|
156
156
|
if (!activeComponents || activeComponents.length === 0) {
|
|
157
157
|
return defaultAvailability;
|
|
158
158
|
}
|
|
159
|
-
if (activeComponents.includes(
|
|
159
|
+
if (activeComponents.includes(MODOITALIANO_COMPONENT_TYPE_LEGACY)) {
|
|
160
160
|
return defaultAvailability;
|
|
161
161
|
}
|
|
162
162
|
return {
|
|
163
|
-
content: activeComponents.includes(
|
|
164
|
-
marquee: activeComponents.includes(
|
|
163
|
+
content: activeComponents.includes(MODOITALIANO_COMPONENT_TYPE_CONTENT),
|
|
164
|
+
marquee: activeComponents.includes(MODOITALIANO_COMPONENT_TYPE_MARQUEE)
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function extractConfigFromMetadata(metadataInput) {
|
|
168
168
|
const metadata = toRecord(metadataInput);
|
|
169
|
-
const legacyProps = toRecord(metadata[
|
|
169
|
+
const legacyProps = toRecord(metadata[MODOITALIANO_COMPONENT_TYPE_LEGACY]);
|
|
170
170
|
const contentProps = {
|
|
171
171
|
...legacyProps,
|
|
172
|
-
...toRecord(metadata[
|
|
172
|
+
...toRecord(metadata[MODOITALIANO_COMPONENT_TYPE_CONTENT])
|
|
173
173
|
};
|
|
174
174
|
const marqueeProps = {
|
|
175
175
|
...legacyProps,
|
|
176
|
-
...toRecord(metadata[
|
|
176
|
+
...toRecord(metadata[MODOITALIANO_COMPONENT_TYPE_MARQUEE])
|
|
177
177
|
};
|
|
178
178
|
const cornerProps = {
|
|
179
179
|
...legacyProps,
|
|
180
|
-
...toRecord(metadata[
|
|
181
|
-
...toRecord(metadata[
|
|
180
|
+
...toRecord(metadata[MODOITALIANO_COMPONENT_TYPE_TONI_CLOCK]),
|
|
181
|
+
...toRecord(metadata[MODOITALIANO_COMPONENT_TYPE_CORNER])
|
|
182
182
|
};
|
|
183
|
-
const parsedMarqueeMinPostsCount = clampNumber(marqueeProps.marqueeMinPostsCount,
|
|
184
|
-
let parsedMarqueeMinAverageRelevance = clampNumber(marqueeProps.marqueeMinAverageRelevance,
|
|
185
|
-
let parsedMarqueeMinMedianRelevance = clampNumber(marqueeProps.marqueeMinMedianRelevance,
|
|
183
|
+
const parsedMarqueeMinPostsCount = clampNumber(marqueeProps.marqueeMinPostsCount, DEFAULT_MODOITALIANO_CONFIG.marqueeMinPostsCount, 0, 50);
|
|
184
|
+
let parsedMarqueeMinAverageRelevance = clampNumber(marqueeProps.marqueeMinAverageRelevance, DEFAULT_MODOITALIANO_CONFIG.marqueeMinAverageRelevance, 0, 100);
|
|
185
|
+
let parsedMarqueeMinMedianRelevance = clampNumber(marqueeProps.marqueeMinMedianRelevance, DEFAULT_MODOITALIANO_CONFIG.marqueeMinMedianRelevance, 0, 100);
|
|
186
186
|
// Compatibility: prior defaults were tuned for OR logic. Under threshold logic, treat that trio as legacy.
|
|
187
187
|
if (parsedMarqueeMinPostsCount === 4 && parsedMarqueeMinAverageRelevance === 5 && parsedMarqueeMinMedianRelevance === 7) {
|
|
188
188
|
parsedMarqueeMinAverageRelevance = 0;
|
|
189
189
|
parsedMarqueeMinMedianRelevance = 0;
|
|
190
190
|
}
|
|
191
191
|
return {
|
|
192
|
-
showArticles: normalizeBoolean(contentProps.showArticles,
|
|
193
|
-
showWeather: normalizeBoolean(contentProps.showWeather,
|
|
194
|
-
showEarthquakes: normalizeBoolean(contentProps.showEarthquakes,
|
|
195
|
-
showMarkets: normalizeBoolean(contentProps.showMarkets,
|
|
196
|
-
showLiveEvents: normalizeBoolean(contentProps.showLiveEvents,
|
|
197
|
-
showMarquee: normalizeBoolean(marqueeProps.showMarquee,
|
|
198
|
-
showCallsignTake: normalizeBoolean(contentProps.showCallsignTake,
|
|
192
|
+
showArticles: normalizeBoolean(contentProps.showArticles, DEFAULT_MODOITALIANO_CONFIG.showArticles),
|
|
193
|
+
showWeather: normalizeBoolean(contentProps.showWeather, DEFAULT_MODOITALIANO_CONFIG.showWeather),
|
|
194
|
+
showEarthquakes: normalizeBoolean(contentProps.showEarthquakes, DEFAULT_MODOITALIANO_CONFIG.showEarthquakes),
|
|
195
|
+
showMarkets: normalizeBoolean(contentProps.showMarkets, DEFAULT_MODOITALIANO_CONFIG.showMarkets),
|
|
196
|
+
showLiveEvents: normalizeBoolean(contentProps.showLiveEvents, DEFAULT_MODOITALIANO_CONFIG.showLiveEvents),
|
|
197
|
+
showMarquee: normalizeBoolean(marqueeProps.showMarquee, DEFAULT_MODOITALIANO_CONFIG.showMarquee),
|
|
198
|
+
showCallsignTake: normalizeBoolean(contentProps.showCallsignTake, DEFAULT_MODOITALIANO_CONFIG.showCallsignTake),
|
|
199
199
|
weatherCities: normalizeStringArray(contentProps.weatherCities),
|
|
200
200
|
languageRotation: normalizeLanguageRotation(contentProps.languageRotation),
|
|
201
|
-
dataLoadTimeoutMs: clampNumber(contentProps.dataLoadTimeoutMs,
|
|
202
|
-
playlistDefaultDurationMs: clampNumber(contentProps.playlistDefaultDurationMs,
|
|
203
|
-
playlistUpdateIntervalMs: clampNumber(contentProps.playlistUpdateIntervalMs,
|
|
204
|
-
articlesDurationMs: clampNumber(contentProps.articlesDurationMs,
|
|
205
|
-
weatherDurationMs: clampNumber(contentProps.weatherDurationMs,
|
|
206
|
-
earthquakesDurationMs: clampNumber(contentProps.earthquakesDurationMs,
|
|
207
|
-
marketsDurationMs: clampNumber(contentProps.marketsDurationMs,
|
|
208
|
-
showWorldClocks: normalizeBoolean(cornerProps.showWorldClocks,
|
|
201
|
+
dataLoadTimeoutMs: clampNumber(contentProps.dataLoadTimeoutMs, DEFAULT_MODOITALIANO_CONFIG.dataLoadTimeoutMs, 1000, 120000),
|
|
202
|
+
playlistDefaultDurationMs: clampNumber(contentProps.playlistDefaultDurationMs, DEFAULT_MODOITALIANO_CONFIG.playlistDefaultDurationMs, 1000, 120000),
|
|
203
|
+
playlistUpdateIntervalMs: clampNumber(contentProps.playlistUpdateIntervalMs, DEFAULT_MODOITALIANO_CONFIG.playlistUpdateIntervalMs, 16, 5000),
|
|
204
|
+
articlesDurationMs: clampNumber(contentProps.articlesDurationMs, DEFAULT_MODOITALIANO_CONFIG.articlesDurationMs, 1000, 120000),
|
|
205
|
+
weatherDurationMs: clampNumber(contentProps.weatherDurationMs, DEFAULT_MODOITALIANO_CONFIG.weatherDurationMs, 1000, 120000),
|
|
206
|
+
earthquakesDurationMs: clampNumber(contentProps.earthquakesDurationMs, DEFAULT_MODOITALIANO_CONFIG.earthquakesDurationMs, 1000, 120000),
|
|
207
|
+
marketsDurationMs: clampNumber(contentProps.marketsDurationMs, DEFAULT_MODOITALIANO_CONFIG.marketsDurationMs, 1000, 120000),
|
|
208
|
+
showWorldClocks: normalizeBoolean(cornerProps.showWorldClocks, DEFAULT_MODOITALIANO_CONFIG.showWorldClocks),
|
|
209
209
|
showBellIcon: true,
|
|
210
|
-
worldClockRotateIntervalMs: clampNumber(cornerProps.worldClockRotateIntervalMs,
|
|
211
|
-
worldClockTransitionMs: clampNumber(cornerProps.worldClockTransitionMs,
|
|
212
|
-
worldClockShuffle: normalizeBoolean(cornerProps.worldClockShuffle,
|
|
213
|
-
worldClockWidthPx: clampNumber(cornerProps.worldClockWidthPx,
|
|
210
|
+
worldClockRotateIntervalMs: clampNumber(cornerProps.worldClockRotateIntervalMs, DEFAULT_MODOITALIANO_CONFIG.worldClockRotateIntervalMs, 500, 120000),
|
|
211
|
+
worldClockTransitionMs: clampNumber(cornerProps.worldClockTransitionMs, DEFAULT_MODOITALIANO_CONFIG.worldClockTransitionMs, 0, 10000),
|
|
212
|
+
worldClockShuffle: normalizeBoolean(cornerProps.worldClockShuffle, DEFAULT_MODOITALIANO_CONFIG.worldClockShuffle),
|
|
213
|
+
worldClockWidthPx: clampNumber(cornerProps.worldClockWidthPx, DEFAULT_MODOITALIANO_CONFIG.worldClockWidthPx, 120, 600),
|
|
214
214
|
worldClockCities: normalizeWorldClockCities(cornerProps.worldClockCities),
|
|
215
|
-
audioCueEnabled: normalizeBoolean(contentProps.audioCueEnabled,
|
|
216
|
-
audioCueMinute: clampNumber(contentProps.audioCueMinute,
|
|
217
|
-
audioCueSecond: clampNumber(contentProps.audioCueSecond,
|
|
215
|
+
audioCueEnabled: normalizeBoolean(contentProps.audioCueEnabled, DEFAULT_MODOITALIANO_CONFIG.audioCueEnabled),
|
|
216
|
+
audioCueMinute: clampNumber(contentProps.audioCueMinute, DEFAULT_MODOITALIANO_CONFIG.audioCueMinute, 0, 59),
|
|
217
|
+
audioCueSecond: clampNumber(contentProps.audioCueSecond, DEFAULT_MODOITALIANO_CONFIG.audioCueSecond, 0, 59),
|
|
218
218
|
callsignPrelaunchUntilNyc: typeof contentProps.callsignPrelaunchUntilNyc === 'string' && contentProps.callsignPrelaunchUntilNyc.trim()
|
|
219
219
|
? contentProps.callsignPrelaunchUntilNyc.trim()
|
|
220
|
-
:
|
|
221
|
-
callsignWindowStartSecond: clampNumber(contentProps.callsignWindowStartSecond,
|
|
222
|
-
callsignWindowEndSecond: clampNumber(contentProps.callsignWindowEndSecond,
|
|
220
|
+
: DEFAULT_MODOITALIANO_CONFIG.callsignPrelaunchUntilNyc,
|
|
221
|
+
callsignWindowStartSecond: clampNumber(contentProps.callsignWindowStartSecond, DEFAULT_MODOITALIANO_CONFIG.callsignWindowStartSecond, 0, 59),
|
|
222
|
+
callsignWindowEndSecond: clampNumber(contentProps.callsignWindowEndSecond, DEFAULT_MODOITALIANO_CONFIG.callsignWindowEndSecond, 0, 59),
|
|
223
223
|
marqueeMinPostsCount: parsedMarqueeMinPostsCount,
|
|
224
224
|
marqueeMinAverageRelevance: parsedMarqueeMinAverageRelevance,
|
|
225
225
|
marqueeMinMedianRelevance: parsedMarqueeMinMedianRelevance,
|
|
226
|
-
marqueePixelsPerSecond: clampNumber(marqueeProps.marqueePixelsPerSecond,
|
|
227
|
-
marqueeMinDurationSeconds: clampNumber(marqueeProps.marqueeMinDurationSeconds,
|
|
228
|
-
marqueeHeightPx: clampNumber(marqueeProps.marqueeHeightPx,
|
|
226
|
+
marqueePixelsPerSecond: clampNumber(marqueeProps.marqueePixelsPerSecond, DEFAULT_MODOITALIANO_CONFIG.marqueePixelsPerSecond, 10, 1000),
|
|
227
|
+
marqueeMinDurationSeconds: clampNumber(marqueeProps.marqueeMinDurationSeconds, DEFAULT_MODOITALIANO_CONFIG.marqueeMinDurationSeconds, 1, 120),
|
|
228
|
+
marqueeHeightPx: clampNumber(marqueeProps.marqueeHeightPx, DEFAULT_MODOITALIANO_CONFIG.marqueeHeightPx, 72, 200)
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
function normalizeLaunchDate(rawDate) {
|
|
@@ -267,7 +267,7 @@ export default function LiveProgram({ embedded = false, sceneMetadata, activeCom
|
|
|
267
267
|
return parseSceneMetadata(state?.activeScene ?? null);
|
|
268
268
|
}, [sceneMetadata, state?.activeScene]);
|
|
269
269
|
const config = useMemo(() => extractConfigFromMetadata(effectiveSceneMetadata), [effectiveSceneMetadata]);
|
|
270
|
-
const layerAvailability = useMemo(() =>
|
|
270
|
+
const layerAvailability = useMemo(() => resolveModoItalianoLayerAvailability(activeComponents), [activeComponents]);
|
|
271
271
|
const languageRotation = config.languageRotation;
|
|
272
272
|
const currentLanguage = languageRotation[languageIndex] ?? languageRotation[0] ?? 'en';
|
|
273
273
|
const resolvedApiBaseUrl = apiBaseUrl?.replace(/\/+$/, '') ||
|
|
@@ -292,7 +292,7 @@ export default function LiveProgram({ embedded = false, sceneMetadata, activeCom
|
|
|
292
292
|
fetch(`${resolvedApiBaseUrl}/state`)
|
|
293
293
|
.then((res) => res.json())
|
|
294
294
|
.then((data) => setState(data))
|
|
295
|
-
.catch((err) => console.error('Failed to fetch
|
|
295
|
+
.catch((err) => console.error('Failed to fetch ModoItaliano program state:', err));
|
|
296
296
|
}, [controlledBySceneRenderer, resolvedApiBaseUrl]);
|
|
297
297
|
const refreshAllData = useCallback(async () => {
|
|
298
298
|
const [articlesData, weatherDataResult, earthquakesData, marketsData, liveEventData] = await Promise.all([
|
|
@@ -747,5 +747,5 @@ export default function LiveProgram({ embedded = false, sceneMetadata, activeCom
|
|
|
747
747
|
}
|
|
748
748
|
const liveStage = (_jsxs("div", { className: stageContainerClass, style: stageContainerStyle, children: [layerAvailability.content ? (showLogoSlide ? (_jsx(CallsignSlide, { currentTime: callsignTime, audioRef: audioRef })) : currentSegment ? (currentSegment.render(playlistState.currentItemIndex, playlistState.progress)) : (_jsx("div", { className: 'absolute inset-0 bg-black' }))) : (_jsx("div", { className: 'absolute inset-0 bg-black' })), isMarqueeVisible && (_jsx("div", { className: 'absolute bottom-0 left-0 right-0 z-100 transition-transform duration-1000 ease-in-out translate-y-0', children: !showLogoSlide &&
|
|
749
749
|
(showCurtain ? (_jsx(MarqueeCurtain, { onComplete: handleCurtainComplete })) : (_jsx(Marquee, { events: programEvents, onCycleComplete: handleMarqueeCycleComplete, minPostsCount: config.marqueeMinPostsCount, minAverageRelevance: config.marqueeMinAverageRelevance, minMedianRelevance: config.marqueeMinMedianRelevance, pixelsPerSecond: config.marqueePixelsPerSecond, minDurationSeconds: config.marqueeMinDurationSeconds, heightPx: config.marqueeHeightPx }))) })), (config.showWorldClocks || config.showBellIcon) && (_jsxs("div", { className: 'absolute top-16 right-24 z-50 flex items-start gap-6', children: [config.showWorldClocks && (_jsx("div", { className: 'flex items-start pt-1.5', children: _jsx(WorldClocks, { currentTime: callsignTime, language: currentLanguage, cities: config.worldClockCities, rotateIntervalMs: config.worldClockRotateIntervalMs, transitionDurationMs: config.worldClockTransitionMs, shuffleCities: config.worldClockShuffle, widthPx: config.worldClockWidthPx }) })), config.showBellIcon && (_jsx("div", { className: 'bg-[#b21100] text-white p-6 shadow-2xl', children: _jsx(BellRing, { size: 64, strokeWidth: 2 }) }))] }))] }));
|
|
750
|
-
return (_jsxs("div", { className: embedded ? 'w-full h-full bg-black overflow-hidden' : 'min-h-screen bg-black flex items-center justify-center overflow-hidden', children: [liveStage, _jsx("audio", { ref: audioRef, preload: 'auto', children: _jsx("source", { src:
|
|
750
|
+
return (_jsxs("div", { className: embedded ? 'w-full h-full bg-black overflow-hidden' : 'min-h-screen bg-black flex items-center justify-center overflow-hidden', children: [liveStage, _jsx("audio", { ref: audioRef, preload: 'auto', children: _jsx("source", { src: MODOITALIANO_ASSETS.audio.pipes, type: 'audio/ogg' }) }), _jsx("style", { children: slideStyles })] }));
|
|
751
751
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const MODOITALIANO_ASSETS: {
|
|
2
2
|
readonly audio: {
|
|
3
|
-
readonly pipes: "./
|
|
3
|
+
readonly pipes: "./modoitaliano/audio/pipes.ogg";
|
|
4
4
|
};
|
|
5
5
|
readonly images: {
|
|
6
|
-
readonly logo: "./
|
|
7
|
-
readonly nyc: "./
|
|
8
|
-
readonly berlin: "./
|
|
9
|
-
readonly santiago: "./
|
|
10
|
-
readonly tokyo: "./
|
|
11
|
-
readonly nyse: "./
|
|
12
|
-
readonly seismograph: "./
|
|
6
|
+
readonly logo: "./modoitaliano/images/modoitaliano.png";
|
|
7
|
+
readonly nyc: "./modoitaliano/images/nyc.jpg";
|
|
8
|
+
readonly berlin: "./modoitaliano/images/berlin.jpg";
|
|
9
|
+
readonly santiago: "./modoitaliano/images/santiago.jpg";
|
|
10
|
+
readonly tokyo: "./modoitaliano/images/tokyo.jpg";
|
|
11
|
+
readonly nyse: "./modoitaliano/images/nyse.jpg";
|
|
12
|
+
readonly seismograph: "./modoitaliano/images/seismograph.jpg";
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const MODOITALIANO_ASSETS = {
|
|
2
2
|
audio: {
|
|
3
|
-
pipes: './
|
|
3
|
+
pipes: './modoitaliano/audio/pipes.ogg'
|
|
4
4
|
},
|
|
5
5
|
images: {
|
|
6
|
-
logo: './
|
|
7
|
-
nyc: './
|
|
8
|
-
berlin: './
|
|
9
|
-
santiago: './
|
|
10
|
-
tokyo: './
|
|
11
|
-
nyse: './
|
|
12
|
-
seismograph: './
|
|
6
|
+
logo: './modoitaliano/images/modoitaliano.png',
|
|
7
|
+
nyc: './modoitaliano/images/nyc.jpg',
|
|
8
|
+
berlin: './modoitaliano/images/berlin.jpg',
|
|
9
|
+
santiago: './modoitaliano/images/santiago.jpg',
|
|
10
|
+
tokyo: './modoitaliano/images/tokyo.jpg',
|
|
11
|
+
nyse: './modoitaliano/images/nyse.jpg',
|
|
12
|
+
seismograph: './modoitaliano/images/seismograph.jpg'
|
|
13
13
|
}
|
|
14
14
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { BellRing } from 'lucide-react';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { FastAverageColor } from 'fast-average-color';
|
|
5
|
-
import {
|
|
5
|
+
import { MODOITALIANO_ASSETS } from '../../assets.js';
|
|
6
6
|
const fac = new FastAverageColor();
|
|
7
7
|
export function CallsignSlide({ currentTime: initialTime }) {
|
|
8
8
|
const [displayTime, setDisplayTime] = useState(initialTime);
|
|
@@ -11,7 +11,7 @@ export function CallsignSlide({ currentTime: initialTime }) {
|
|
|
11
11
|
const [smallOpacity, setSmallOpacity] = useState(0);
|
|
12
12
|
const [centerOpacity, setCenterOpacity] = useState(0);
|
|
13
13
|
const [showTime, setShowTime] = useState(false);
|
|
14
|
-
const backgroundImage =
|
|
14
|
+
const backgroundImage = MODOITALIANO_ASSETS.images.nyc;
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
setDisplayTime(initialTime);
|
|
17
17
|
const timer = window.setInterval(() => {
|
|
@@ -9,7 +9,7 @@ const MOCK_ARTICLES = [
|
|
|
9
9
|
summary: 'World leaders have agreed to ambitious new targets for reducing carbon emissions, marking a significant step forward in the fight against climate change.',
|
|
10
10
|
imageUrl: 'https://picsum.photos/seed/news1/1920/1080',
|
|
11
11
|
category: 'Environment',
|
|
12
|
-
url: 'https://
|
|
12
|
+
url: 'https://modoitaliano.fm/climate-summit-agreement'
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
id: '2',
|
|
@@ -17,7 +17,7 @@ const MOCK_ARTICLES = [
|
|
|
17
17
|
summary: 'Researchers have achieved a major milestone in quantum computing, potentially revolutionizing data processing and encryption technologies.',
|
|
18
18
|
imageUrl: 'https://picsum.photos/seed/news2/1920/1080',
|
|
19
19
|
category: 'Technology',
|
|
20
|
-
url: 'https://
|
|
20
|
+
url: 'https://modoitaliano.fm/quantum-computing-breakthrough'
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
id: '3',
|
|
@@ -25,7 +25,7 @@ const MOCK_ARTICLES = [
|
|
|
25
25
|
summary: 'Archaeologists have unearthed artifacts that challenge our understanding of ancient civilizations and their technological capabilities.',
|
|
26
26
|
imageUrl: 'https://picsum.photos/seed/news3/1920/1080',
|
|
27
27
|
category: 'Science',
|
|
28
|
-
url: 'https://
|
|
28
|
+
url: 'https://modoitaliano.fm/archaeological-discovery'
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
id: '4',
|
|
@@ -33,7 +33,7 @@ const MOCK_ARTICLES = [
|
|
|
33
33
|
summary: 'NASA and international partners announce extension of ISS operations, paving the way for continued scientific research in orbit.',
|
|
34
34
|
imageUrl: 'https://picsum.photos/seed/news4/1920/1080',
|
|
35
35
|
category: 'Space',
|
|
36
|
-
url: 'https://
|
|
36
|
+
url: 'https://modoitaliano.fm/iss-mission-extended'
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
id: '5',
|
|
@@ -41,7 +41,7 @@ const MOCK_ARTICLES = [
|
|
|
41
41
|
summary: 'For the first time in history, renewable energy sources have generated more electricity than traditional fossil fuels globally.',
|
|
42
42
|
imageUrl: 'https://picsum.photos/seed/news5/1920/1080',
|
|
43
43
|
category: 'Energy',
|
|
44
|
-
url: 'https://
|
|
44
|
+
url: 'https://modoitaliano.fm/renewable-energy-milestone'
|
|
45
45
|
}
|
|
46
46
|
];
|
|
47
47
|
function normalizePath(input) {
|
|
@@ -74,7 +74,7 @@ function buildArticlePath(article, language) {
|
|
|
74
74
|
}
|
|
75
75
|
export async function fetchArticles(language = 'en') {
|
|
76
76
|
try {
|
|
77
|
-
const response = await fetch(`https://cdn.
|
|
77
|
+
const response = await fetch(`https://cdn.modoitaliano.fm/content/homepage-current-${language}.json?_=${Date.now()}`, {
|
|
78
78
|
cache: 'no-store'
|
|
79
79
|
});
|
|
80
80
|
if (!response.ok) {
|
|
@@ -99,7 +99,7 @@ export async function fetchArticles(language = 'en') {
|
|
|
99
99
|
summary: article.excerpt,
|
|
100
100
|
imageUrl: article.featuredImage.url,
|
|
101
101
|
category: article.categories?.[0]?.name,
|
|
102
|
-
url: `https://
|
|
102
|
+
url: `https://modoitaliano.fm${buildArticlePath(article, language)}`
|
|
103
103
|
}));
|
|
104
104
|
const finalItems = items.length > 0 ? items : MOCK_ARTICLES;
|
|
105
105
|
finalItems.forEach((item) => {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { AlertTriangle, Clock, Layers, Link, MapPin } from 'lucide-react';
|
|
4
4
|
import { FastAverageColor } from 'fast-average-color';
|
|
5
|
-
import {
|
|
5
|
+
import { MODOITALIANO_ASSETS } from '../assets.js';
|
|
6
6
|
import { t } from '../i18n.js';
|
|
7
7
|
function formatTimeAgo(timestamp, language = 'en') {
|
|
8
8
|
const now = Date.now();
|
|
@@ -75,7 +75,7 @@ function getMagnitudeColor(magnitude) {
|
|
|
75
75
|
const fac = new FastAverageColor();
|
|
76
76
|
function EarthquakeSlide({ earthquakes, progress, language }) {
|
|
77
77
|
const [dominantColor, setDominantColor] = useState('#7c2d12');
|
|
78
|
-
const backgroundImage =
|
|
78
|
+
const backgroundImage = MODOITALIANO_ASSETS.images.seismograph;
|
|
79
79
|
const handleImageLoad = (event) => {
|
|
80
80
|
try {
|
|
81
81
|
const color = fac.getColor(event.currentTarget);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { TrendingDown, TrendingUp } from 'lucide-react';
|
|
4
4
|
import { FastAverageColor } from 'fast-average-color';
|
|
5
|
-
import {
|
|
5
|
+
import { MODOITALIANO_ASSETS } from '../assets.js';
|
|
6
6
|
import { t } from '../i18n.js';
|
|
7
7
|
let marketCache = null;
|
|
8
8
|
const CACHE_DURATION_MS = 15 * 60 * 1000;
|
|
@@ -35,7 +35,7 @@ export function getLastUpdateTime() {
|
|
|
35
35
|
const fac = new FastAverageColor();
|
|
36
36
|
function MarketSlide({ progress, marketData, language }) {
|
|
37
37
|
const [dominantColor, setDominantColor] = useState('#065f46');
|
|
38
|
-
const backgroundImage =
|
|
38
|
+
const backgroundImage = MODOITALIANO_ASSETS.images.nyse;
|
|
39
39
|
const handleImageLoad = (event) => {
|
|
40
40
|
try {
|
|
41
41
|
const color = fac.getColor(event.currentTarget);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { Cloud, CloudRain, Sun, Wind } from 'lucide-react';
|
|
4
4
|
import { FastAverageColor } from 'fast-average-color';
|
|
5
|
-
import {
|
|
5
|
+
import { MODOITALIANO_ASSETS } from '../assets.js';
|
|
6
6
|
import { t } from '../i18n.js';
|
|
7
7
|
let weatherCache = null;
|
|
8
8
|
const CACHE_DURATION_MS = 60 * 60 * 1000;
|
|
@@ -44,13 +44,13 @@ function fahrenheitToCelsius(value) {
|
|
|
44
44
|
function getRegionBackground(region) {
|
|
45
45
|
switch (region) {
|
|
46
46
|
case 'North America':
|
|
47
|
-
return
|
|
47
|
+
return MODOITALIANO_ASSETS.images.nyc;
|
|
48
48
|
case 'Europe':
|
|
49
|
-
return
|
|
49
|
+
return MODOITALIANO_ASSETS.images.berlin;
|
|
50
50
|
case 'South America':
|
|
51
|
-
return
|
|
51
|
+
return MODOITALIANO_ASSETS.images.santiago;
|
|
52
52
|
case 'Asia':
|
|
53
|
-
return
|
|
53
|
+
return MODOITALIANO_ASSETS.images.tokyo;
|
|
54
54
|
default:
|
|
55
55
|
return '';
|
|
56
56
|
}
|
|
@@ -47,7 +47,7 @@ async function fetchFromAuburnale(language) {
|
|
|
47
47
|
}
|
|
48
48
|
export async function fetchLiveEvent(language = 'en') {
|
|
49
49
|
try {
|
|
50
|
-
const response = await fetch(`https://cdn.
|
|
50
|
+
const response = await fetch(`https://cdn.modoitaliano.fm/content/homepage-current-${language}.json?_=${Date.now()}`, { cache: 'no-store' });
|
|
51
51
|
if (!response.ok) {
|
|
52
52
|
return fetchFromAuburnale(language);
|
|
53
53
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
6
|
-
<title>Live Program |
|
|
6
|
+
<title>Live Program | ModoItaliano</title>
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Encode+Sans+Condensed:wght@100;200;300;400;500;600;700;800;900&family=Encode+Sans:wght@100..900&family=Funnel+Display:wght@300..800&family=League+Gothic&family=Libre+Franklin:ital,wght@0,100..900;1,100..900&family=Outfit:wght@100..900&display=swap" rel="stylesheet" />
|