Skip to content

Commit 8bb1828

Browse files
committed
Merge pull request 'beta' (#14) from beta into main
Reviewed-on: https://commitcloud.net/RonDevHub/MailShield/pulls/14
2 parents 365edf4 + 5a6635f commit 8bb1828

6 files changed

Lines changed: 115 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
### Fixed
44

55
### Added
6-
- A “How It Works” section has been added, and the translation has been included in the languages that have already been translated
6+
- A “How It Works” section has been added, and the translation has been included in the languages that have already been translated
7+
- Adding a badge shows that an email is protected.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<h1 align="center">
22
<img src="https://mail-shield.net/img/icon.png" height="50"><br>
3-
MailShield
3+
MailShield<br>
4+
![Badge](https://mail-shield.net/badge)
45
</h1>
56

67
<p align="center">
@@ -28,6 +29,7 @@ MailShield is a minimalist, resource-efficient PHP application designed to hide
2829
- **Lightweight:** Optimized for small home labs (minimal RAM usage).
2930
- **Modern UI:** Built with Tailwind CSS, including Dark Mode support.
3031
- **Multilingual:** Automatically detects German and English.
32+
- **Badge:** Use a badge to promote your protection
3133

3234
## Database Support
3335

src/lang/de.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@
5454
'step2_desc' => 'Wir erstellen einen eindeutigen, geschützten Link für dich',
5555
'step3_title' => 'Sicher teilen',
5656
'step3_desc' => 'Nur Menschen können deine echte E-Mail-Adresse herausfinden.',
57+
'badge_promo' => 'Mach deinen Schutz bekannt',
5758
'copy' => 'Erstellt mit ❤️ und ☕️ von'
5859
];

src/lang/en.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@
5454
'step2_desc' => 'We generate a unique, protected link for you',
5555
'step3_title' => 'Share Safely',
5656
'step3_desc' => 'Only humans can reveal your real email',
57+
'badge_promo' => 'Promote your protection',
5758
'copy' => 'Created with ❤️ and ☕️ by'
5859
];

src/public/badge.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
// badge.php - Generiert das MailShield Badge
3+
$logo_path = 'img/icon.png';
4+
$logo_data = '';
5+
6+
if (file_exists($logo_path)) {
7+
$logo_data = base64_encode(file_get_contents($logo_path));
8+
}
9+
10+
header('Content-Type: image/svg+xml');
11+
header('Cache-Control: public, max-age=86400'); // Cache für 24h
12+
?>
13+
<svg xmlns="http://www.w3.org/2000/svg" width="190" height="28" viewBox="0 0 190 28">
14+
<rect width="190" height="28" rx="6" fill="#1f2937"/>
15+
<rect x="105" width="85" height="28" rx="6" fill="#2dd4bf"/>
16+
<rect x="100" width="10" height="28" fill="#2dd4bf"/>
17+
18+
<?php if ($logo_data): ?>
19+
<image x="8" y="4" width="20" height="20" href="data:image/png;base64,<?= $logo_data ?>"/>
20+
<?php endif; ?>
21+
22+
<g fill="#fff" font-family="Verdana,Geneva,sans-serif" font-size="11" font-weight="bold">
23+
<text x="35" y="18" fill="#fff">MailShield</text>
24+
<text x="112" y="18" fill="#111827">Protect Email</text>
25+
</g>
26+
</svg>

src/public/index.php

Lines changed: 82 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
exit;
3838
}
3939

40+
// Support-Routing
41+
if ($slug === 'badge') {
42+
require_once 'badge.php';
43+
exit;
44+
}
45+
4046
$message = '';
4147
$generated_links = null;
4248

@@ -64,10 +70,18 @@
6470

