forked from haiyib/steam-games
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
174 lines (156 loc) · 6.3 KB
/
index.html
File metadata and controls
174 lines (156 loc) · 6.3 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Steam Sales Monitor</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicon: 👾 -->
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' x='.1em' font-size='90'%3E👾%3C/text%3E%3C/svg%3E">
<!-- Merriweather for main title -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Merriweather:wght@400;600;700&display=swap" rel="stylesheet">
<style>
body {
margin: 0;
background-color: #121212; /* dark gray background */
color: #ffffff; /* default text color: white */
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/* Centered content */
.container {
width: 900px;
max-width: 100%;
margin: 4em auto;
padding: 0 1em;
}
h1 {
text-align: center;
font-size: 2.4em;
margin: 1.5em 0 0.5em;
font-family: "Merriweather", "Times New Roman", Times, serif;
color: #ffffff;
}
h3 {
text-align: center;
font-weight: normal;
color: #f0f0f0;
margin-top: 0;
}
/* Subheading above charts (if needed later) */
h2 {
font-size: 1.6em;
margin: 4em 0 0.5em;
font-weight: 600;
color: #ffffff;
}
p {
color: #f0f0f0;
line-height: 1.5;
}
/* Wrapper around each chart, adds vertical space */
.chart-wrapper {
position: relative;
width: 100%;
overflow: hidden;
margin: 2.5em 0; /* space above and below each chart */
}
.chart-wrapper iframe {
width: 100% !important;
border: none;
}
#footer {
text-align: center;
padding: 4em 1em;
background-color: #121212; /* match page background */
border-top: solid #111111 5px;
font-size: 0.9em;
color: #f0f0f0;
}
</style>
</head>
<body>
<div class="container">
<h1>🎮 Steam Sales Monitor 👾</h1>
<h3>Having a hard time choosing what game you should buy when it's on sale? <br>
This page might be helpful for you.</h3>
<!-- Intro paragraph for the whole page -->
<p>
This day, you suddenly want to find a game to play on Steam. But you don't have much money. <br>
So, after a quick glance at your bank account, you opened up your Steam store, taking a look at the discount page. <br>
It is ALWAYS free games like <strong>"Counter-Strike 2", "PUBG: BATTLEGROUNDS"</strong> on the top of the list.<br>
Dang it! What can I do?? I can't find what game I want to buy!
</p>
<p>
<mark>This page uses real Steam deal data to help answer that question.</mark> <br>
The first chart shows the <strong>top 20 deals by deal rating</strong>, and draws a line from each game’s normal price to its sale price. <br>
The second chart have every discounted game as a dot, with <strong>its release year on the x-axis and its sale price on the y-axis</strong>, so you can see how cheap older and newer games actually get during sales. <br>
This page updates by every two hours.
</p>
<!-- Current date and time will be inserted here by JavaScript -->
<p id="current-datetime"></p>
<!-- First chart: range plot (top 20 deals) -->
<div class="chart-wrapper">
<iframe
title="Top 20 Games on Steam By Deal Rating"
aria-label="Range Plot"
id="datawrapper-chart-QZJgA"
src="https://datawrapper.dwcdn.net/QZJgA/2/?dark=true"
scrolling="no"
frameborder="0"
style="width: 0; min-width: 100% !important; border: none;"
height="420"
data-external="1">
</iframe>
</div>
<!-- Second chart: scatter plot (every discounted game, by release year) -->
<div class="chart-wrapper">
<iframe
title="Every discounted game, by release year"
aria-label="Scatter Plot"
id="datawrapper-chart-na0jF"
src="https://datawrapper.dwcdn.net/na0jF/3/?dark=true"
scrolling="no"
frameborder="0"
style="width: 0; min-width: 100% !important; border: none;"
height="691"
data-external="1">
</iframe>
</div>
</div>
<!-- Scripts -->
<script type="text/javascript">
// Set current date/time
document.addEventListener("DOMContentLoaded", function () {
var dtElem = document.getElementById("current-datetime");
if (dtElem) {
var now = new Date();
var formatted = now.toLocaleString("en-US", {
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "2-digit",
second: "2-digit",
hour12: true
});
dtElem.textContent = "Date: " + formatted;
}
});
// Datawrapper auto-resize script (shared by both charts)
window.addEventListener("message", function(a) {
if (void 0 !== a.data["datawrapper-height"]) {
var iframes = document.querySelectorAll("iframe");
for (var key in a.data["datawrapper-height"]) {
for (var i = 0; i < iframes.length; i++) {
var iframe = iframes[i];
if (iframe.contentWindow === a.source) {
iframe.style.height = a.data["datawrapper-height"][key] + "px";
}
}
}
}
});
</script>
</body>
</html>