Skip to content

Commit

Permalink
add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbam committed Sep 2, 2019
1 parent 5de857f commit 42b9d78
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 13 deletions.
4 changes: 4 additions & 0 deletions static/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ div {
text-align: center;
}

.lb-logo img {
height: 200px;
}

.lb-title {
margin-top: 15px;
margin-bottom: 15px;
Expand Down
4 changes: 4 additions & 0 deletions static/league.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ div {
text-align: center;
}

.lb-logo img {
height: 200px;
}

.lb-title {
margin-bottom: 15px;
margin-top: 15px;
Expand Down
11 changes: 9 additions & 2 deletions static/league.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* league.js
*/

let lb_logo = document.querySelector('.lb-logo');
let lb_title = document.querySelector('.lb-title');
let lb_items = document.querySelector('.lb-items');

Expand Down Expand Up @@ -63,7 +64,8 @@ function reloaded(res) {
}

function print(res) {
clear(res.title);
clear(res.logo, res.title);

addRow('lb-header', 'Rank', 'Name', 'Time')

let rank = 0;
Expand All @@ -89,8 +91,13 @@ function sec(t) {
return ((+a[0]) * 60) + (+a[1]);
}

function clear(title) {
function clear(logo, title) {
if (logo && logo !== '') {
lb_logo.innerHTML = `<img src="${logo}">`;
}

lb_title.innerText = title;

while (lb_items.lastChild) {
lb_items.removeChild(lb_items.lastChild);
}
Expand Down
Binary file added static/logo_circuit_challenge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions static/submit.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ a {
text-align: center;
}

.lb-logo img {
height: 200px;
}

.lb-title {
margin-bottom: 30px;
margin-top: 30px;
Expand Down
11 changes: 10 additions & 1 deletion static/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* submit.js
*/

let lb_logo = document.querySelector('.lb-logo');
let lb_title = document.querySelector('.lb-title');

let lb_email = document.querySelector('.lb-email');
Expand All @@ -15,7 +16,7 @@ function reload() {
type: 'get',
success: function (res, status) {
if (res) {
lb_title.innerText = res.title;
clear(res.logo, res.title);
}
},
});
Expand All @@ -38,6 +39,14 @@ function validateTime(val) {
let lb_email_valid = false;
let lb_time_valid = false;

function clear(logo, title) {
if (logo && logo !== '') {
lb_logo.innerHTML = `<img src="${logo}">`;
}

lb_title.innerText = title;
}

function submit() {
if (!lb_email_valid || !lb_time_valid) {
return;
Expand Down
6 changes: 2 additions & 4 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@

<body>
<figure class="lb-logo">
<div>
<img src="/deepracer.png" width="500">
</div>
<img src="/logo_trophy.png">
</figure>

<h1 class="lb-title">AWS DeepRacer League</h1>
<h1 class="lb-title">DeepRacer Challenge</h1>

<footer></footer>
</body>
Expand Down
4 changes: 1 addition & 3 deletions views/league.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

<body>
<figure class="lb-logo">
<div>
<img src="/deepracer.png" width="300">
</div>
<img src="/logo_trophy.png">
</figure>

<h1 class="lb-title"></h1>
Expand Down
4 changes: 1 addition & 3 deletions views/submit.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

<body>
<figure class="lb-logo">
<div>
<img src="/deepracer.png" width="300">
</div>
<img src="/logo_trophy.png">
</figure>

<h1 class="lb-title"></h1>
Expand Down

0 comments on commit 42b9d78

Please sign in to comment.