6571
$app_url = rtrim(getenv('APP_URL') ?: 'http://localhost', '/');
6672
$full_url = $app_url . '/' . $final_slug;
73+
74+
// Badge URLs
75+
$badge_url = $app_url . '/badge';
76+
$badge_md = '[![Protected by MailShield](' . $badge_url . ')](' . $full_url . ')';
77+
$badge_html = '<a href="' . $full_url . '"><img src="' . $badge_url . '" alt="Protected by MailShield"></a>';
78+
6779
$generated_links = [
6880
'url' => $full_url,
6981
'html' => '<a href="' . $full_url . '" target="_blank">' . $lang['view_title'] . '</a>',
70-
'markdown' => '[' . $lang['view_title'] . '](' . $full_url . ')'
82+
'markdown' => '[' . $lang['view_title'] . '](' . $full_url . ')',
83+
'badge_md' => $badge_md,
84+
'badge_html' => $badge_html
7185
];
7286
}
7387
}
@@ -245,7 +259,7 @@ class="group relative p-2 ml-1 bg-white/50 dark:bg-gray-800/50 backdrop-blur-sm
245259
class="w-full bg-blue-600 text-white font-bold py-3 rounded-xl transition-all flex items-center justify-center gap-2">
246260
<?= $lang['btn_view'] ?>
247261
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 576 512">
248-
<path fill="currentColor" d="M288 64c-140.8 0-229.3 128-256 192 26.7 64 115.2 192 256 192 140.8 0 229.3-128 256-192-26.7-64-115.2-192-256-192zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1 3.3 7.9 3.3 16.7 0 24.6-14.9 35.7-46.2 87.7-93 131.1-47.1 43.7-111.8 80.6-192.6 80.6S142.5 443.2 95.4 399.4c-46.8-43.5-78.1-95.4-93-131.1-3.3-7.9-3.3-16.7 0-24.6 14.9-35.7-46.2-87.7 93-131.1zM288 352c53 0 96-43 96-96 0-43.3-28.7-79.9-68.1-91.9 2.7 8.8 4.1 18.2 4.1 27.9 0 53-43 96-96 96-9.7 0-19.1-1.4-27.9-4.1 11.9 39.4 48.6 68.1 91.9 68.1zM160.2 263.8c-.2-2.6-.2-5.2-.2-7.8 0-12.2 1.7-23.9 4.9-35 .3-.9 .5-1.8 .8-2.7 12.4-40.4 44.3-72.2 84.7-84.7 11.9-3.7 24.6-5.6 37.7-5.6 2.5 0 5 .1 7.4 .2l.4 0c67.1 4 120.2 59.7 120.2 127.8 0 70.7-57.3 128-128 128-68.1 0-123.8-53.2-127.8-120.2zm32.1-16.1c9.3 5.3 20.1 8.4 31.6 8.4 35.3 0 64-28.7 64-64 0-11.5-3-22.3-8.4-31.6-46.4 4-83.3 40.9-87.3 87.3z" />
262+
<path fill="currentColor" d="M288 64c-140.8 0-229.3 128-256 192 26.7 64 115.2 192 256 192 140.8 0 229.3-128 256-192-26.7-64-115.2-192-256-192zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1 3.3 7.9 3.3 16.7 0 24.6-14.9-35.7-46.2-87.7-93-131.1-47.1 43.7-111.8 80.6-192.6 80.6S142.5 443.2 95.4 399.4c-46.8-43.5-78.1-95.4-93-131.1-3.3-7.9-3.3-16.7 0-24.6 14.9-35.7-46.2-87.7 93-131.1zM288 352c53 0 96-43 96-96 0-43.3-28.7-79.9-68.1-91.9 2.7 8.8 4.1 18.2 4.1 27.9 0 53-43 96-96 96-9.7 0-19.1-1.4-27.9-4.1 11.9 39.4 48.6 68.1 91.9 68.1zM160.2 263.8c-.2-2.6-.2-5.2-.2-7.8 0-12.2 1.7-23.9 4.9-35 .3-.9 .5-1.8 .8-2.7 12.4-40.4 44.3-72.2 84.7-84.7 11.9-3.7 24.6-5.6 37.7-5.6 2.5 0 5 .1 7.4 .2l.4 0c67.1 4 120.2 59.7 120.2 127.8 0 70.7-57.3 128-128 128-68.1 0-123.8-53.2-127.8-120.2zm32.1-16.1c9.3 5.3 20.1 8.4 31.6 8.4 35.3 0 64-28.7 64-64 0-11.5-3-22.3-8.4-31.6-46.4 4-83.3 40.9-87.3 87.3z" />
249263
</svg>
250264
</button>
251265
</form>
@@ -275,28 +289,67 @@ class="w-full bg-blue-600 text-white font-bold py-3 rounded-xl transition-all fl
275289
<?php endif; ?>
276290

