Skip to content

Commit fb5bf96

Browse files
committed
[FIX] - card style
1 parent 83df738 commit fb5bf96

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

herkunftcheck/script/map.js

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,34 @@ function InitializeMapAndData() {
44
// Initialize Map
55

66
var map = L.map('map', { zoomControl: true });
7-
8-
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png', {
7+
8+
/* L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png', {
99
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',
1010
subdomains: 'abcd',
1111
maxZoom: 20
1212
}).addTo(map);
13-
14-
15-
L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png', {
16-
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/">CARTO</a>',
17-
subdomains: 'abcd',
18-
maxZoom: 20
19-
}).addTo(map);
20-
21-
13+
*/
14+
15+
L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {
16+
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OSM</a> & CartoDB',
17+
subdomains: 'abcd',
18+
maxZoom: 19
19+
}).addTo(map);
20+
21+
22+
23+
24+
25+
26+
27+
28+
L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png', {
29+
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/">CARTO</a>',
30+
subdomains: 'abcd',
31+
maxZoom: 20
32+
}).addTo(map);
33+
34+
2235
// Create bounds object
2336
var bounds = L.latLngBounds();
2437

@@ -37,15 +50,15 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
3750
document.getElementById("product-name").textContent = data.productName;
3851
document.getElementById("product-category").textContent = data.category;
3952
const options = { day: '2-digit', month: '2-digit', year: 'numeric' };
40-
document.getElementById("production-date").textContent =
53+
document.getElementById("production-date").textContent =
4154
new Date(data.productionDate).toLocaleDateString("de-DE", options);
42-
55+
4356
document.getElementById("best-before").textContent = new Date(data.bestBefore).toLocaleDateString();
4457
document.getElementById("company-name").textContent = data.productOwner.companyName;
4558
//document.getElementById("product-image").src = data.imageSrc;
4659
document.getElementById("product-image").src = data.imageSrc !== "string" ? data.imageSrc : "https://via.placeholder.com/100";
4760

48-
61+
4962

5063
// Load Certificates
5164
let certificateContainer = document.getElementById("certificates");
@@ -120,7 +133,7 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
120133
const midpointLatLng = [midpointY, midpointX];
121134

122135
const pathOptions = {
123-
color: '#6ed391',
136+
color: '#3c8138',
124137
weight: 2,
125138
opacity: 0.8,
126139
};
@@ -167,7 +180,7 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
167180
if (i < latlngs.length) {
168181
animatedLine.addLatLng(latlngs[i]);
169182

170-
183+
171184
i++;
172185
} else {
173186
clearInterval(interval);
@@ -186,7 +199,7 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.
186199
if (bounds.isValid()) {
187200
//map.fitBounds(bounds);
188201
const zoom = map.getBoundsZoom(bounds);
189-
map.setView(bounds.getCenter(), zoom - 0.5); // Zoom um 1 verringert
202+
map.setView(bounds.getCenter(), zoom - 0.5); // Zoom um 1 verringert
190203

191204
} else {
192205
console.warn("No valid coordinates found.");

herkunftcheck/style/card_v2.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,16 @@ img {
248248

249249
.certificate-images img {
250250
width: auto;
251-
height: 20px;
251+
height: 10px;
252252
border-radius: 0px;
253253
cursor: pointer;
254254
}
255255

256256
.card__text {
257257

258258
margin-top: -10px;
259+
margin-top: 010px;
260+
display: block;
259261
}
260262

261263
}

herkunftcheck/style/map.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313

1414
.leaflet-popup-content b {
1515
color: #6ed391;
16+
color: #3c8138;;
1617
}
1718

1819
/* Marker styling */
1920
.custom-marker {
2021
background-color: #6ed391;
22+
background-color: #3c8138;
2123
border-radius: 50%;
2224
width: 14px;
2325
height: 14px;
@@ -59,6 +61,7 @@
5961
font-weight: bold;
6062
border-radius: 50%;
6163
background-color: rgba(110, 211, 145, 0.6);
64+
background-color: #3c8138af;
6265

6366
color: #fff;
6467
text-align: center;

0 commit comments

Comments
 (0)