@jjlmoya/utils-tools 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 +63 -0
- package/src/category/i18n/en.ts +172 -0
- package/src/category/i18n/es.ts +172 -0
- package/src/category/i18n/fr.ts +172 -0
- package/src/category/index.ts +23 -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 +11 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +90 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +146 -0
- package/src/pages/[locale].astro +251 -0
- package/src/pages/index.astro +4 -0
- package/src/tests/faq_count.test.ts +19 -0
- package/src/tests/locale_completeness.test.ts +42 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/seo_length.test.ts +23 -0
- package/src/tests/title_quality.test.ts +56 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/date-diff-calculator/bibliography.astro +14 -0
- package/src/tool/date-diff-calculator/component.astro +370 -0
- package/src/tool/date-diff-calculator/i18n/en.ts +132 -0
- package/src/tool/date-diff-calculator/i18n/es.ts +132 -0
- package/src/tool/date-diff-calculator/i18n/fr.ts +132 -0
- package/src/tool/date-diff-calculator/index.ts +22 -0
- package/src/tool/date-diff-calculator/seo.astro +14 -0
- package/src/tool/date-diff-calculator/ui.ts +17 -0
- package/src/tool/drive-direct-link/bibliography.astro +14 -0
- package/src/tool/drive-direct-link/component.astro +280 -0
- package/src/tool/drive-direct-link/i18n/en.ts +118 -0
- package/src/tool/drive-direct-link/i18n/es.ts +118 -0
- package/src/tool/drive-direct-link/i18n/fr.ts +118 -0
- package/src/tool/drive-direct-link/index.ts +22 -0
- package/src/tool/drive-direct-link/seo.astro +14 -0
- package/src/tool/drive-direct-link/ui.ts +10 -0
- package/src/tool/email-list-cleaner/bibliography.astro +14 -0
- package/src/tool/email-list-cleaner/component.astro +375 -0
- package/src/tool/email-list-cleaner/i18n/en.ts +140 -0
- package/src/tool/email-list-cleaner/i18n/es.ts +140 -0
- package/src/tool/email-list-cleaner/i18n/fr.ts +140 -0
- package/src/tool/email-list-cleaner/index.ts +22 -0
- package/src/tool/email-list-cleaner/seo.astro +14 -0
- package/src/tool/email-list-cleaner/ui.ts +15 -0
- package/src/tool/env-badge-spain/bibliography.astro +14 -0
- package/src/tool/env-badge-spain/component.astro +303 -0
- package/src/tool/env-badge-spain/components/BadgeForm.astro +243 -0
- package/src/tool/env-badge-spain/components/BadgeResult.astro +151 -0
- package/src/tool/env-badge-spain/i18n/en.ts +153 -0
- package/src/tool/env-badge-spain/i18n/es.ts +153 -0
- package/src/tool/env-badge-spain/i18n/fr.ts +153 -0
- package/src/tool/env-badge-spain/index.ts +22 -0
- package/src/tool/env-badge-spain/seo.astro +14 -0
- package/src/tool/env-badge-spain/ui.ts +53 -0
- package/src/tool/morse-beacon/bibliography.astro +14 -0
- package/src/tool/morse-beacon/component.astro +534 -0
- package/src/tool/morse-beacon/i18n/en.ts +157 -0
- package/src/tool/morse-beacon/i18n/es.ts +157 -0
- package/src/tool/morse-beacon/i18n/fr.ts +157 -0
- package/src/tool/morse-beacon/index.ts +22 -0
- package/src/tool/morse-beacon/logic/MorseEngine.ts +124 -0
- package/src/tool/morse-beacon/seo.astro +14 -0
- package/src/tool/morse-beacon/ui.ts +18 -0
- package/src/tool/password-generator/bibliography.astro +14 -0
- package/src/tool/password-generator/component.astro +259 -0
- package/src/tool/password-generator/components/Config.astro +227 -0
- package/src/tool/password-generator/components/Display.astro +147 -0
- package/src/tool/password-generator/components/Strength.astro +70 -0
- package/src/tool/password-generator/i18n/en.ts +166 -0
- package/src/tool/password-generator/i18n/es.ts +166 -0
- package/src/tool/password-generator/i18n/fr.ts +166 -0
- package/src/tool/password-generator/index.ts +22 -0
- package/src/tool/password-generator/seo.astro +14 -0
- package/src/tool/password-generator/ui.ts +16 -0
- package/src/tool/routes/bibliography.astro +14 -0
- package/src/tool/routes/component.astro +543 -0
- package/src/tool/routes/i18n/en.ts +157 -0
- package/src/tool/routes/i18n/es.ts +157 -0
- package/src/tool/routes/i18n/fr.ts +157 -0
- package/src/tool/routes/index.ts +22 -0
- package/src/tool/routes/logic/GeocodingService.ts +60 -0
- package/src/tool/routes/logic/RouteManager.ts +192 -0
- package/src/tool/routes/logic/RouteService.ts +66 -0
- package/src/tool/routes/seo.astro +14 -0
- package/src/tool/routes/ui.ts +16 -0
- package/src/tool/rule-of-three/bibliography.astro +14 -0
- package/src/tool/rule-of-three/component.astro +369 -0
- package/src/tool/rule-of-three/i18n/en.ts +171 -0
- package/src/tool/rule-of-three/i18n/es.ts +171 -0
- package/src/tool/rule-of-three/i18n/fr.ts +171 -0
- package/src/tool/rule-of-three/index.ts +22 -0
- package/src/tool/rule-of-three/seo.astro +14 -0
- package/src/tool/rule-of-three/ui.ts +13 -0
- package/src/tool/seo-content-optimizer/bibliography.astro +14 -0
- package/src/tool/seo-content-optimizer/component.astro +552 -0
- package/src/tool/seo-content-optimizer/i18n/en.ts +136 -0
- package/src/tool/seo-content-optimizer/i18n/es.ts +136 -0
- package/src/tool/seo-content-optimizer/i18n/fr.ts +136 -0
- package/src/tool/seo-content-optimizer/index.ts +22 -0
- package/src/tool/seo-content-optimizer/seo.astro +14 -0
- package/src/tool/seo-content-optimizer/ui.ts +29 -0
- package/src/tool/speed-reader/bibliography.astro +14 -0
- package/src/tool/speed-reader/component.astro +586 -0
- package/src/tool/speed-reader/i18n/en.ts +152 -0
- package/src/tool/speed-reader/i18n/es.ts +152 -0
- package/src/tool/speed-reader/i18n/fr.ts +152 -0
- package/src/tool/speed-reader/index.ts +22 -0
- package/src/tool/speed-reader/logic/RSVPEngine.ts +106 -0
- package/src/tool/speed-reader/seo.astro +14 -0
- package/src/tool/speed-reader/ui.ts +14 -0
- package/src/tool/text-pixel-calculator/bibliography.astro +14 -0
- package/src/tool/text-pixel-calculator/component.astro +315 -0
- package/src/tool/text-pixel-calculator/components/Editor.astro +240 -0
- package/src/tool/text-pixel-calculator/components/Preview.astro +155 -0
- package/src/tool/text-pixel-calculator/components/Stats.astro +87 -0
- package/src/tool/text-pixel-calculator/i18n/en.ts +133 -0
- package/src/tool/text-pixel-calculator/i18n/es.ts +133 -0
- package/src/tool/text-pixel-calculator/i18n/fr.ts +133 -0
- package/src/tool/text-pixel-calculator/index.ts +22 -0
- package/src/tool/text-pixel-calculator/seo.astro +14 -0
- package/src/tool/text-pixel-calculator/ui.ts +15 -0
- package/src/tool/whatsapp-link/bibliography.astro +14 -0
- package/src/tool/whatsapp-link/component.astro +455 -0
- package/src/tool/whatsapp-link/i18n/en.ts +128 -0
- package/src/tool/whatsapp-link/i18n/es.ts +128 -0
- package/src/tool/whatsapp-link/i18n/fr.ts +128 -0
- package/src/tool/whatsapp-link/index.ts +22 -0
- package/src/tool/whatsapp-link/seo.astro +14 -0
- package/src/tool/whatsapp-link/ui.ts +15 -0
- package/src/tools.ts +15 -0
- package/src/types.ts +72 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { KnownLocale } from "../../types";
|
|
3
|
+
import type { PasswordGeneratorUI } from "./ui";
|
|
4
|
+
import Display from "./components/Display.astro";
|
|
5
|
+
import Strength from "./components/Strength.astro";
|
|
6
|
+
import Config from "./components/Config.astro";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
locale?: KnownLocale;
|
|
10
|
+
ui?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { ui } = Astro.props;
|
|
14
|
+
const t = (ui ?? {}) as PasswordGeneratorUI;
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<div class="pg-app-container" data-ui={JSON.stringify(t)}>
|
|
18
|
+
<div class="pg-card">
|
|
19
|
+
<div class="pg-card-glow"></div>
|
|
20
|
+
<div class="pg-card-content">
|
|
21
|
+
<Display
|
|
22
|
+
generating={t.generating}
|
|
23
|
+
copyTitle={t.copyTitle}
|
|
24
|
+
regenerateTitle={t.regenerateTitle}
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<Strength labelSecurity={t.labelSecurity} />
|
|
28
|
+
|
|
29
|
+
<div class="pg-divider"></div>
|
|
30
|
+
|
|
31
|
+
<Config
|
|
32
|
+
labelLength={t.labelLength}
|
|
33
|
+
optionUppercase={t.optionUppercase}
|
|
34
|
+
optionLowercase={t.optionLowercase}
|
|
35
|
+
optionNumbers={t.optionNumbers}
|
|
36
|
+
optionSymbols={t.optionSymbols}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<style>
|
|
43
|
+
.pg-app-container {
|
|
44
|
+
width: 100%;
|
|
45
|
+
max-width: 640px;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
padding: 1rem;
|
|
48
|
+
perspective: 1000px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pg-card {
|
|
52
|
+
position: relative;
|
|
53
|
+
border-radius: 2rem;
|
|
54
|
+
padding: 2px;
|
|
55
|
+
background: linear-gradient(
|
|
56
|
+
135deg,
|
|
57
|
+
rgba(255, 255, 255, 0.1),
|
|
58
|
+
rgba(255, 255, 255, 0.05)
|
|
59
|
+
);
|
|
60
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
|
|
61
|
+
transition: transform 0.3s ease;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:global(.theme-dark) .pg-card {
|
|
65
|
+
background: linear-gradient(
|
|
66
|
+
135deg,
|
|
67
|
+
rgba(255, 255, 255, 0.05),
|
|
68
|
+
rgba(0, 0, 0, 0.2)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pg-card-glow {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
border-radius: 2rem;
|
|
76
|
+
background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
|
|
77
|
+
opacity: 0.1;
|
|
78
|
+
filter: blur(20px);
|
|
79
|
+
z-index: -1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pg-card-content {
|
|
83
|
+
background: #fff;
|
|
84
|
+
border-radius: calc(2rem - 2px);
|
|
85
|
+
padding: 1.5rem;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:global(.theme-dark) .pg-card-content {
|
|
91
|
+
background: #0f172a;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.pg-divider {
|
|
95
|
+
height: 1px;
|
|
96
|
+
background: linear-gradient(
|
|
97
|
+
to right,
|
|
98
|
+
transparent,
|
|
99
|
+
rgba(0, 0, 0, 0.05),
|
|
100
|
+
transparent
|
|
101
|
+
);
|
|
102
|
+
margin: 1.5rem 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:global(.theme-dark) .pg-divider {
|
|
106
|
+
background: linear-gradient(
|
|
107
|
+
to right,
|
|
108
|
+
transparent,
|
|
109
|
+
rgba(255, 255, 255, 0.05),
|
|
110
|
+
transparent
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes pulse-success {
|
|
115
|
+
0% {
|
|
116
|
+
transform: scale(1);
|
|
117
|
+
}
|
|
118
|
+
50% {
|
|
119
|
+
transform: scale(1.05);
|
|
120
|
+
}
|
|
121
|
+
100% {
|
|
122
|
+
transform: scale(1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:global(.pg-copied-anim) {
|
|
127
|
+
animation: pulse-success 0.3s ease-out;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
130
|
+
|
|
131
|
+
<script>
|
|
132
|
+
const root = document.querySelector(
|
|
133
|
+
".pg-app-container",
|
|
134
|
+
) as HTMLElement | null;
|
|
135
|
+
const t = JSON.parse(root?.dataset.ui ?? "{}") as Record<string, string>;
|
|
136
|
+
|
|
137
|
+
const output = document.getElementById("pg-output");
|
|
138
|
+
const strengthBar = document.getElementById("pg-strength-bar");
|
|
139
|
+
const strengthText = document.getElementById("pg-strength-text");
|
|
140
|
+
const lengthInput = document.getElementById("pg-length") as HTMLInputElement;
|
|
141
|
+
const lengthVal = document.getElementById("pg-length-val");
|
|
142
|
+
const copyBtn = document.getElementById("pg-copy-btn");
|
|
143
|
+
const regenBtn = document.getElementById("pg-regen-btn");
|
|
144
|
+
|
|
145
|
+
const checkboxes = {
|
|
146
|
+
uppercase: document.getElementById("pg-uppercase") as HTMLInputElement,
|
|
147
|
+
lowercase: document.getElementById("pg-lowercase") as HTMLInputElement,
|
|
148
|
+
numbers: document.getElementById("pg-numbers") as HTMLInputElement,
|
|
149
|
+
symbols: document.getElementById("pg-symbols") as HTMLInputElement,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const CHARS = {
|
|
153
|
+
uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
154
|
+
lowercase: "abcdefghijklmnopqrstuvwxyz",
|
|
155
|
+
numbers: "0123456789",
|
|
156
|
+
symbols: "!@#$%^&*()_+-=[]{}|;:,.<>?",
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
function generate() {
|
|
160
|
+
let charset = "";
|
|
161
|
+
if (checkboxes.uppercase?.checked) charset += CHARS.uppercase;
|
|
162
|
+
if (checkboxes.lowercase?.checked) charset += CHARS.lowercase;
|
|
163
|
+
if (checkboxes.numbers?.checked) charset += CHARS.numbers;
|
|
164
|
+
if (checkboxes.symbols?.checked) charset += CHARS.symbols;
|
|
165
|
+
|
|
166
|
+
if (charset === "") {
|
|
167
|
+
charset = CHARS.lowercase;
|
|
168
|
+
if (checkboxes.lowercase) checkboxes.lowercase.checked = true;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const length = parseInt(lengthInput?.value ?? "16", 10);
|
|
172
|
+
const array = new Uint32Array(length);
|
|
173
|
+
crypto.getRandomValues(array);
|
|
174
|
+
|
|
175
|
+
let password = "";
|
|
176
|
+
for (let i = 0; i < length; i++) {
|
|
177
|
+
const idx = array[i];
|
|
178
|
+
password +=
|
|
179
|
+
idx !== undefined ? (charset[idx % charset.length] ?? "") : "";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (output) output.textContent = password;
|
|
183
|
+
updateStrength(password);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function updateStrength(password: string) {
|
|
187
|
+
let score = 0;
|
|
188
|
+
if (password.length > 8) score += 10;
|
|
189
|
+
if (password.length > 12) score += 20;
|
|
190
|
+
if (password.length >= 16) score += 30;
|
|
191
|
+
if (/[A-Z]/.test(password)) score += 10;
|
|
192
|
+
if (/[a-z]/.test(password)) score += 10;
|
|
193
|
+
if (/[0-9]/.test(password)) score += 10;
|
|
194
|
+
if (/[^A-Za-z0-9]/.test(password)) score += 10;
|
|
195
|
+
|
|
196
|
+
let width = "20%";
|
|
197
|
+
let bg = "#ef4444";
|
|
198
|
+
let label = t.strengthWeak ?? "Weak";
|
|
199
|
+
|
|
200
|
+
if (score > 90) {
|
|
201
|
+
width = "100%";
|
|
202
|
+
bg = "#10b981";
|
|
203
|
+
label = t.strengthUnbreakable ?? "Unbreakable";
|
|
204
|
+
} else if (score > 70) {
|
|
205
|
+
width = "80%";
|
|
206
|
+
bg = "#22c55e";
|
|
207
|
+
label = t.strengthStrong ?? "Strong";
|
|
208
|
+
} else if (score > 50) {
|
|
209
|
+
width = "60%";
|
|
210
|
+
bg = "#eab308";
|
|
211
|
+
label = t.strengthGood ?? "Good";
|
|
212
|
+
} else if (score > 30) {
|
|
213
|
+
width = "40%";
|
|
214
|
+
bg = "#f97316";
|
|
215
|
+
label = t.strengthFair ?? "Fair";
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (strengthBar) {
|
|
219
|
+
strengthBar.style.width = width;
|
|
220
|
+
strengthBar.style.background = bg;
|
|
221
|
+
}
|
|
222
|
+
if (strengthText) {
|
|
223
|
+
strengthText.textContent = label;
|
|
224
|
+
strengthText.style.color = bg;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
lengthInput?.addEventListener("input", () => {
|
|
229
|
+
if (lengthVal) lengthVal.textContent = lengthInput.value;
|
|
230
|
+
generate();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
Object.values(checkboxes).forEach((cb) =>
|
|
234
|
+
cb?.addEventListener("change", generate),
|
|
235
|
+
);
|
|
236
|
+
regenBtn?.addEventListener("click", generate);
|
|
237
|
+
|
|
238
|
+
copyBtn?.addEventListener("click", () => {
|
|
239
|
+
const text = output?.textContent;
|
|
240
|
+
if (!text) return;
|
|
241
|
+
navigator.clipboard.writeText(text);
|
|
242
|
+
|
|
243
|
+
output?.classList.add("pg-copied-anim");
|
|
244
|
+
setTimeout(() => output?.classList.remove("pg-copied-anim"), 300);
|
|
245
|
+
|
|
246
|
+
const svg = copyBtn.querySelector("svg");
|
|
247
|
+
if (!svg) return;
|
|
248
|
+
const oldPath = svg.innerHTML;
|
|
249
|
+
svg.innerHTML =
|
|
250
|
+
'<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/>';
|
|
251
|
+
svg.style.color = "#10b981";
|
|
252
|
+
setTimeout(() => {
|
|
253
|
+
svg.innerHTML = oldPath;
|
|
254
|
+
svg.style.color = "";
|
|
255
|
+
}, 1500);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
generate();
|
|
259
|
+
</script>
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
labelLength: string;
|
|
4
|
+
optionUppercase: string;
|
|
5
|
+
optionLowercase: string;
|
|
6
|
+
optionNumbers: string;
|
|
7
|
+
optionSymbols: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { labelLength, optionUppercase, optionLowercase, optionNumbers, optionSymbols } = Astro.props;
|
|
11
|
+
|
|
12
|
+
const options = [
|
|
13
|
+
{ id: 'pg-uppercase', label: optionUppercase, hint: 'A-Z' },
|
|
14
|
+
{ id: 'pg-lowercase', label: optionLowercase, hint: 'a-z' },
|
|
15
|
+
{ id: 'pg-numbers', label: optionNumbers, hint: '0-9' },
|
|
16
|
+
{ id: 'pg-symbols', label: optionSymbols, hint: '!@#$%^&*' },
|
|
17
|
+
];
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<div class="pg-config-card">
|
|
21
|
+
<div class="pg-config-section">
|
|
22
|
+
<div class="pg-config-header">
|
|
23
|
+
<label for="pg-length" class="pg-config-label">{labelLength}</label>
|
|
24
|
+
<span id="pg-length-val" class="pg-config-value">16</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="pg-range-container">
|
|
27
|
+
<input type="range" id="pg-length" class="pg-range-input" min="6" max="64" value="16" />
|
|
28
|
+
<div class="pg-range-markers">
|
|
29
|
+
<span>6</span>
|
|
30
|
+
<span>16</span>
|
|
31
|
+
<span>32</span>
|
|
32
|
+
<span>48</span>
|
|
33
|
+
<span>64</span>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="pg-options-grid">
|
|
39
|
+
{options.map((opt) => (
|
|
40
|
+
<label class="pg-option-item">
|
|
41
|
+
<input type="checkbox" id={opt.id} class="pg-option-checkbox" checked />
|
|
42
|
+
<div class="pg-option-content">
|
|
43
|
+
<div class="pg-option-indicator">
|
|
44
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
|
|
45
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
46
|
+
</svg>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="pg-option-info">
|
|
49
|
+
<span class="pg-option-label">{opt.label}</span>
|
|
50
|
+
<span class="pg-option-hint">{opt.hint}</span>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</label>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.pg-config-card {
|
|
60
|
+
background: rgba(255, 255, 255, 0.4);
|
|
61
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
62
|
+
border-radius: 1.5rem;
|
|
63
|
+
padding: 1.5rem;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 2rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:global(.theme-dark) .pg-config-card {
|
|
70
|
+
background: rgba(0, 0, 0, 0.2);
|
|
71
|
+
border-color: rgba(255, 255, 255, 0.05);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pg-config-header {
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
align-items: center;
|
|
78
|
+
margin-bottom: 1rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.pg-config-label {
|
|
82
|
+
font-size: 1rem;
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
color: #475569;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:global(.theme-dark) .pg-config-label {
|
|
88
|
+
color: #94a3b8;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.pg-config-value {
|
|
92
|
+
font-size: 1.5rem;
|
|
93
|
+
font-weight: 800;
|
|
94
|
+
color: #3b82f6;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pg-range-input {
|
|
98
|
+
width: 100%;
|
|
99
|
+
margin-bottom: 0.5rem;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
accent-color: #3b82f6;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.pg-range-markers {
|
|
105
|
+
display: flex;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
padding: 0 4px;
|
|
108
|
+
font-size: 0.75rem;
|
|
109
|
+
color: #94a3b8;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.pg-options-grid {
|
|
114
|
+
display: grid;
|
|
115
|
+
grid-template-columns: repeat(2, 1fr);
|
|
116
|
+
gap: 0.75rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (max-width: 480px) {
|
|
120
|
+
.pg-options-grid {
|
|
121
|
+
grid-template-columns: 1fr;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.pg-option-item {
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
position: relative;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.pg-option-checkbox {
|
|
131
|
+
position: absolute;
|
|
132
|
+
opacity: 0;
|
|
133
|
+
width: 0;
|
|
134
|
+
height: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.pg-option-content {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
gap: 0.75rem;
|
|
141
|
+
padding: 0.75rem;
|
|
142
|
+
background: rgba(255, 255, 255, 0.6);
|
|
143
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
144
|
+
border-radius: 1rem;
|
|
145
|
+
transition: all 0.2s ease;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:global(.theme-dark) .pg-option-content {
|
|
149
|
+
background: rgba(30, 41, 59, 0.4);
|
|
150
|
+
border-color: rgba(255, 255, 255, 0.05);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.pg-option-item:hover .pg-option-content {
|
|
154
|
+
background: rgba(255, 255, 255, 0.8);
|
|
155
|
+
transform: translateY(-1px);
|
|
156
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:global(.theme-dark) .pg-option-item:hover .pg-option-content {
|
|
160
|
+
background: rgba(30, 41, 59, 0.6);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.pg-option-checkbox:checked + .pg-option-content {
|
|
164
|
+
border-color: #10b981;
|
|
165
|
+
background: rgba(16, 185, 129, 0.05);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:global(.theme-dark) .pg-option-checkbox:checked + .pg-option-content {
|
|
169
|
+
background: rgba(16, 185, 129, 0.1);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.pg-option-indicator {
|
|
173
|
+
width: 1.5rem;
|
|
174
|
+
height: 1.5rem;
|
|
175
|
+
border-radius: 0.5rem;
|
|
176
|
+
border: 2px solid #cbd5e1;
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
transition: all 0.2s ease;
|
|
181
|
+
color: white;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:global(.theme-dark) .pg-option-indicator {
|
|
185
|
+
border-color: #475569;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.pg-option-checkbox:checked + .pg-option-content .pg-option-indicator {
|
|
189
|
+
background: #10b981;
|
|
190
|
+
border-color: #10b981;
|
|
191
|
+
box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.pg-option-indicator svg {
|
|
195
|
+
width: 0.875rem;
|
|
196
|
+
height: 0.875rem;
|
|
197
|
+
opacity: 0;
|
|
198
|
+
transform: scale(0.5);
|
|
199
|
+
transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.pg-option-checkbox:checked + .pg-option-content .pg-option-indicator svg {
|
|
203
|
+
opacity: 1;
|
|
204
|
+
transform: scale(1);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.pg-option-info {
|
|
208
|
+
display: flex;
|
|
209
|
+
flex-direction: column;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.pg-option-label {
|
|
213
|
+
font-size: 0.9375rem;
|
|
214
|
+
font-weight: 600;
|
|
215
|
+
color: #1e293b;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
:global(.theme-dark) .pg-option-label {
|
|
219
|
+
color: #e2e8f0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.pg-option-hint {
|
|
223
|
+
font-size: 0.75rem;
|
|
224
|
+
color: #94a3b8;
|
|
225
|
+
font-weight: 500;
|
|
226
|
+
}
|
|
227
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
generating: string;
|
|
4
|
+
copyTitle: string;
|
|
5
|
+
regenerateTitle: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { generating, copyTitle, regenerateTitle } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<div class="pg-display">
|
|
12
|
+
<div class="pg-display-glass"></div>
|
|
13
|
+
<div class="pg-display-content">
|
|
14
|
+
<div id="pg-output" class="pg-output-text">{generating}</div>
|
|
15
|
+
<div class="pg-display-divider"></div>
|
|
16
|
+
<div class="pg-display-controls">
|
|
17
|
+
<button id="pg-copy-btn" class="pg-control-btn" title={copyTitle} aria-label={copyTitle}>
|
|
18
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
19
|
+
<path d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"/>
|
|
20
|
+
</svg>
|
|
21
|
+
</button>
|
|
22
|
+
<button id="pg-regen-btn" class="pg-control-btn pg-control-btn-accent" title={regenerateTitle} aria-label={regenerateTitle}>
|
|
23
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
24
|
+
<path d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
|
|
25
|
+
</svg>
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.pg-display {
|
|
33
|
+
position: relative;
|
|
34
|
+
width: 100%;
|
|
35
|
+
margin-bottom: 1.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pg-display-glass {
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: -2px;
|
|
41
|
+
background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
|
|
42
|
+
border-radius: 1.25rem;
|
|
43
|
+
opacity: 0.15;
|
|
44
|
+
filter: blur(8px);
|
|
45
|
+
transition: opacity 0.3s ease;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pg-display:hover .pg-display-glass {
|
|
49
|
+
opacity: 0.25;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pg-display-content {
|
|
53
|
+
position: relative;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
background: rgba(255, 255, 255, 0.8);
|
|
57
|
+
backdrop-filter: blur(12px);
|
|
58
|
+
-webkit-backdrop-filter: blur(12px);
|
|
59
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
60
|
+
border-radius: 1.25rem;
|
|
61
|
+
padding: 0.75rem;
|
|
62
|
+
min-height: 5rem;
|
|
63
|
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:global(.theme-dark) .pg-display-content {
|
|
67
|
+
background: rgba(15, 23, 42, 0.8);
|
|
68
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
69
|
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pg-output-text {
|
|
73
|
+
flex: 1;
|
|
74
|
+
font-size: 1.75rem;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
text-align: center;
|
|
77
|
+
letter-spacing: 0.05em;
|
|
78
|
+
color: #1e293b;
|
|
79
|
+
word-break: break-all;
|
|
80
|
+
padding: 0.5rem 1rem;
|
|
81
|
+
transition: transform 0.2s ease;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:global(.theme-dark) .pg-output-text {
|
|
85
|
+
color: #f8fafc;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.pg-display-divider {
|
|
89
|
+
width: 1px;
|
|
90
|
+
height: 3rem;
|
|
91
|
+
background: rgba(0, 0, 0, 0.1);
|
|
92
|
+
margin: 0 0.5rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:global(.theme-dark) .pg-display-divider {
|
|
96
|
+
background: rgba(255, 255, 255, 0.1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pg-display-controls {
|
|
100
|
+
display: flex;
|
|
101
|
+
gap: 0.5rem;
|
|
102
|
+
padding-right: 0.25rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.pg-control-btn {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: 3rem;
|
|
110
|
+
height: 3rem;
|
|
111
|
+
border-radius: 0.75rem;
|
|
112
|
+
border: none;
|
|
113
|
+
background: transparent;
|
|
114
|
+
color: #64748b;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.pg-control-btn svg {
|
|
120
|
+
width: 1.5rem;
|
|
121
|
+
height: 1.5rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.pg-control-btn:hover {
|
|
125
|
+
background: rgba(0, 0, 0, 0.05);
|
|
126
|
+
color: #10b981;
|
|
127
|
+
transform: translateY(-2px);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:global(.theme-dark) .pg-control-btn:hover {
|
|
131
|
+
background: rgba(255, 255, 255, 0.05);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.pg-control-btn-accent:hover {
|
|
135
|
+
color: #3b82f6;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pg-control-btn:active {
|
|
139
|
+
transform: translateY(0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@media (max-width: 480px) {
|
|
143
|
+
.pg-output-text {
|
|
144
|
+
font-size: 1.25rem;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
labelSecurity: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { labelSecurity } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div class="pg-strength-container">
|
|
10
|
+
<div class="pg-strength-header">
|
|
11
|
+
<span class="pg-strength-label">{labelSecurity}</span>
|
|
12
|
+
<span id="pg-strength-text" class="pg-strength-status">-</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="pg-strength-track">
|
|
15
|
+
<div id="pg-strength-bar" class="pg-strength-bar"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.pg-strength-container {
|
|
21
|
+
width: 100%;
|
|
22
|
+
margin-bottom: 2rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pg-strength-header {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: flex-end;
|
|
29
|
+
margin-bottom: 0.75rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.pg-strength-label {
|
|
33
|
+
font-size: 0.875rem;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
text-transform: uppercase;
|
|
36
|
+
letter-spacing: 0.05em;
|
|
37
|
+
color: #94a3b8;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pg-strength-status {
|
|
41
|
+
font-size: 1rem;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
transition: color 0.3s ease;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pg-strength-track {
|
|
47
|
+
position: relative;
|
|
48
|
+
height: 0.5rem;
|
|
49
|
+
width: 100%;
|
|
50
|
+
background: rgba(0, 0, 0, 0.05);
|
|
51
|
+
border-radius: 1rem;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:global(.theme-dark) .pg-strength-track {
|
|
56
|
+
background: rgba(255, 255, 255, 0.05);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pg-strength-bar {
|
|
60
|
+
position: absolute;
|
|
61
|
+
left: 0;
|
|
62
|
+
top: 0;
|
|
63
|
+
height: 100%;
|
|
64
|
+
width: 0;
|
|
65
|
+
border-radius: 1rem;
|
|
66
|
+
background: #ef4444;
|
|
67
|
+
transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
|
|
68
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
69
|
+
}
|
|
70
|
+
</style>
|