@jjlmoya/utils-travel 1.1.0
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/package.json +60 -0
- package/src/category/i18n/en.ts +185 -0
- package/src/category/i18n/es.ts +187 -0
- package/src/category/i18n/fr.ts +100 -0
- package/src/category/index.ts +12 -0
- package/src/category/seo.astro +15 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +143 -0
- package/src/data.ts +15 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +22 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +146 -0
- package/src/pages/[locale].astro +278 -0
- package/src/pages/index.astro +4 -0
- package/src/tests/faq_count.test.ts +8 -0
- package/src/tests/locale_completeness.test.ts +21 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_h1_in_components.test.ts +8 -0
- package/src/tests/seo_length.test.ts +8 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/luggage-calculator/bibliography.astro +14 -0
- package/src/tool/luggage-calculator/component.astro +560 -0
- package/src/tool/luggage-calculator/i18n/en.ts +617 -0
- package/src/tool/luggage-calculator/i18n/es.ts +617 -0
- package/src/tool/luggage-calculator/i18n/fr.ts +549 -0
- package/src/tool/luggage-calculator/index.ts +53 -0
- package/src/tool/luggage-calculator/seo.astro +14 -0
- package/src/tool/mini-adventures/bibliography.astro +14 -0
- package/src/tool/mini-adventures/component.astro +665 -0
- package/src/tool/mini-adventures/i18n/en.ts +161 -0
- package/src/tool/mini-adventures/i18n/es.ts +286 -0
- package/src/tool/mini-adventures/i18n/fr.ts +144 -0
- package/src/tool/mini-adventures/index.ts +70 -0
- package/src/tool/mini-adventures/seo.astro +14 -0
- package/src/tool/optimal-routes/bibliography.astro +14 -0
- package/src/tool/optimal-routes/component.astro +439 -0
- package/src/tool/optimal-routes/i18n/en.ts +42 -0
- package/src/tool/optimal-routes/i18n/es.ts +52 -0
- package/src/tool/optimal-routes/index.ts +63 -0
- package/src/tool/optimal-routes/lib/RouteManager.ts +181 -0
- package/src/tool/optimal-routes/seo.astro +14 -0
- package/src/tool/suitcase-checklist/bibliography.astro +14 -0
- package/src/tool/suitcase-checklist/component.astro +710 -0
- package/src/tool/suitcase-checklist/i18n/en.ts +261 -0
- package/src/tool/suitcase-checklist/i18n/es.ts +261 -0
- package/src/tool/suitcase-checklist/i18n/fr.ts +259 -0
- package/src/tool/suitcase-checklist/index.ts +75 -0
- package/src/tool/suitcase-checklist/seo.astro +14 -0
- package/src/tool/tip-calculator/bibliography.astro +14 -0
- package/src/tool/tip-calculator/component.astro +683 -0
- package/src/tool/tip-calculator/i18n/en.ts +264 -0
- package/src/tool/tip-calculator/i18n/es.ts +264 -0
- package/src/tool/tip-calculator/i18n/fr.ts +264 -0
- package/src/tool/tip-calculator/index.ts +53 -0
- package/src/tool/tip-calculator/seo.astro +14 -0
- package/src/tools.ts +13 -0
- package/src/types.ts +73 -0
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Icon } from "astro-icon/components";
|
|
3
|
+
import type { MiniAdventuresUI } from "./index";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
ui: MiniAdventuresUI;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { ui } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class="mini-adventures">
|
|
13
|
+
<div class="ma-card" id="ma-card">
|
|
14
|
+
<div class="ma-bg-glow"></div>
|
|
15
|
+
|
|
16
|
+
<div id="ma-home-view" class="ma-view ma-home">
|
|
17
|
+
<div class="ma-icon-circle">
|
|
18
|
+
<Icon name="mdi:compass-outline" class="ma-pulse" />
|
|
19
|
+
</div>
|
|
20
|
+
<div class="ma-hero">
|
|
21
|
+
<h3>{ui.homeTitle}</h3>
|
|
22
|
+
<p>{ui.homeDesc}</p>
|
|
23
|
+
</div>
|
|
24
|
+
<button id="ma-generate-btn" class="ma-btn-main">
|
|
25
|
+
{ui.generateBtn}
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div id="ma-adventure-view" class="ma-view ma-adventure hidden">
|
|
30
|
+
<header class="ma-header">
|
|
31
|
+
<div id="ma-category-badge" class="ma-badge"></div>
|
|
32
|
+
<button id="ma-close-btn" class="ma-close"><Icon name="mdi:close" /></button>
|
|
33
|
+
</header>
|
|
34
|
+
|
|
35
|
+
<div class="ma-content">
|
|
36
|
+
<div id="ma-icon-container" class="ma-adventure-icon">
|
|
37
|
+
<Icon name="mdi:map" id="ma-curr-icon" />
|
|
38
|
+
</div>
|
|
39
|
+
<h2 id="ma-adventure-text"></h2>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<footer class="ma-footer">
|
|
43
|
+
<div class="ma-btn-grid">
|
|
44
|
+
<button id="ma-done-btn" class="ma-btn-emerald">
|
|
45
|
+
<Icon name="mdi:check-bold" />
|
|
46
|
+
{ui.doneBtn}
|
|
47
|
+
</button>
|
|
48
|
+
<button id="ma-another-btn" class="ma-btn-outline">
|
|
49
|
+
<Icon name="mdi:refresh" />
|
|
50
|
+
{ui.anotherBtn}
|
|
51
|
+
</button>
|
|
52
|
+
</div>
|
|
53
|
+
<button id="ma-share-btn" class="ma-btn-share">
|
|
54
|
+
<Icon name="mdi:share-variant" />
|
|
55
|
+
{ui.shareBtn}
|
|
56
|
+
</button>
|
|
57
|
+
</footer>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div class="ma-stats-section">
|
|
62
|
+
<div class="ma-stats-grid">
|
|
63
|
+
<div class="ma-stat-card">
|
|
64
|
+
<span class="ma-stat-num" id="ma-stat-completed">0</span>
|
|
65
|
+
<span class="ma-stat-label">{ui.stats.adventures}</span>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="ma-stat-card">
|
|
68
|
+
<span class="ma-stat-num" id="ma-stat-achievements">0</span>
|
|
69
|
+
<span class="ma-stat-label">{ui.stats.badges}</span>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="ma-progress-card">
|
|
74
|
+
<div class="ma-progress-header">
|
|
75
|
+
<div>
|
|
76
|
+
<span class="ma-progress-label">{ui.stats.progress}</span>
|
|
77
|
+
<h4>{ui.stats.trophies}</h4>
|
|
78
|
+
</div>
|
|
79
|
+
<span class="ma-total-perc" id="ma-total-progress">0%</span>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="ma-achievements-list" id="ma-achievements-container"></div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<script is:inline define:vars={{ ui }}>
|
|
87
|
+
const homeView = document.getElementById("ma-home-view");
|
|
88
|
+
const adventureView = document.getElementById("ma-adventure-view");
|
|
89
|
+
const generateBtn = document.getElementById("ma-generate-btn");
|
|
90
|
+
const anotherBtn = document.getElementById("ma-another-btn");
|
|
91
|
+
const doneBtn = document.getElementById("ma-done-btn");
|
|
92
|
+
const closeBtn = document.getElementById("ma-close-btn");
|
|
93
|
+
const shareBtn = document.getElementById("ma-share-btn");
|
|
94
|
+
|
|
95
|
+
const textEl = document.getElementById("ma-adventure-text");
|
|
96
|
+
const badgeEl = document.getElementById("ma-category-badge");
|
|
97
|
+
const iconContainer = document.getElementById("ma-icon-container");
|
|
98
|
+
const iconEl = document.getElementById("ma-curr-icon");
|
|
99
|
+
const statCompleted = document.getElementById("ma-stat-completed");
|
|
100
|
+
const statAchievements = document.getElementById("ma-stat-achievements");
|
|
101
|
+
const achievementsContainer = document.getElementById("ma-achievements-container");
|
|
102
|
+
const totalProgressEl = document.getElementById("ma-total-progress");
|
|
103
|
+
|
|
104
|
+
let currentAdventure = null;
|
|
105
|
+
|
|
106
|
+
const ICON_PATHS = {
|
|
107
|
+
"mdi:footprint": "M11,2C10.5,2 10.1,2.4 10.1,2.9V11.1H8.9C8.4,11.1 8,11.5 8,12V21.1C8,21.6 8.4,22 8.9,22H15.1C15.6,22 16,21.6 16,21.1V12C16,11.5 15.6,11.1 15.1,11.1H13.9V2.9C13.9,2.4 13.5,2 13,2H11Z",
|
|
108
|
+
"mdi:sparkles": "M10,21V19H12V21H10M14,14L10,18L7,15L8.4,13.6L10,15.2L12.6,12.6L14,14M21,11A2,2 0 0,0 19,9H12V3H10V9H3A2,2 0 0,0 1,11V19A2,2 0 0,0 3,21H5V23H7V21H17V23H19V21H21A2,2 0 0,0 23,19V11A2,2 0 0,0 21,11Z",
|
|
109
|
+
"mdi:calendar-star": "M19,19V8H5V19H19M16,1H18V3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H6V1H8V3H16V1M11,10.5L12,9L13,10.5L14.7,10.7L13.5,11.9L13.8,13.6L12.3,12.8L10.8,13.6L11.1,11.9L9.9,10.7L11,10.5Z",
|
|
110
|
+
"mdi:trophy-variant": "M18,2H6V5H18V2M18,7H6V9H18V7M12,13L8,9V11C8,13.21 9.79,15 12,15C14.21,15 16,13.21 16,11V9L12,13M12,17C9.24,17 7,14.76 7,12H5V19H19V12H17C17,14.76 14.76,17 12,17M9,21V23H15V21H9Z",
|
|
111
|
+
"mdi:ghost": "M12,2A9,9 0 0,0 3,11V22L6,19L9,22L12,19L15,22L18,19L21,22V11A9,9 0 0,0 12,2M9,8A2,2 0 0,1 11,10A2,2 0 0,1 9,12A2,2 0 0,1 7,10A2,2 0 0,1 9,8M15,8A2,2 0 0,1 17,10A2,2 0 0,1 15,12A2,2 0 0,1 13,10A2,2 0 0,1 15,8Z",
|
|
112
|
+
"mdi:map-marker-outline": "M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2M12,4A5,5 0 0,1 17,9C17,12.42 12,18.05 12,18.05C12,18.05 7,12.42 7,9A5,5 0 0,1 12,4M12,6A3,3 0 0,0 9,9A3,3 0 0,0 12,12A3,3 0 0,0 15,9A3,3 0 0,0 12,6Z",
|
|
113
|
+
"mdi:map-check": "M20,15.5H22V17.5H20V15.5M20,19.5H22V21.5H20V19.5M3,3V19H12.35L11,17H5V5H19V11.23L21,13.23V3H3M20,14L15.3,18.7L13,16.4L11.5,17.9L15.3,21.7L21.4,15.4L20,14Z",
|
|
114
|
+
"mdi:silverware-clean": "M10,21V11.5C10,10.67 9.33,10 8.5,10H7.5V3H6.5V10H5.5C4.67,10 4,10.67 4,11.5V21H5V11H6V21H7V11H8V21H10M14.5,18V21H13V18H14.5M19.5,18V21H18V18H19.5M16,21V7.5C16,4.46 18.46,2 21.5,2V21H16Z",
|
|
115
|
+
"mdi:silverware-variant": "M10,21V11.5C10,10.67 9.33,10 8.5,10H7.5V3H6.5V10H5.5C4.67,10 4,10.67 4,11.5V21H5V11H6V21H7V11H8V21H10M14.5,18V21H13V18H14.5M19.5,18V21H18V18H19.5M16,21V7.5C16,4.46 18.46,2 21.5,2V21H16Z",
|
|
116
|
+
"mdi:book-open-page-variant": "M20,3H4A2,2 0 0,0 2,5V19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19V5A2,2 0 0,0 20,3M20,19H13V5H20V19M11,19H4V5H11V19Z",
|
|
117
|
+
"mdi:head-cog": "M12,2A7,7 0 0,0 5,9C5,11.38 6.19,13.47 8,14.74V17A1,1 0 0,0 9,18H15A1,1 0 0,0 16,17V14.74C17.81,13.47 19,11.38 19,9A7,7 0 0,0 12,2M13,22H11V20H13V22M10.12,19.37L9.06,18.31L10.47,16.9L11.53,17.96L10.12,19.37M14.94,18.31L13.88,19.37L12.47,17.96L13.53,16.9L14.94,18.31Z",
|
|
118
|
+
"mdi:palette-outline": "M12,22C6.48,22 2,17.52 2,12C2,6.48 6.48,2 12,2C17.52,2 22,6.48 22,12C22,13.1 21.1,14 20,14H18.4C17.85,14 17.4,14.45 17.4,15C17.4,15.27 17.5,15.5 17.7,15.7C18.1,16.1 18.3,16.6 18.3,17.1C18.3,18.15 17.5,19 16.4,19H14.4C14.4,20.66 13.06,22 11.4,22H12M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C12,20 12,20 12.1,20C12,20 12,20 12,20H14V17H16.4C16.95,17 17.4,16.55 17.4,16C17.4,15.73 17.3,15.5 17.1,15.3C16.7,14.9 16.5,14.4 16.5,13.9C16.5,12.85 17.35,12 18.4,12H20C20,12 20,12 20,11.9C20,7.54 16.41,4 12,4Z",
|
|
119
|
+
"mdi:palette-swatch": "M2,13C2,13 2,13 2,13V4C2,2.9 2.9,2 4,2H16C17.1,2 18,2.9 18,4V5H20C21.1,5 22,5.9 22,7V20C22,21.1 21.1,22 20,22H6C4.9,22 4,21.1 4,20V19H4C2.9,19 2,18.1 2,17V13M4,13V17H16V13H4M4,12H16V5C16,4.45 15.55,4 15,4H4V12Z",
|
|
120
|
+
"mdi:account-voice": "M16,13C15.71,13 15.38,13 15.03,13.05C16.19,13.89 17,15.11 17,16.5V19H22V16.5C22,14.28 18.44,13.17 16,13M8,13C5.56,13 2,14.12 2,16.34V19H14V16.34C14,14.12 10.44,13 8,13M8,7A4,4 0 0,0 4,11A4,4 0 0,0 8,15A4,4 0 0,0 12,11A4,4 0 0,0 8,7M16,7A4,4 0 0,0 12,11A4,4 0 0,0 16,15A4,4 0 0,0 20,11A4,4 0 0,0 16,7Z",
|
|
121
|
+
"mdi:account-group": "M16,13C15.71,13 15.38,13 15.03,13.05C16.19,13.89 17,15.11 17,16.5V19H22V16.5C22,14.28 18.44,13.17 16,13M8,13C5.56,13 2,14.12 2,16.34V19H14V16.34C14,14.12 10.44,13 8,13M8,7A4,4 0 0,0 4,11A4,4 0 0,0 8,15A4,4 0 0,0 12,11A4,4 0 0,0 8,7M16,7A4,4 0 0,0 12,11A4,4 0 0,0 16,15A4,4 0 0,0 20,11A4,4 0 0,0 16,7Z",
|
|
122
|
+
"mdi:magnify": "M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5A4.5,4.5 0 0,0 5,9.5A4.5,4.5 0 0,0 9.5,14A4.5,4.5 0 0,0 14,9.5A4.5,4.5 0 0,0 9.5,5Z",
|
|
123
|
+
"mdi:telescope": "M1,14L2.2,12.8C2.6,12.4 3.2,12.4 3.6,12.8L5.4,14.6C5.8,15 5.8,15.6 5.4,16L4.2,17.2C3.8,17.6 3.2,17.6 2.8,17.2L1,15.4C0.6,15 0.6,14.4 1,14M9,11L13,7L15.3,9.3C15.7,9.7 15.7,10.3 15.3,10.7L13.1,12.9C12.7,13.3 12.1,13.3 11.7,12.9L9,10.2M23,3.4L21.6,2L14,9.6V11.1L12.9,12.2V13.6L1,26.2L2.4,27.6L15,15H16.4L17.5,13.9H19L26.6,6.3L25.2,4.9L23,7.1V3.4Z",
|
|
124
|
+
"mdi:leaf": "M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C11,20 15,14 15,14C15,14 19,18 21,18C22,18 22,15 22,15C22,15 21,8 17,8Z",
|
|
125
|
+
"mdi:spa": "M12,21C12,21 12,13 7,10C3,7.6 2,5 2,5C2,5 3.5,7 6,7C9,7 12,11 12,11C12,11 15,7 18,7C20.5,7 22,5 22,5C22,5 21,7.6 17,10C12,13 12,21 12,21Z"
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
function createBadgeHTML(ach, val, catColor) {
|
|
129
|
+
return `
|
|
130
|
+
<svg viewBox="0 0 24 24"><path d="${ICON_PATHS[ach.icon] || ""}"></path></svg>
|
|
131
|
+
<div class="ma-tooltip">
|
|
132
|
+
<div class="flex items-center gap-2 mb-2">
|
|
133
|
+
<div class="w-6 h-6 rounded-full flex items-center justify-center" style="background: ${catColor}20; color: ${catColor}">
|
|
134
|
+
<svg viewBox="0 0 24 24" class="w-4 h-4"><path fill="currentColor" d="${ICON_PATHS[ach.icon] || ""}"></path></svg>
|
|
135
|
+
</div>
|
|
136
|
+
<strong class="!m-0">${ach.label}</strong>
|
|
137
|
+
</div>
|
|
138
|
+
<p>${ach.description}</p>
|
|
139
|
+
<div class="ma-bar-mini">
|
|
140
|
+
<div style="width:${Math.min(100, (val/ach.milestone)*100)}%; background:${catColor}"></div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getBadgeColor(ach) {
|
|
147
|
+
const globalColors = { "g1": "#6366f1", "g10": "#0ea5e9", "g50": "#10b981", "g150": "#f59e0b", "g300": "#f43f5e" };
|
|
148
|
+
if (ach.categoryId === 'global') return globalColors[ach.id] || "#6366f1";
|
|
149
|
+
return ui.categories[ach.categoryId]?.color || "#6366f1";
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function renderAchievements(history) {
|
|
153
|
+
if (!achievementsContainer) return;
|
|
154
|
+
achievementsContainer.innerHTML = "";
|
|
155
|
+
|
|
156
|
+
const counts = {};
|
|
157
|
+
history.forEach(id => {
|
|
158
|
+
const adv = ui.adventures.find(a => a.id === id);
|
|
159
|
+
if (adv) counts[adv.categoryId] = (counts[adv.categoryId] || 0) + 1;
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
ui.achievements.forEach(ach => {
|
|
163
|
+
const val = ach.categoryId === 'global' ? history.length : counts[ach.categoryId] || 0;
|
|
164
|
+
const isEarned = val >= ach.milestone;
|
|
165
|
+
const catColor = getBadgeColor(ach);
|
|
166
|
+
|
|
167
|
+
const badge = document.createElement("div");
|
|
168
|
+
badge.className = `ma-badge-item ${isEarned ? 'earned' : 'locked'}`;
|
|
169
|
+
if (isEarned) badge.style.color = catColor;
|
|
170
|
+
badge.innerHTML = createBadgeHTML(ach, val, catColor);
|
|
171
|
+
achievementsContainer.appendChild(badge);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const earned = ui.achievements.filter(a => (a.categoryId === 'global' ? history.length : counts[a.categoryId] || 0) >= a.milestone).length;
|
|
175
|
+
if (statAchievements) statAchievements.textContent = earned;
|
|
176
|
+
if (totalProgressEl) totalProgressEl.textContent = `${Math.round((earned / ui.achievements.length) * 100)}%`;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function loadStats() {
|
|
180
|
+
const history = JSON.parse(localStorage.getItem("mini_adventures_history") || "[]");
|
|
181
|
+
renderAchievements(history);
|
|
182
|
+
if (statCompleted) statCompleted.textContent = history.length;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function showAdventure() {
|
|
186
|
+
const adv = ui.adventures[Math.floor(Math.random() * ui.adventures.length)];
|
|
187
|
+
currentAdventure = adv;
|
|
188
|
+
|
|
189
|
+
const cat = ui.categories[adv.categoryId];
|
|
190
|
+
textEl.textContent = adv.text;
|
|
191
|
+
badgeEl.textContent = cat.label;
|
|
192
|
+
badgeEl.style.borderColor = cat.color + '50';
|
|
193
|
+
badgeEl.style.color = cat.color;
|
|
194
|
+
badgeEl.style.background = cat.color + '10';
|
|
195
|
+
|
|
196
|
+
iconContainer.style.background = cat.color + '20';
|
|
197
|
+
iconEl.style.color = cat.color;
|
|
198
|
+
|
|
199
|
+
homeView.classList.add("hidden");
|
|
200
|
+
adventureView.classList.remove("hidden");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
generateBtn?.addEventListener("click", showAdventure);
|
|
204
|
+
anotherBtn?.addEventListener("click", showAdventure);
|
|
205
|
+
closeBtn?.addEventListener("click", () => {
|
|
206
|
+
adventureView.classList.add("hidden");
|
|
207
|
+
homeView.classList.remove("hidden");
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
doneBtn?.addEventListener("click", () => {
|
|
211
|
+
const history = JSON.parse(localStorage.getItem("mini_adventures_history") || "[]");
|
|
212
|
+
if (!history.includes(currentAdventure.id)) {
|
|
213
|
+
history.push(currentAdventure.id);
|
|
214
|
+
localStorage.setItem("mini_adventures_history", JSON.stringify(history));
|
|
215
|
+
}
|
|
216
|
+
loadStats();
|
|
217
|
+
showAdventure();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
shareBtn?.addEventListener("click", () => {
|
|
221
|
+
const text = ui.shareTemplate.replace("{text}", currentAdventure.text).replace("{url}", window.location.href);
|
|
222
|
+
if (navigator.share) navigator.share({ text });
|
|
223
|
+
else window.open(`https://wa.me/?text=${encodeURIComponent(text)}`, "_blank");
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
loadStats();
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<style>
|
|
230
|
+
.mini-adventures {
|
|
231
|
+
--ma-primary: #6366f1;
|
|
232
|
+
--ma-bg: #f8fafc;
|
|
233
|
+
--ma-card-bg: #fff;
|
|
234
|
+
--ma-text: #1e293b;
|
|
235
|
+
--ma-text-muted: #64748b;
|
|
236
|
+
--ma-border: #e2e8f0;
|
|
237
|
+
--ma-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:global(.theme-dark) .mini-adventures {
|
|
241
|
+
--ma-bg: #0f172a;
|
|
242
|
+
--ma-card-bg: #1e293b;
|
|
243
|
+
--ma-text: #f1f5f9;
|
|
244
|
+
--ma-text-muted: #94a3b8;
|
|
245
|
+
--ma-border: #334155;
|
|
246
|
+
--ma-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.ma-card {
|
|
250
|
+
position: relative;
|
|
251
|
+
background: var(--ma-card-bg);
|
|
252
|
+
border-radius: 2.5rem;
|
|
253
|
+
padding: 2.5rem;
|
|
254
|
+
min-height: 400px;
|
|
255
|
+
border: 1px solid var(--ma-border);
|
|
256
|
+
box-shadow: var(--ma-shadow);
|
|
257
|
+
overflow: hidden;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.ma-bg-glow {
|
|
261
|
+
position: absolute;
|
|
262
|
+
inset: 0;
|
|
263
|
+
background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.05), transparent);
|
|
264
|
+
pointer-events: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.ma-view {
|
|
268
|
+
height: 100%;
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
align-items: center;
|
|
272
|
+
justify-content: center;
|
|
273
|
+
text-align: center;
|
|
274
|
+
gap: 2rem;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.ma-view.hidden { display: none; }
|
|
278
|
+
|
|
279
|
+
.ma-icon-circle {
|
|
280
|
+
width: 80px;
|
|
281
|
+
height: 80px;
|
|
282
|
+
background: var(--ma-bg);
|
|
283
|
+
border-radius: 50%;
|
|
284
|
+
display: flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
justify-content: center;
|
|
287
|
+
border: 1px solid var(--ma-border);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.ma-icon-circle svg {
|
|
291
|
+
font-size: 2.5rem;
|
|
292
|
+
color: var(--ma-primary);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.ma-pulse {
|
|
296
|
+
animation: ma-pulse 2s infinite;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@keyframes ma-pulse {
|
|
300
|
+
0% {
|
|
301
|
+
transform: scale(1);
|
|
302
|
+
opacity: 1;
|
|
303
|
+
}
|
|
304
|
+
50% {
|
|
305
|
+
transform: scale(1.1);
|
|
306
|
+
opacity: 0.7;
|
|
307
|
+
}
|
|
308
|
+
100% {
|
|
309
|
+
transform: scale(1);
|
|
310
|
+
opacity: 1;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.ma-hero h3 {
|
|
315
|
+
font-size: 2rem;
|
|
316
|
+
font-weight: 900;
|
|
317
|
+
margin: 0 0 0.5rem;
|
|
318
|
+
}
|
|
319
|
+
.ma-hero p {
|
|
320
|
+
font-size: 1.1rem;
|
|
321
|
+
color: var(--ma-text-muted);
|
|
322
|
+
margin: 0;
|
|
323
|
+
line-height: 1.5;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.ma-btn-main {
|
|
327
|
+
padding: 1.25rem 2.5rem;
|
|
328
|
+
background: var(--ma-text);
|
|
329
|
+
color: var(--ma-card-bg);
|
|
330
|
+
border: none;
|
|
331
|
+
border-radius: 1.25rem;
|
|
332
|
+
font-size: 1.1rem;
|
|
333
|
+
font-weight: 900;
|
|
334
|
+
cursor: pointer;
|
|
335
|
+
transition: 0.2s;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
:global(.theme-dark) .ma-btn-main {
|
|
339
|
+
background: white;
|
|
340
|
+
color: black;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.ma-btn-main:hover {
|
|
344
|
+
transform: translateY(-2px);
|
|
345
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.ma-adventure {
|
|
349
|
+
justify-content: space-between;
|
|
350
|
+
gap: 1rem;
|
|
351
|
+
width: 100%;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.ma-header {
|
|
355
|
+
width: 100%;
|
|
356
|
+
display: flex;
|
|
357
|
+
justify-content: space-between;
|
|
358
|
+
align-items: center;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.ma-badge {
|
|
362
|
+
font-size: 0.7rem;
|
|
363
|
+
font-weight: 900;
|
|
364
|
+
text-transform: uppercase;
|
|
365
|
+
letter-spacing: 0.1em;
|
|
366
|
+
padding: 0.4rem 1rem;
|
|
367
|
+
border-radius: 2rem;
|
|
368
|
+
border: 1px solid;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.ma-close {
|
|
372
|
+
background: transparent;
|
|
373
|
+
border: none;
|
|
374
|
+
color: var(--ma-text-muted);
|
|
375
|
+
cursor: pointer;
|
|
376
|
+
padding: 0.5rem;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.ma-close svg {
|
|
380
|
+
font-size: 1.5rem;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.ma-content {
|
|
384
|
+
flex: 1;
|
|
385
|
+
display: flex;
|
|
386
|
+
flex-direction: column;
|
|
387
|
+
align-items: center;
|
|
388
|
+
justify-content: center;
|
|
389
|
+
gap: 1.5rem;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.ma-adventure-icon {
|
|
393
|
+
width: 80px;
|
|
394
|
+
height: 80px;
|
|
395
|
+
border-radius: 1.5rem;
|
|
396
|
+
display: flex;
|
|
397
|
+
align-items: center;
|
|
398
|
+
justify-content: center;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.ma-adventure-icon svg {
|
|
402
|
+
font-size: 2.5rem;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
#ma-adventure-text {
|
|
406
|
+
font-size: 1.75rem;
|
|
407
|
+
font-weight: 800;
|
|
408
|
+
line-height: 1.2;
|
|
409
|
+
margin: 0;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.ma-footer {
|
|
413
|
+
width: 100%;
|
|
414
|
+
display: flex;
|
|
415
|
+
flex-direction: column;
|
|
416
|
+
gap: 1rem;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.ma-btn-grid {
|
|
420
|
+
display: grid;
|
|
421
|
+
grid-template-columns: 1fr 1fr;
|
|
422
|
+
gap: 1rem;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.ma-btn-emerald {
|
|
426
|
+
background: #10b981;
|
|
427
|
+
color: white;
|
|
428
|
+
border: none;
|
|
429
|
+
padding: 1rem;
|
|
430
|
+
border-radius: 1rem;
|
|
431
|
+
font-weight: 900;
|
|
432
|
+
cursor: pointer;
|
|
433
|
+
display: flex;
|
|
434
|
+
align-items: center;
|
|
435
|
+
justify-content: center;
|
|
436
|
+
gap: 0.5rem;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.ma-btn-outline {
|
|
440
|
+
background: var(--ma-bg);
|
|
441
|
+
border: 1px solid var(--ma-border);
|
|
442
|
+
color: var(--ma-text);
|
|
443
|
+
padding: 1rem;
|
|
444
|
+
border-radius: 1rem;
|
|
445
|
+
font-weight: 700;
|
|
446
|
+
cursor: pointer;
|
|
447
|
+
display: flex;
|
|
448
|
+
align-items: center;
|
|
449
|
+
justify-content: center;
|
|
450
|
+
gap: 0.5rem;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.ma-btn-share {
|
|
454
|
+
background: transparent;
|
|
455
|
+
border: 1px solid var(--ma-border);
|
|
456
|
+
color: var(--ma-text-muted);
|
|
457
|
+
padding: 0.75rem;
|
|
458
|
+
border-radius: 1rem;
|
|
459
|
+
font-weight: 700;
|
|
460
|
+
cursor: pointer;
|
|
461
|
+
display: flex;
|
|
462
|
+
align-items: center;
|
|
463
|
+
justify-content: center;
|
|
464
|
+
gap: 0.5rem;
|
|
465
|
+
font-size: 0.8rem;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.ma-stats-section {
|
|
469
|
+
margin-top: 3rem;
|
|
470
|
+
display: grid;
|
|
471
|
+
gap: 2rem;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.ma-stats-grid {
|
|
475
|
+
display: grid;
|
|
476
|
+
grid-template-columns: 1fr 1fr;
|
|
477
|
+
gap: 1.5rem;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.ma-stat-card {
|
|
481
|
+
background: linear-gradient(135deg, var(--ma-card-bg), var(--ma-bg));
|
|
482
|
+
border: 1px solid var(--ma-border);
|
|
483
|
+
padding: 2rem;
|
|
484
|
+
border-radius: 2rem;
|
|
485
|
+
display: flex;
|
|
486
|
+
flex-direction: column;
|
|
487
|
+
align-items: center;
|
|
488
|
+
box-shadow: 0 4px 20px rgba(0,0,0,0.03);
|
|
489
|
+
transition: transform 0.3s;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.ma-stat-card:hover {
|
|
493
|
+
transform: translateY(-5px);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.ma-stat-num {
|
|
497
|
+
font-size: 2.5rem;
|
|
498
|
+
font-weight: 900;
|
|
499
|
+
background: linear-gradient(to bottom, var(--ma-text), var(--ma-primary));
|
|
500
|
+
-webkit-background-clip: text;
|
|
501
|
+
-webkit-text-fill-color: transparent;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.ma-progress-card {
|
|
505
|
+
background: var(--ma-card-bg);
|
|
506
|
+
border: 1px solid var(--ma-border);
|
|
507
|
+
padding: 3rem;
|
|
508
|
+
border-radius: 3rem;
|
|
509
|
+
box-shadow: var(--ma-shadow);
|
|
510
|
+
position: relative;
|
|
511
|
+
overflow: hidden;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.ma-progress-card::after {
|
|
515
|
+
content: '';
|
|
516
|
+
position: absolute;
|
|
517
|
+
top: -50%;
|
|
518
|
+
right: -50%;
|
|
519
|
+
width: 100%;
|
|
520
|
+
height: 100%;
|
|
521
|
+
background: radial-gradient(circle, var(--ma-primary-soft), transparent 70%);
|
|
522
|
+
opacity: 0.1;
|
|
523
|
+
pointer-events: none;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.ma-progress-header {
|
|
527
|
+
display: flex;
|
|
528
|
+
justify-content: space-between;
|
|
529
|
+
align-items: center;
|
|
530
|
+
margin-bottom: 3rem;
|
|
531
|
+
position: relative;
|
|
532
|
+
z-index: 1;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.ma-progress-header h4 {
|
|
536
|
+
margin: 0.5rem 0 0;
|
|
537
|
+
font-size: 2rem;
|
|
538
|
+
font-weight: 900;
|
|
539
|
+
letter-spacing: -0.02em;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.ma-total-perc {
|
|
543
|
+
font-size: 3rem;
|
|
544
|
+
font-weight: 950;
|
|
545
|
+
color: var(--ma-primary);
|
|
546
|
+
text-shadow: 0 0 20px var(--ma-primary-soft);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.ma-achievements-list {
|
|
550
|
+
display: grid;
|
|
551
|
+
grid-template-columns: repeat(5, 1fr);
|
|
552
|
+
gap: 1.25rem;
|
|
553
|
+
position: relative;
|
|
554
|
+
z-index: 1;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.ma-achievements-list :global(.ma-badge-item) {
|
|
558
|
+
aspect-ratio: 1;
|
|
559
|
+
border-radius: 1.25rem;
|
|
560
|
+
background: var(--ma-bg);
|
|
561
|
+
border: 1px solid var(--ma-border);
|
|
562
|
+
display: flex;
|
|
563
|
+
align-items: center;
|
|
564
|
+
justify-content: center;
|
|
565
|
+
position: relative;
|
|
566
|
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
567
|
+
cursor: pointer;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.ma-achievements-list :global(.ma-badge-item svg) {
|
|
571
|
+
width: 32px;
|
|
572
|
+
height: 32px;
|
|
573
|
+
fill: currentcolor;
|
|
574
|
+
transition: all 0.3s;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.ma-achievements-list :global(.ma-badge-item.locked) {
|
|
578
|
+
opacity: 0.2;
|
|
579
|
+
filter: grayscale(1) blur(1px);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.ma-achievements-list :global(.ma-badge-item.earned) {
|
|
583
|
+
background: var(--ma-card-bg);
|
|
584
|
+
border-color: currentcolor;
|
|
585
|
+
box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), inset 0 0 10px rgba(255,255,255,0.5);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.ma-achievements-list :global(.ma-badge-item.earned::after) {
|
|
589
|
+
content: '';
|
|
590
|
+
position: absolute;
|
|
591
|
+
inset: -2px;
|
|
592
|
+
border-radius: 1.4rem;
|
|
593
|
+
background: currentcolor;
|
|
594
|
+
opacity: 0.15;
|
|
595
|
+
z-index: -1;
|
|
596
|
+
filter: blur(8px);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.ma-achievements-list :global(.ma-badge-item:hover) {
|
|
600
|
+
transform: scale(1.15) rotate(5deg);
|
|
601
|
+
z-index: 10;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.ma-achievements-list :global(.ma-badge-item.earned:hover svg) {
|
|
605
|
+
transform: scale(1.1);
|
|
606
|
+
filter: drop-shadow(0 0 8px currentcolor);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.ma-achievements-list :global(.ma-tooltip) {
|
|
610
|
+
position: absolute;
|
|
611
|
+
bottom: 120%;
|
|
612
|
+
left: 50%;
|
|
613
|
+
transform: translateX(-50%) translateY(10px);
|
|
614
|
+
background: rgba(15, 23, 42, 0.95);
|
|
615
|
+
backdrop-filter: blur(12px);
|
|
616
|
+
color: white;
|
|
617
|
+
padding: 1.5rem;
|
|
618
|
+
border-radius: 1.5rem;
|
|
619
|
+
width: 220px;
|
|
620
|
+
font-size: 0.9rem;
|
|
621
|
+
pointer-events: none;
|
|
622
|
+
opacity: 0;
|
|
623
|
+
transition: all 0.3s;
|
|
624
|
+
z-index: 100;
|
|
625
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
626
|
+
box-shadow: 0 20px 40px rgba(0,0,0,0.4);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.ma-achievements-list :global(.ma-badge-item:hover .ma-tooltip) {
|
|
630
|
+
opacity: 1;
|
|
631
|
+
transform: translateX(-50%) translateY(0);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.ma-achievements-list :global(.ma-tooltip strong) {
|
|
635
|
+
display: block;
|
|
636
|
+
margin-bottom: 0.5rem;
|
|
637
|
+
font-size: 1rem;
|
|
638
|
+
color: white;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.ma-achievements-list :global(.ma-tooltip p) {
|
|
642
|
+
margin: 0 0 1rem;
|
|
643
|
+
color: rgba(255,255,255,0.6);
|
|
644
|
+
line-height: 1.4;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.ma-achievements-list :global(.ma-bar-mini) {
|
|
648
|
+
height: 6px;
|
|
649
|
+
background: rgba(255,255,255,0.1);
|
|
650
|
+
border-radius: 3px;
|
|
651
|
+
overflow: hidden;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
@media (max-width: 640px) {
|
|
655
|
+
.ma-achievements-list {
|
|
656
|
+
grid-template-columns: repeat(4, 1fr);
|
|
657
|
+
}
|
|
658
|
+
.ma-progress-card {
|
|
659
|
+
padding: 2rem;
|
|
660
|
+
}
|
|
661
|
+
.ma-total-perc {
|
|
662
|
+
font-size: 2rem;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
</style>
|