-
Notifications
You must be signed in to change notification settings - Fork 0
/
skandia.html
84 lines (73 loc) · 3.21 KB
/
skandia.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="https://zolodev.github.io/bumbisaft/favicon.ico">
<title>Skandia</title>
<link href="app.css" rel="stylesheet">
</head>
<body>
<div class="banner" style="background-color:#538f73;color:white;">
<h1>Skandia</h1>
<span class="bannder-divider">/</span>
<a href="./index.html">Avanza</a>
</div>
<div class="notice">
<h2>Viktig information</h2>
<p>Informationen är filtrerad och sorterad efter följande:</p>
<ul>
<li>Filter:
<ul>
<li>Förutsätter att fonden är en Fondförsäkring</li>
<li>Endast fonder där historiskt gått bra (positivt).</li>
</ul>
</li>
<li>
Sorterad: Största förändringen "dag", fallande ordning
</li>
</ul>
</div>
<div class="data-container" id="dataContainer"></div>
<script>
// URL of the JSON data
const url = 'https://raw.githubusercontent.com/zolodev/auto-python/main/Skandia_data_filtered.json';
// Fetch the JSON data from the URL
fetch(url)
.then(response => response.json())
.then(data => {
const containerDiv = document.createElement('div');
containerDiv.className = 'data-item-container';
document.getElementById('dataContainer').appendChild(containerDiv);
data.forEach(fund => {
// Create a div for each fund
const div = document.createElement('div');
div.className = 'data-item';
div.innerHTML += `
<div class='data-item-name'>${fund['Name']}</div>
<div class='data-item-ppmcode'>${fund['isin']}</div>
<div class='data-item-worth'>
<div class='data-item-worth-label'>Worth</div>
<div class='data-item-worth-container'>
<div class="data-item-worth-current">
<div>Day</div>
<div><strong>${fund['Day'].toFixed(3)}</strong></div>
</div>
<div class="data-item-worth-yesterday">
<div>Week</div>
<div><strong>${fund['Week'].toFixed(3)}</strong></div>
</div>
</div>
</div>
<div class='data-item-updated'><em>${fund['LastUpdated']}</em></div>
<div class='data-item-link'>
<a href='${fund['URL']}' target='_blank'>${fund['URL']}</a>
</div>
`;
// Append the div to the container
containerDiv.appendChild(div);
});
document.getElementById('dataContainer').appendChild(containerDiv);
})
.catch(error => console.error('Error:', error));
</script>
</body>
</html>