-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblog.html
More file actions
252 lines (214 loc) · 9.81 KB
/
Copy pathblog.html
File metadata and controls
252 lines (214 loc) · 9.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Costope | Blog</title>
<link rel="shortcut icon" href="assets/website-icon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<!-- Navbar -->
<script src="navbar.js"></script>
</head>
<body>
<a href="#main" class="skip-link">Skip to content</a>
<div class="container">
<main id="main">
<header class="page-head">
<p class="kicker">Dev notes</p>
<h1 class="title">Blog</h1>
<p class="page-sub">
Click a post to open it in a clean reader view.
</p>
<div class="blog-toolbar" aria-label="Blog search">
<input id="blogSearch" class="search" type="text" placeholder="Search posts…" autocomplete="off" />
<div class="search-hint" id="blogHint" aria-live="polite"></div>
</div>
</header>
<section class="blog-grid" aria-label="Blog posts" id="blogGrid">
<!-- POST 1 -->
<article class="blog-card"
tabindex="0"
role="button"
aria-label="Open post: Valtro: My new big project"
data-title="Valtro: My new big project"
data-date="09.08.2026"
data-image="assets/blog/blog-valtro.jpeg"
data-tags="Website • PWA • Project"
data-excerpt="Documentation about my project Valtro"
data-body="<h3>How I got into that</h3>
<p>I found myself wanting to calculate returns more and more often — wondering how long it would take to
reach my financial goals or even become a millionaire. Yet, I couldn't find a simple website where I could
just enter my starting capital, monthly contributions, and expected interest rates. So, I built one by myself.</p>
<h3>How I build that App</h3>
<p>To deliver a seamless, app-like user experience, I designed and developed this tool as a Progressive Web App (PWA) using HTML,
CSS, and JavaScript. By choosing a PWA architecture over a native Swift app, I successfully bypassed the bureaucracy, high costs,
and restrictions of the traditional App Store while still providing a fast, installable, and fully responsive mobile feel.</p>
<h3>“Valtro? What does it mean?”</h3>
<p>The name is derived from the word “Vault,” which naturally evolved into Valtro. Fortunately, the domain <strong>valtro.app</strong> was
still available. I intentionally chose the .app extension to immediately signal to users that this isn't just a static
website, but a fully functional web application that is ready to use instantly.</p>
<h3>Release Date</h3>
<p>Valtro will launch in the next few weeks as a completely free, ad-free utility tool for everyone to use. The code will be also avaidable at GitHub.</p>
">
<div class="blog-thumb">
<img src="assets/blog/blog-valtro.jpeg" alt="Valtro Picture" loading="lazy" />
</div>
<div class="blog-meta">
<p class="blog-date">Release: 09.08.2026</p>
<h2 class="blog-title">Valtro: My new big project</h2>
<p class="blog-excerpt">Documentation about my project Valtro, a web-app tool to calculate long-term wealth accumulation by compounding initial capital, monthly deposits, and annual interest rates.
</p>
<div class="blog-tags">
<span class="tag">Website</span>
<span class="tag">PWA</span>
<span class="tag">Project</span>
</div>
</div>
<div class="blog-open">Open <svg class="blog-pfeil-svg"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"></polyline></svg></div>
</article>
</section>
<div class="empty-state" id="blogEmpty" hidden>
<p>No posts match your search.</p>
<button class="btn btn-ghost" type="button" id="blogClear">Clear search</button>
</div>
</main>
</div>
<!-- MODAL -->
<div class="modal" id="postModal" aria-hidden="true">
<div class="modal-backdrop" data-close></div>
<div class="modal-dialog" role="dialog" aria-modal="true" aria-labelledby="modalTitle">
<button class="modal-close" data-close aria-label="Schließen">
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 1L19 19M1 19L19 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
<div class="modal-hero">
<img id="modalImg" src="" alt="" />
</div>
<div class="modal-content">
<p class="kicker" id="modalDate"></p>
<h2 class="modal-title" id="modalTitle"></h2>
<p class="modal-excerpt" id="modalExcerpt"></p>
<p class="modal-tags" id="modalTags"></p>
<hr class="modal-divider" aria-hidden="true">
<div class="modal-body" id="modalBody"></div>
</div>
</div>
</div>
<script>
(function () {
const cards = Array.from(document.querySelectorAll(".blog-card"));
const modal = document.getElementById("postModal");
const modalImg = document.getElementById("modalImg");
const modalTitle = document.getElementById("modalTitle");
const modalExcerpt = document.getElementById("modalExcerpt");
const modalDate = document.getElementById("modalDate");
const modalTags = document.getElementById("modalTags");
const modalBody = document.getElementById("modalBody");
const search = document.getElementById("blogSearch");
const hint = document.getElementById("blogHint");
const empty = document.getElementById("blogEmpty");
const clearBtn = document.getElementById("blogClear");
let lastFocus = null;
let scrollPosition = 0;
const openModal = (card) => {
lastFocus = document.activeElement;
// 1. Exakte Scroll-Position sichern
scrollPosition = window.scrollY || document.documentElement.scrollTop;
// 2. Inhalte setzen
modalImg.src = card.dataset.image || "";
modalImg.alt = card.dataset.title || "Blog image";
modalTitle.textContent = card.dataset.title || "";
modalExcerpt.textContent = card.dataset.excerpt || "";
modalDate.textContent = "Release: " + (card.dataset.date || "");
modalTags.textContent = card.dataset.tags || "";
modalBody.innerHTML = card.dataset.body || "<p>No content yet.</p>";
// 3. Body fixieren, damit iOS nicht im Hintergrund scrollt
document.body.style.position = "fixed";
document.body.style.top = `-${scrollPosition}px`;
document.body.style.left = "0";
document.body.style.right = "0";
document.body.style.width = "100%";
// 4. Modal anzeigen
modal.classList.add("is-open");
modal.setAttribute("aria-hidden", "false");
const closeBtn = modal.querySelector(".modal-close");
if (closeBtn) closeBtn.focus();
};
const closeModal = () => {
// 1. Schließ-Animation starten
modal.classList.remove("is-open");
modal.setAttribute("aria-hidden", "true");
// 2. Erst NACH der Animation (300ms) den Body freigeben & springen
setTimeout(() => {
document.body.style.position = "";
document.body.style.top = "";
document.body.style.left = "";
document.body.style.right = "";
document.body.style.width = "";
// 'instant' verhindert das sanfte (sichtbare) Zurückscrollen auf iOS
window.scrollTo({
top: scrollPosition,
behavior: "instant"
});
if (lastFocus && lastFocus.focus) lastFocus.focus();
}, 300); // Entspricht genau der CSS transition Dauer
};
cards.forEach((card) => {
card.addEventListener("click", () => openModal(card));
card.addEventListener("keydown", (e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
openModal(card);
}
});
});
modal.addEventListener("click", (e) => {
if (e.target.closest("[data-close]")) {
closeModal();
}
});
window.addEventListener("keydown", (e) => {
if (e.key === "Escape" && modal.classList.contains("is-open")) closeModal();
});
const normalize = (s) => (s || "").toLowerCase().trim();
const cardText = (c) => normalize(
`${c.dataset.title} ${c.dataset.excerpt} ${c.dataset.tags} ${c.dataset.date}`
);
const applySearch = () => {
const q = normalize(search?.value || "");
let visible = 0;
cards.forEach((c) => {
const ok = q === "" || cardText(c).includes(q);
c.style.display = ok ? "" : "none";
if (ok) visible++;
});
if (hint) hint.textContent = `${visible} / ${cards.length} shown`;
if (empty) empty.hidden = visible !== 0;
};
if (search) {
let t = null;
search.addEventListener("input", () => {
clearTimeout(t);
t = setTimeout(applySearch, 120);
});
}
if (clearBtn) {
clearBtn.addEventListener("click", () => {
if (search) search.value = "";
applySearch();
if (search) search.focus();
});
}
applySearch();
})();
</script>
</body>
</html>