diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/battleNew.html | 45 | ||||
-rw-r--r-- | templates/battleQuick.html | 57 | ||||
-rw-r--r-- | templates/battleSingle.html | 355 | ||||
-rw-r--r-- | templates/battles.html | 4 | ||||
-rw-r--r-- | templates/botSingle.html | 16 | ||||
-rw-r--r-- | templates/bots.html | 6 | ||||
-rw-r--r-- | templates/footer.html | 1 | ||||
-rw-r--r-- | templates/head.html | 30 | ||||
-rw-r--r-- | templates/index.html | 12 | ||||
-rw-r--r-- | templates/nav.html | 12 |
10 files changed, 321 insertions, 217 deletions
diff --git a/templates/battleNew.html b/templates/battleNew.html index 0460dc7..1992e1d 100644 --- a/templates/battleNew.html +++ b/templates/battleNew.html @@ -7,8 +7,9 @@ <span id="newbattle"></span> <h1><a href="#newbattle">New battle</a></h1> - <p>This is the page on which you can create a battle. Select the values you find appropriate. - Bots can be added to the battle later.</p> + <p>A battle is a <b>collection</b> of fights intended to be fought with multiple bots. In case you just want to try out two bots, create a <a href="/battle/quick">quick</a> battle!</p> + <br> + <p>Select the values you find appropriate. Bots can be added to the battle later.</p> <br> @@ -49,7 +50,21 @@ <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label> {{- end }} </td> - </td> + </tr> + + <tr> + <td>Arena size:</td> + <td> + <input class="border" type="number" name="arena-size" id="arena-size" value="4096"/> + </td> + </tr> + + <tr> + <td>Max Rounds:</td> + <td> + <input class="border" type="number" name="max-rounds" id="max-rounds" value="100"/> + </td> + </tr> <tr> <td>Public:</td> @@ -62,6 +77,23 @@ </td> <tr> + <td>Owners</td> + <td> + {{ $viewerID := .user.ID }} + {{ range $idx, $u := .users}}{{if $idx}},{{- end}} + <input + type="checkbox" + class="check-with-label" + name="owner-{{ $u.ID }}" + id="owner-{{ $u.ID }}" + {{if eq $u.ID $viewerID}}checked{{end}} + /> + <label class="label-for-check" for="owner-{{ $u.ID }}">{{$u.Name}}</label> + {{- end }} + </td> + </tr> + + <tr> <td></td> <td><input class="border" type="submit" value="Create"></td> </tr> @@ -69,11 +101,16 @@ {{ if .res }} <tr> <td></td> - <td>{{ .res }}</td> + <td><div style="border: 1px solid blue; padding: 1ex">{{ .res }}</div></td> </tr> {{ end }} </form> </table> + + <span id="debug"></span> + <h2><a href="#debug">Debug</a></h2> + + <pre>{{ . }}</pre> </body> {{ template "footer" . }} {{ end }} diff --git a/templates/battleQuick.html b/templates/battleQuick.html new file mode 100644 index 0000000..e309346 --- /dev/null +++ b/templates/battleQuick.html @@ -0,0 +1,57 @@ +{{ define "battleQuick" }} + +{{ template "head" . }} +<body> + {{ template "nav" . }} + + <span id="quickbattle"></span> + <h1><a href="#quickbattle">Quick battle</a></h1> + + <p>Just quickly want to try out two bots? Select them here and we'll let them fight quickly!</p> + + <br> + + <form id="battle" method="POST" action="/battle/quick"> + <table class="trhover"> + {{ range $bot := .bots }} + <tr> + + <!-- The name of the bot with the link to the bot's page --> + <td> + <a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a> + </td> + + <!-- A checkbox allowing the user to select the bot --> + <!-- class="check-with-label" --> + <td> + <input + type="checkbox" + name="bot-{{$bot.ID}}" + id="bot-{{$bot.ID}}" + /> + <label class="label-for-check" for="bot-{{$bot.ID}}"></label> + <td> + + <!-- The list of users the bot belongs to--> + <td> + {{ range $idx, $usr := $bot.Users }}{{if $idx}},{{end}}<a href="/user/{{ $usr.ID }}">{{ $usr.Name }}</a>{{ end }} + </td> + + </tr> + {{ end }} + <tr> + <td></td> + <td>{{ .res }}</td> + </tr> + </table> + + <br> + <div class=".w-100"><input class="border" type="submit" value="Fight!"></div> + + </form> + + <!-- {{ . }} --> + +</body> +{{ template "footer" . }} +{{ end }} diff --git a/templates/battleSingle.html b/templates/battleSingle.html index fb53fc2..b074a75 100644 --- a/templates/battleSingle.html +++ b/templates/battleSingle.html @@ -9,218 +9,217 @@ <pre> <a href="#settings">Settings</a> -<a href="#elimination-ladder">Elimination Ladder</a> - <a href="#round-1">Round 1</a> - <a href="#round-2">Round 2</a> - <a href="#round-3">Round 3</a> -<a href="#current-standings">Current Standings</a> +<a href="#registered-bots">Registered Bots</a> +<a href="#output">Output</a> +<a href="#debug">Debug</a> </pre> <span id="settings"></span> <h2><a href="#settings">Settings</a></h2> - <form id="delete" method="POST" action="/battle/{{ .battle.ID }}/delete"> - </form> - <table> - <form id="battle" method="POST" action="/battle/{{ .battle.ID }}"> - <tr> - <td><label for="name">Name:</label></td> - <td><input class="border" type="text" id="name" name="name" value="{{ .battle.Name }}"></td> - </tr> - - <tr> - <td><label for="latestBotSubmission">Latest Bot Submission</label></td> - <td><input - class="border" - type="datetime-local" - id="latestBotSubmission" - name="latestBotSubmission" - value="2024-11-08T12:00" - ></td> - </tr> - - <tr> - <td><label for="battleStart">Battle Start</label></td> - <td><input - class="border" - type="datetime-local" - id="battleStart" - name="battleStart" - value="2024-11-08T16:00" - ></td> - </tr> - -<!-- - <tr> - <td><label for="owners">Owners:</label></td> - <td> - {{ range $idx, $usr := .battle.Owners }}{{if $idx}},{{end}}<a href="/user/{{ $usr.ID }}">{{ $usr.Name }}</a>{{ end }} + <tbody> + <form id="save" method="POST" action="/battle/{{ .battle.ID }}"> + <tr> + <td><label for="name">Name:</label></td> + <td><input class="border" type="text" id="name" name="name" value="{{ .battle.Name }}"></td> + </tr> + + <!-- + <tr> + <td><label for="latestBotSubmission">Latest Bot Submission</label></td> + <td><input + class="border" + type="datetime-local" + id="latestBotSubmission" + name="latestBotSubmission" + value="2024-11-08T12:00" + ></td> + </tr> + + <tr> + <td><label for="battleStart">Battle Start</label></td> + <td><input + class="border" + type="datetime-local" + id="battleStart" + name="battleStart" + value="2024-11-08T16:00" + ></td> + </tr> + + <tr> + <td><label for="owners">Owners:</label></td> + <td> + {{ range $idx, $usr := .battle.Owners }}{{if $idx}},{{end}}<a href="/user/{{ $usr.ID }}">{{ $usr.Name }}</a>{{ end }} + </td> + </tr> + --> + + <!-- + <tr> + <td><label for="public">Public?</label></td> + <td><input type="checkbox" id="public" name="public" {{ if .battle.Public }}checked{{end}}/></td> + </tr> + --> + + <tr> + <td>Archs</td> + <td> + {{ range $idx, $arch := .archs }}{{if $idx}},{{end}} + <input + type="checkbox" + class="check-with-label" + name="arch-{{$arch.ID}}" + id="arch-{{$arch.ID}}" + {{if $arch.Enabled}}checked{{end}}/> + <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label> + {{- end }} + </td> </td> - </tr> - - <tr> - <td><label for="bots">Bots:</label></td> - <td> - {{ range $idx, $bot := .battle.Bots }}{{if $idx}},{{end}}<a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a>{{ end }} - </td> - </tr> - --> - <tr> - <td><label for="public">Public?</label></td> - <td><input type="checkbox" id="public" name="public" {{ if .battle.Public }}checked{{end}}/></td> - </tr> - - <tr> - <td>Archs</td> - <td> - {{ range $idx, $arch := .archs }}{{if $idx}},{{end}} + <tr> + <td>Bits</td> + <td>{{ range $idx, $bit := .bits }}{{if $idx}},{{end}} <input type="checkbox" class="check-with-label" - name="arch-{{$arch.ID}}" - id="arch-{{$arch.ID}}" - {{if $arch.Enabled}}checked{{end}}/> - <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label> - {{- end }} - </td> - </td> + id="bit-{{$bit.ID}}" + name="bit-{{$bit.ID}}" + {{if $bit.Enabled}}checked{{end}}/> + <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label> + {{- end }} + </td> + </tr> + + <tr> + <td>Arena size:</td> + <td> + <input class="border" type="number" name="arena-size" id="arena-size" value="{{ .battle.ArenaSize }}"/> + </td> + </tr> + + <tr> + <td>Max Rounds:</td> + <td> + <input class="border" type="number" name="max-rounds" id="max-rounds" value="100"/> + </td> + </tr> + + <tr> + <td>Owners</td> + <td> + {{ $viewerID := .user.ID }} + {{ $owners := .battle.Owners }} + {{ range $idx, $u := .users}}{{if $idx}},{{- end}} + <input + type="checkbox" + class="check-with-label" + name="owner-{{ $u.ID }}" + id="owner-{{ $u.ID }}" + {{if eq $u.ID $viewerID}}{{end}} + + {{ range $idx, $own := $owners }} + {{if eq $u.ID $own.ID}}checked{{end}} + {{ end }} + /> + <label class="label-for-check" for="owner-{{ $u.ID }}">{{$u.Name}}</label> + {{- end }} + </td> + </tr> + </form> <tr> - <td>Bits</td> - <td>{{ range $idx, $bit := .bits }}{{if $idx}},{{end}} - <input - type="checkbox" - class="check-with-label" - id="bit-{{$bit.ID}}" - name="bit-{{$bit.ID}}" - {{if $bit.Enabled}}checked{{end}}/> - <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label> - {{- end }} + <td></td> + <td width="100%"> + <div style="display: grid; grid-template-columns: 32% 32% 32%; justify-content: space-between;"> + <input class="border" type="submit" value="Save Settings" form="save" style="padding: 0 1ex; width: 100%"> + <input class="border" type="submit" value="Run Battle" form="run" style="border: width: 100%"> + <input class="border" type="submit" value="Delete this battle" form="delete" style="border: 1px solid red; background: red; color: white; width: 100%"> + </div> </td> - </td> + </tr> + {{ if .res }} <tr> <td></td> - <td> - <table> - <tr> - <td style="width: 33%;"><input class="border" type="submit" value="Save"></td> - <td style="width: 33%;"></td> - <td style="width: 33%; "> - <input type="submit" value="Delete this battle" form="delete" style="border: 1px solid red; "> - </td> - </tr> - </table> - </td> + <td><div style="border: 1px solid blue; padding: 1ex">{{ .res }}</div></td> </tr> + {{ end }} - </form> - - {{ if .res }} - <tr> - <td></td> - <td>{{ .res }}</td> - </tr> - {{ end }} - - <tr> - <td><br><hr><br></td> - <td><br><hr><br></td> - </tr> + <tr> + <td><br><hr><br></td> + <td><br><hr><br></td> + </tr> - {{ if .myBots }} + {{ if .myBots }} + + <form id="submit" method="POST" action="/battle/{{ .battle.ID }}/submit"> + <tr> + <td><label for="name">My Bots</label></td> + <td style="width: 100%;"> + <table style="width: 100%;"> + {{ range $bot := .myBots }} + <tr class="trhover"> + <td style="text-align: center; vertical-align: middle; width: 2ex;"> + <input + type="checkbox" + id="bot-{{$bot.ID}}" + name="bot-{{$bot.ID}}" + value="{{$bot.ID}}" + {{ range $bbot := $.battle.Bots }} + {{ if eq $bot.ID $bbot.ID }}checked{{ end }} + {{ end }} + /> + <label for="bot-{{$bot.ID}}"> + <a href="/bot/{{$bot.ID}}">{{$bot.Name}}</a> + </label> + </td> + <td style="vertical-align: middle"> + </td> + </tr> + {{ end }} + </table> + </td> + </tr> + </form> + + <form id="run" method="POST" action="/battle/{{ .battle.ID }}/run"> </form> + <form id="delete" method="POST" action="/battle/{{ .battle.ID }}/delete"></form> - <form method="POST" action="/battle/{{ .battle.ID }}/submit"> <tr> - <td><label for="name">My Bots</label></td> - <td style="width: 100%;"> - <table class="trhover"> - {{ range $bot := .myBots }} - <tr> - <td style="text-align: center; vertical-align: middle; width: 2ex;"> - <input - type="checkbox" - id="bot-{{$bot.ID}}" - name="bot-{{$bot.ID}}" - value="{{$bot.ID}}" /> - </td> - <td style="vertical-align: middle"> - <label for="bot-{{$bot.ID}}"> - <a href="/bot/{{$bot.ID}}">{{$bot.Name}}</a> - </label> - </td> - </tr> - {{ end }} - </table> + <td></td> + <td width="100%"> + <div style="display: grid; grid-template-columns: 100%; justify-content: space-between;"> + <input class="border" type="submit" value="Submit Bots" form="submit" style="width: 100%"> + </div> </td> </tr> + {{ else }} <tr> <td></td> - <td><input class="border" type="submit" value="Submit"></td> + <td><a href='/bot/new'>Upload a bot</a> to get started!</td> </tr> - </form> - - {{ else }} - - <tr> - <td></td> - <td><a href='/bot/new'>Upload a bot</a> to get started!</td> - </tr> + {{ end }} - {{ end }} + </tbody> <table> - <span id="elimination-ladder"></span> - <h2><a href="#elimination-ladder">Elimination Ladder</a></h2> - - <span id="round-1"></span> - <h3><a href="#round-1">Round 1</a></h2> - - <br><a href="">Round 1.1</a>: <a href="">bot1</a> vs <a href="">bot2</a> - <br><a href="">Round 1.2</a>: <a href="">bot3</a> vs <a href="">bot4</a> - <br> - <br><a href="">Round 1.3</a>: <a href="">bot1</a> vs <a href="">bot2</a> - <br><a href="">Round 1.4</a>: <a href="">bot3</a> vs <a href="">bot4</a> - - <span id="round-2"></span> - <h3><a href="#round-2">Round 2</a></h2> - - <br><a href="">Round 2.1</a>: winner of <a href="">round 1.1</a> vs winner of <a href="">round 1.2</a> - <br><a href="">Round 2.2</a>: winner of <a href="">round 1.3</a> vs winner of <a href="">round 1.4</a> - - <span id="round-3"></span> - <h3><a href="#round-3">Round 3</a></h2> - - <br><a href="">Round 3.1</a>: winner of <a href="">round 2.1</a> vs winner of <a href="">round 2.2</a> - - <span id="current-standings"></span> - <h2><a href="#current-standings">Current Standings</a></h2> - - <p>There are {{ .botAmount }} Bots in this battle, as we're executing each battle two times with all permutations, we're executing {{ .battleCount }} battles.</p> - - <br>What is Lorem Ipsum? - <br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. - - <br>Why do we use it? - <br>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). + <span id="registered bots"></span> + <h2><a href="#registered-bots">Registered Bots</a></h2> + {{ range $idx, $bot := .battle.Bots}}{{if $idx}}, {{end}}<a href="/bot/{{ $bot.ID }}">{{ $bot.Name }}</a>{{ end -}} - <br>Where does it come from? - <br>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + <span id="output"></span> + <h2><a href="#output">Output</a></h2> + <!--<details>--> + <pre>{{ .battle.RawOutput }}</pre> + <!--</details>--> - <br>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + <span id="debug"></span> + <h2><a href="#debug">Debug</a></h2> + <details> <pre>{{ . }}</pre> </details> </body> - <br>Where can I get some? - <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. - <br>Where can I get some? - <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. - <br>Where can I get some? - <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. - <br>Where can I get some? - <br>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. -</body> {{ template "footer" . }} {{ end }} diff --git a/templates/battles.html b/templates/battles.html index bdc4d4b..d3f85da 100644 --- a/templates/battles.html +++ b/templates/battles.html @@ -10,9 +10,9 @@ <p>A battle is a collection of matches. It plays through all matches in the elimination ladder in order to determine an overall winner.</p> <br> - <table class="trhover"> + <table> {{ range $battle := .battles }} - <tr> + <tr class="trhover"> <td> - <a href="/battle/{{ $battle.ID }}">{{ $battle.Name }}</a> </td> diff --git a/templates/botSingle.html b/templates/botSingle.html index dcb874f..024e2c1 100644 --- a/templates/botSingle.html +++ b/templates/botSingle.html @@ -75,10 +75,14 @@ <tr><td><hr></td><td><hr></td></tr> <tr> - <td>CMD</td> - <td>{{ .bytecode_r2cmd }}</td> + <td></td> + <td>Command converting your source into bytes:</td> </tr> - <tr> + <tr class="trhover"> + <td style="width: 100ex; ">CMD</td> + <td style="width: 100ex; ">{{ .bytecode_r2cmd }}</td> + </tr> + <tr class="trhover"> <td>Bytecode</td> <td>{{ .bytecode }}</td> </tr> @@ -86,10 +90,14 @@ <tr><td><hr></td><td><hr></td></tr> <tr> + <td></td> + <td>The disassembly of your source:</td> + </tr> + <tr class="trhover"> <td>CMD</td> <td>{{ .disasm_r2cmd }}</td> </tr> - <tr> + <tr class="trhover"> <td>Disasm</td> <td><pre>{{ .disasm }}</pre></td> </tr> diff --git a/templates/bots.html b/templates/bots.html index 34fa0c2..70018dd 100644 --- a/templates/bots.html +++ b/templates/bots.html @@ -7,7 +7,11 @@ <span id="allbots"></span> <h1><a href="#allbots">All Bots</a></h1> - <table class="trhover"> + <table> + <tr> + <td>Bot</td> + <td>User</td> + <tr> {{ range $bot := .bots }} <tr> <td> diff --git a/templates/footer.html b/templates/footer.html index cb7b0c9..7c8682f 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -3,4 +3,5 @@ <br><br><hr><br> {{ . }} {{ end }} +</div> {{ end }} diff --git a/templates/head.html b/templates/head.html index 42d569c..75c3d21 100644 --- a/templates/head.html +++ b/templates/head.html @@ -8,7 +8,7 @@ <title>r2wa.rs</title> <style> -* { word-wrap:break-word !important; font-family: monospace; margin: 0; padding: 0; } +* { word-wrap:break-word; font-family: monospace; margin: 0; padding: 0; } /* light/darktheme specific foo */ @media (prefers-color-scheme: light) { @@ -26,7 +26,7 @@ h5 { margin: 1ex 0 1ex 0; width: 100%; font-size: 1em; /*background-color: #fafafa*/} .code { border-left: 1px solid #040404; margin-left: 2ex; padding-left: 1ex; } .codeline:hover { background: #eeeeee; color: #040404; } - .trhover tr:hover { border-bottom: 1px solid #dddddd; } + .trhover:hover { background: #c0c0c0; color: #040404; } /* add an outline while hovering, the !important makes hovering on checked elements still visible */ .check-with-label:checked + .label-for-check { background-color: #040404; color: #eeeeee !important; } @@ -50,14 +50,14 @@ .code { border-left: 1px solid #c0c0c0; margin-left: 2ex; padding-left: 1ex; } .codeline:hover { background: #c0c0c0; color: #040404; } .webring { -webkit-filter: invert(100%); filter: invert(100%); } - .trhover tr:hover { background: #c0c0c0; color: #040404; } + .trhover:hover { background: #c0c0c0; color: #040404; } /* add an outline while hovering, the !important makes hovering on checked elements still visible */ .check-with-label:checked + .label-for-check { background-color: #c0c0c0; color: #040404 !important; } .check-with-label:hover + .label-for-check { outline: 1px solid #c0c0c0; color: #c0c0c0; } input, textarea { background-color: #c0c0c0; } - .border { outline: 1px solid #c0c0c0; border: none; } + .border { outline: 1px solid #000000; border: none; } } /* settings for mobile devices*/ @@ -65,6 +65,12 @@ body { margin: 1ex; width: calc(100% - 2ex) !important; } img { max-width: 100% !important; max-height: 500px; } } + +/* only display the hover dropdown on non-mobile devices */ +@media only screen and (min-width: 768px) { + nav ul li:hover a + ul { display: inherit; white-space: nowrap; } +} + img { max-width: 100ex; max-height: 500px; } body { margin-left: auto; margin-right: auto; margin-top: 1ex; margin-bottom: 1ex; width: 100ex; } @@ -78,7 +84,7 @@ body a:not(h1 a, h2 a, h3 a,h4 a):not([href*="webring.xxiivv.com"]):not([class*= a[href*="//"]:not([href*="r2wa.rs"]):not([class*="icon"]):before { content: '{'; } a[href*="//"]:not([href*="r2wa.rs"]):not([class*="icon"]):after { content: '}'; } -table { width: 100%; } +/* table { width: 100ex; } */ input, textarea { width: 100%; } textarea { padding: 0.5ex; } @@ -92,11 +98,6 @@ nav ul ul { display: none; position: absolute; outline: 1px solid #040404; backg nav ul ul li { width: 100%; padding-right: 1ex; float:none; display:list-item; position: relative; } nav + ul li { display: inline-block;} -/* only display the hover dropdown on non-mobile devices */ -@media only screen and (min-width: 768px) { - nav ul li:hover a + ul { display: inherit; white-space: nowrap; } -} - /* nav bar spacing char */ nav ul li > a::after { content: " /"; } nav ul li > a:only-child::after { content: ""; } @@ -113,10 +114,13 @@ nav + ul.vert li { display: block; } .w-100 { width: 100%; } -.check-with-label { display: none; } +.check-with-label { display: none; } /* checkbox with a label */ -body table tbody tr td { padding-bottom: 0.5ex; vertical-align: top; } -body table tbody tr td:not(:last-child) { padding-right: 1ex; } +/* In tables, make the first column fit the content and the reset be relaxed */ +body table tbody { width: 100%; word-wrap: break-word; } +/* body table tbody tr>td { padding: 0.5ex 0 0.5ex !important; } */ +body table tbody tr td:nth-child(1) { width: auto; white-space: nowrap; padding-right: 1ex; } +body table tbody tr td:not(:nth-child(1)) { width: 100%; max-width: 100%; word-wrap: anywhere; } tr { text-wrap: wrap;} diff --git a/templates/index.html b/templates/index.html index ab869da..5d033c5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -50,18 +50,6 @@ <br> <br> - <pre> -╭──╮ ╭──────────────────────╮ -│ _│_ │ │ -│ O O < LET THE GAMES BEGIN! │ -│ │╷ │ │ -│ ││ ╰──────────────────────╯ -│ ─╯│ -╰───╯ - </pre> - - - </body> {{ template "footer" . }} {{ end }} diff --git a/templates/nav.html b/templates/nav.html index ea1e1af..bdad48d 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,7 +1,7 @@ {{ define "nav" }} <header> - <p style="margin: 1ex 0; display: block; width: 100%; background-color: red; color: white;"> - EARLY BETA - Data can be deleted at random! + <p style="margin: 1ex 0; display: block; width: 100%; background-color: #ffaa00; color: white;"> + v0.0.0.0.0.0.1 EARLY BETA - Data can be deleted at random! </p> <a href="/">r2wa.rs</a> @@ -16,9 +16,11 @@ <ul> {{ if .pagelink1options }} {{ range $opt := .pagelink1options }} + {{ if eq $opt.Name $.pagelink1.Name }}{{ else }} <li><a class="local" href="{{ $opt.Target }}">{{ $opt.Name }}</a></li> {{ end }} {{ end }} + {{ end }} </ul> </li> {{ end }} @@ -28,9 +30,11 @@ <ul> {{ if .pagelink2options }} {{ range $opt := .pagelink2options }} + {{ if eq $opt.Name $.pagelink2.Name }}{{ else }} <li><a class="local" href="{{ $.pagelink1.Target }}{{ $opt.Target }}">{{ $opt.Name }}</a></li> {{ end }} {{ end }} + {{ end }} </ul> </li> {{ end }} @@ -40,16 +44,18 @@ <ul> {{ if .pagelink3options }} {{ range $opt := .pagelink3options }} + {{ if eq $opt.Name $.pagelink3.Name }}{{ else }} <li><a class="local" href="{{ $.pagelink1.Target }}{{ $.pagelink2.Target }}{{ $opt.Target }}">{{ $opt.Name }}</a></li> {{ end }} {{ end }} + {{ end }} </ul> </li> {{ end }} </ul> <ul style="float: right"> <li> - <a href="https://github.com/HanEmile/r2wars-web">{{ .version }} src</a> + <a href="https://github.com/HanEmile/r2wars-web">{{if .version}}{{ .version }} src{{else}}src{{end}}</a> </li> </ul> </nav> |