Skip to content
Snippets Groups Projects
Commit 901ac0a5 authored by Gabriel Copat's avatar Gabriel Copat
Browse files

Added trail pictures for mock data

parent 9cbd4208
No related branches found
No related tags found
1 merge request!11Resolve "As a user, I want to see all trails across a town and seamlessly move between them."
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
src/main/resources/static/images/trails/trail1.jpg

833 KiB

src/main/resources/static/images/trails/trail2.jpg

68.1 KiB

src/main/resources/static/images/trails/trail3.jpg

415 KiB

src/main/resources/static/images/trails/trail4.jpg

102 KiB

......@@ -10,8 +10,12 @@
<header>
<ul class="flexList">
<!--TODO trail image instead of title-->
<li class="listButton" th:each="trail : ${trails}">
<a class="listA" th:onclick="'updateOutputTrail('+ ${trail.id} +');'" th:id="'li' + ${trail.id}" th:text="${trail.name}"></a>
<a class="listA" th:onclick="'updateOutputTrail('+ ${trail.id} +');'" th:id="'li' + ${trail.id}">
<img th:src="@{${trail.getImgPath()}}" class="trailsImages" th:id="'img' + ${trail.getId()}" alt="IMG">
</a>
</li>
</ul>
</header>
......@@ -28,16 +32,18 @@
$.get("/allTrails/" + id).done(function (fragment) {
$("#trailInfoBox").html(fragment)
});
updateSelectedTrail(id);
}
function updateSelectedTrail(string) {
function updateSelectedTrail(id) {
/* Updates the trail bar, so that it highlights the selected trail */
let listEl = document.getElementsByClassName('listA')
for (let i = 0; i < listEl.length; i++) {
listEl[i].classList.remove('selected')
let list = document.getElementsByClassName('trailsImages')
for (let i = 0; i < list.length; i++) {
if (list[i].classList.contains('selected')) {
list[i].classList.remove('selected')
break
}
}
document.getElementById(string).classList.add("selected")
document.getElementById("img" + id).classList.add("selected")
}
</script>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment