-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (62 loc) · 2.37 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
<!DOCTYPE html>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117347703-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-117347703-1');
</script>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Only the most important Yankees info.">
<title>The Giancarlo Stanton Strikeout Tracker</title>
<style>
.sr_widget {
display: none;
/* Sorryyyyyy */
}
body {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
.app {
padding: 20px;
}
h1 {
font-weight: normal;
}
p {
font-size: 12px;
margin-top: 50px;
}
a {
color: #2c3e50;
}
</style>
</head>
<body>
<script type="text/javascript" src="//widgets.sports-reference.com/wg.fcgi?css=1&site=br&url=%2Fplayers%2Fsplit.fcgi%3Fid%3Dstantmi03%26year%3D2019%26t%3Db&div=div_total&del_col=1,2,3,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29&max_rows=1"></script>
<div class='app'>
<h1 id='text'></h1>
<p>
Data courtesy <a href='http://bbref.com'>Baseball-Reference</a>, updated once daily.
<br />
Brought to you by <a href='http://twitter.com/ruhee_'>Ruhee</a>, creator of the <a href='http://ruhee.ca/david-price-names'>David Price Nickname Generator</a>.
</p>
</div>
<script>
const number = document.querySelector('td[data-stat="SO"]').innerHTML;
const date = new Date();
const formattedDate = date.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });
const PA = document.querySelector('td[data-stat="PA"]').innerHTML;
const kRate = Math.round(number/PA * 100);
document.getElementById('text').innerHTML = 'It is <b>' + formattedDate + '</b> and Giancarlo Stanton has struck out <b>' + number + '</b> times.<br />(That\'s ' + kRate + '% of the time)';
</script>
</body>
</html>