Compare commits
2 commits
b1a56edc57
...
f728070815
Author | SHA1 | Date | |
---|---|---|---|
f728070815 | |||
1663a060d9 |
4 changed files with 51 additions and 20 deletions
|
@ -8,6 +8,7 @@ import httpx
|
|||
import json
|
||||
import os
|
||||
import re
|
||||
from . import utils
|
||||
basedir = os.path.dirname(__file__)
|
||||
app = FastAPI()
|
||||
app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
|
||||
|
@ -15,7 +16,9 @@ app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
|
|||
template_env = jinja2.Environment(
|
||||
loader=jinja2.PackageLoader("iwm_browser", "templates"),
|
||||
auto_reload=True
|
||||
)
|
||||
)
|
||||
|
||||
template_env.globals['convert_times'] = utils.convert_times
|
||||
|
||||
BASE_URL = "http://make.fangam.es"
|
||||
THUMB_URL = "https://images.make.fangam.es"
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
.searchResults {
|
||||
font-size: 16px;
|
||||
}
|
||||
.times {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -77,6 +80,21 @@
|
|||
margin-bottom: 0.3rem;
|
||||
}
|
||||
|
||||
.levelTitle a:link, a:visited {
|
||||
color: inherit;
|
||||
text-decoration: initial;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.levelTitle a:hover {
|
||||
outline: 2px dotted blue;
|
||||
}
|
||||
|
||||
.levelTitle a:link:active {
|
||||
color: inherit;
|
||||
outline: 2px dotted blue;
|
||||
}
|
||||
|
||||
.creatorName {
|
||||
justify-self: left;
|
||||
text-align: left;
|
||||
|
@ -84,10 +102,11 @@
|
|||
}
|
||||
|
||||
.levelDescription {
|
||||
overflow-x: scroll;
|
||||
text-align: left;
|
||||
background-color: rgba(245, 222, 179, 0.128);
|
||||
padding: 1em;
|
||||
font-size: 1rem;
|
||||
background-color: #30303a;
|
||||
padding: 0.5rem;
|
||||
font-size: small;
|
||||
|
||||
/* justify-self: right;
|
||||
|
||||
|
|
|
@ -33,10 +33,13 @@
|
|||
<div class="levelDifficulty"><span>Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
|
||||
<div class="creatorName">by <b>{{ map['CreatorName'] }}</b></div>
|
||||
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</div>
|
||||
{% if map['Description'] != ''%}<div class="levelDescription">{{ map['Description'] }}</div>{% endif %}
|
||||
<div class="levelCode">Code: <input type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
|
||||
</div>
|
||||
<div class="times">
|
||||
<div class="FirstClear">First Clear: <b>{{ map['FirstClearUsername'] }}</b> </div>
|
||||
<div class="FirstClear">First Clear: <b>{{ map['FirstClearUsername'] }}</b></div>
|
||||
{% set BestTime = convert_times(map['BestTimePlaytime']) %}
|
||||
<div class="BestTime">Best Time: <b>{{ map['BestTimeUsername'] }}</b> [{{ BestTime[0] }}:{{ BestTime[1] }}:{{ BestTime[2] }}]</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -64,17 +64,23 @@
|
|||
<div class="thumbnail"><img src="{{ THUMB_URL }}/{{ map['ID'] }}.png"></div>
|
||||
<div class="details">
|
||||
<div class="basic">
|
||||
<div class="levelTitle">{{ map['Name'] }}</div>
|
||||
<div class="levelTitle"><a href="/level/{{ map['ID'] }}">{{ map['Name'] }}</a></div>
|
||||
<div class="levelDifficulty"><span>Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
|
||||
<div class="creatorName">by <b>{{ map['CreatorName'] }}</b></div>
|
||||
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</div>
|
||||
{% if map['Description'] != ''%}<div class="levelDescription">{{ map['Description'] }}</div>{% endif %}
|
||||
<div class="levelCode">Code: <input type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
|
||||
</div>
|
||||
|
||||
<div class="times">
|
||||
<div class="FirstClear">First Clear: <b>{{ map['FirstClearUsername'] }}</b></div>
|
||||
{% set BestTime = convert_times(map['BestTimePlaytime']) %}
|
||||
<div class="BestTime">Best Time: <b>{{ map['BestTimeUsername'] }}</b> [{{ BestTime[0] }}:{{ BestTime[1] }}:{{ BestTime[2] }}]</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
<div class="searchResultsFooter">
|
||||
<p>Page {{ searchPage+1 }}</p>
|
||||
|
|
Loading…
Reference in a new issue