277291
<?php if ($generated_links): ?>
278-
<div class="mt-8 space-y-3">
279-
<?php foreach ($generated_links as $type => $val): ?>
280-
<div class="flex items-center gap-2 bg-gray-50 dark:bg-gray-900/50 p-3 rounded-xl border border-gray-100 dark:border-gray-700 overflow-hidden">
281-
<code class="text-xs flex-1 truncate opacity-70 px-2"><?= htmlspecialchars($val) ?></code>
282-
<button @click="copyLink(<?= htmlspecialchars(json_encode($val)) ?>)" class="text-blue-500 hover:text-blue-400 p-2 shrink-0">
283-
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 384 512">
284-
<path fill="currentColor" d="M280 64h40c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128c0-35.3 28.7-64 64-64h40c8.8 0 16-7.2 16-16V48C120 21.5 141.5 0 168 0h48c26.5 0 48 21.5 48 48v16c0 8.8 7.2 16 16 16zM168 48v16h48V48c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16zM64 112v352h256V112H64z" />
285-
</svg>
286-
</button>
292+
<div class="mt-8 space-y-4">
293+
<div class="space-y-2">
294+
<?php foreach (['url', 'html', 'markdown'] as $key): ?>
295+
<div class="flex items-center gap-2 bg-gray-50 dark:bg-gray-900/50 p-3 rounded-xl border border-gray-100 dark:border-gray-700 overflow-hidden">
296+
<code class="text-xs flex-1 truncate opacity-70 px-2"><?= htmlspecialchars($generated_links[$key]) ?></code>
297+
<button @click="copyLink(<?= htmlspecialchars(json_encode($generated_links[$key])) ?>)" class="text-blue-500 hover:text-blue-400 p-2 shrink-0">
298+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 384 512">
299+
<path fill="currentColor" d="M280 64h40c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128c0-35.3 28.7-64 64-64h40c8.8 0 16-7.2 16-16V48C120 21.5 141.5 0 168 0h48c26.5 0 48 21.5 48 48v16c0 8.8 7.2 16 16 16zM168 48v16h48V48c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16zM64 112v352h256V112H64z" />
300+
</svg>
301+
</button>
302+
</div>
303+
<?php endforeach; ?>
304+
</div>
305+
306+
<div class="pt-4 border-t border-gray-100 dark:border-gray-700">
307+
<p class="text-[10px] uppercase tracking-widest font-bold text-gray-400 mb-3 text-center"><?= $lang['badge_promo'] ?></p>
308+
<div class="flex flex-col items-center gap-4">
309+
<img src="/badge" alt="MailShield Badge" class="h-8">
310+
311+
<div class="w-full space-y-2">
312+
<div class="flex items-center gap-2 bg-gray-50 dark:bg-gray-900/50 p-3 rounded-xl border border-gray-100 dark:border-gray-700 overflow-hidden">
313+
<span class="text-[9px] font-bold opacity-40 uppercase w-12">MD</span>
314+
<code class="text-[10px] flex-1 truncate opacity-70"><?= htmlspecialchars($generated_links['badge_md']) ?></code>
315+
<button @click="copyLink(<?= htmlspecialchars(json_encode($generated_links['badge_md'])) ?>)" class="text-teal-500 hover:text-teal-400 p-2 shrink-0">
316+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 384 512">
317+
<path fill="currentColor" d="M280 64h40c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128c0-35.3 28.7-64 64-64h40c8.8 0 16-7.2 16-16V48C120 21.5 141.5 0 168 0h48c26.5 0 48 21.5 48 48v16c0 8.8 7.2 16 16 16zM168 48v16h48V48c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16zM64 112v352h256V112H64z" />
318+
</svg>
319+
</button>
320+
</div>
321+
<div class="flex items-center gap-2 bg-gray-50 dark:bg-gray-900/50 p-3 rounded-xl border border-gray-100 dark:border-gray-700 overflow-hidden">
322+
<span class="text-[9px] font-bold opacity-40 uppercase w-12">HTML</span>
323+
<code class="text-[10px] flex-1 truncate opacity-70"><?= htmlspecialchars($generated_links['badge_html']) ?></code>
324+
<button @click="copyLink(<?= htmlspecialchars(json_encode($generated_links['badge_html'])) ?>)" class="text-teal-500 hover:text-teal-400 p-2 shrink-0">
325+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 384 512">
326+
<path fill="currentColor" d="M280 64h40c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128c0-35.3 28.7-64 64-64h40c8.8 0 16-7.2 16-16V48C120 21.5 141.5 0 168 0h48c26.5 0 48 21.5 48 48v16c0 8.8 7.2 16 16 16zM168 48v16h48V48c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16zM64 112v352h256V112H64z" />
327+
</svg>
328+
</button>
329+
</div>
330+
</div>
287331
</div>
288-
<?php endforeach; ?>
332+
</div>
333+
334+
<div class="mt-8 pt-6 border-t border-gray-100 dark:border-gray-700">
335+
<a href="/" class="text-sm font-medium opacity-50 hover:opacity-100 transition-all flex items-center justify-center gap-2">
336+
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
337+
<polyline points="15 18 9 12 15 6" />
338+
</svg>
339+
<?= $lang['back'] ?>
340+
</a>
341+
</div>
289342
</div>
290343
<?php endif; ?>
291344
</main>
292345

293346
<section class="mt-20 mb-12">
294347
<div class="text-center mb-12">
295348
<h2 class="text-3xl font-extrabold text-gray-900 dark:text-white mb-2">
296-
<?= $lang['how_it_works_title'] ?? 'How It Works' ?>
349+
<?= $lang['how_it_works_title'] ?>
297350
</h2>
298351
<p class="text-gray-500 dark:text-gray-400">
299-
<?= $lang['how_it_works_subtitle'] ?? 'Protect your email in 3 simple steps' ?>
352+
<?= $lang['how_it_works_subtitle'] ?>
300353
</p>
301354
</div>
302355

