Skip to content

Commit 11e9b46

Browse files
author
web3blind
committed
Refine forecasts and home navigation
1 parent a14c8a6 commit 11e9b46

8 files changed

Lines changed: 139 additions & 26 deletions

File tree

app/css/main.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,3 +1674,30 @@ body,
16741674
grid-template-columns: 1fr;
16751675
}
16761676
}
1677+
1678+
1679+
.prophecy-mini-button {
1680+
width: 100%;
1681+
border: 1px solid var(--color-border);
1682+
color: var(--color-text);
1683+
text-align: left;
1684+
cursor: pointer;
1685+
}
1686+
1687+
.prophecy-mini-button:focus-visible {
1688+
outline: 2px solid var(--color-primary);
1689+
outline-offset: 2px;
1690+
}
1691+
1692+
.prophecy-mini-button:hover {
1693+
border-color: var(--color-primary);
1694+
}
1695+
1696+
.forecast-festival {
1697+
margin: var(--space-xs) 0 0;
1698+
padding-top: var(--space-xs);
1699+
border-top: 1px solid var(--color-border);
1700+
color: var(--color-text);
1701+
font-size: 0.82rem;
1702+
line-height: 1.4;
1703+
}

app/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="icon" type="image/png" sizes="192x192" href="assets/icons/viz-magic-192.png?v=20260712c">
1414
<link rel="icon" type="image/png" sizes="512x512" href="assets/icons/viz-magic-512.png?v=20260712c">
1515
<link rel="apple-touch-icon" href="assets/icons/viz-magic-192.png?v=20260712c">
16-
<link rel="stylesheet" href="css/main.css?v=20260712e">
16+
<link rel="stylesheet" href="css/main.css?v=20260712f">
1717
<link rel="stylesheet" href="css/themes.css">
1818
<link rel="stylesheet" href="css/accessibility.css">
1919
</head>
@@ -116,8 +116,8 @@
116116
<script src="js/config.js?v=20260621m"></script>
117117

118118
<!-- I18n -->
119-
<script src="js/i18n/ru.js?v=20260712e"></script>
120-
<script src="js/i18n/en.js?v=20260712e"></script>
119+
<script src="js/i18n/ru.js?v=20260712f"></script>
120+
<script src="js/i18n/en.js?v=20260712f"></script>
121121

122122
<!-- Utilities -->
123123
<script src="js/utils/helpers.js?v=20260621l"></script>
@@ -161,7 +161,7 @@
161161
<script src="js/engine/marketplace.js"></script>
162162
<script src="js/engine/checkpoint.js"></script>
163163
<script src="js/engine/block-processor.js"></script>
164-
<script src="js/engine/world-events.js?v=20260712e"></script>
164+
<script src="js/engine/world-events.js?v=20260712f"></script>
165165
<script src="js/engine/world-boss.js"></script>
166166
<script src="js/engine/quest-system.js?v=20260621e"></script>
167167
<script src="js/engine/loci.js"></script>
@@ -182,7 +182,7 @@
182182
<script src="js/ui/screens/landing.js"></script>
183183
<script src="js/ui/screens/login.js?v=20260711a"></script>
184184
<script src="js/ui/screens/onboarding.js"></script>
185-
<script src="js/ui/screens/home.js?v=20260712e"></script>
185+
<script src="js/ui/screens/home.js?v=20260712f"></script>
186186
<script src="js/ui/screens/character.js?v=20260621l"></script>
187187
<script src="js/ui/screens/hunt.js"></script>
188188
<script src="js/ui/screens/inventory.js?v=20260621l"></script>

