-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprofile.html
210 lines (196 loc) · 7.34 KB
/
profile.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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html>
<head>
<title>CF Stonks</title>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" href="./favicon.png">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<meta name="keywords" content="codeforces,stock,stonks,market,trading,game">
<meta name="description" content="A virtual Stock Market based off of CodeForces">
<meta name="title" content="CF Stonks">
<meta name="Author" content="CodeTiger">
<link rel="stylesheet" href="./css/main.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js" integrity="sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<nav class="navbar sticky-top navbar-expand-lg navbar-dark bg-dark">
<a class="mb-0 h1 navbar-brand active" href="./">Stonks CF</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="./">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="./profile.html">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./explore.html">Explore</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./transactions.html">Transactions</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./leaderboard.html">Leaderboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./chats.html">Chats</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./about.html">About</a>
</li>
</ul>
<div class="form-inline navbar-si">
<button class="btn btn-outline-light lrB navBtn" type="button" onclick="window.location.replace('register.html');">Register</button>
<button class="btn btn-outline-light lrB navBtn" type="button" onclick="writeRecord('username','');window.location.replace('login.html');">Logout</button>
</div>
</div>
</nav>
<div class="container main-container">
<div class="alert alert-primary" role="alert">
Welcome back user <b id="usernameBold">-</b>!
</div>
<div class="row">
<div class="col-lg-4">
<div class="card shadow-sm stats-card">
<div class="card-body">
<div class="profile-card-header">Net Worth</div>
<div class="profile-number" id="networth">N/A</div>
<br>
<div class="profile-card-header">Growth</div>
<div class="profile-number" id="growth"></div>
<br>
<div class="profile-card-header">Cash</div>
<div class="profile-number" id="cash">$0</div>
<br>
<div class="profile-card-header">CF Value</div>
<div class="profile-number" id="cfvalue">$0</div>
</div>
</div>
<div class="card shadow-sm stats-card">
<div class="card-body">
<div class="profile-card-header">Rank</div>
<div class="profile-number" id="rank">#30 / 500</div>
</div>
</div>
</div>
<div class="col-lg-8">
<div class="card shadow-sm stats-card">
<div class="card-header">
<h5>Change Chart</h5>
</div>
<div class="card-body">
<canvas id="changeChart"></canvas>
</div>
</div>
</div>
</div>
<br><br>
<div class="row events">
<div class="col-lg-12">
<div class="alert" role="alert" id="openclose">
The Market is <b>CLOSED</b> right now!
</div>
<div class="card shadow-sm stats-card">
<div class="card-header">
<h3>Sell/Buy Stocks</h3>
</div>
<div class="card-body">
<div class="form-group">
<label for="usernameBuySell">Username</label>
<input type="email" class="form-control" id="usernameBuySell" placeholder="CodeForces Username">
</div>
<div class="row">
<div class="col-lg-4">
<div class="form-group">
<label for="quantityBuySell">Quantity</label>
<input type="email" class="form-control" id="quantityBuySell" placeholder="Amount of stock to sell/buy">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="actionBuySell">Action</label>
<div class="form-group">
<select class="form-control" id="actionBuySell">
<option value="1">Buy</option>
<option value="-1">Sell</option>
</select>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-lg btn-primary mb-2 buysell-btn" id="btnBuySell" disabled onclick="trade();">Confirm Order</button>
</div>
</div>
<div class="card shadow-sm stats-card">
<div class="card-header">
<h3>Holdings</h3>
</div>
<div class="card-body">
<table class="table">
<thead style="text-align: center;">
<tr>
<th style="width: 10em;border-top: none;">Name</th>
<th style="width: 6em;border-top: none;">Current Price</th>
<th style="width: 6em;border-top: none">Purchase Price</th>
<th style="width: 3em;border-top: none">QTY</th>
</tr>
</thead>
<tbody style="text-align: center;" id="holdings">
</tbody>
</table>
</div>
</div>
<div class="card shadow-sm stats-card">
<div class="card-header">
<h3>Owners</h3>
</div>
<div class="card-body">
<table class="table">
<thead style="text-align: center;">
<tr>
<th style="width: 10em;border-top: none;">Name</th>
<th style="width: 3em;border-top: none">QTY</th>
<th style="width: 4em;border-top: none">Total</th>
<th style="width: 3em;border-top: none">%</th>
</tr>
</thead>
<tbody style="text-align: center;" id="owners">
</tbody>
</table>
</div>
</div>
<div class="card shadow-sm stats-card">
<div class="card-header">
<h3>Trade History</h3>
</div>
<div class="card-body">
<table class="table">
<thead style="text-align: center;">
<tr>
<th style="width: 10em;border-top: none;">Stock</th>
<th style="width: 4em;border-top: none">Time</th>
<th style="width: 6em;border-top: none">Price</th>
<th style="width: 3em;border-top: none">QTY</th>
<th style="width: 3em;border-top: none">Action</th>
</tr>
</thead>
<tbody style="text-align: center;" id="history">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="./javascript/helpers.js"></script>
<script src="./javascript/profile.js"></script>
</body>
</html>