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

HTML/CSS added for each trail

Updated a few naming conventions and fixed some bugs
parent f097a5ec
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."
...@@ -31,7 +31,7 @@ public class TrailsController { ...@@ -31,7 +31,7 @@ public class TrailsController {
{ {
List<Trail> trailList= Trail.trails;//results from db List<Trail> trailList= Trail.trails;//results from db
ModelAndView mv= new ModelAndView("fragments/allTrailsFrags :: trailSection"); ModelAndView mv= new ModelAndView("fragments/allTrailsFrags :: trailSection");
mv.addObject("searchList", trailList.get(id-1)); mv.addObject("trail", trailList.get(id-1));
return mv; return mv;
} }
......
* {
box-sizing: border-box;
}
body { body {
background-color: rgb(41, 41, 41); background-color: rgb(41, 41, 41);
margin: 0; margin: 0;
} }
main {
}
.centerFlex { .centerFlex {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
#allTrailsBar { #allTrailsBar {
padding:0; padding:0;
max-width: 60%; max-width: 80%;
height: 11svh; height: 11svh;
margin: auto; margin: 1svh auto;
border-bottom: solid grey 2px; display: flex;
justify-content: space-between;
/*border-bottom: solid grey 2px;*/
/*border-top: solid grey 4px;*/ /*border-top: solid grey 4px;*/
} }
...@@ -33,19 +40,73 @@ body { ...@@ -33,19 +40,73 @@ body {
.selected { .selected {
box-shadow: 0 0 20px 10px #bbbb00; box-shadow: 0 0 20px 10px #bbbb00;
} }
.trailInfoBox {
animation: fadeIn 3s;
padding: 20px;
font-size: xx-large;
}
@keyframes fadeIn { @keyframes fadeIn {
0% { opacity: 0; } 0% { opacity: 0; }
100% { opacity: 1; } 100% { opacity: 1; }
} }
main {
margin: 0;
}
#trailInfoContainer {
margin: auto;
width: 95vw;
min-height: 80vh;
min-width: 30svw;
}
.trailInfoFrag {
background-color: rgb(84, 33, 128);
border: #000000 solid 2px;
border-radius: 10px;
box-shadow: 0 5px 20px 0 #000000;
margin:0;
padding:0;
animation: fadeIn 3s;
overflow: hidden;
display: flex;
flex-direction: column;
/*min-height: 80svh;*/
min-width: 30svh;
& h1 {
color: white;
grid-area: header;
margin: 10px 25%;
font-size: xx-large;
text-align: center;
border-bottom: #1e1e1e solid 2px;
}
}
#trailFragContent {
margin: 0;
padding: 0;
display: flex;
overflow: hidden;
& img {
border-radius: 10px;
border: black solid 1px;
margin: 1%;
flex: 1 1;
width: 30%;
min-height: 30svh;
}
& p {
color: white;
flex: 1 1;
padding-top: 5px;
padding-left: 10px;
width: 60%;
border-left: solid darkgrey 2px;
}
}
function updateOutputTrail(id) { function updateOutputTrail(id) {
/* Updates the trail being shown on screen to the one requested by ID */ /* Updates the trail being shown on screen to the one requested by ID */
$.get("/allTrails/" + id).done(function (fragment) { $.get("/allTrails/" + id).done(function (fragment) {
$("#trailInfoBox").html(fragment) $("#trailInfoContainer").html(fragment)
}); });
updateSelectedTrail(id); updateSelectedTrail(id);
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
<main> <main>
<section id="allTrailsBar" class="centerFlex"> <section id="allTrailsBar" class="centerFlex">
<!--TODO add rest of page-->
<img class="trailsImages" <img class="trailsImages"
th:each="trail : ${trails}" th:each="trail : ${trails}"
th:src="@{${trail.getImgPath()}}" th:src="@{${trail.getImgPath()}}"
...@@ -21,7 +20,12 @@ ...@@ -21,7 +20,12 @@
th:id="'img' + ${trail.getId()}" th:alt="${trail.getName()}" th:id="'img' + ${trail.getId()}" th:alt="${trail.getName()}"
> >
</section> </section>
<section id="trailInfoBox"></section>
<section id="trailInfoContainer">
</section>
</main> </main>
<footer th:replace="towns/templates.server/Templating.html:: footerBlock"></footer> <footer th:replace="towns/templates.server/Templating.html:: footerBlock"></footer>
......
test
\ No newline at end of file
<section th:fragment="trailSection" class="trailInfoBox"> <article th:fragment="trailSection" class="trailInfoFrag">
<h1 th:text="${searchList.getName()}"></h1> <h1 th:text="${trail.getName()}"></h1>
<p th:text="${searchList.getDescription()}"></p>
<div id="trailFragContent">
<img th:src="@{${trail.getImgPath()}}" th:alt="${trail.getName()} ">
<p th:text="${trail.getDescription()}"></p>
</div>
<!--TODO add more to this fragment and then add styling to it--> <!--TODO add more to this fragment and then add styling to it-->
</section> </article>
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