add link button in lobby

This commit is contained in:
ajuvercr 2020-04-11 07:53:36 +02:00
parent b69f42cb7e
commit 8f39a71c4a
3 changed files with 19 additions and 2 deletions

View file

@ -50,3 +50,20 @@
content: "\f091";
transform: translate(-30px, 0px);
}
.link::before {
content: "";
display: block;
width: 16px;
height: 16px;
float: left;
margin: 0 -20px 0 0;
font-family: 'fontawesome';
content: "\f14c";
transform: translate(-20px, 0px);
color: antiquewhite;
}
.link:hover::before {
color: #ff7f00;
}

View file

@ -4,7 +4,7 @@
<h2 class="handle">
<label for="handle_{{loop.index}}">
<span>{{state.name}} ({% if state.state %}{{state.state.map}}{% else %}{{state.map}}{% endif %})</span>
<span style="float: right">{% if state.type == "Playing" %}{{ state.connected }}/{{state.total}}{% endif %}</span>
<span style="float: right">{% if state.type == "Playing" %}{{ state.connected }}/{{state.total}}{% else %}<a class="link" href='/visualizer?name={{state.name}}&game={{state.file}}'></a>{% endif %}</span>
</label>
</h2>
<div class="content">

View file

@ -16,7 +16,7 @@ async function on_load() {
const urlVars = new URLSearchParams(window.location.search);
if (urlVars.get("game") && urlVars.get("name")) {
handle(urlVars.get("game"),urlVars.get("name"))
handle("/games/"+urlVars.get("game"),urlVars.get("name"))
} else if (options[0]) {
const options_div = <HTMLDivElement> options[0];
if (options_div.children[0]) {