forked from RayBB/random-stock-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (68 loc) · 2.94 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
<!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 Orca.app">
<meta name="author" content="">
<meta name="theme-color" content="#007bff">
<link rel="icon" href="favicon.ico">
<title>Orca Random Stock Picker</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="orcastocks.js" ></script>
</head>
<body>
<div class="col-lg-3 card-deck text-center justify-content-center align-items-center" id="wrap">
<div class="card box-shadow">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Orca Random Stock</h4>
</div>
<div class="card-body">
<a id="yahoo" target="_blank" rel="noopener" href="#"><h1 id="ticker" class="card-title pricing-card-title" target="_blank" rel="noopener" href="#">Loading...</h1></a>
<a id="wiki" target="_blank" rel="noopener" href="#"><h2 id="name" class="card-title pricing-card-title">Loading...</h2></a>
<a href="whyrandom.html">Why random?</a> | <a target="_blank" rel="noopener" href="https://orca.app/rBNUAD">Orca Sign-up</a>
<hr>
<input type="button" class="btn btn-lg btn-primary btn-block" id="refresh" value="Refresh" onclick="newStock()">
</div>
</div>
</div>
<div id="foot">
<small class="col-lg-12 text-center white">Made by
<a class="white font-italic" href="https://github.com/aflugge/orca-random-stock-picker">ajf</a>
</small>
</div>
<script>
let curStock = "";
newStock();
document.querySelector("#yahoo")
document.querySelector("#refresh")
function newStock() {
let random = Math.floor(Math.random() * Math.floor(stocks.length));
curStock = stocks[random];
document.querySelector("#ticker").innerText = curStock['symbol'];
document.querySelector("#name").innerText = curStock['name'];
document.querySelector("#yahoo").href = "https://finance.yahoo.com/quote/" + curStock['symbol'] + ".L";
document.querySelector("#wiki").href = "http://en.wikipedia.org/?search=" + encodeURIComponent(curStock['name']);
}
</script>
<style>
body {
background-color: darkslategrey;
}
#wrap {
height: auto;
/* Negative indent footer by its height */
margin: 40px auto -40px;
/* Pad bottom by footer height */
padding: 0 10px 50px;
}
#foot{
height: 40px;
text-align: center;
}
.white{
color: white!important;
}
</style>
</body>
</html>