start repo for random html stuff

This commit is contained in:
Alexander Mahr 2024-06-17 07:54:58 +02:00
commit d5d8db94ff
2 changed files with 67 additions and 0 deletions

5
README.md Normal file
View file

@ -0,0 +1,5 @@
# unsorted collection of some html stuff
## goldprice
a projection where goldprice should be if linearly extrapolated in year 2023
[./goldprice](./goldprice/index.html)

62
goldprice/index.html Normal file
View file

@ -0,0 +1,62 @@
<!DOCTYPE html>
<!-- asdasdasd --->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title> mini rocketchat </title>
<style>
td{
border:1px solid black;
}
#pricestable{
box-sizing:border-box;
margin:auto;
max-width:20cm;
width:100%
}
</style>
</head>
<table id="pricestable">
<tr>
<td> Year</td><td> Month</td><td>estimated Price</td>
</tr>
</table>
<body>
<script>
// gather rathes by 1999 -> 300 EURO to 2023 bing 1800 euro
yearly = 100 * (Math.pow((1800 / 300 - 1), 1 / (1 * 23)) - 1);
monthly = 100 * (Math.pow((1800 / 300 - 1), 1 / (12 * 23)) - 1);
daily = 100 * (Math.pow((1800 / 300 - 1), 1 / (365 * 23)) - 1);
value = 1800;
console.log('yearly ', yearly);
console.log('monthly ', monthly);
console.log('daily', daily);
year_value = value;
table = document.getElementById("pricestable");
for (year = 2023; year <= 2033; year++) {
// console.log(year, " => ", year_value);
month_value = year_value;
for (month = 1; month <= 12; month++) {
console.log(year, month, " => ", month_value);
row = document.createElement("tr");
formated_value = ((100*month_value)|0)
formated_value = ((formated_value/100)|0)+"."+("0"+(formated_value%100)).slice(-2);
// formated_value = ((formated_value/100)|0)+"."+(formated_value%100);
row.innerHTML="<td> "+year+"</td><td>"+month+"</td><td>"+formated_value+"</td>";
if(month==1){
row.style.color="red";
row.style.backgroundColor='#ffa';
}
table.appendChild(row);
month_value *= (1 + monthly / 100);
}
year_value *= (1 + yearly / 100);
}
</script>
</body>
</html>