diff --git a/src/main/java/Team5/SmartTowns/trails/Trail.java b/src/main/java/Team5/SmartTowns/trails/Trail.java index 81a8298177efc622eafff53e297eda6600cf5dd1..a80755867991c82eb90b21fcb33f563294ab44b2 100644 --- a/src/main/java/Team5/SmartTowns/trails/Trail.java +++ b/src/main/java/Team5/SmartTowns/trails/Trail.java @@ -12,7 +12,7 @@ public class Trail { new Trail(2,"Trail2", "This is trail two"), new Trail(3,"Trail3", "This is trail three"), new Trail(4,"Trail4", "This is trail four"), - new Trail(5,"Trail5", "EDITING THIS") + new Trail(5,"Trail5", "This trail is an example of a trail that does not have an image") ); int id; String name; diff --git a/src/main/resources/static/css/allTrails.css b/src/main/resources/static/css/allTrails.css index 1b441111518afb14cea3c1d1debe553ad32d941f..ab706c5ba8ee5925faf8c774e1ec8711ffab4674 100644 --- a/src/main/resources/static/css/allTrails.css +++ b/src/main/resources/static/css/allTrails.css @@ -4,37 +4,40 @@ body { background-color: rgb(41, 41, 41); margin: 0; + display: flex; + flex-direction: column; + min-height: 100svh; } main { } + .centerFlex { display: flex; justify-content: center; } #allTrailsBar { - padding:0; - max-width: 80%; - height: 11svh; - margin: 1svh auto; + width: 100%; + height: auto; + /*margin: 1svh auto;*/ + padding: 0 5svh; display: flex; - justify-content: space-between; - /*border-bottom: solid grey 2px;*/ - /*border-top: solid grey 4px;*/ + flex-wrap: wrap; + justify-content: space-evenly; } .trailsImages { - margin: auto; - height: 10svh; - width: 10svh; + margin: 1svh auto; + height: 12svh; + width: auto; border-radius: 20px; border: solid grey 2px; transition: 0.5s ease-out 100ms; - + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.85); } + .trailsImages:hover { box-shadow: 0 0 20px 10px #bbbb00; transform: scale(1.2,1.2); - !important; overflow: visible; } .selected { @@ -49,10 +52,8 @@ main { } #trailInfoContainer { - margin: auto; - width: 95svw; - min-height: 40svh; - min-width: 30svw; + + overflow: scroll; } .trailInfoFrag { @@ -60,62 +61,74 @@ main { border: #000000 solid 2px; border-radius: 10px; box-shadow: 0 5px 20px 0 #000000; - margin:0; - padding:0; + margin: 2svh auto; + padding-bottom: 2svw; + width: 70vw; + height: auto; + min-height: 30svh; animation: fadeIn 3s; - overflow: hidden; - display: flex; - flex-direction: column; - min-width: 30svh; - & h1 { - color: white; + display: grid; + grid-template-areas: + "header header header" + "image text text"; + grid-template-columns: 30% 30% auto; + grid-template-rows: 10% auto; + grid-column-gap: 2vw; + grid-row-gap: 2svh; + & .trailInfoHeader { grid-area: header; - margin: 10px 25%; - font-size: xx-large; - text-align: center; - border-bottom: #1e1e1e solid 2px; - } -} + width: 100%; + height: 100%; + margin-top: 1svh; + padding: 0; + & h1 { + color: white; + padding:0; + margin:0 25%; + font-size: 2vw; + text-align: center; + box-shadow: 0 10px 10px -10px black; + } -#trailFragContent { - margin: 0; - padding: 0; - display: flex; - overflow: hidden; - min-height: 40svh; - max-height: 60svh; + } & img { + grid-area: image; border-radius: 10px; border: black solid 1px; - margin: 1%; - flex: 1 1; - - min-width: 20%; - max-width: 40%; - min-height: 20svh; - max-height: 90%; - overflow: hidden; + margin-left: 2vw; + margin-right: 2vw; + width: 100%; + height: auto; + box-shadow: 0 10px 20px -10px black; } & p { + grid-area: text; color: white; - flex: 1 1; - padding: 5%; - width: 60%; - border-left: solid darkgrey 2px; - font-size: x-large; + margin: 0; + padding: 0 2vw; + font-size: 1.3vw; text-align: justify; text-justify: inter-character; line-height: 1.5; + width: fit-content; + height: fit-content; + overflow: scroll; + } } +#trailFragContent { + margin: 0; + padding: 0; + display: flex; + min-height: 40svh; + flex-wrap: wrap; + +} + header { box-shadow: #1e1e1e 0 0 10px 10px; + font-size: 1vw; } - -footer { - position: relative; - bottom: 0; -} \ No newline at end of file diff --git a/src/main/resources/static/css/templatingstyle.css b/src/main/resources/static/css/templatingstyle.css index 7f975776b3acca318e9eee9d1e30d7bde4ea09d9..1ffc84d486810f03102e4a7534aa5d088c97bab0 100644 --- a/src/main/resources/static/css/templatingstyle.css +++ b/src/main/resources/static/css/templatingstyle.css @@ -3,13 +3,11 @@ border-bottom: 2px rgb(230, 230, 230) solid; margin-bottom: 20px; display: flex; - background: blueviolet; + background-color: rgb(84, 33, 128); } /* Navbar Links */ .navBar { - margin-top: 50px; - margin-left: auto; - margin-right:20px; + margin: 2svh 1vw 2svh auto; text-align: right; } .work{ @@ -61,15 +59,18 @@ /* Footer */ footer { - margin-top:20px; + margin-top:auto; display: flex; justify-content: center; + background-color: rgb(84, 33, 128); + border-top: 2px rgb(230, 230, 230) solid; + font-size: 1vw; } .footerBar{ - border-top: 2px rgb(230, 230, 230) solid; + text-align: left; display: flex; - background: blueviolet; + color: rgb(255, 255, 255); padding-left: 30px; } diff --git a/src/main/resources/static/images/trails/trail2.jpg b/src/main/resources/static/images/trails/trail2.jpg index 31e14eae5ac6e1132c33b7161dc2bc5e30c90dcf..683d275abb6772456d55082eb4940d0e606bf5f6 100644 Binary files a/src/main/resources/static/images/trails/trail2.jpg and b/src/main/resources/static/images/trails/trail2.jpg differ diff --git a/src/main/resources/static/images/trails/trail3.jpg b/src/main/resources/static/images/trails/trail3.jpg index 84763490556a7e758d2d56e8b649e051bd7a770d..f02b15249a3f0e2158023b8a98c8bf67fcc272c8 100644 Binary files a/src/main/resources/static/images/trails/trail3.jpg and b/src/main/resources/static/images/trails/trail3.jpg differ diff --git a/src/main/resources/static/images/trails/trail4.jpg b/src/main/resources/static/images/trails/trail4.jpg index c2b43e3a3488a4b4c7105948c4a9903bd15915e0..c8c405e4f332a4f9b495c98ecbac7988b2b27cda 100644 Binary files a/src/main/resources/static/images/trails/trail4.jpg and b/src/main/resources/static/images/trails/trail4.jpg differ diff --git a/src/main/resources/static/images/trails/trailNotFound.jpg b/src/main/resources/static/images/trails/trailNotFound.jpg index dc106d5033650fe232b4f01d8914a163c4462c75..9fd46288f31cf61cbce2d58244e69b908cf727c1 100644 Binary files a/src/main/resources/static/images/trails/trailNotFound.jpg and b/src/main/resources/static/images/trails/trailNotFound.jpg differ diff --git a/src/main/resources/static/scripts/allTrails.js b/src/main/resources/static/scripts/allTrails.js index 0e5132a7453bee04a1eed08dbcdb5401a68b72f7..e62cd3bbedf582442bf20874e9f877949935db0d 100644 --- a/src/main/resources/static/scripts/allTrails.js +++ b/src/main/resources/static/scripts/allTrails.js @@ -1,7 +1,7 @@ function updateOutputTrail(id) { /* Updates the trail being shown on screen to the one requested by ID */ $.get("/allTrails/" + id).done(function (fragment) { - $("#trailInfoContainer").html(fragment) + $(".trailInfoFrag").replaceWith(fragment); }); updateSelectedTrail(id); } diff --git a/src/main/resources/templates/allTrails/allTrails.html b/src/main/resources/templates/allTrails/allTrails.html index 669020d15507bfcaeb8ca959df108269222ba8ec..746762b68f64b62190bf71e102edf0ff309772d9 100644 --- a/src/main/resources/templates/allTrails/allTrails.html +++ b/src/main/resources/templates/allTrails/allTrails.html @@ -2,6 +2,7 @@ <html lang="en"> <head> <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>All Trails</title> <link rel="stylesheet" th:href="@{css/allTrails.css}"> <link rel="stylesheet" th:href="@{css/templatingstyle.css}"> @@ -21,9 +22,12 @@ > </section> - <section id="trailInfoContainer"> - <h1 class="centerFlex">Please select your trail</h1> - <!--Loaded from thymeleaf--> + <section id="trailInfoContainer" class="trailInfoFrag"> + <!--All this section is loaded from thymeleaf, based on what tail is selected + in the #allTrailsBar --> + <div class="trailInfoHeader"> + <h1 class="centerFlex">Please select your trail</h1> + </div> </section> </main> diff --git a/src/main/resources/templates/fragments/allTrailsFrags.html b/src/main/resources/templates/fragments/allTrailsFrags.html index fc4da1492b07e6d7f3004a95554aeae13cf58bcb..7f7f41dba9f99ce028118a4b4da502a6039d6f2d 100644 --- a/src/main/resources/templates/fragments/allTrailsFrags.html +++ b/src/main/resources/templates/fragments/allTrailsFrags.html @@ -1,11 +1,7 @@ <article th:fragment="trailSection" class="trailInfoFrag"> - <h1 th:text="${trail.getName()}"></h1> - - <div id="trailFragContent"> - <img th:src="@{${trail.getImgPath()}}" th:alt="${trail.getName()} "> - <p th:text="${trail.getDescription()}"></p> + <div class="trailInfoHeader"> + <h1 th:text="${trail.getName()}"></h1> </div> - - - <!--TODO add more to this fragment and then add styling to it--> + <img th:src="@{${trail.getImgPath()}}" th:alt="${trail.getName()} "> + <p id="trailDesc" th:text="${trail.getDescription()}"></p> </article>