@nohemia/widgets 0.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/LICENSE +21 -0
- package/README.de.md +140 -0
- package/README.es.md +149 -0
- package/README.fr.md +139 -0
- package/README.it.md +140 -0
- package/README.ja.md +140 -0
- package/README.ko.md +140 -0
- package/README.md +146 -0
- package/README.pl.md +140 -0
- package/README.pt.md +149 -0
- package/README.tr.md +147 -0
- package/examples/index.html +34 -0
- package/package.json +44 -0
- package/src/nohemia-widget.js +54 -0
package/README.pt.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Nohemia Widgets
|
|
2
|
+
|
|
3
|
+
**[English](README.md) · [Français](README.fr.md) · [Português](README.pt.md) · [Español](README.es.md) · [Italiano](README.it.md) · [Deutsch](README.de.md) · [Polski](README.pl.md) · [한국어](README.ko.md) · [日本語](README.ja.md) · [Türkçe](README.tr.md)**
|
|
4
|
+
|
|
5
|
+
**Widgets gratuitos e incorporáveis de astrologia e lua para qualquer site.** Dados de efeméride reais, atualizados toda
|
|
6
|
+
noite, sem conta, sem rastreamento, sem necessidade de JavaScript. É só colar uma linha de HTML e pronto.
|
|
7
|
+
|
|
8
|
+
Criado e mantido por [Jade Nohemia](https://nohemia.com/fr/auteur/jade/) em **[nohemia.com](https://nohemia.com/fr/)**.
|
|
9
|
+
Galeria e prévias ao vivo: **[nohemia.com/fr/widgets](https://nohemia.com/fr/widgets/)**.
|
|
10
|
+
|
|
11
|
+
> Des widgets d'astrologie gratuits pour ton site. La lune du jour, le ciel du moment : un petit cadre
|
|
12
|
+
> soigné à coller en deux copier-coller, recalculé chaque nuit à partir d'une éphéméride réelle.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Quick start (HTML puro)
|
|
17
|
+
|
|
18
|
+
Cole isto em qualquer lugar da sua página. Funciona em qualquer site que aceite HTML (WordPress, Wix, Squarespace,
|
|
19
|
+
Webflow, Ghost, Shopify, uma página estática...).
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<iframe src="https://nohemia.com/fr/widgets/lune/clair-m/"
|
|
23
|
+
width="300" height="210" loading="lazy"
|
|
24
|
+
title="Calendrier lunaire" style="border:0;border-radius:12px;max-width:100%"></iframe>
|
|
25
|
+
<p style="font:12px/1.4 system-ui,sans-serif;text-align:center;margin:6px 0 0">
|
|
26
|
+
<a href="https://nohemia.com/fr/lune/" rel="nofollow">Calendrier lunaire par Nohemia</a>
|
|
27
|
+
</p>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
A pequena linha de crédito é o único agradecimento que pedimos. Ela é opcional: você pode editá-la ou removê-la, que o
|
|
31
|
+
widget continua funcionando exatamente igual.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Widgets
|
|
36
|
+
|
|
37
|
+
| Widget | `type` | Descrição | Tamanhos |
|
|
38
|
+
|--------|--------|-------------|-------|
|
|
39
|
+
| Lua hoje | `lune` | Fase, signo e próxima lua cheia | `s` (220x140), `m` (300x210) |
|
|
40
|
+
| Céu hoje | `ciel` | Sol e Lua por signo, fase atual | `s` (230x150), `m` (300x200) |
|
|
41
|
+
|
|
42
|
+
Cada `type` vem em dois temas (`clair` / `sombre`) e dois tamanhos (`s` / `m`). O padrão da URL é:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
https://nohemia.com/fr/widgets/{type}/{theme}-{size}/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Mais widgets estão a caminho: contagem regressiva para a lua cheia, horóscopo diário por signo, retrógrados em curso.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Exemplos por framework
|
|
53
|
+
|
|
54
|
+
### WordPress
|
|
55
|
+
Adicione um bloco **HTML personalizado** (ou use a aba *Texto* do editor Clássico) e cole o trecho do Quick start.
|
|
56
|
+
Nenhum plugin é necessário.
|
|
57
|
+
|
|
58
|
+
### React / Next.js
|
|
59
|
+
```jsx
|
|
60
|
+
export function MoonWidget() {
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<iframe
|
|
64
|
+
src="https://nohemia.com/fr/widgets/lune/clair-m/"
|
|
65
|
+
width={300} height={210} loading="lazy"
|
|
66
|
+
title="Calendrier lunaire"
|
|
67
|
+
style={{ border: 0, borderRadius: 12, maxWidth: '100%' }}
|
|
68
|
+
/>
|
|
69
|
+
<p style={{ font: '12px/1.4 system-ui, sans-serif', textAlign: 'center', margin: '6px 0 0' }}>
|
|
70
|
+
<a href="https://nohemia.com/fr/lune/" rel="nofollow">Calendrier lunaire par Nohemia</a>
|
|
71
|
+
</p>
|
|
72
|
+
</>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Vue
|
|
78
|
+
```vue
|
|
79
|
+
<template>
|
|
80
|
+
<iframe src="https://nohemia.com/fr/widgets/ciel/sombre-m/"
|
|
81
|
+
width="300" height="200" loading="lazy" title="Le ciel du jour"
|
|
82
|
+
style="border:0;border-radius:12px;max-width:100%" />
|
|
83
|
+
</template>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Webflow / Squarespace
|
|
87
|
+
Solte um elemento **Embed** (Webflow) ou um bloco **Code** (Squarespace) e cole o trecho do Quick start.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Web component (npm)
|
|
92
|
+
|
|
93
|
+
Se você prefere uma tag em vez de um iframe, instale o pequeno web component (um wrapper enxuto e sem dependências):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm i @nohemia/widgets
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<script type="module">import '@nohemia/widgets'</script>
|
|
101
|
+
|
|
102
|
+
<nohemia-widget type="lune" theme="clair" size="m"></nohemia-widget>
|
|
103
|
+
<nohemia-widget type="ciel" theme="sombre" size="s"></nohemia-widget>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Ou carregue direto de um CDN, sem nenhuma etapa de build:
|
|
107
|
+
|
|
108
|
+
```html
|
|
109
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@nohemia/widgets"></script>
|
|
110
|
+
<nohemia-widget type="lune"></nohemia-widget>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Atributos: `type` (`lune` | `ciel`), `theme` (`clair` | `sombre`), `size` (`s` | `m`). O componente
|
|
114
|
+
apenas renderiza o iframe oficial, então os dados e o estilo permanecem sincronizados com o nohemia.com.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Dados e atualização
|
|
119
|
+
|
|
120
|
+
Nada é digitado à mão. Fases, signos e horários vêm de uma efeméride astronômica real
|
|
121
|
+
([astronomy-engine](https://github.com/cosinekitty/astronomy), MIT), recalculada toda noite. Os horários são
|
|
122
|
+
dados em Europe/Paris, com precisão de minuto. Os mesmos dados alimentam o
|
|
123
|
+
[calendário lunar completo no nohemia.com](https://nohemia.com/fr/lune/calendrier-pleines-lunes/).
|
|
124
|
+
|
|
125
|
+
Você também pode ler o JSON bruto se quiser construir o seu próprio:
|
|
126
|
+
`https://nohemia.com/widgets/lune/data.json` (fase de hoje, próxima lua cheia e nova, as dez próximas lunações).
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Por que esses widgets
|
|
131
|
+
|
|
132
|
+
- **Gratuitos, para sempre.** Sem conta, sem chave de API, sem limite de requisições.
|
|
133
|
+
- **Leves e seguros.** Um iframe em sandbox: ele nunca lê sua página, não define nenhum cookie e não deixa seu site mais lento.
|
|
134
|
+
- **Design editorial.** Acolhedor, sóbrio, no estilo Nohemia. Temas claro e escuro.
|
|
135
|
+
- **Dados honestos e reais.** Uma efeméride genuína, não uma tabela fixa no código.
|
|
136
|
+
- **Respeito à privacidade.** Zero rastreamento, em conformidade com a LGPD por construção.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Links
|
|
141
|
+
|
|
142
|
+
- Site: [nohemia.com](https://nohemia.com/fr/) · Galeria de widgets: [nohemia.com/fr/widgets](https://nohemia.com/fr/widgets/)
|
|
143
|
+
- Autora: [Jade Nohemia](https://nohemia.com/fr/auteur/jade/)
|
|
144
|
+
- Problemas e ideias: [github.com/jadenohemia/nohemia-widgets/issues](https://github.com/jadenohemia/nohemia-widgets/issues)
|
|
145
|
+
|
|
146
|
+
## Licença
|
|
147
|
+
|
|
148
|
+
[MIT](./LICENSE) © Jade Nohemia / Nohemia. Use-os em qualquer lugar, inclusive comercialmente. Um link de volta para
|
|
149
|
+
[nohemia.com](https://nohemia.com/fr/) é apreciado, mas nunca obrigatório.
|
package/README.tr.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Nohemia Widgets
|
|
2
|
+
|
|
3
|
+
**[English](README.md) · [Français](README.fr.md) · [Português](README.pt.md) · [Español](README.es.md) · [Italiano](README.it.md) · [Deutsch](README.de.md) · [Polski](README.pl.md) · [한국어](README.ko.md) · [日本語](README.ja.md) · [Türkçe](README.tr.md)**
|
|
4
|
+
|
|
5
|
+
**Her web sitesine eklenebilen ücretsiz astroloji ve ay widget'ları.** Gerçek efemeris verisi, her gece yenilenir, hesap yok, takip yok, JavaScript gerektirmez. Tek satır HTML yapıştırın, işte bu kadar.
|
|
6
|
+
|
|
7
|
+
[Jade Nohemia](https://nohemia.com/fr/auteur/jade/) tarafından **[nohemia.com](https://nohemia.com/fr/)** üzerinde geliştirilir ve bakımı yapılır.
|
|
8
|
+
Galeri ve canlı önizlemeler: **[nohemia.com/fr/widgets](https://nohemia.com/fr/widgets/)**.
|
|
9
|
+
|
|
10
|
+
> Des widgets d'astrologie gratuits pour ton site. La lune du jour, le ciel du moment : un petit cadre
|
|
11
|
+
> soigné à coller en deux copier-coller, recalculé chaque nuit à partir d'une éphéméride réelle.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Hızlı başlangıç (düz HTML)
|
|
16
|
+
|
|
17
|
+
Bunu sayfanızda herhangi bir yere yapıştırın. HTML kabul eden her sitede çalışır (WordPress, Wix, Squarespace,
|
|
18
|
+
Webflow, Ghost, Shopify, statik bir sayfa...).
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<iframe src="https://nohemia.com/fr/widgets/lune/clair-m/"
|
|
22
|
+
width="300" height="210" loading="lazy"
|
|
23
|
+
title="Calendrier lunaire" style="border:0;border-radius:12px;max-width:100%"></iframe>
|
|
24
|
+
<p style="font:12px/1.4 system-ui,sans-serif;text-align:center;margin:6px 0 0">
|
|
25
|
+
<a href="https://nohemia.com/fr/lune/" rel="nofollow">Calendrier lunaire par Nohemia</a>
|
|
26
|
+
</p>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
İstediğimiz tek teşekkür o küçük kaynak satırı. Zorunlu değil: düzenleyebilir ya da kaldırabilirsiniz,
|
|
30
|
+
widget yine tıpatıp aynı şekilde çalışır.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Widget'lar
|
|
35
|
+
|
|
36
|
+
| Widget | `type` | Açıklama | Boyutlar |
|
|
37
|
+
|--------|--------|----------|----------|
|
|
38
|
+
| Bugünün ayı | `lune` | Evre, burç ve bir sonraki dolunay | `s` (220x140), `m` (300x210) |
|
|
39
|
+
| Bugünün gökyüzü | `ciel` | Burca göre Güneş ve Ay, güncel evre | `s` (230x150), `m` (300x200) |
|
|
40
|
+
|
|
41
|
+
Her `type`, iki temayla (`clair` / `sombre`) ve iki boyutla (`s` / `m`) gelir. URL kalıbı şudur:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
https://nohemia.com/fr/widgets/{type}/{theme}-{size}/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Daha fazla widget yolda: dolunaya geri sayım, burca göre günlük burç yorumu, süregelen retrolar.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Framework örnekleri
|
|
52
|
+
|
|
53
|
+
### WordPress
|
|
54
|
+
Bir **Custom HTML** bloğu ekleyin (ya da Klasik düzenleyicinin *Text* sekmesini kullanın) ve Hızlı başlangıç parçacığını yapıştırın.
|
|
55
|
+
Eklenti gerekmez.
|
|
56
|
+
|
|
57
|
+
### React / Next.js
|
|
58
|
+
```jsx
|
|
59
|
+
export function MoonWidget() {
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
<iframe
|
|
63
|
+
src="https://nohemia.com/fr/widgets/lune/clair-m/"
|
|
64
|
+
width={300} height={210} loading="lazy"
|
|
65
|
+
title="Calendrier lunaire"
|
|
66
|
+
style={{ border: 0, borderRadius: 12, maxWidth: '100%' }}
|
|
67
|
+
/>
|
|
68
|
+
<p style={{ font: '12px/1.4 system-ui, sans-serif', textAlign: 'center', margin: '6px 0 0' }}>
|
|
69
|
+
<a href="https://nohemia.com/fr/lune/" rel="nofollow">Calendrier lunaire par Nohemia</a>
|
|
70
|
+
</p>
|
|
71
|
+
</>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Vue
|
|
77
|
+
```vue
|
|
78
|
+
<template>
|
|
79
|
+
<iframe src="https://nohemia.com/fr/widgets/ciel/sombre-m/"
|
|
80
|
+
width="300" height="200" loading="lazy" title="Le ciel du jour"
|
|
81
|
+
style="border:0;border-radius:12px;max-width:100%" />
|
|
82
|
+
</template>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Webflow / Squarespace
|
|
86
|
+
Bir **Embed** öğesi (Webflow) ya da bir **Code** bloğu (Squarespace) bırakın ve Hızlı başlangıç parçacığını yapıştırın.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Web bileşeni (npm)
|
|
91
|
+
|
|
92
|
+
iframe yerine bir etiket kullanmayı tercih ederseniz, küçük web bileşenini kurun (ince, bağımlılıksız bir sarmalayıcı):
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm i @nohemia/widgets
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<script type="module">import '@nohemia/widgets'</script>
|
|
100
|
+
|
|
101
|
+
<nohemia-widget type="lune" theme="clair" size="m"></nohemia-widget>
|
|
102
|
+
<nohemia-widget type="ciel" theme="sombre" size="s"></nohemia-widget>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Ya da doğrudan bir CDN üzerinden yükleyin, derleme adımı yok:
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@nohemia/widgets"></script>
|
|
109
|
+
<nohemia-widget type="lune"></nohemia-widget>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Öznitelikler: `type` (`lune` | `ciel`), `theme` (`clair` | `sombre`), `size` (`s` | `m`). Bileşen
|
|
113
|
+
yalnızca resmi iframe'i işler, dolayısıyla veri ve görünüm nohemia.com ile eşzamanlı kalır.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Veri ve güncellik
|
|
118
|
+
|
|
119
|
+
Hiçbir şey elle girilmez. Evreler, burçlar ve saatler gerçek bir astronomik efemeristen gelir
|
|
120
|
+
([astronomy-engine](https://github.com/cosinekitty/astronomy), MIT) ve her gece yeniden hesaplanır. Saatler
|
|
121
|
+
Europe/Paris saat dilimine göre, dakikası dakikasına verilir. Aynı veri, nohemia.com'daki tam
|
|
122
|
+
[ay takvimini](https://nohemia.com/fr/lune/calendrier-pleines-lunes/) de besler.
|
|
123
|
+
|
|
124
|
+
Kendi widget'ınızı oluşturmak isterseniz ham JSON'u da okuyabilirsiniz:
|
|
125
|
+
`https://nohemia.com/widgets/lune/data.json` (bugünkü evre, sonraki dolunay ve yeniay, yaklaşan on lunasyon).
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Bu widget'lar neden
|
|
130
|
+
|
|
131
|
+
- **Ücretsiz, sonsuza dek.** Hesap yok, API anahtarı yok, kullanım sınırı yok.
|
|
132
|
+
- **Hafif ve güvenli.** Sandbox'lanmış bir iframe: sayfanızı asla okumaz, hiçbir çerez kullanmaz ve sitenizi yavaşlatmaz.
|
|
133
|
+
- **Editöryel tasarım.** Sıcak, sade, Nohemia tarzında. Açık ve koyu temalar.
|
|
134
|
+
- **Dürüst, gerçek veri.** Sabit kodlanmış bir tablo değil, hakiki bir efemeris.
|
|
135
|
+
- **Gizliliğe saygılı.** Sıfır takip, yapısı gereği GDPR uyumlu.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Bağlantılar
|
|
140
|
+
|
|
141
|
+
- Site: [nohemia.com](https://nohemia.com/fr/) · Widget galerisi: [nohemia.com/fr/widgets](https://nohemia.com/fr/widgets/)
|
|
142
|
+
- Yazar: [Jade Nohemia](https://nohemia.com/fr/auteur/jade/)
|
|
143
|
+
- Sorunlar ve fikirler: [github.com/jadenohemia/nohemia-widgets/issues](https://github.com/jadenohemia/nohemia-widgets/issues)
|
|
144
|
+
|
|
145
|
+
## Lisans
|
|
146
|
+
|
|
147
|
+
[MIT](./LICENSE) © Jade Nohemia / Nohemia. İster ticari olsun, her yerde kullanın. [nohemia.com](https://nohemia.com/fr/) adresine geri bağlantı verirseniz seviniriz ama bu asla zorunlu değildir.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Nohemia Widgets - examples</title>
|
|
7
|
+
<style>
|
|
8
|
+
body { font: 16px/1.6 system-ui, sans-serif; max-width: 720px; margin: 40px auto; padding: 0 20px; }
|
|
9
|
+
h2 { margin-top: 40px; }
|
|
10
|
+
pre { background: #f4f1ea; padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<h1>Nohemia Widgets</h1>
|
|
15
|
+
<p>Free, embeddable astrology & moon widgets. See the gallery at
|
|
16
|
+
<a href="https://nohemia.com/fr/widgets/">nohemia.com/fr/widgets</a>.</p>
|
|
17
|
+
|
|
18
|
+
<h2>1. Plain iframe (works everywhere)</h2>
|
|
19
|
+
<iframe src="https://nohemia.com/fr/widgets/lune/clair-m/"
|
|
20
|
+
width="300" height="210" loading="lazy"
|
|
21
|
+
title="Calendrier lunaire" style="border:0;border-radius:12px;max-width:100%"></iframe>
|
|
22
|
+
<p style="font:12px/1.4 system-ui,sans-serif;margin:6px 0 0">
|
|
23
|
+
<a href="https://nohemia.com/fr/lune/" rel="nofollow">Calendrier lunaire par Nohemia</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<h2>2. Web component (npm or CDN)</h2>
|
|
27
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@nohemia/widgets"></script>
|
|
28
|
+
<nohemia-widget type="ciel" theme="sombre" size="m"></nohemia-widget>
|
|
29
|
+
|
|
30
|
+
<h2>How to use</h2>
|
|
31
|
+
<pre><code><script type="module" src="https://cdn.jsdelivr.net/npm/@nohemia/widgets"></script>
|
|
32
|
+
<nohemia-widget type="lune" theme="clair" size="m"></nohemia-widget></code></pre>
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nohemia/widgets",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Free, embeddable astrology & moon widgets. Real ephemeris, refreshed nightly, no account, no tracking.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/nohemia-widget.js",
|
|
7
|
+
"module": "./src/nohemia-widget.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/nohemia-widget.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"src",
|
|
13
|
+
"examples",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"./src/nohemia-widget.js"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"astrology",
|
|
22
|
+
"moon-phase",
|
|
23
|
+
"lunar-calendar",
|
|
24
|
+
"moon-widget",
|
|
25
|
+
"horoscope",
|
|
26
|
+
"widget",
|
|
27
|
+
"embed",
|
|
28
|
+
"iframe",
|
|
29
|
+
"web-component",
|
|
30
|
+
"astronomy",
|
|
31
|
+
"ephemeris",
|
|
32
|
+
"nohemia"
|
|
33
|
+
],
|
|
34
|
+
"homepage": "https://nohemia.com/fr/widgets/",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/jadenohemia/nohemia-widgets.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/jadenohemia/nohemia-widgets/issues"
|
|
41
|
+
},
|
|
42
|
+
"author": "Jade Nohemia (https://nohemia.com)",
|
|
43
|
+
"license": "MIT"
|
|
44
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <nohemia-widget> - a tiny, dependency-free web component that embeds an official Nohemia widget.
|
|
3
|
+
*
|
|
4
|
+
* It renders the canonical iframe served from nohemia.com, so the data, the nightly refresh and the
|
|
5
|
+
* styling always stay in sync with the source. No tracking, no cookies, no external runtime.
|
|
6
|
+
*
|
|
7
|
+
* <script type="module">import '@nohemia/widgets'</script>
|
|
8
|
+
* <nohemia-widget type="lune" theme="clair" size="m"></nohemia-widget>
|
|
9
|
+
*
|
|
10
|
+
* Attributes:
|
|
11
|
+
* type "lune" | "ciel" (default "lune")
|
|
12
|
+
* theme "clair" | "sombre" (default "clair")
|
|
13
|
+
* size "s" | "m" (default "m")
|
|
14
|
+
*
|
|
15
|
+
* MIT © Jade Nohemia / Nohemia - https://nohemia.com/fr/widgets/
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const BASE = 'https://nohemia.com/fr/widgets'
|
|
19
|
+
|
|
20
|
+
// Pixel dimensions per type and size, matching the official widget pages.
|
|
21
|
+
const DIMS = {
|
|
22
|
+
lune: { s: [220, 140], m: [300, 210] },
|
|
23
|
+
ciel: { s: [230, 150], m: [300, 200] },
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class NohemiaWidget extends HTMLElement {
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
const type = (this.getAttribute('type') || 'lune').toLowerCase()
|
|
29
|
+
const theme = (this.getAttribute('theme') || 'clair').toLowerCase()
|
|
30
|
+
const size = (this.getAttribute('size') || 'm').toLowerCase()
|
|
31
|
+
|
|
32
|
+
const safeType = DIMS[type] ? type : 'lune'
|
|
33
|
+
const safeSize = size === 's' ? 's' : 'm'
|
|
34
|
+
const safeTheme = theme === 'sombre' ? 'sombre' : 'clair'
|
|
35
|
+
const [w, h] = DIMS[safeType][safeSize]
|
|
36
|
+
|
|
37
|
+
const iframe = document.createElement('iframe')
|
|
38
|
+
iframe.src = `${BASE}/${safeType}/${safeTheme}-${safeSize}/`
|
|
39
|
+
iframe.width = String(w)
|
|
40
|
+
iframe.height = String(h)
|
|
41
|
+
iframe.loading = 'lazy'
|
|
42
|
+
iframe.title = 'Widget Nohemia'
|
|
43
|
+
iframe.style.cssText = 'border:0;border-radius:12px;max-width:100%'
|
|
44
|
+
iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin')
|
|
45
|
+
|
|
46
|
+
this.replaceChildren(iframe)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (typeof customElements !== 'undefined' && !customElements.get('nohemia-widget')) {
|
|
51
|
+
customElements.define('nohemia-widget', NohemiaWidget)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { NohemiaWidget }
|