@jjlmoya/utils-civic 1.10.0 → 1.11.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.
@@ -82,11 +82,10 @@ jobs:
82
82
  {"baseUrl":"https://www.gamebob.dev","pathPrefixes":["/en/utilities/","/fr/utilitaires/","/de/werkzeuge/","/it/utilita/","/pt/utilidades/","/nl/hulpmiddelen/","/sv/verktyg/","/pl/narzedzia/","/id/utilitas/","/tr/araclar/","/ru/instrumenty/","/ja/utilities/","/ko/utilities/","/zh/utilities/"]}
83
83
  ]
84
84
  - name: Deploy both domains to Cloudflare
85
- uses: cloudflare/wrangler-action@v3
86
- with:
87
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
88
- accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
89
- command: deploy
85
+ env:
86
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
87
+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
88
+ run: ./node_modules/.bin/wrangler deploy
90
89
  - name: Save deployed page manifest
91
90
  continue-on-error: true
92
91
  uses: Game-Bob/ai-knows/.github/actions/indexnow-save@main
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-civic",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -44,12 +44,25 @@ const ui = getCategoryUi(locale);
44
44
  </ProductionPage>
45
45
 
46
46
  <script>
47
+ const isWidget = new URLSearchParams(window.location.search).get("widget") === "true";
48
+ const page = document.querySelector<HTMLElement>(".utility-production");
47
49
  const container = document.querySelector<HTMLElement>(".utility-tool-production");
48
- let zoom = Number(localStorage.getItem("gamebob-utility-zoom") ?? 1);
49
- const applyZoom = () => { if (container) container.style.zoom = String(zoom); };
50
+ const zoomButton = document.querySelector<HTMLButtonElement>('[data-zoom="reset"]');
51
+ const storedZoom = isWidget ? 1 : Number(localStorage.getItem("gamebob-utility-zoom") ?? 1);
52
+ let zoom = Number.isFinite(storedZoom) ? Math.min(1.5, Math.max(0.75, storedZoom)) : 1;
53
+ const applyZoom = () => {
54
+ if (container) container.style.zoom = String(zoom);
55
+ if (zoomButton) zoomButton.textContent = `${Math.round(zoom * 100)}%`;
56
+ };
50
57
  document.querySelector('[data-zoom="out"]')?.addEventListener("click", () => { zoom = Math.max(0.75, zoom - 0.1); applyZoom(); localStorage.setItem("gamebob-utility-zoom", String(zoom)); });
51
58
  document.querySelector('[data-zoom="in"]')?.addEventListener("click", () => { zoom = Math.min(1.5, zoom + 0.1); applyZoom(); localStorage.setItem("gamebob-utility-zoom", String(zoom)); });
52
59
  document.querySelector('[data-zoom="reset"]')?.addEventListener("click", () => { zoom = 1; applyZoom(); localStorage.removeItem("gamebob-utility-zoom"); });
60
+ if (isWidget) {
61
+ document.body.classList.add("utility-widget-body");
62
+ if (page) {
63
+ page.classList.add("utility-widget-mode");
64
+ }
65
+ }
53
66
  applyZoom();
54
67
  </script>
55
68
 
@@ -60,6 +73,38 @@ const ui = getCategoryUi(locale);
60
73
  background: radial-gradient(ellipse at top, var(--primary-10), var(--bg-surface) 50%, var(--bg-main));
61
74
  }
62
75
 
76
+ .utility-production.utility-widget-mode {
77
+ min-height: auto;
78
+ background: transparent;
79
+ }
80
+
81
+ .utility-production.utility-widget-mode .utility-production-inner {
82
+ max-width: none;
83
+ padding: 0;
84
+ }
85
+
86
+ .utility-production.utility-widget-mode .utility-tool-production {
87
+ margin-top: 0;
88
+ }
89
+
90
+ .utility-production.utility-widget-mode .utility-production-inner > :not(.utility-tool-production) {
91
+ display: none;
92
+ }
93
+
94
+ :global(body.utility-widget-body) {
95
+ margin: 0;
96
+ padding-top: 0;
97
+ background: transparent;
98
+ }
99
+
100
+ :global(body.utility-widget-body > :not(main)) {
101
+ display: none;
102
+ }
103
+
104
+ :global(body.utility-widget-body main), :global(body.utility-widget-body main .utility-production), :global(body.utility-widget-body main .utility-production-inner) {
105
+ min-height: auto;
106
+ }
107
+
63
108
  .utility-production-inner {
64
109
  max-width: 72rem;
65
110
  margin: 0 auto;