Skip to content

Commit

Permalink
Style changes to UI settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
awenelo committed May 6, 2023
1 parent fd2483a commit 453c4ae
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
27 changes: 27 additions & 0 deletions application/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -678,3 +678,30 @@ footer a:hover {
text-decoration: none;
color: var(--main-color);
}

input[type=color] {
width: 5ch;
height: 2em;
background-color: transparent;
border-radius: 1ch;
}

.filepreview img {
height: 64px;
border-radius: 8px;
padding: 10px;
}

.filepreview p {
line-height: 24px;
margin-block-start: 0px;
margin-block-end: 0px;
margin-top: 20px;
padding-right: 10px;
}

.filepreview {
border: 2px solid black;
border-radius: 10px;
display: inline-flex;
}
24 changes: 21 additions & 3 deletions application/templates/uisettings.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{% extends "utils/layout.html" %}

{% block scripts %}
<script>
function updateImagePreview(input) {
file = input.files[0];
console.log(file);
if (file.type == "image/png") {
document.getElementById("filename").innerText = file.name;
document.getElementById("imagepreview").src = URL.createObjectURL(file);
}
}
</script>
{% endblock %}

{% block body %}
<div class="contentw admindiv">
<h1>Edit UI Settings</h1>
Expand All @@ -8,16 +22,20 @@ <h1>Edit UI Settings</h1>
<form method="post" enctype="multipart/form-data">
<label for="colour">Colour:</label>
<input id="colour" name="colour" type="color" value="{{colourString}}"><br />
<label for="bigimage">Big image:</label>
<input id="bigimage" name="bigimage" type="file" accept=".png"><br />
<label for="appname">App name:</label>
<input id="appname" name="appName" type="text" value="{{app_name()}}"><br />
<input id="hidedayleaderboard" name="hideDayLeaderboard" type="checkbox" {% if ui_settings["hideDayLeaderboard"] %}checked{% endif %}>
<label for="hidedayleaderboard">Hide day leaderboard</label><br />
<label for="hidedayleaderboard">Hide daily leaderboard</label><br />
<input id="enablestrava" name="enableStrava" type="checkbox" {% if ui_settings["enableStrava"] %}checked{% endif %}>
<label for="enablestrava">Enable Strava</label><br />
<input id="showwalksbyhour" name="showWalksByHour" type="checkbox" {% if ui_settings["showWalksByHour"] %}checked{% endif %}>
<label for="showwalksbyhour">Show walks by hour</label><br />
<hr>
<label for="bigimage">Select Main Image<br>
<div class="filepreview">
<img id="imagepreview" src="/bigimage.png"><p id="filename"> Current Logo</p>
</div></label>
<input id="bigimage" name="bigimage" type="file" accept=".png" style="display:none;" onchange="updateImagePreview(this)"><br />
<input type="submit" value="Apply">
</form>
</div>
Expand Down

0 comments on commit 453c4ae

Please sign in to comment.