-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
620 lines (566 loc) · 28.9 KB
/
index.html
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Min Matplikt</title>
<!-- CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link href="fonts.css" rel="stylesheet">
<style>
:root {
--white: #fff;
--black: #000;
--gray: #E9E4E3;
--pink: #FF7484;
--green: #00F1A4;
}
body {
font-family: "GT Zirkon", BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
background-color: var(--white);
color: var(--black);
}
.region-selector {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
}
.region-button {
padding: 0.5rem 1rem;
border: 2px solid var(--gray);
border-radius: 4px;
cursor: pointer;
}
.region-button.active {
background-color: var(--green);
border-color: var(--green);
}
.dashboard-grid {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 2rem;
margin-bottom: 2rem;
}
.card {
background: var(--white);
border: 1px solid var(--gray);
padding: 1.5rem;
border-radius: 8px;
margin-bottom: 1.5rem;
}
.checkbox-list {
list-style: none;
padding: 0;
}
.checkbox-item {
display: flex;
align-items: center;
margin-bottom: 1rem;
}
.custom-checkbox {
width: 24px;
height: 24px;
border: 2px solid var(--gray);
border-radius: 4px;
margin-right: 1rem;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.custom-checkbox.checked {
background-color: var(--green);
border-color: var(--green);
}
.custom-checkbox.checked::after {
content: '✓';
color: var(--black);
font-weight: bold;
}
#map {
height: 400px;
width: 100%;
border-radius: 4px;
}
.map-legend {
display: flex;
gap: 2rem;
padding: 1rem;
background: var(--white);
border: 1px solid var(--gray);
border-radius: 4px;
margin-top: 1rem;
}
.legend-item {
display: flex;
align-items: center;
gap: 0.5rem;
}
.climate-stats {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
margin-bottom: 1rem;
}
.stat-card {
background: var(--gray);
padding: 1rem;
border-radius: 4px;
text-align: center;
}
.stat-card i {
color: var(--black);
margin-bottom: 0.5rem;
}
.recommended-crops {
margin-top: 1rem;
background: var(--white);
padding: 1rem;
border-radius: 4px;
border: 1px solid var(--gray);
}
.crop-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 0;
border-bottom: 1px solid var(--gray);
}
.crop-metrics {
display: flex;
gap: 1rem;
}
.metric {
display: flex;
align-items: center;
gap: 0.25rem;
}
.project-card {
border: 1px solid var(--gray);
padding: 1rem;
margin-bottom: 1rem;
border-radius: 4px;
}
.button {
background-color: var(--green);
color: var(--black);
padding: 0.5rem 1rem;
border-radius: 4px;
cursor: pointer;
}
.button:hover {
background-color: var(--pink);
}
</style>
</head>
<body>
<div class="container mx-auto px-4 max-w-7xl">
<!-- Header -->
<header class="py-8">
<h1 class="text-4xl font-bold mb-2">Min Matplikt</h1>
<p class="text-xl">Verktyg för att hantera min matproduktion</p>
</header>
<!-- Region Selector -->
<div class="region-selector">
<button class="region-button">Sverige</button>
<button class="region-button">Västra Götaland</button>
<button class="region-button">Göteborg</button>
<button class="region-button active">Masthugget</button>
</div>
<div class="dashboard-grid">
<!-- Left Column -->
<div class="space-y-4">
<!-- Map -->
<div class="card">
<div class="flex justify-between items-start mb-4">
<h2 class="text-2xl font-bold">Masthugget</h2>
<div class="text-right">
<p class="font-bold">Odlingszon 1</p>
</div>
</div>
<div id="map"></div>
<div class="map-legend">
<div class="legend-item">
<div style="width: 12px; height: 12px; background: var(--green); border-radius: 50%;"></div>
<span>Aktiva odlingar</span>
</div>
<div class="legend-item">
<div style="width: 12px; height: 12px; border: 2px solid var(--pink); border-radius: 50%;"></div>
<span>Föreslagna områden</span>
</div>
</div>
</div>
<!-- Climate Data -->
<div class="card">
<h2 class="text-xl font-bold mb-4">Klimatdata - Mars 2025</h2>
<div class="climate-stats">
<div class="stat-card">
<i class="fas fa-temperature-high text-2xl"></i>
<h3>Temperatur</h3>
<p class="text-2xl font-bold">8°C</p>
</div>
<div class="stat-card">
<i class="fas fa-cloud-rain text-2xl"></i>
<h3>Nederbörd</h3>
<p class="text-2xl font-bold">45mm</p>
</div>
<div class="stat-card">
<i class="fas fa-seedling text-2xl"></i>
<h3>Jordkvalitet</h3>
<p class="text-2xl font-bold">God</p>
</div>
<div class="stat-card">
<i class="fas fa-wind text-2xl"></i>
<h3>Luftkvalitet</h3>
<p class="text-2xl font-bold">Måttlig</p>
</div>
</div>
<!-- Recommended Crops under Climate Data -->
<div class="recommended-crops">
<h3 class="text-lg font-bold mb-2">Rekommenderade grödor</h3>
<div class="crop-item">
<span class="font-bold">🥬 Spenat</span>
<div class="flex gap-2">
<div class="flex items-center">
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-xs ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-xs ml-2">Klimatpoäng</span>
</div>
</div>
</div>
<div class="crop-item">
<span class="font-bold">🥕 Morötter</span>
<div class="flex gap-2">
<div class="flex items-center">
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-xs ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-xs ml-2">Klimatpoäng</span>
</div>
</div>
</div>
<div class="crop-item">
<span class="font-bold">🌱 Rädisor</span>
<div class="flex gap-2">
<div class="flex items-center">
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-xs ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-2 h-2 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-xs ml-2">Klimatpoäng</span>
</div>
</div>
</div>
</div>
</div>
<!-- Goals Chart -->
<div class="card">
<h2 class="text-xl font-bold mb-4">Måluppfyllelse lokal matproduktion</h2>
<canvas id="goalsChart" height="200"></canvas>
</div>
</div>
<!-- Right Column -->
<div class="space-y-4">
<!-- Commitments as Checklist -->
<div class="card">
<h2 class="text-xl font-bold mb-4">Mina åtaganden</h2>
<ul class="checkbox-list">
<li class="checkbox-item">
<div class="custom-checkbox checked"></div>
<span>Gå med i lokal odlingsgrupp</span>
</li>
<li class="checkbox-item">
<div class="custom-checkbox checked"></div>
<span>Tillvarata frukt från allmänna parker</span>
</li>
<li class="checkbox-item">
<div class="custom-checkbox"></div>
<span>Starta balkongodling</span>
</li>
</ul>
</div>
<!-- Active Projects -->
<div class="card">
<h2 class="text-xl font-bold mb-4">Pågående projekt</h2>
<div class="space-y-4">
<div class="project-card">
<h3 class="font-bold">Masthuggets Odlingsförening</h3>
<p class="text-sm mb-2">Stadsodling</p>
<div class="flex justify-between items-center">
<span>24 medlemmar</span>
<button class="button">Anmäl intresse</button>
</div>
</div>
<div class="project-card">
<h3 class="font-bold">Kolonilotter vid Kjellmansgatan</h3>
<p class="text-sm mb-2">Koloniområde</p>
<div class="flex justify-between items-center">
<span>12 medlemmar</span>
<button class="button">Anmäl intresse</button>
</div>
</div>
</div>
</div>
<!-- Project Suggestions -->
<div class="card">
<h2 class="text-xl font-bold mb-4">Förslag på projekt</h2>
<div class="space-y-4">
<div class="project-card">
<h3 class="font-bold">Nya pallkragar till Värmlandsgatan</h3>
<div class="flex gap-2 my-2">
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Klimatpoäng</span>
</div>
</div>
<div class="flex justify-between items-center">
<span>15 intresserade</span>
<button class="button">Visa intresse</button>
</div>
</div>
<div class="project-card">
<h3 class="font-bold">Takodling Masthuggsterrassen</h3>
<p class="text-sm text-gray-600 mb-2">Ett av fyra förslag på platser för takodlingar</p>
<div class="flex gap-2 my-2">
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Klimatpoäng</span>
</div>
</div>
<div class="flex justify-between items-center">
<span>28 intresserade</span>
<button class="button">Visa intresse</button>
</div>
</div>
<div class="project-card">
<h3 class="font-bold">Ny odlingsförening för Kjellmansgatan</h3>
<div class="flex gap-2 my-2">
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Klimatpoäng</span>
</div>
</div>
<div class="flex justify-between items-center">
<span>22 intresserade</span>
<button class="button">Visa intresse</button>
</div>
</div>
<div class="project-card">
<h3 class="font-bold">Upplåt din trädgård för odling</h3>
<div class="flex gap-2 my-2">
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Matpoäng</span>
</div>
<div class="flex items-center">
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #00F1A4"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="inline-block w-3 h-3 rounded-full mr-1" style="background: #E9E4E3"></span>
<span class="text-sm ml-2">Klimatpoäng</span>
</div>
</div>
<div class="flex justify-between items-center">
<span>8 intresserade</span>
<button class="button">Visa intresse</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="py-8 border-t border-gray">
<p>Matplikt är ett projekt från Digidem Lab</p>
</footer>
</div>
<!-- JavaScript i slutet av body -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js"></script>
<script>
// Initiera karta och graf när sidan har laddats helt
window.addEventListener('load', function() {
// Initiera karta
initMap();
// Initiera graf
initChart();
});
function initMap() {
const mapElement = document.getElementById('map');
if (!mapElement) {
console.error('Map element not found');
return;
}
try {
const map = L.map('map').setView([57.700, 11.952], 15);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// Större och tydligare ikoner
const activeIcon = L.divIcon({
className: 'custom-marker',
html: '<div style="width: 24px; height: 24px; background: #00F1A4; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 4px rgba(0,0,0,0.3);"></div>',
iconSize: [24, 24]
});
const suggestedIcon = L.divIcon({
className: 'custom-marker',
html: '<div style="width: 24px; height: 24px; border: 3px solid #FF7484; background: rgba(255,116,132,0.2); border-radius: 50%; box-shadow: 0 0 4px rgba(0,0,0,0.3);"></div>',
iconSize: [24, 24]
});
// Aktiva odlingsområden
const activeAreas = [
{
pos: [57.699, 11.952],
name: 'Masthuggets Odlingsförening'
},
{
pos: [57.698, 11.951],
name: 'Masthuggsterrassens Koloniområde'
},
{
pos: [57.701, 11.953],
name: 'Slottsskogens Stadsodling'
}
];
// Föreslagna områden
const suggestedAreas = [
{
pos: [57.697, 11.955],
name: 'Förslag: Nya pallkragar vid Värmlandsgatan'
},
{
pos: [57.700, 11.954],
name: 'Förslag: Takodling Masthuggsterrassen'
},
{
pos: [57.698, 11.950],
name: 'Förslag: Odlingsförening Kjellmansgatan'
}
];
// Lägg till alla markeringar med popup
activeAreas.forEach(area => {
L.marker(area.pos, {icon: activeIcon})
.addTo(map)
.bindPopup(area.name);
});
suggestedAreas.forEach(area => {
L.marker(area.pos, {icon: suggestedIcon})
.addTo(map)
.bindPopup(area.name);
});
} catch (error) {
console.error('Error initializing map:', error);
mapElement.innerHTML = '<div class="p-4 bg-red-100 text-red-700">Det gick inte att ladda kartan. Försök ladda om sidan.</div>';
}
}
function initChart() {
const chartElement = document.getElementById('goalsChart');
if (!chartElement) {
console.error('Chart element not found');
return;
}
try {
const ctx = chartElement.getContext('2d');
new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun'],
datasets: [{
label: 'Måluppfyllelse',
data: [65, 70, 75, 80, 85, 90],
backgroundColor: '#00F1A4'
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true,
max: 100
}
}
}
});
} catch (error) {
console.error('Error initializing chart:', error);
chartElement.insertAdjacentHTML('afterend',
'<div class="p-4 bg-red-100 text-red-700">Det gick inte att ladda grafen. Försök ladda om sidan.</div>'
);
}
}
</script>
</body>
</html>