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

Added trail pictures for mock data

parent 207756f9
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."
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 @@ ...@@ -10,8 +10,12 @@
<header> <header>
<ul class="flexList"> <ul class="flexList">
<!--TODO trail image instead of title-->
<li class="listButton" th:each="trail : ${trails}"> <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> </li>
</ul> </ul>
</header> </header>
...@@ -28,16 +32,18 @@ ...@@ -28,16 +32,18 @@
$.get("/allTrails/" + id).done(function (fragment) { $.get("/allTrails/" + id).done(function (fragment) {
$("#trailInfoBox").html(fragment) $("#trailInfoBox").html(fragment)
}); });
updateSelectedTrail(id);
} }
function updateSelectedTrail(id) {
function updateSelectedTrail(string) {
/* Updates the trail bar, so that it highlights the selected trail */ /* Updates the trail bar, so that it highlights the selected trail */
let listEl = document.getElementsByClassName('listA') let list = document.getElementsByClassName('trailsImages')
for (let i = 0; i < listEl.length; i++) { for (let i = 0; i < list.length; i++) {
listEl[i].classList.remove('selected') 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> </script>
</body> </body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment