Working version 0.1.

This commit is contained in:
2023-12-27 23:24:03 +01:00
parent 38edb49053
commit 04b3a7d02d
13 changed files with 4425 additions and 1 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.vscode/*
dist/*
node_modules/*

View File

@@ -1,2 +1,15 @@
# AbfallAlarm
AbfallAlarm ist eine intuitive und benutzerfreundliche WebApp, die darauf abzielt, das Leben der Bürger von Arnsberg zu vereinfachen, indem sie eine zuverlässige Erinnerungsfunktion für den städtischen Abfallkalender bietet.
**AbfallAlarm** ist eine intuitive und benutzerfreundliche WebApp, die darauf abzielt, das Leben der Bürger von Arnsberg zu vereinfachen, indem sie eine zuverlässige Erinnerungsfunktion für den städtischen Abfallkalender bietet. Mit dieser App können Nutzer ihre iCalendar (.ics) Dateien für den Abfallkalender der Stadt Arnsberg hochladen und automatisch Erinnerungen für jeden Abholtermin hinzufügen.
## Hauptmerkmale
- **Einfaches Hochladen**: Benutzer können ihre bestehenden iCalendar-Dateien des Abfallkalenders direkt in die App hochladen.
**Flexible Erinnerungseinstellungen**: Benutzer haben die Möglichkeit, Erinnerungszeiten individuell anzupassen, um ihren persönlichen Bedürfnissen gerecht zu werden.
**Automatische Aktualisierung**: Die App fügt automatisch Erinnerungen zu allen Ereignissen in der iCalendar-Datei hinzu und generiert eine neue Datei zur einfachen Integration in persönliche Kalenderanwendungen.
**Benutzerfreundliches Interface**: Eine klare und einfache Benutzeroberfläche macht die Bedienung der App für jedermann leicht und intuitiv.
**Datenschutzorientiert**: Keine Speicherung persönlicher Daten. Die Verarbeitung erfolgt clientseitig, und die Dateien werden nicht auf dem Server gespeichert.
## Zielsetzung
Unser Ziel ist es, den Bürgern von Arnsberg einen bequemen und effizienten Weg zu bieten, um ihre Abfallentsorgung zu planen und zu verwalten. Durch die Bereitstellung einer zuverlässigen Erinnerungsfunktion wollen wir das städtische Recycling- und Abfallmanagement fördern und dadurch einen Beitrag zum Umweltschutz leisten.
# Mitwirken
Wir heißen Beiträge zur Verbesserung von AbfallAlarm herzlich willkommen! Falls Sie Ideen, Feedback oder Verbesserungsvorschläge haben, zögern Sie bitte nicht, einen Issue zu eröffnen oder einen Pull Request zu stellen.

3717
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

32
package.json Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "abfallalarm",
"version": "0.1.0",
"description": "AbfallAlarm ist eine intuitive und benutzerfreundliche WebApp, die darauf abzielt, das Leben der Bürger von Arnsberg zu vereinfachen, indem sie eine zuverlässige Erinnerungsfunktion für den städtischen Abfallkalender bietet.",
"main": "index.js",
"scripts": {
"build": "webpack --config webpack.config.js --mode production",
"start": "webpack serve --config webpack.config.js --mode development",
"stop": "sh stop-server.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/PxaMMaxP/AbfallAlarm.git"
},
"keywords": [],
"author": "M. Passarello",
"license": "MIT",
"bugs": {
"url": "https://github.com/PxaMMaxP/AbfallAlarm/issues"
},
"homepage": "https://github.com/PxaMMaxP/AbfallAlarm#readme",
"devDependencies": {
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"ical.js": "^1.5.0"
}
}

31
public/github-corner.css Normal file
View File

@@ -0,0 +1,31 @@
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0)
}
20%,
60% {
transform: rotate(-25deg)
}
40%,
80% {
transform: rotate(10deg)
}
}
@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation: none
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
}

170
public/index.css Normal file
View File

@@ -0,0 +1,170 @@
html {
min-height: 100vh;
min-width: 100vw;
}
body {
margin: 0;
padding: 0;
width: 100vw;
min-height: 100vh;
height: auto;
display: flex;
align-items: center;
text-align: center;
font-family: Arial, sans-serif;
}
#app-content {
width: 60%;
max-width: 880px;
padding: 30px 40px;
margin: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #ffffff;
background-image: linear-gradient(to right, #ffffff, #e6e6e6);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
border-radius: 25px;
}
#app-content .header {
width: 90%;
height: auto;
margin-bottom: 10px;
font-size: xx-large;
}
#app-content .logo {
width: 30%;
height: auto;
margin-bottom: 20px;
}
#app-content .description {
margin-bottom: 20px;
}
#working-area .areas {
margin-bottom: 25px;
}
#reminder-setting-area .reminder-days,
#reminder-setting-area .reminder-hours {
margin-bottom: 10px;
}
#upload-area .button,
#upload-area .file-input {
padding: 10px 15px;
margin-bottom: 15px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s, box-shadow 0.3s;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
outline: none;
}
#upload-area .button:hover,
#upload-area .file-input:hover {
background-color: #007BFF;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
#upload-area .file-input {
display: block;
width: 80%;
color: #555;
background-color: #f9f9f9;
}
#upload-area .button {
background-color: #28a745;
color: white;
}
#upload-area .button:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
#upload-area #ical-upload {
opacity: 0;
position: absolute;
z-index: -1;
}
#upload-area #ical-upload-label {
background-color: #007bff;
color: white;
display: inline-block;
cursor: pointer;
text-align: center;
}
#upload-area #ical-upload-label:hover {
background-color: #0056b3;
}
#app-content #download-area {
display: block;
overflow: hidden;
height: 0;
opacity: 0;
transition: height 1.5s ease, opacity 0.5s ease;
}
#app-content #download-area.show-download-area {
height: 175px;
opacity: 1;
}
#app-content #download-button {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border: none;
border-radius: 5px;
transition: background-color 0.3s;
}
#app-content #download-button:hover {
background-color: #45a049;
}
#app-content #footer {
margin-top: 30px;
}
h1,
a {
text-wrap: nowrap;
}
@media (max-width: 768px) {
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.5rem;
}
p {
font-size: 1rem;
}
#app-content #download-area.show-download-area {
height: 290px;
}
}

129
public/index.html Normal file
View File

@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html>
<head>
<title>AbfallAlarm</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Responsive design meta tag -->
<meta name="description" content="AbfallAlarm, eine benutzerfreundliche WebApp, die darauf abzielt, das Leben der
Bürger von Arnsberg zu vereinfachen.">
<link rel="stylesheet" href="/index.css">
<link rel="stylesheet" href="/github-corner.css">
</head>
<body>
<a href="https://github.com/PxaMMaxP/AbfallAlarm" class="github-corner" aria-label="View source on GitHub"><svg
width="80" height="80" viewBox="0 0 250 250"
style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor" class="octo-body"></path>
</svg></a>
<div id="app-content">
<!-- Header Section -->
<div class="header">
<h1>Abfall Alarm</h1>
</div>
<!-- Logo Section -->
<div class="logo">
<img src="logo.svg" alt="Abfall Alarm Logo">
</div>
<!-- Description Text -->
<div class="description">
<p><b>Abfall Alarm</b> ist eine intuitive und benutzerfreundliche WebApp, die darauf abzielt, das Leben der
Bürger von Arnsberg zu vereinfachen, indem sie eine zuverlässige Erinnerungsfunktion für den städtischen
Abfallkalender bietet.</p>
<p>Mit dieser App können Nutzer ihre iCalendar (.ics) Dateien für den Abfallkalender der Stadt Arnsberg
hochladen und automatisch Erinnerungen für jeden Abholtermin hinzufügen.</p>
</div>
<!-- Working Area -->
<div class="working-area">
<!-- Reminder Settings -->
<div id="reminder-setting-area" class="areas">
<h2>1. Erinnerung einstellen</h2>
<p>Wählen Sie aus, wann Sie an die Abfuhr erinnert werden möchten.</p>
<div class="reminder-days">
<label for="reminder-days-select">Tage vor Abfuhr erinnern:</label>
<select id="reminder-days-select">
<!-- Options for days -->
<option value="0">Am Tag selbst</option>
<option value="1" selected>1 Tag</option>
<option value="2">2 Tage</option>
<option value="3">3 Tage</option>
<option value="4">4 Tage</option>
<option value="5">5 Tage</option>
<option value="6">6 Tage</option>
<option value="7">7 Tage</option>
</select>
</div>
<div class="reminder-hours">
<label for="reminder-hours-select">Uhrzeit:</label>
<select id="reminder-hours-select">
<!-- Options for hours -->
<option value="0">00:00 Uhr</option>
<option value="1">01:00 Uhr</option>
<option value="2">02:00 Uhr</option>
<option value="3">03:00 Uhr</option>
<option value="4">04:00 Uhr</option>
<option value="5">05:00 Uhr</option>
<option value="6">06:00 Uhr</option>
<option value="7">07:00 Uhr</option>
<option value="8">08:00 Uhr</option>
<option value="9">09:00 Uhr</option>
<option value="10">10:00 Uhr</option>
<option value="11">11:00 Uhr</option>
<option value="12" selected>12:00 Uhr</option>
<option value="13">13:00 Uhr</option>
<option value="14">14:00 Uhr</option>
<option value="15">15:00 Uhr</option>
<option value="16">16:00 Uhr</option>
<option value="17">17:00 Uhr</option>
<option value="18">18:00 Uhr</option>
<option value="19">19:00 Uhr</option>
<option value="20">20:00 Uhr</option>
<option value="21">21:00 Uhr</option>
<option value="22">22:00 Uhr</option>
<option value="23">23:00 Uhr</option>
</select>
</div>
</div>
<!-- Upload Section -->
<div id="upload-area" class="areas">
<h2>2. Abfallkalender hochladen</h2>
<p>Wählen Sie Ihren Abfallkalender aus und klicken Sie danach auf den 'Kalender bearbeiten'-Button.</p>
<!-- Hidden upload field for .ical file and label as a button replacement -->
<input type="file" id="ical-upload" accept=".ics">
<label for="ical-upload" id="ical-upload-label" class="button file-input">Datei auswählen...</label>
<button id="work-button" class="button" disabled>Kalender bearbeiten..</button>
</div>
<!-- Download Section -->
<div id="download-area" class="areas">
<h2>3. Abfallkalender inkl. Erinnerungen herunterladen</h2>
<p>Wenn Sie Ihren Abfallkalender inkl. Erinnerungen herunterladen möchten, klicken Sie auf den
folgenden Button.</p>
<a id="download-button">Herunterladen</a>
</div>
</div>
<!-- Footer Section -->
<div id="footer">
M. Passarello | <a href="https://github.com/PxaMMaxP" target="_blank">Github Profil</a>
</div>
</div>
<script src="/bundle.js"></script>
</body>
</html>

41
public/logo.svg Normal file
View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW 2019 (64-Bit) -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="174 330 710 715"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
<defs>
<style type="text/css">
<![CDATA[
.fil1 {fill:#363636}
.fil5 {fill:#383838}
.fil2 {fill:#79929E}
.fil4 {fill:#9DBACD}
.fil3 {fill:#D04C7C}
.fil6 {fill:#E0EEFE}
.fil0 {fill:#E1EFFF}
]]>
</style>
</defs>
<g id="Ebene_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<g id="_1996037455472">
<path class="fil0" d="M366.28 926.47l25.19 0 -24.46 -267.19c-8.66,-3.19 -11.8,-1.89 -17.69,-8.14 -11.18,-11.85 -9.02,-43.36 6.61,-54.99 12.75,-9.48 24.1,-7.45 41.88,-7.45 16.29,0 32.59,0 48.89,0 1.47,-11.21 -5.22,-40.73 17.98,-45.72 7.52,-1.61 120,-1.61 127.47,0.01 7.76,1.68 14.46,8.81 16.55,16.11 2.4,8.41 0.21,20.25 1.44,29.6 16.75,0 33.5,0 50.25,0 17.63,0 29.17,-1.47 41.29,8.04 15,11.75 20.03,52.01 -2.21,59.95 -2.14,0.77 -3.36,0.74 -5.32,1.31 -6.45,1.87 5.19,-1.86 -2.22,0.74l-25.52 254.91 151.86 0.11c23.42,-0.77 35.23,-16.47 35.26,-40.35 0.03,-36.32 1.67,-365.52 -0.61,-377.57l-649 0c-2.35,12.38 -0.54,335.37 -0.59,372.13 -0.03,19.18 2.65,40.15 28.19,45.09 11.58,2.25 88.21,0.77 110.51,0.72 15.61,-0.04 21.18,-1.75 24.25,12.69z"/>
<path class="fil1" d="M390.29 658.32l275.54 0c-4.71,73.71 -13.22,148.56 -20.04,222.14 -3.44,37.08 -6.84,73.76 -10.34,110.88 -0.99,10.52 -3.74,15.08 -14.44,15.38 -44.08,1.22 -106.41,-0.03 -152.45,-0.03 -29.19,0 -45.17,4.63 -47.14,-14.17 -3.85,-36.87 -6.95,-73.91 -10.3,-110.81 -6.73,-74.11 -15.44,-149.18 -20.83,-223.39zm-98.22 -325.05l9.41 0c3.86,0.53 7.62,1.71 11.1,3.6 18.09,9.83 18.56,22.88 18.56,42.66l46.26 0c0,-16.96 -0.28,-23.23 7.32,-33.49 5.93,-8 14.78,-12.16 25.07,-12.77l5.53 0c25.39,1.46 32.83,22.6 32.83,46.26l44.9 0c0,-15.24 0.39,-24.79 7.79,-33.02 6.76,-7.53 14.56,-11.94 22.55,-13.24l10.06 0c7.99,1.3 15.79,5.71 22.55,13.24 7.4,8.23 7.79,17.78 7.79,33.02l44.9 0c0,-14.38 1.39,-24.76 7.91,-32.91 6.03,-7.55 14.75,-12.15 23.76,-13.35l9.42 0c3.86,0.53 7.62,1.71 11.1,3.6 4.55,2.48 8.25,5.14 11.24,9.17 7.6,10.26 7.32,16.53 7.32,33.49l46.26 0c0,-19.78 0.47,-32.83 18.56,-42.66 3.48,-1.89 7.24,-3.07 11.1,-3.6l9.41 0c9.02,1.2 17.74,5.8 23.77,13.35 6.52,8.15 7.91,18.53 7.91,32.91 33.46,0 51.07,-1.04 70.19,25.04 2.08,2.85 3.32,4.67 4.67,7.58 3.79,8.22 5.05,15.48 5.41,23.86l0 23.79 0 371.43 0 53.2c-1.64,13.18 -6.11,24.82 -17.11,35.82 -23.79,23.79 -54.34,17.1 -89.01,17.1 -35.38,0 -70.75,0 -106.13,0 -0.68,8.21 -2.48,18.33 -2.71,27.22 -0.23,8.71 -2.37,18.39 -2.73,27.2 -1.09,26.74 -15.35,35.56 -33.26,38.1l-45.65 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -1.82 0 -1.83 0 -1.83 0 -1.83 0 -1.83 0 -28.47 0c-15.64,-1.24 -30.24,-6.43 -34.93,-25.04 -3.57,-14.19 -6.18,-73.43 -8.24,-78.36l-24.46 -267.19c-8.66,-3.19 -11.8,-1.89 -17.69,-8.14 -11.18,-11.85 -9.02,-43.36 6.61,-54.99 12.75,-9.48 24.1,-7.45 41.88,-7.45 16.29,0 32.59,0 48.89,0 1.47,-11.21 -5.22,-40.73 17.98,-45.72 7.52,-1.61 120,-1.61 127.47,0.01 7.76,1.68 14.46,8.81 16.55,16.11 2.4,8.41 0.21,20.25 1.44,29.6 16.75,0 33.5,0 50.25,0 17.63,0 29.17,-1.47 41.29,8.04 15,11.75 20.03,52.01 -2.21,59.95 -2.14,0.77 -3.36,0.74 -5.32,1.31 -6.45,1.87 5.19,-1.86 -2.22,0.74l-25.52 254.91 151.86 0.11c23.42,-0.77 35.23,-16.47 35.26,-40.35 0.03,-36.32 1.67,-365.52 -0.61,-377.57l-649 0c-2.35,12.38 -0.54,335.37 -0.59,372.13 -0.03,19.18 2.65,40.15 28.19,45.09 11.58,2.25 88.21,0.77 110.51,0.72 15.61,-0.04 21.18,-1.75 24.25,12.69 -2.71,7.1 -2.79,10.97 -16.04,10.94 -23.74,-0.06 -110.51,2.16 -128.25,-2.47 -10.34,-2.69 -17.71,-7.97 -24.95,-14.51 -1.46,-1.31 -4.31,-4.88 -5.67,-6.58 -1.73,-2.17 -3.77,-5.7 -5.27,-8.33 -5.64,-9.86 -5.97,-21.05 -5.98,-32.38l0 -0.55 0 -0.54 0 -364.63 0 -65.15c0.88,-13.75 2.83,-25.88 6.81,-32.8 5.93,-10.28 15.75,-20.25 26.75,-24.95 15.17,-6.47 26.32,-4.99 46.71,-4.99 0,-14.38 1.39,-24.76 7.91,-32.91 6.03,-7.55 14.75,-12.15 23.77,-13.35zm398.64 301.88l-325.56 0c-0.84,-29.9 8.38,-23.26 70.75,-23.26l231.29 0c20.96,-0.04 25.13,0.74 23.52,23.26zm-220.11 -69.7l115.93 0.59 -0.26 22.45 -4.79 0.24 -106.13 0.07 -4.95 -0.41 0.2 -22.94zm-267.28 -92.96c0,-41.26 -6.5,-74.84 57.9,-69.3 0.88,14.81 -0.31,22.44 7.87,32.91 13.62,17.42 40.14,18.06 55.19,-0.81 6.7,-8.41 6.03,-19.83 7.2,-32.38l45.74 0c1.09,13.59 0.12,24.55 7.65,33.12 16.36,18.62 41.76,17.12 55.16,-0.71 8.55,-11.37 6.41,-17.42 7.29,-32.36l45.9 -0.05c1.69,15.55 -0.36,21.03 7.56,32.83 4.47,6.67 14.86,13.55 27.64,13.55 34.55,-0.01 33.68,-32.43 35.2,-46.4l45.9 0.3c0.88,14.81 -0.32,22.44 7.87,32.91 13.62,17.42 40.14,18.06 55.19,-0.81 6.7,-8.41 6.03,-19.83 7.03,-32.38l45.91 0c1.09,13.59 0.12,24.55 7.65,33.12 6,6.82 14.88,13.46 27.91,13.25 13.31,-0.21 22.14,-7.16 27.25,-13.96 8.55,-11.37 6.41,-17.42 7.29,-32.13 21.49,-1.85 40.62,-0.19 50.15,12.75 11.11,15.09 7.75,35.3 7.75,56.55l-650.2 0zm553.76 -115.15c17.7,-6.2 15.16,17.4 15.16,28.99 0,12.15 4.06,35.19 -7.61,39.04 -19.31,6.36 -15.63,-21.2 -15.63,-29.51 0,-7.72 -0.09,-15.48 -0.04,-23.19 0.06,-9.17 0.83,-12.78 8.12,-15.33zm-115.93 -0.16c17.23,-5.23 14.99,16.18 14.99,29.15 0,11.6 4.1,35.02 -7.22,38.93 -21,7.26 -16.29,-28.09 -16.07,-52.57 0.07,-8.04 0.62,-13.17 8.3,-15.51zm-232.37 0.16c17.7,-6.2 15.16,17.4 15.16,28.99 0,12.15 4.06,35.19 -7.61,39.04 -19.31,6.36 -15.63,-21.2 -15.63,-29.51 0,-20.06 -3.39,-34.5 8.08,-38.52zm-115.93 -0.16c17.23,-5.23 14.99,16.18 14.99,29.15 0,11.6 4.1,35.02 -7.22,38.93 -18.44,6.38 -16.02,-16.9 -16.02,-29.4 0,-18.38 -3.41,-35.13 8.25,-38.68zm231.89 0.35c6.52,-2.78 12.99,1.67 14.65,6.92 1.23,3.87 0.66,16.84 0.66,21.88 0,12.25 3.64,34.91 -6.82,38.86 -18.76,7.08 -16.44,-16.29 -16.44,-29.33 0,-22.14 -3.4,-33.48 7.95,-38.33z"/>
<path class="fil2" d="M516.92 972.73c-1.28,-13.11 -0.09,-180.65 -0.09,-209.53 0,-9.17 -2.86,-25.25 3.28,-31.46 7.48,-7.56 18.78,-2.56 19.82,7.35l0.08 209.15c0,9.18 2.85,25.19 -3.31,31.43 -6.95,7.05 -18.85,2.68 -19.78,-6.94zm102.85 -217.69c-4.45,45.92 -9.3,91.68 -13.76,137.43 -2.22,22.76 -4.67,45.44 -6.8,68.07 -1.02,10.78 -0.85,24.54 -14.62,22.63 -12.2,-1.69 -9.4,-15.1 -8.21,-26.81 4.64,-45.77 9.13,-91.54 13.73,-137.34 2.28,-22.65 4.54,-45.33 6.8,-68.03 1.13,-11.27 0.99,-24.12 14.22,-22.74 13.4,1.4 9.66,16.23 8.64,26.79zm-183.39 -6.8c-1.08,-10.7 0.52,-24.29 14.8,-19.39 9.39,3.21 8.34,17.42 9.48,28.9l20.69 206.71c1.13,10.64 -1.74,22.23 -14.67,18.29 -10.15,-3.09 -8.68,-18.44 -9.7,-28.45l-20.6 -206.06zm6.88 -65.41c5.5,-2.72 130.7,-1.18 154.55,-1.23 8.94,-0.01 16.38,-1.14 20.99,4.83 5.03,6.52 1.05,14.64 -4.42,17.13 -5.28,2.4 -131.75,1.14 -155.35,1.19 -34.7,0.08 -23.64,-18.03 -15.77,-21.92zm192.19 308.51c3.5,-37.12 6.9,-73.8 10.34,-110.88 6.82,-73.58 15.33,-148.43 20.04,-222.14l-275.54 0c5.39,74.21 14.1,149.28 20.83,223.39 3.35,36.9 6.45,73.94 10.3,110.81 1.97,18.8 17.95,14.17 47.14,14.17 46.04,0 108.37,1.25 152.45,0.03 10.7,-0.3 13.45,-4.86 14.44,-15.38z"/>
<path class="fil3" d="M203.32 472.49l650.2 0c0,-21.25 3.36,-41.46 -7.75,-56.55 -9.53,-12.94 -28.66,-14.6 -50.15,-12.75 -0.88,14.71 1.26,20.76 -7.29,32.13 -5.11,6.8 -13.94,13.75 -27.25,13.96 -13.03,0.21 -21.91,-6.43 -27.91,-13.25 -7.53,-8.57 -6.56,-19.53 -7.65,-33.12l-45.91 0c-1,12.55 -0.33,23.97 -7.03,32.38 -15.05,18.87 -41.57,18.23 -55.19,0.81 -8.19,-10.47 -6.99,-18.1 -7.87,-32.91l-45.9 -0.3c-1.52,13.97 -0.65,46.39 -35.2,46.4 -12.78,0 -23.17,-6.88 -27.64,-13.55 -7.92,-11.8 -5.87,-17.28 -7.56,-32.83l-45.9 0.05c-0.88,14.94 1.26,20.99 -7.29,32.36 -13.4,17.83 -38.8,19.33 -55.16,0.71 -7.53,-8.57 -6.56,-19.53 -7.65,-33.12l-45.74 0c-1.17,12.55 -0.5,23.97 -7.2,32.38 -15.05,18.87 -41.57,18.23 -55.19,0.81 -8.18,-10.47 -6.99,-18.1 -7.87,-32.91 -64.4,-5.54 -57.9,28.04 -57.9,69.3z"/>
<path class="fil4" d="M690.71 635.15c1.61,-22.52 -2.56,-23.3 -23.52,-23.26l-231.29 0c-62.37,0 -71.59,-6.64 -70.75,23.26l325.56 0z"/>
<path class="fil5" d="M516.92 972.73c0.93,9.62 12.83,13.99 19.78,6.94 6.16,-6.24 3.31,-22.25 3.31,-31.43l-0.08 -209.15c-1.04,-9.91 -12.34,-14.91 -19.82,-7.35 -6.14,6.21 -3.28,22.29 -3.28,31.46 0,28.88 -1.19,196.42 0.09,209.53z"/>
<path class="fil1" d="M456.98 954.3c1.02,10.01 -0.45,25.36 9.7,28.45 12.93,3.94 15.8,-7.65 14.67,-18.29l-20.69 -206.71c-1.14,-11.48 -0.09,-25.69 -9.48,-28.9 -14.28,-4.9 -15.88,8.69 -14.8,19.39l20.6 206.06z"/>
<path class="fil1" d="M619.77 755.04c1.02,-10.56 4.76,-25.39 -8.64,-26.79 -13.23,-1.38 -13.09,11.47 -14.22,22.74 -2.26,22.7 -4.52,45.38 -6.8,68.03 -4.6,45.8 -9.09,91.57 -13.73,137.34 -1.19,11.71 -3.99,25.12 8.21,26.81 13.77,1.91 13.6,-11.85 14.62,-22.63 2.13,-22.63 4.58,-45.31 6.8,-68.07 4.46,-45.75 9.31,-91.51 13.76,-137.43z"/>
<path class="fil1" d="M443.26 682.83c-7.87,3.89 -18.93,22 15.77,21.92 23.6,-0.05 150.07,1.21 155.35,-1.19 5.47,-2.49 9.45,-10.61 4.42,-17.13 -4.61,-5.97 -12.05,-4.84 -20.99,-4.83 -23.85,0.05 -149.05,-1.49 -154.55,1.23z"/>
<polygon class="fil2" points="470.4,588.39 475.35,588.8 581.48,588.73 586.27,588.49 586.53,566.04 470.6,565.45 "/>
<path class="fil6" d="M641.15 357.18c-7.68,2.34 -8.23,7.47 -8.3,15.51 -0.22,24.48 -4.93,59.83 16.07,52.57 11.32,-3.91 7.22,-27.33 7.22,-38.93 0,-12.97 2.24,-34.38 -14.99,-29.15z"/>
<path class="fil6" d="M408.78 357.34c-11.47,4.02 -8.08,18.46 -8.08,38.52 0,8.31 -3.68,35.87 15.63,29.51 11.67,-3.85 7.61,-26.89 7.61,-39.04 0,-11.59 2.54,-35.19 -15.16,-28.99z"/>
<path class="fil6" d="M292.85 357.18c-11.66,3.55 -8.25,20.3 -8.25,38.68 0,12.5 -2.42,35.78 16.02,29.4 11.32,-3.91 7.22,-27.33 7.22,-38.93 0,-12.97 2.24,-34.38 -14.99,-29.15z"/>
<path class="fil6" d="M757.08 357.34c-7.29,2.55 -8.06,6.16 -8.12,15.33 -0.05,7.71 0.04,15.47 0.04,23.19 0,8.31 -3.68,35.87 15.63,29.51 11.67,-3.85 7.61,-26.89 7.61,-39.04 0,-11.59 2.54,-35.19 -15.16,-28.99z"/>
<path class="fil6" d="M524.74 357.53c-11.35,4.85 -7.95,16.19 -7.95,38.33 0,13.04 -2.32,36.41 16.44,29.33 10.46,-3.95 6.82,-26.61 6.82,-38.86 0,-5.04 0.57,-18.01 -0.66,-21.88 -1.66,-5.25 -8.13,-9.7 -14.65,-6.92z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

60
src/IcsModifier.ts Normal file
View File

@@ -0,0 +1,60 @@
export default class IcsModifier {
// Private properties to store the content and reminder settings
private icsContent: string;
private reminderDays: number;
private reminderHours: number;
private reminderPrefix = 'Erinnerung: ';
// Constructor to initialize the class with the content and reminder settings
constructor(icsContent: string, reminderDays: number, reminderHours: number) {
this.icsContent = icsContent;
this.reminderDays = reminderDays;
this.reminderHours = reminderHours;
}
// Method to modify events in the ICS content
modifyEvents(): string {
// Regular expression to match individual events
const eventRegex = /BEGIN:VEVENT.*?END:VEVENT/gs;
// Replace each event in the ICS content
return this.icsContent.replace(eventRegex, (event) => {
// Extract the summary string from the event
const summaryRegex = /SUMMARY:(.*)\r\n/;
const summaryMatch = event.match(summaryRegex);
const summary = summaryMatch ? summaryMatch[1] : '';
const triggerValue = this.createTriggerValue();
// Create an additional string for the VAlarm
const additionalString = this.createVAlarmString(this.reminderPrefix + summary, triggerValue);
// Insert the additional string before "END:VEVENT"
return event.replace(/END:VEVENT/, additionalString + 'END:VEVENT');
});
}
// Helper method to create a VAlarm string
private createVAlarmString(summary: string, trigger: string): string {
// Construct the VAlarm string
let vAlarmString = 'BEGIN:VALARM\r\n';
vAlarmString += 'ACTION:DISPLAY\r\n';
vAlarmString += `DESCRIPTION:${summary}\r\n`;
vAlarmString += `TRIGGER:${trigger}\r\n`;
vAlarmString += 'END:VALARM\r\n';
return vAlarmString;
}
// Helper method to create a trigger value string
private createTriggerValue() {
// Calculate hours until midnight of the event day
const hoursUntilMidnight = this.reminderHours === 0 ? 0 : 24 - this.reminderHours;
// Use reminderDays directly as daysPart
const daysPart = this.reminderDays;
// Create the trigger string
const trigger = `-P${daysPart}DT${hoursUntilMidnight}H0M0S`;
return trigger;
}
}

93
src/main.ts Normal file
View File

@@ -0,0 +1,93 @@
// main.ts
import IcsModifier from './IcsModifier';
// Event listener for DOMContentLoaded to initialize the application
document.addEventListener('DOMContentLoaded', () => {
console.log('Loading the WebApp...');
const workButton = document.getElementById('work-button') as HTMLButtonElement;
const fileInput = document.getElementById('ical-upload') as HTMLInputElement;
// Enable the work button once a file is selected
fileInput.addEventListener('change', () => {
workButton.disabled = false;
});
// Set up the click event for processing the file
workButton.addEventListener('click', fileInputEvent);
});
// Handles the file input event
function fileInputEvent(event: Event) {
hideDownloadArea();
const fileInput = document.getElementById('ical-upload') as HTMLInputElement;
const reminderDaysElement = document.getElementById('reminder-days-select') as HTMLSelectElement;
const reminderHoursElement = document.getElementById('reminder-hours-select') as HTMLSelectElement;
// Parse reminder settings from the form
const reminderDays = parseInt(reminderDaysElement.value, 10);
const reminderHours = parseInt(reminderHoursElement.value, 10);
// Get the uploaded file
const file = fileInput.files ? fileInput.files[0] : null;
if (file) {
console.log('File uploaded:', file.name);
// Read the file content
const reader = new FileReader();
reader.onload = (e) => {
const fileContent = e.target?.result;
if (typeof fileContent === 'string') {
console.log('File content readable..');
// Modify the ICS content with reminders
const icsModifier = new IcsModifier(fileContent, reminderDays, reminderHours);
const newIcsContent = icsModifier.modifyEvents();
// Generate the new filename and set up download
const newFileName = getNewFileName(file.name);
const blob = new Blob([newIcsContent], { type: 'text/calendar' });
const downloadUrl = URL.createObjectURL(blob);
setupDownloadArea(newFileName, downloadUrl);
}
};
reader.readAsText(file); // Read the file as text
}
}
// Function to generate a new file name with reminders
function getNewFileName(originalFileName: string): string {
const dotIndex = originalFileName.lastIndexOf('.');
if (dotIndex === -1) {
return originalFileName + ' with reminders';
}
return originalFileName.substring(0, dotIndex) + ' with reminders' + originalFileName.substring(dotIndex);
}
// Sets up the download area with the download link
function setupDownloadArea(fileName: string, url: string) {
const downloadArea = document.getElementById('download-area');
const downloadButton = document.getElementById('download-button') as HTMLAnchorElement;
if (downloadArea && downloadButton) {
downloadButton.href = url;
downloadButton.download = fileName;
// Add class to start the animation for the download area
setTimeout(() => downloadArea.classList.add('show-download-area'), 0);
// Disable the work button after processing
const workButton = document.getElementById('work-button') as HTMLButtonElement;
workButton.disabled = true;
}
}
// Hides the download area
function hideDownloadArea() {
const downloadArea = document.getElementById('download-area');
if (downloadArea) {
downloadArea.classList.remove('show-download-area');
}
}

4
stop-server.sh Executable file
View File

@@ -0,0 +1,4 @@
# stop-server.sh
#!/bin/bash
PORT=8080 # Der Port, auf dem Ihr Webpack Dev Server läuft
lsof -i tcp:${PORT} | grep LISTEN | awk '{print $2}' | xargs kill

101
tsconfig.json Normal file
View File

@@ -0,0 +1,101 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}

30
webpack.config.js Normal file
View File

@@ -0,0 +1,30 @@
const path = require('path');
module.exports = {
mode: 'development', // oder 'production' für Produktionsbuilds
entry: path.resolve(__dirname, 'src', 'main.ts'), // Ihr Einstiegspunkt, üblicherweise main.ts
devtool: 'source-map', // Source Maps für das Debugging
module: {
rules: [
{
test: /\.ts$/, // Regel für TypeScript-Dateien
use: 'ts-loader', // Verwendung des ts-loaders
exclude: /node_modules/, // node_modules ausschließen
},
],
},
resolve: {
extensions: ['.ts', '.js'], // Erlaubt das Importieren von .ts und .js Dateien
},
output: {
path: path.resolve(__dirname, 'dist'), // Output-Verzeichnis
filename: 'bundle.js', // Output-Dateiname
},
devServer: {
static: {
directory: path.join(__dirname, 'public'), // Statischer Inhalt aus dem public-Verzeichnis
},
compress: true, // Komprimierung für kleinere Dateien
port: 8080, // Port für den Entwicklungsserver
},
};