diff --git a/src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java b/src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java index 381ccf04293b752f03e2eb743ba820c186b277dd..f9ceacf15728a5f7cdf9b36c2577dbb1aa0c7624 100644 --- a/src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java +++ b/src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java @@ -18,11 +18,10 @@ public class Landmarks { // Initialized object to getID from trail. //Predefined Landmark for Dragons Tale. - public static List<Landmarks> landmarksDragonstrail = List.of( + private static List<Landmarks> landmarksDragonstrail = List.of( new Landmarks( 1, "A scent of...Dragon", "The Dragon has been spotted near by, find the QR code to continue" , "Start your discovery, at the sweet shop."), new Landmarks( 2, "They've been found!", "Don't let them escape, find the next QR code to continue!", "Location test") ); - private Integer trailID; private int landmarkID; @NotEmpty(message = "You must type in a username.") @@ -34,6 +33,10 @@ public class Landmarks { private String landmarkLocation; private String landmarkPicture; + public static List<Landmarks> getLandmarksDragonstrail() { + return landmarksDragonstrail; + } + // Constructor for List above. public Landmarks( int landmarkID, String landmarkName, String landmarkDescription, String landmarkLocation) { this.landmarkID = landmarkID; diff --git a/src/main/java/Team5/SmartTowns/trails/Trail.java b/src/main/java/Team5/SmartTowns/trails/Trail.java index efc9e125af8f94a79e29c21e1de4b1cdf3d5a503..a7067f83758ce0904851b89a51880dc9782da104 100644 --- a/src/main/java/Team5/SmartTowns/trails/Trail.java +++ b/src/main/java/Team5/SmartTowns/trails/Trail.java @@ -14,6 +14,7 @@ public class Trail { new Trail(4,"Trail4", "This is trail four"), new Trail(5,"A Dragon's Tale", "EDITING THIS") ); + int id; String name; String description; diff --git a/src/main/java/Team5/SmartTowns/trails/TrailsController.java b/src/main/java/Team5/SmartTowns/trails/TrailsController.java index 0b9b8f6c7f241a88b31b38598378fe1ab1b6ab4c..c91c7abb4f64270f948d4313070adf47b08c07c8 100644 --- a/src/main/java/Team5/SmartTowns/trails/TrailsController.java +++ b/src/main/java/Team5/SmartTowns/trails/TrailsController.java @@ -13,7 +13,7 @@ import org.springframework.web.servlet.ModelAndView; import java.util.ArrayList; import java.util.List; -import static Team5.SmartTowns.Landmarks.Landmarks.landmarksDragonstrail; +import static Team5.SmartTowns.Landmarks.Landmarks.getLandmarksDragonstrail; @Controller public class TrailsController { @@ -40,11 +40,21 @@ public class TrailsController { @GetMapping("/dragonstale") public ModelAndView getDragonsTale(){ - List<Landmarks> landmarksList = landmarksDragonstrail; + List<Landmarks> landmarksList = getLandmarksDragonstrail(); + Landmarks landmarks = new Landmarks(); + int listSize = landmarksList.size(); ModelAndView modelAndView = new ModelAndView("towns/trails/dragonstale/index"); modelAndView.addObject("landmarksList", landmarksList); + modelAndView.addObject("getListSize", listSize); return modelAndView; } +// @GetMapping("/dragonstale/{landmarks}") +// public ModelAndView getDragonstaleLandmarks(){ +// ModelAndView modelAndView = new ModelAndView(); +// modelAndView.addObject() +// } + + } diff --git a/src/main/resources/static/css/dragonstaless.css b/src/main/resources/static/css/dragonstaless.css index 69503719953005705fd789f816766664caa2d3d2..2f456a23299e5296a53d8c37f48d93345fe84a9a 100644 --- a/src/main/resources/static/css/dragonstaless.css +++ b/src/main/resources/static/css/dragonstaless.css @@ -8,10 +8,19 @@ background-color: #927BB7; } -#homeimg.centre{ - box-shadow: 100px -100px purple; +.landmarkName{ + font-weight: bold; + text-align: left; +} + +.landmarkDesc{ + font-style: italic; + text-align: left; } body{ - background-color: #927BB7; -} \ No newline at end of file + background-color: #E8A87C; +} + + + diff --git a/src/main/resources/static/scripts/qrCode.js b/src/main/resources/static/scripts/qrCode.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/resources/templates/towns/trails/dragonstale/index.html b/src/main/resources/templates/towns/trails/dragonstale/index.html index 21ef46b042f44eaf03bdb47075245e8d9b6a895d..80aa32934673ddca22af19a7f7772a378ce9c774 100644 --- a/src/main/resources/templates/towns/trails/dragonstale/index.html +++ b/src/main/resources/templates/towns/trails/dragonstale/index.html @@ -5,14 +5,16 @@ <title>A Dragon's Tale</title> <link rel="stylesheet" th:href="@{/css/dragonstaless.css}"> <link rel="stylesheet" th:href="@{/css/templatingstyle.css}"> + <script src="./node_modules/html5-qrcode/html5-qrcode.min.js"></script> </head> <body> <header th:insert="towns/Templating.html :: header"></header> + <!-- As this predefined trail will be accessible from multiple different towns, this thymeleaf element will display the town the user is currently trying to access and display it accordingly. <span th:text="${townName}"> --> <div class="centre"> <h1> Welcome, to a dragon's tale! </h1> <img th:src="@{/images/trails/dragonstalehome.png}" alt="Image of a dragon" id="homeimg"> - <h2> Discover the mystery of the dragon, track its location and follow it throughout the town of (thymeleaf element) to discover a prize! </h2> + <h2> Discover the mystery of the dragon, track its location and follow it throughout the town of to discover a prize! </h2> </div> <div class="centre"> @@ -22,15 +24,28 @@ </p> </div> + + <!-- tabs --> <div class="centre"> - <ul th:each="item : ${landmarksList}"> - <p th:text="${item.landmarkName}"></p> - <p th:text="${item.landmarkDescription}"></p> + <h2>There are <span th:text="${getListSize}"> Size of List </span> adventures in this journey! </h2> + <ul th:each="item : ${landmarksList}" id="tabBox"> + <li> + <a id="tabIdCounter" href="#landmarkTabLink" th:text="${item.landmarkName}"> Landmark Tab</a> + </li> </ul> </div> + + <!-- Need to mark each element to an ID then loop through them. --> + <div class="centre" id="listOfLandmarks"> + <p th:each="item : ${landmarksList}"> + <span th:text="${item.landmarkDescription}" class="landmarkDesc" id="landmarkTabLink"> Landmark Description</span> + </p> + </div> + + <!-- If use is starting their journey, this will display begin. If not, they'll continue their journey. <span th:text="${beginOrContinue}"> --> <div class="centre"> - <h3>Begin your hunt!</h3> + <h3> Begin or Continue your hunt!</h3> <button type="button" id="begin">Click here!</button> </div> diff --git a/src/main/resources/templates/towns/trails/welshhistory/welshhistory.html b/src/main/resources/templates/towns/trails/welshhistory/welshhistory.html deleted file mode 100644 index 9a4ae9e885b177cdaa5d12ef77ae9f52ec72f071..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/towns/trails/welshhistory/welshhistory.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>The Roman Empire</title> -</head> -<body> - -</body> -</html> \ No newline at end of file