Compare commits

..

No commits in common. "f728070815e851bfd8c698c2cf6df2aa423723b7" and "b1a56edc57f9e9e14fbb89ee627e7c624fdc10cb" have entirely different histories.

4 changed files with 20 additions and 51 deletions

View file

@ -8,7 +8,6 @@ import httpx
import json import json
import os import os
import re import re
from . import utils
basedir = os.path.dirname(__file__) basedir = os.path.dirname(__file__)
app = FastAPI() app = FastAPI()
app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static") app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
@ -16,9 +15,7 @@ app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
template_env = jinja2.Environment( template_env = jinja2.Environment(
loader=jinja2.PackageLoader("iwm_browser", "templates"), loader=jinja2.PackageLoader("iwm_browser", "templates"),
auto_reload=True auto_reload=True
) )
template_env.globals['convert_times'] = utils.convert_times
BASE_URL = "http://make.fangam.es" BASE_URL = "http://make.fangam.es"
THUMB_URL = "https://images.make.fangam.es" THUMB_URL = "https://images.make.fangam.es"

View file

@ -26,9 +26,6 @@
.searchResults { .searchResults {
font-size: 16px; font-size: 16px;
} }
.times {
display: none;
}
} }
@ -80,21 +77,6 @@
margin-bottom: 0.3rem; 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 { .creatorName {
justify-self: left; justify-self: left;
text-align: left; text-align: left;
@ -102,11 +84,10 @@
} }
.levelDescription { .levelDescription {
overflow-x: scroll;
text-align: left; text-align: left;
background-color: #30303a; background-color: rgba(245, 222, 179, 0.128);
padding: 0.5rem; padding: 1em;
font-size: small; font-size: 1rem;
/* justify-self: right; /* justify-self: right;

View file

@ -33,13 +33,10 @@
<div class="levelDifficulty"><span>Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div> <div class="levelDifficulty"><span>Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
<div class="creatorName">by <b>{{ map['CreatorName'] }}</b></div> <div class="creatorName">by <b>{{ map['CreatorName'] }}</b></div>
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</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 class="levelCode">Code: <input type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
</div> </div>
<div class="times"> <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>
</div> </div>

View file

@ -64,23 +64,17 @@
<div class="thumbnail"><img src="{{ THUMB_URL }}/{{ map['ID'] }}.png"></div> <div class="thumbnail"><img src="{{ THUMB_URL }}/{{ map['ID'] }}.png"></div>
<div class="details"> <div class="details">
<div class="basic"> <div class="basic">
<div class="levelTitle"><a href="/level/{{ map['ID'] }}">{{ map['Name'] }}</a></div> <div class="levelTitle">{{ map['Name'] }}</div>
<div class="levelDifficulty"><span>Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div> <div class="levelDifficulty"><span>Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
<div class="creatorName">by <b>{{ map['CreatorName'] }}</b></div> <div class="creatorName">by <b>{{ map['CreatorName'] }}</b></div>
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</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 class="levelCode">Code: <input type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
</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>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
<div class="searchResultsFooter"> <div class="searchResultsFooter">
<p>Page {{ searchPage+1 }}</p> <p>Page {{ searchPage+1 }}</p>