Skip to content

Commit 5151839

Browse files
committed
[EDIT] - Steps
1 parent ad249af commit 5151839

3 files changed

Lines changed: 76 additions & 19 deletions

File tree

herkunftcheck/herkunftcheck2/index.html

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ <h1 class="product-name text-left" id="product-step-name">Produktionsschritt</h1
279279

280280
<section class="projects">
281281
<div class="card-grid mt-2">
282-
<div class="project-card light info">
282+
<div class="w-100 info">
283283
<div class="row d-flex align-items-stretch">
284-
<div class="col-6">
285-
284+
<div class="col-5 pt-4 pb-4 pe-0">
285+
<div class="project-card light info info-card-border-radius-right-0">
286286
<h4>Info</h4>
287287
<div class="content">
288288

@@ -319,8 +319,9 @@ <h4>Info</h4>
319319
</div>
320320
</div>
321321
</div>
322+
</div>
322323

323-
<div class="col-6">
324+
<div class="col-7 ps-0">
324325
<div id="product-step-image-container"
325326
class="info-card p-0 m-0 w-100 product-image-container shadow-none"
326327
style="background-image: url('https://smartfarminglab.github.io/data/flasche_stock.jpg');">
@@ -337,7 +338,7 @@ <h2 class="section-heading" id="step-description">
337338
</h2>
338339
</div>
339340

340-
<div class="card-grid mt-2" id="step-entries">
341+
<div class="card-grid mt-4" id="step-entries">
341342

342343
</div>
343344

@@ -371,6 +372,12 @@ <h2 class="section-heading" id="step-description">
371372

372373
function toggleStepSheet() {
373374
sheetStep.classList.toggle("open");
375+
376+
377+
if(!sheetStep.classList.contains("open")){
378+
removePulse();
379+
}
380+
374381
}
375382

376383
/* sheet.addEventListener("touchstart", e => {
@@ -408,7 +415,9 @@ <h2 class="section-heading" id="step-description">
408415

409416

410417

411-
function showSidebarWithStep(step) {
418+
function showSidebarWithStep(e, step) {
419+
420+
console.log(e);
412421

413422
sheetStep.classList.add("open");
414423

@@ -443,14 +452,10 @@ <h2 class="section-heading" id="step-description">
443452
444453
<div class="project-card green info" onclick="toogleStepEntry(${index + 1})" id="step-entry-${index + 1}-container">
445454
<div class="project-title">Eintrag ${index + 1}</div>
446-
<div class="content">
447-
448-
<div class="toggle-button" style="cursor:pointer;">Hier klicken für mehr Informationen</div>
449-
450-
<div class="extra-info hidden" id="step-entry-${index + 1}">
451-
452-
453-
<div>
455+
<div class="content">
456+
<div class="toggle-button" style="cursor:pointer;">Hier klicken für mehr Informationen</div>
457+
<div class="extra-info hidden" id="step-entry-${index + 1}">
458+
<div>
454459
<div class="label">
455460
<div class="logo-icon">
456461
<svg xmlns="http://www.w3.org/2000/svg"
@@ -463,7 +468,7 @@ <h2 class="section-heading" id="step-description">
463468
464469
<span>Beschreibung</span>
465470
</div>
466-
<span>${entry.description || "-"}</span>
471+
<span>${entry.description || "-"}</span>
467472
468473
469474
@@ -488,7 +493,11 @@ <h2 class="section-heading" id="step-description">
488493
entriesContainer.insertAdjacentHTML("beforeend", entryHtml);
489494
});
490495
} else {
491-
entriesContainer.innerHTML = "<p>Keine Einträge vorhanden.</p>";
496+
entriesContainer.innerHTML = ` <div class="project-card green">
497+
<div class="project-title">Eintrag</div>
498+
<p class="content">Keine Einträge vorhanden</p>
499+
500+
</div>`;
492501
}
493502

494503
}

herkunftcheck/herkunftcheck2/script/map_1.1.6.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const markers = [];
2+
13
function InitializeMapAndData() {
24

35

@@ -33,7 +35,7 @@ function InitializeMapAndData() {
3335

3436
// Create bounds object
3537
var bounds = L.latLngBounds();
36-
38+
3739
// Fetch and process product batch steps
3840
fetch("https://smartfarminglab.github.io/data/productpassport.json")
3941
.then(response => {
@@ -137,8 +139,25 @@ function InitializeMapAndData() {
137139
popupAnchor: [0, -10]
138140
})
139141
}).on('click', function (e) {
140-
showSidebarWithStep(step);
141-
});//.addTo(map)
142+
143+
markers.forEach(m => {
144+
const el = m.getElement();
145+
if (el) el.classList.remove('pulse');
146+
});
147+
148+
// Step 3: Add 'pulse' to clicked marker
149+
const el = marker.getElement();
150+
if (el) el.classList.add('pulse');
151+
152+
showSidebarWithStep(e, step);
153+
});
154+
155+
156+
markers.push(marker);
157+
158+
159+
160+
//.addTo(map)
142161
//.bindPopup(`<b>${step.name}</b><br>${step.address.name}, ${step.address.city}`);
143162

144163

@@ -253,4 +272,12 @@ function InitializeMapAndData() {
253272
})
254273
.catch(error => console.error("Error loading data:", error));
255274

275+
}
276+
277+
278+
function removePulse(){
279+
markers.forEach(m => {
280+
const el = m.getElement();
281+
if (el) el.classList.remove('pulse');
282+
});
256283
}

herkunftcheck/herkunftcheck2/style/style_v1.2.1.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ body {
203203
margin: 6px 0;
204204
}
205205

206+
.info-card-border-radius-right-0{
207+
border-top-right-radius: 0 !important;
208+
border-bottom-right-radius: 0 !important;
209+
210+
}
211+
206212
.steps-list {
207213
list-style-type: none;
208214
padding: 0;
@@ -577,4 +583,19 @@ display: flex;
577583
}
578584
.expanded-container .toggle-button{
579585
max-height: 0;
586+
}
587+
588+
589+
590+
.pulse {
591+
animation: pulse-animation 2s infinite;
592+
}
593+
594+
@keyframes pulse-animation {
595+
0% {
596+
box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2);
597+
}
598+
100% {
599+
box-shadow: 0 0 0 20px rgba(0, 0, 0, 0);
600+
}
580601
}

0 commit comments

Comments
 (0)