Skip to content

Commit e8dfbd2

Browse files
committed
add: ranking fetched and predicted columns, meta keywords and description, repo stars
1 parent b6ed6c6 commit e8dfbd2

File tree

3 files changed

+67
-39
lines changed

3 files changed

+67
-39
lines changed

views/index.ejs

+53-36
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,64 @@
11
<link rel="stylesheet" href="/stylesheets/tablestyle.css">
22
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" type="text/css">
3-
4-
<section class="content">
5-
<h2 class="mb-5 mt-5" style="text-align: center; ">Leetcode Rating Predictor</h2>
3+
<section class="content mt-5">
4+
<div class="mb-4 text-center">
5+
<h2 style="font-weight: bold;">Leetcode Rating Predictor</h2>
6+
<div class="text-muted">
7+
<i>Get your rating changes right after the completion of Leetcode contests</i>
8+
</div>
9+
</div>
610
<div class="container">
7-
<div align="center">
8-
<a href="https://chrome.google.com/webstore/detail/lc-predictor/jfhgaegpgiepniiebglgjhhfnjcibphh" target="_blank">
9-
<img
10-
src="https://i.imgur.com/iswHnpJ.png" alt="Chrome Web Store">
11-
</img>
12-
</a>
11+
<div class="d-flex justify-content-around">
12+
<div>
13+
<a href="https://chrome.google.com/webstore/detail/lc-predictor/jfhgaegpgiepniiebglgjhhfnjcibphh"
14+
target="_blank">
15+
<img src="https://i.imgur.com/iswHnpJ.png" alt="Chrome Web Store" style="max-width: 90%;">
16+
</img>
17+
</a>
18+
</div>
19+
<div>
20+
<iframe class="mt-1"
21+
src="https://ghbtns.com/github-btn.html?user=SysSn13&repo=leetcode-rating-predictor&type=star&count=true&size=large"
22+
frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
23+
</div>
1324
</div>
25+
1426
<div class="row justify-content-center">
1527
<div class="col-12">
16-
28+
<style>
29+
th,td {
30+
text-align: center !important;
31+
}
32+
</style>
1733
<div class="table-responsive-lg">
1834
<table id="contest-table" class="table table-striped hover">
1935
<thead>
2036
<tr class="bg-primary">
2137
<th scope="col">Contest Name</th>
22-
<th scope="col">Type</th>
2338
<th scope="col">Start Time</th>
2439
<th scope="col">Duration</th>
40+
<th scope="col">Rankings Fetched</th>
41+
<th scope="col">Predicted</th>
2542
</tr>
2643
</thead>
2744
<tbody>
2845
<% for( let contest of contests ) { %>
2946
<tr>
30-
<td>
31-
<% if (contest.rankings_fetched) { %>
32-
<a href="/contest/<%= contest._id %>/ranking/1" style="text-decoration:none"><%= contest._id %></a>
33-
<% } else {%>
34-
<%= contest._id %>
35-
<% } %>
36-
</td>
37-
<% if (contest.startTime>Date.now()) { %>
38-
<td>Upcoming</td>
39-
<% } else { %>
40-
<td>Virtual</td>
41-
<% } %>
47+
<td>
48+
<% if (contest.rankings_fetched) { %>
49+
<a href="/contest/<%= contest._id %>/ranking/1" style="text-decoration:none"><%= contest._id %></a>
50+
<% } else {%>
51+
<%= contest._id %>
52+
<% } %>
53+
</td>
4254
<td class="startTime"><%= contest.startTime %></td>
4355
<td><%= (contest.endTime - contest.startTime)/60000 %> minutes</td>
56+
<td>
57+
<%= contest.rankings_fetched?"Yes":"No" %>
58+
</td>
59+
<td>
60+
<%= contest.ratings_predicted?"Yes":"No" %>
61+
</td>
4462
</tr>
4563
<% } %>
4664
</tbody>
@@ -53,23 +71,22 @@
5371

5472
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" type="text/javascript"></script>
5573
<script>
74+
const dataTable = new simpleDatatables.DataTable("#contest-table", {
75+
searchable: true,
76+
fixedHeight: true,
77+
sortable: false,
78+
});
5679
57-
const dataTable = new simpleDatatables.DataTable("#contest-table", {
58-
searchable: true,
59-
fixedHeight: true,
60-
sortable:false,
61-
});
62-
63-
const contests = document.getElementsByClassName('startTime')
64-
for (let contest of contests) {
65-
let startTime = new Date(contest.textContent)
66-
contest.textContent = startTime.toLocaleString()
67-
}
68-
dataTable.on('datatable.page', function(page) {
6980
const contests = document.getElementsByClassName('startTime')
7081
for (let contest of contests) {
7182
let startTime = new Date(contest.textContent)
7283
contest.textContent = startTime.toLocaleString()
7384
}
74-
})
85+
dataTable.on('datatable.page', function (page) {
86+
const contests = document.getElementsByClassName('startTime')
87+
for (let contest of contests) {
88+
let startTime = new Date(contest.textContent)
89+
contest.textContent = startTime.toLocaleString()
90+
}
91+
})
7592
</script>

views/layouts/layout.ejs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9+
<title><%= title %> </title>
10+
<meta name="description" content="Get accurate rating predictions for leetcode contests right after the completion of contest.">
11+
<meta name="keywords" content="Leetcode Rating Predictor,LC Predictor,Rating Predictor,Leetcode Contests,Leetcode,Leetcode rating,Chrome Extension">
912
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
1013
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
11-
<title><%= title %> </title>
1214
<link rel="stylesheet" href="/stylesheets/main.css">
1315

1416
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">

views/ranking.ejs

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
<link rel="stylesheet" href="/stylesheets/tablestyle.css">
22

3-
<div class="container">
4-
<a href="/" class="btn btn-primary btn-md mt-3" role="button">All Contests</a>
3+
<div class="container mt-3">
4+
5+
<div class="d-flex">
6+
<div class="me-auto p-2 ">
7+
<a href="/" class="btn btn-primary btn-md" role="button">All Contests</a>
8+
</div>
9+
<div class="p-2 ">
10+
<iframe src="https://ghbtns.com/github-btn.html?user=SysSn13&repo=leetcode-rating-predictor&type=star&count=true&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
11+
</div>
12+
</div>
13+
514
<h2 class="mb-5 mt-3" style="text-align: center;">Ranking of <strong><%= contest.title || contest._id %> </strong>
615
</h2>
716
<form action="/contest/<%= contest._id %>/ranking/search" method='POST'>

0 commit comments

Comments
 (0)