@@ -305,29 +358,29 @@ class="w-full bg-blue-600 text-white font-bold py-3 rounded-xl transition-all fl
305358
<div class="w-16 h-16 bg-blue-500/10 rounded-2xl flex items-center justify-center mb-6 border border-blue-500/20 shadow-lg shadow-blue-500/5 transition-transform hover:scale-110 duration-300">
306359
<span class="text-2xl font-black text-blue-500">1</span>
307360
</div>
308-
<h3 class="text-lg font-bold mb-2"><?= $lang['step1_title'] ?? 'Enter Email' ?></h3>
361+
<h3 class="text-lg font-bold mb-2"><?= $lang['step1_title'] ?></h3>
309362
<p class="text-sm text-gray-500 dark:text-gray-400 leading-relaxed px-4">
310-
<?= $lang['step1_desc'] ?? 'Type your email address in the form above' ?>
363+
<?= $lang['step1_desc'] ?>
311364
</p>
312365
</div>
313366

314367
<div class="flex flex-col items-center">
315368
<div class="w-16 h-16 bg-teal-500/10 rounded-2xl flex items-center justify-center mb-6 border border-teal-500/20 shadow-lg shadow-teal-500/5 transition-transform hover:scale-110 duration-300">
316369
<span class="text-2xl font-black text-teal-500">2</span>
317370
</div>
318-
<h3 class="text-lg font-bold mb-2"><?= $lang['step2_title'] ?? 'Get Protected Link' ?></h3>
371+
<h3 class="text-lg font-bold mb-2"><?= $lang['step2_title'] ?></h3>
319372
<p class="text-sm text-gray-500 dark:text-gray-400 leading-relaxed px-4">
320-
<?= $lang['step2_desc'] ?? 'We generate a unique, protected link for you' ?>
373+
<?= $lang['step2_desc'] ?>
321374
</p>
322375
</div>
323376

324377
<div class="flex flex-col items-center">
325378
<div class="w-16 h-16 bg-purple-500/10 rounded-2xl flex items-center justify-center mb-6 border border-purple-500/20 shadow-lg shadow-purple-500/5 transition-transform hover:scale-110 duration-300">
326379
<span class="text-2xl font-black text-purple-500">3</span>
327380
</div>
328-
<h3 class="text-lg font-bold mb-2"><?= $lang['step3_title'] ?? 'Share Safely' ?></h3>
381+
<h3 class="text-lg font-bold mb-2"><?= $lang['step3_title'] ?></h3>
329382
<p class="text-sm text-gray-500 dark:text-gray-400 leading-relaxed px-4">
330-
<?= $lang['step3_desc'] ?? 'Only humans can reveal your real email' ?>
383+
<?= $lang['step3_desc'] ?>
331384
</p>
332385
</div>
333386
</div>
@@ -351,10 +404,17 @@ class="w-full bg-blue-600 text-white font-bold py-3 rounded-xl transition-all fl
351404

352405
<p class="text-[10px] uppercase tracking-widest text-gray-400 dark:text-gray-500">
353406
<?= $lang['copy'] ?>
407+
<a href="https://rondev.de"
408+
target="_blank"
409+
class="relative group inline-block bg-clip-text text-bold text-transparent bg-gradient-to-r from-blue-500 to-teal-400 transition-all duration-300 hover:scale-105">
410+
<span>RonDev</span>
411+
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-gradient-to-r from-blue-500 to-teal-400 transition-all duration-300 group-hover:w-full"></span>
412+
<span class="absolute inset-0 bg-blue-500/0 group-hover:bg-blue-500/5 blur-xl transition-all duration-500 -z-10 rounded-full"></span>
413+
</a> -
354414
<a href="https://github.com/RonDevHub/MailShield"
355415
target="_blank"
356-
class="relative group inline-block bg-clip-text font-semibold text-transparent bg-gradient-to-r from-blue-500 to-teal-400 transition-all duration-300 hover:scale-105">
357-
<span>RonDevHub</span>
416+
class="relative group inline-block bg-clip-text text-bold text-transparent bg-gradient-to-r from-blue-500 to-teal-400 transition-all duration-300 hover:scale-105">
417+
<span>Github</span>
358418
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-gradient-to-r from-blue-500 to-teal-400 transition-all duration-300 group-hover:w-full"></span>
359419
<span class="absolute inset-0 bg-blue-500/0 group-hover:bg-blue-500/5 blur-xl transition-all duration-500 -z-10 rounded-full"></span>
360420
</a>

0 commit comments

Comments
 (0)