app/js/engine/world-events.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,21 @@ var WorldEvents = (function() {
304304

305305

306306

307+
308+
309+
/** Occasional magical holidays tied to game sections. */
310+
var FESTIVALS = [
311+
{ id: 'hearth_spirit_day', icon: '\uD83C\uDFE0', screen: 'home', nameKey: 'festival_hearth_spirit_day', descKey: 'festival_hearth_spirit_day_desc' },
312+
{ id: 'hunt_tribute', icon: '\u2694\uFE0F', screen: 'hunt', nameKey: 'festival_hunt_tribute', descKey: 'festival_hunt_tribute_desc' },
313+
{ id: 'guild_dance', icon: '\uD83D\uDEE1\uFE0F', screen: 'guild', nameKey: 'festival_guild_dance', descKey: 'festival_guild_dance_desc' },
314+
{ id: 'chronicle_ink_night', icon: '\uD83D\uDCDD', screen: 'chronicle', nameKey: 'festival_chronicle_ink_night', descKey: 'festival_chronicle_ink_night_desc' },
315+
{ id: 'bazaar_bell_day', icon: '\uD83C\uDFEA', screen: 'marketplace', nameKey: 'festival_bazaar_bell_day', descKey: 'festival_bazaar_bell_day_desc' },
316+
{ id: 'hammer_sparks', icon: '\uD83D\uDD28', screen: 'crafting', nameKey: 'festival_hammer_sparks', descKey: 'festival_hammer_sparks_desc' },
317+
{ id: 'bag_whisper', icon: '\uD83C\uDF92', screen: 'inventory', nameKey: 'festival_bag_whisper', descKey: 'festival_bag_whisper_desc' },
318+
{ id: 'prophecy_candle', icon: '\uD83D\uDD2E', screen: 'quests', nameKey: 'festival_prophecy_candle', descKey: 'festival_prophecy_candle_desc' },
319+
{ id: 'dragon_mask_day', icon: '\uD83D\uDC32', screen: 'world-boss', nameKey: 'festival_dragon_mask_day', descKey: 'festival_dragon_mask_day_desc' }
320+
];
321+
307322
/** Everyday magical sky signs. Combined with omens, this gives a year-sized forecast pool. */
308323
var SKY_SIGNS = [
309324
{ id: 'sun_cloud', icon: '\u26C5', summaryKey: 'sky_sun_cloud' },
@@ -357,6 +372,20 @@ var WorldEvents = (function() {
357372

358373

359374

375+
376+
377+
/**
378+
* Get occasional magical holiday. Appears roughly every fifth in-world day.
379+
* @param {number} blockNum
380+
* @returns {Object|null}
381+
*/
382+
function getCurrentFestival(blockNum) {
383+
var day = Math.floor(blockNum / 28800);
384+
if (day % 5 !== 0) return null;
385+
var idx = Math.floor(day / 5) % FESTIVALS.length;
386+
return FESTIVALS[idx];
387+
}
388+
360389
/**
361390
* Get current sky sign based on block number.
362391
* @param {number} blockNum
@@ -562,6 +591,7 @@ var WorldEvents = (function() {
562591
getCurrentWeather: getCurrentWeather,
563592
getCurrentSky: getCurrentSky,
564593
getForecastVariantCount: getForecastVariantCount,
594+
getCurrentFestival: getCurrentFestival,
565595
getActiveEvents: getActiveEvents,
566596
checkEventTriggers: checkEventTriggers,
567597
checkWeaveSurge: checkWeaveSurge,

app/js/i18n/en.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,11 @@ var LangEN = {
755755
weather_quiet_stars_effect: 'Creatures hit 5% softer, character defense is 5% higher.',
756756
weather_forbidden_wind: 'The wind has frozen in a forbidden region. Entry is lethal; exit is not promised.',
757757
weather_forbidden_wind_effect: 'Creatures hit 15% harder, character defense is 5% lower.',
758-
weather_dragon_shadow: 'Do not stay long in the shade. The Dragon is hunting and considers shadows its property.',
758+
weather_dragon_shadow: 'Aether Dragon shadow: do not stay long in the shade. The Dragon is hunting.',
759759
weather_dragon_shadow_effect: 'Creatures hit 12% harder.',
760760
weather_no_looking_back: 'Do not look back. The thing behind you is pretending to be your own thought.',
761761
weather_no_looking_back_effect: 'Creatures hit 8% harder, character defense is 2% lower.',
762-
weather_mirror_fog: 'Mirror fog. Everyone sees themselves victorious; only the quick come out.',
762+
weather_mirror_fog: 'Mirror fog: everyone sees themselves victorious, but only the quick come out.',
763763
weather_mirror_fog_effect: 'Character defense is 8% lower.',
764764
weather_whispering_mushrooms: 'Mushrooms whisper enemy plans. Some plans are mushroom plans, but still useful.',
765765
weather_whispering_mushrooms_effect: 'Creatures hit 4% softer, character defense is 6% higher.',
@@ -769,7 +769,7 @@ var LangEN = {
769769
weather_singing_swamp_effect: 'Creatures hit 6% harder, character defense is 4% lower.',
770770
weather_upward_rain: 'Rain falls upward. If your boots are wet, the sky is below today.',
771771
weather_upward_rain_effect: 'Creatures hit 3% softer, character defense is 4% higher.',
772-
weather_glass_grass: 'Glass grass cuts each step. Walking is allowed; arguing with the meadow is not.',
772+
weather_glass_grass: 'Glass grass: cuts each step. Walking is allowed, but arguing with the meadow spirit is not.',
773773
weather_glass_grass_effect: 'Creatures hit 9% harder, character defense is 3% lower.',
774774
weather_sleeping_thunder: 'Thunder sleeps underground. Speak softly: it wakes to overconfidence.',
775775
weather_sleeping_thunder_effect: 'Creatures hit 6% softer, character defense is 8% higher.',
@@ -816,8 +816,27 @@ var LangEN = {
816816
sky_sudden_thaw: 'Sudden thaw. Snow has reconsidered being snow.',
817817
sky_red_dawn: 'Red dawn is watching too carefully.',
818818
sky_black_snow: 'Black snow falls quietly. Footprints sound louder than steps.',
819-
sky_silver_fog: 'Silver fog makes the world richer and more suspicious.',
819+
sky_silver_fog: 'Silver rain: makes the world richer and more suspicious.',
820820
sky_double_rainbow: 'A double rainbow. One is real; the other handles consequences.',
821+
festival_today_prefix: 'World holiday',
822+
festival_hearth_spirit_day: 'Hearth Spirit Honoring',
823+
festival_hearth_spirit_day_desc: 'A warm word is left for the hearth guardian; Home listens more closely today.',
824+
festival_hunt_tribute: 'Hunt Tribute',
825+
festival_hunt_tribute_desc: 'A small offering is made to the forest keeper for luck before the hunt.',
826+
festival_guild_dance: 'Warband Dance',
827+
festival_guild_dance_desc: 'Guilds hold battle drills so shields remember hands.',
828+
festival_chronicle_ink_night: 'Night of Living Ink',
829+
festival_chronicle_ink_night_desc: 'The Chronicle accepts stories more easily and keeps borrowed voices longer.',
830+
festival_bazaar_bell_day: 'Bazaar Bell Day',
831+
festival_bazaar_bell_day_desc: 'Merchants argue with prices, and prices sometimes argue back.',
832+
festival_hammer_sparks: 'Hammer Sparks',
833+
festival_hammer_sparks_desc: 'In the Workshop, old things are repaired and new metal is not offended.',
834+
festival_bag_whisper: 'Whisper of Bags',
835+
festival_bag_whisper_desc: 'Bags count findings and pretend they hid nothing.',
836+
festival_prophecy_candle: 'Prophecy Candle',
837+
festival_prophecy_candle_desc: 'Quests are read aloud so the future cannot pretend it was random.',
838+
festival_dragon_mask_day: 'Day of Dragon Masks',
839+
festival_dragon_mask_day_desc: 'Mages wear masks so the Aether Dragon cannot immediately tell who is tastier.',
821840

822841
// World Events
823842
event_weave_surge: 'Weave Surge',

app/js/i18n/ru.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,11 @@ var LangRU = {
755755
weather_quiet_stars_effect: 'Существа бьют на 5% слабее, защита персонажа выше на 5%.',
756756
weather_forbidden_wind: 'В запретном регионе застыл ветер. Вход смертелен, выход не обещан.',
757757
weather_forbidden_wind_effect: 'Существа бьют на 15% сильнее, защита персонажа ниже на 5%.',
758-
weather_dragon_shadow: 'Не оставайся надолго в тени. Дракон вышел на охоту и считает тени своими.',
758+
weather_dragon_shadow: 'Тень Эфирного Дракона: не оставайся надолго в тени. Дракон вышел на охоту.',
759759
weather_dragon_shadow_effect: 'Существа бьют на 12% сильнее.',
760760
weather_no_looking_back: 'Не оглядывайся. То, что идёт следом, делает вид, что оно — твоя мысль.',
761761
weather_no_looking_back_effect: 'Существа бьют на 8% сильнее, защита персонажа ниже на 2%.',
762-
weather_mirror_fog: 'Зеркальный туман. В нём каждый видит себя победителем, а выходит кто успеет.',
762+
weather_mirror_fog: 'Зеркальный туман: в нём каждый видит себя победителем, но выходит тот, кто успеет.',
763763
weather_mirror_fog_effect: 'Защита персонажа ниже на 8%.',
764764
weather_whispering_mushrooms: 'Грибы шепчут планы врагов. Некоторые планы грибные, но всё равно полезные.',
765765
weather_whispering_mushrooms_effect: 'Существа бьют на 4% слабее, защита персонажа выше на 6%.',
@@ -769,7 +769,7 @@ var LangRU = {
769769
weather_singing_swamp_effect: 'Существа бьют на 6% сильнее, защита персонажа ниже на 4%.',
770770
weather_upward_rain: 'Дождь идёт вверх. Если промокли ботинки — значит, небо сегодня снизу.',
771771
weather_upward_rain_effect: 'Существа бьют на 3% слабее, защита персонажа выше на 4%.',
772-
weather_glass_grass: 'Стеклянная трава режет шаги. Идти можно, но лучше не спорить с лугом.',
772+
weather_glass_grass: 'Стеклянная трава: режет шаги. Идти можно, но лучше не спорить с духом луга.',
773773
weather_glass_grass_effect: 'Существа бьют на 9% сильнее, защита персонажа ниже на 3%.',
774774
weather_sleeping_thunder: 'Гром спит под землёй. Говорите тише: он просыпается от самоуверенности.',
775775
weather_sleeping_thunder_effect: 'Существа бьют на 6% слабее, защита персонажа выше на 8%.',
@@ -816,8 +816,27 @@ var LangRU = {
816816
sky_sudden_thaw: 'Внезапная оттепель. Снег передумал быть снегом.',
817817
sky_red_dawn: 'Красный рассвет смотрит слишком внимательно.',
818818
sky_black_snow: 'Чёрный снег падает тихо. Следы на нём слышнее, чем шаги.',
819-
sky_silver_fog: 'Серебряный туман делает мир богаче и подозрительнее.',
819+
sky_silver_fog: 'Серебряный дождь: делает мир богаче и подозрительнее.',
820820
sky_double_rainbow: 'Двойная радуга. Одна настоящая, вторая отвечает за последствия.',
821+
festival_today_prefix: 'Праздник мира',
822+
festival_hearth_spirit_day: 'Чествование домового',
823+
festival_hearth_spirit_day_desc: 'Защитнику очага оставляют тёплое слово; Дом сегодня слушает внимательнее.',
824+
festival_hunt_tribute: 'Охотная дань',
825+
festival_hunt_tribute_desc: 'Хозяину леса приносят малую жертву на удачу перед охотой.',
826+
festival_guild_dance: 'Дружинная пляска',
827+
festival_guild_dance_desc: 'Гильдии проводят боевые учения, чтобы щиты помнили руки.',
828+
festival_chronicle_ink_night: 'Ночь живых чернил',
829+
festival_chronicle_ink_night_desc: 'Хроника легче принимает истории и дольше хранит чужие голоса.',
830+
festival_bazaar_bell_day: 'День базарного колокола',
831+
festival_bazaar_bell_day_desc: 'Торговцы спорят с ценами, а цены иногда спорят в ответ.',
832+
festival_hammer_sparks: 'Искры молота',
833+
festival_hammer_sparks_desc: 'В Мастерской принято чинить старое и не обижать новый металл.',
834+
festival_bag_whisper: 'Шёпот сумок',
835+
festival_bag_whisper_desc: 'Сумки пересчитывают находки и делают вид, что ничего не прятали.',
836+
festival_prophecy_candle: 'Свеча пророчества',
837+
festival_prophecy_candle_desc: 'Задания читают вслух, чтобы будущее не притворялось случайностью.',
838+
festival_dragon_mask_day: 'День драконьих масок',
839+
festival_dragon_mask_day_desc: 'Маги надевают маски, чтобы Эфирный Дракон не сразу понял, кто вкуснее.',
821840

822841
// World Events
823842
event_weave_surge: 'Всплеск Плетения',

app/js/ui/screens/home.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
var HomeScreen = (function() {
66
'use strict';
77

8-
var PRIMARY_HOME_SCREENS = ['home', 'hunt', 'map', 'guild', 'marketplace', 'crafting', 'character', 'help', 'leaderboard'];
9-
var SECONDARY_HOME_SCREENS = ['inventory', 'chronicle', 'arena', 'quests', 'world-boss', 'settings'];
8+
var PRIMARY_HOME_SCREENS = ['home', 'hunt', 'map', 'chronicle', 'guild', 'marketplace', 'crafting', 'character', 'leaderboard'];
9+
var SECONDARY_HOME_SCREENS = ['inventory', 'arena', 'quests', 'world-boss', 'settings', 'help'];
1010
var HOME_HP_DISPLAY_MAX = 5000;
1111
var HOME_XP_DISPLAY_MAX = 3000;
1212

@@ -92,6 +92,14 @@ var HomeScreen = (function() {
9292
});
9393
}
9494

95+
var prophecyBtn = el.querySelector('.prophecy-mini-button');
96+
if (prophecyBtn) {
97+
prophecyBtn.addEventListener('click', function() {
98+
SoundManager.play('tap');
99+
Helpers.EventBus.emit('navigate', 'quests');
100+
});
101+
}
102+
95103
var installBtn = Helpers.$('btn-install-shortcut');
96104
if (installBtn) {
97105
installBtn.addEventListener('click', function() {
@@ -165,6 +173,9 @@ var HomeScreen = (function() {
165173
var skyText = sky ? t(sky.summaryKey) : '';
166174
var forecast = weather ? t(weather.summaryKey) : '';
167175
var effect = weather ? t(weather.effectKey) : '';
176+
var festival = WorldEvents.getCurrentFestival ? WorldEvents.getCurrentFestival(blockNum) : null;
177+
var festivalHtml = festival ? '<p class="forecast-festival"><span aria-hidden="true">' + festival.icon + '</span> ' +
178+
t('festival_today_prefix') + ': ' + t(festival.nameKey) + '. ' + t(festival.descKey) + '</p>' : '';
168179
return '<section class="season-indicator magical-forecast" aria-label="' + t('weather_forecast_label') + '">' +
169180
'<div class="forecast-card forecast-card-season">' +
170181
'<span class="forecast-icon" aria-hidden="true">' + season.icon + '</span>' +
@@ -182,6 +193,7 @@ var HomeScreen = (function() {
182193
'<span class="forecast-kicker">' + t('season_effect_prefix') + '</span>' +
183194
'<p class="season-bonus">' + t('school_' + season.dominant) + ' +20%, ' +
184195
t('school_' + season.secondary) + ' +10%. ' + effect + '</p>' +
196+
festivalHtml +
185197
'</div>' +
186198
'</section>';
187199
}
@@ -193,15 +205,15 @@ var HomeScreen = (function() {
193205
if (!prophecy) return '';
194206

195207
return '<section class="home-prophecy" aria-label="' + t('home_daily_prophecy') + '">' +
196-
'<div class="prophecy-mini">' +
208+
'<button type="button" class="prophecy-mini prophecy-mini-button" aria-label="' + t('home_daily_prophecy') + ': ' + t(prophecy.titleKey) + '">' +
197209
'<span class="prophecy-icon" aria-hidden="true">\uD83D\uDD2E</span>' +
198210
'<div class="prophecy-info">' +
199211
'<h3>' + t('home_daily_prophecy') + '</h3>' +
200212
'<p>' + t(prophecy.titleKey) + '</p>' +
201213
'<p><small>' + t('quest_daily_help_text') + '</small></p>' +
202214
'<span class="prophecy-reward">\u2B50 ' + (prophecy.rewards ? prophecy.rewards.xp : 0) + ' XP</span>' +
203215
'</div>' +
204-
'</div>' +
216+
'</button>' +
205217
'</section>';
206218
}
207219

app/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Viz Magic — Service Worker
2-
var CACHE_NAME = 'viz-magic-v38';
2+
var CACHE_NAME = 'viz-magic-v39';
33
var ASSETS = [
44
'/',
55
'/index.html',

0 commit comments

Comments
 (0)