diff --git a/build.gradle b/build.gradle index 0bdcc02bb2a5367c58f9bb20ef3f61c21057242b..cb5f573cc10ea35ff24ce651c551df82c32873e7 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.1.5' id 'io.spring.dependency-management' version '1.1.3' + id "com.github.node-gradle.node" version "7.0.1" } group = 'Team.5' @@ -26,7 +27,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-jdbc' implementation 'org.mariadb.jdbc:mariadb-java-client:2.1.2' - testImplementation 'junit:junit:4.13.1' + implementation 'org.springframework.boot:spring-boot-starter-security' + testImplementation 'junit:junit:4.13.1' compileOnly 'org.projectlombok:lombok' testImplementation 'org.projectlombok:lombok:1.18.28' compileOnly 'org.projectlombok:lombok' @@ -34,12 +36,23 @@ dependencies { annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6:3.1.1.RELEASE' + // https://mvnrepository.com/artifact/org.webjars/openlayers + implementation group: 'org.webjars', name: 'openlayers', version: '5.2.0' } tasks.named('bootBuildImage') { builder = 'paketobuildpacks/builder-jammy-base:latest' } +test { + useJUnitPlatform() +} tasks.named('test') { useJUnitPlatform() } + +task myScript(type: NodeTask) { + script = file('src/main/resources/static/scripts/mapAPI.js') +} diff --git a/src/main/java/Team5.Smarttowns/Data/Towns.db b/src/main/java/Team5.Smarttowns/Data/Towns.db deleted file mode 100644 index 2532550d9acf4d8abc21a6e6ed89629908b72a3e..0000000000000000000000000000000000000000 Binary files a/src/main/java/Team5.Smarttowns/Data/Towns.db and /dev/null differ diff --git a/src/main/java/Team5/SmartTowns/Data/locationRepository.java b/src/main/java/Team5/SmartTowns/Data/locationRepository.java deleted file mode 100644 index 822a18cb860654694734c7f591cbb5b216eb8a39..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/Data/locationRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -//Holds locations data repository (landmarks) -package Team5.SmartTowns.Data; - -import java.util.List; - - -public interface locationRepository { - List<Location> getAllLocation(); - void addLocation(Location loc); - - -} diff --git a/src/main/java/Team5/SmartTowns/Data/locationRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/Data/locationRepositoryJDBC.java deleted file mode 100644 index a5e79d4442d540f5dba67ee7f2b6217984044ebb..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/Data/locationRepositoryJDBC.java +++ /dev/null @@ -1,42 +0,0 @@ -//Implements the locations repository using JDBC -package Team5.SmartTowns.Data; - -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class locationRepositoryJDBC implements locationRepository { - private JdbcTemplate jdbc; - private RowMapper<Location> locationMapper; - - public locationRepositoryJDBC(JdbcTemplate aJdbc) { - this.jdbc = aJdbc; - setlocationMapper(); - } - private void setlocationMapper(){ - locationMapper = (rs, i) -> new Location( - - rs.getString("locationName"), - rs.getString("locationEmail"), - rs.getString("locationDescription"), - rs.getString("locationPlace"), - rs.getInt("locationTrailID") - ); - } - public List<Location> getAllLocation(){ - String sql= "SELECT * FROM locations"; - return jdbc.query(sql, locationMapper); - } - - @Override // intended implementation at current: user data from templates/Landmarks/LandmarkFormTh.html is added to the Location table - public void addLocation(Location loc) { - String sql = "insert into locations( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) values (?,?,?,?,?)"; - - jdbc.update(sql,loc.getLocationName(),loc.getLocationEmail(),loc.getLocationDescription(),loc.getLocationPlace(),loc.getLocationTrailID()); - } - - -} diff --git a/src/main/java/Team5/SmartTowns/Data/trail.java b/src/main/java/Team5/SmartTowns/Data/trail.java deleted file mode 100644 index 86e78b96712ecf7a5756edbf20a4bae35839ca70..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/Data/trail.java +++ /dev/null @@ -1,12 +0,0 @@ -//Holds variable data for the trails table -package Team5.SmartTowns.Data; - -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class trail { - private int trailsId; - private String name; -} diff --git a/src/main/java/Team5/SmartTowns/Data/trailsRepository.java b/src/main/java/Team5/SmartTowns/Data/trailsRepository.java deleted file mode 100644 index 52d8dc39b9bda0a7390f06afca8769a5fd0607a9..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/Data/trailsRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -//Holds trails data repository -package Team5.SmartTowns.Data; - -import java.util.List; - -public interface trailsRepository { - List<trail> getAllTrails(); -} diff --git a/src/main/java/Team5/SmartTowns/Data/trailsRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/Data/trailsRepositoryJDBC.java deleted file mode 100644 index 58aa84a95b00b8f8b5d7f97d240e04f405d2ac3b..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/Data/trailsRepositoryJDBC.java +++ /dev/null @@ -1,28 +0,0 @@ -//Implements the trails repository using JDBC -package Team5.SmartTowns.Data; - -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class trailsRepositoryJDBC implements trailsRepository{ - private JdbcTemplate jdbc; - private RowMapper<trail> trailMapper; - public trailsRepositoryJDBC(JdbcTemplate aJdbc){ - this.jdbc = aJdbc; - settrailsMapper(); - } - private void settrailsMapper(){ - trailMapper = (rs, i) -> new trail( - rs.getInt("trailID"), - rs.getString("name") - ); - } - public List<trail> getAllTrails(){ - String sql= "SELECT * FROM trails"; - return jdbc.query(sql, trailMapper); - } -} diff --git a/src/main/java/Team5/SmartTowns/Towns/TownStorage.java b/src/main/java/Team5/SmartTowns/Towns/TownStorage.java deleted file mode 100644 index d2d99ea992086630324fa131ad5bb410acd3c425..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/Towns/TownStorage.java +++ /dev/null @@ -1,44 +0,0 @@ -package Team5.SmartTowns.Towns; - -import java.util.ArrayList; -import java.util.List; - -public class TownStorage { - private List<Towns> townList; - private static TownStorage singleton; - - TownStorage() { - townList = new ArrayList<>(); - townList.addAll( - List.of( - new Towns("Caerphilly",01,3,70,"/images/CaerphillyCastle.jpg"), - new Towns("Risca",02,2,34,"/images/RiscaBanner.jpg"), - new Towns("Penarth",03,5,0,"/images/PenarthBanner.jpg"), - new Towns("Penarth",03,5,50,"/images/PenarthBanner.jpg"), - new Towns("Caerphilly",01,3,70,"/images/CaerphillyCastle.jpg"), - new Towns("Risca",02,2,90,"/images/RiscaBanner.jpg"), - new Towns("Penarth",03,5,100,"/images/PenarthBanner.jpg") - - - - ) - - ); - - } - public static TownStorage getInstance() { - if (singleton == null) { - singleton = new TownStorage(); - - } - return singleton; - } - - public List<Towns> getTownList() { - return townList; - } - - - - -} diff --git a/src/main/java/Team5/SmartTowns/Data/DatabaseController.java b/src/main/java/Team5/SmartTowns/data/DatabaseController.java similarity index 53% rename from src/main/java/Team5/SmartTowns/Data/DatabaseController.java rename to src/main/java/Team5/SmartTowns/data/DatabaseController.java index 0d38e955dd0a2e38e9585e5560d1cd4b6df83033..5b5d5ac4fa54cf3f0801b4fad4d8e1b9304cc9f1 100644 --- a/src/main/java/Team5/SmartTowns/Data/DatabaseController.java +++ b/src/main/java/Team5/SmartTowns/data/DatabaseController.java @@ -1,27 +1,27 @@ -package Team5.SmartTowns.Data; +package Team5.SmartTowns.data; -import Team5.SmartTowns.users.User; -import Team5.SmartTowns.users.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.servlet.ModelAndView; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; import java.util.*; + @Controller public class DatabaseController { - @Autowired - private locationRepository locationRepository; + private LocationRepository locationRepository; @Autowired - private trailsRepository trailsRepository; - + private TrailsRepository trailsRepository; @GetMapping("/trailList") public ModelAndView trailList() { ModelAndView mav1 = new ModelAndView("towns/trailsData"); - List<trail> trail = trailsRepository.getAllTrails(); + List<Trail> trail = trailsRepository.getAllTrails(); mav1.addObject("trails", trail); return mav1; } @@ -32,4 +32,17 @@ public class DatabaseController { mav2.addObject("location", Locations); return mav2; } + +// +// public List<Location> approvedLocations(){ +// List<Location> locations = locationRepository.getAllLocation(); +// List<Location> locationApprovalList; +//// for (int i=0;i<locations.size();i++){ +//// location +// for (Location loc :locations){ +// if (loc.isLocationApproved()) { +// locationApprovalList.add(loc); +// } +// } return locationApprovalList; +// } } diff --git a/src/main/java/Team5/SmartTowns/Data/Location.java b/src/main/java/Team5/SmartTowns/data/Location.java similarity index 50% rename from src/main/java/Team5/SmartTowns/Data/Location.java rename to src/main/java/Team5/SmartTowns/data/Location.java index 01ba2932c6b7d0a6201aa8128161bf7ad8b27526..760f37c205f31e28189ded51dfce28f5b451687f 100644 --- a/src/main/java/Team5/SmartTowns/Data/Location.java +++ b/src/main/java/Team5/SmartTowns/data/Location.java @@ -1,5 +1,5 @@ //Holds variable data for the locations table (landmarks) -package Team5.SmartTowns.Data; +package Team5.SmartTowns.data; import lombok.AllArgsConstructor; import lombok.Data; @@ -11,7 +11,13 @@ public class Location { private String locationEmail; private String locationDescription; private String locationPlace; - private int locationTrailID; + private String locationTrailID; + + private boolean locationApproved; + + public Location() { + + } @Override public String toString() { @@ -21,6 +27,7 @@ public class Location { locationDescription + '\'' + locationPlace + '\'' + locationTrailID + + locationApproved+ '}'; } @@ -40,9 +47,36 @@ public class Location { return locationPlace; } - public int getLocationTrailID() { + public String getLocationTrailID() { return locationTrailID; } + public boolean isLocationApproved() { + return locationApproved; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public void setLocationEmail(String locationEmail) { + this.locationEmail = locationEmail; + } + + public void setLocationDescription(String locationDescription) { + this.locationDescription = locationDescription; + } + + public void setLocationPlace(String locationPlace) { + this.locationPlace = locationPlace; + } + + public void setLocationTrailID(String locationTrailID) { + this.locationTrailID = locationTrailID; + } + + public void setLocationApproved(boolean locationApproved) { + this.locationApproved = locationApproved; + } } diff --git a/src/main/java/Team5/SmartTowns/data/LocationRepository.java b/src/main/java/Team5/SmartTowns/data/LocationRepository.java new file mode 100644 index 0000000000000000000000000000000000000000..cbc980a816f339bae030bd1848d26c34d2376670 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/LocationRepository.java @@ -0,0 +1,22 @@ +//Holds locations data repository (landmarks) +package Team5.SmartTowns.data; + +import java.util.List; + + +public interface LocationRepository { + List<Location> getAllLocation(); + void addLocation(Location loc); + + + List<Location> getAllApprovedLocations(); + +// List<Location> getApprovedLocations2(List<Location> list); + + List<Location> getAllUnapprovedLocations(); + + +// List<Location> approvedLocations(); + + +} diff --git a/src/main/java/Team5/SmartTowns/data/LocationRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/data/LocationRepositoryJDBC.java new file mode 100644 index 0000000000000000000000000000000000000000..457366e8caa54f63f2b18011231a99c600753caa --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/LocationRepositoryJDBC.java @@ -0,0 +1,130 @@ +//Implements the locations repository using JDBC +package Team5.SmartTowns.data; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + +import java.util.ArrayList; +import java.util.List; + +@Repository +public class LocationRepositoryJDBC implements LocationRepository { + private JdbcTemplate jdbc; + private RowMapper<Location> locationMapper; + + public LocationRepositoryJDBC(JdbcTemplate aJdbc) { + this.jdbc = aJdbc; + setlocationMapper(); + } + +// public LocationRepositoryJDBC() { +// JdbcTemplate ajdbc = new JdbcTemplate(); +// this.jdbc =ajdbc; +// setlocationMapper(); +// +// } + + + private void setlocationMapper(){ + locationMapper = (rs, i) -> new Location( + + rs.getString("locationName"), + rs.getString("locationEmail"), + rs.getString("locationDescription"), + rs.getString("locationPlace"), + rs.getString("locationTrailID"), + rs.getBoolean("locationApproved") + ); + } + public List<Location> getAllLocation(){ + String sql= "SELECT * FROM locations"; + return jdbc.query(sql, locationMapper); + } +// public LocationRepositoryJDBC() { +// JdbcTemplate ajdbc = new JdbcTemplate(); +// this.jdbc =ajdbc; +// setlocationMapper(); +// +// } +// public LocationRepositoryJDBC(JdbcTemplate jdbc, RowMapper<Location> locationMapper) { +// this.jdbc = jdbc; +// this.locationMapper = locationMapper; +// } + + @Override + public List<Location> getAllApprovedLocations(){ + String sql= "SELECT * FROM locations"; + List<Location> lis = jdbc.query(sql, locationMapper); + List<Location> lisFiltered = new ArrayList<>(); + for (Location li : lis){ + if (li.isLocationApproved()){ + lisFiltered.add(li); + } + } + return lisFiltered; + } + + @Override + public List<Location> getAllUnapprovedLocations(){ + String sql= "SELECT * FROM locations"; + List<Location> lis = jdbc.query(sql, locationMapper); + List<Location> lisFiltered = new ArrayList<>(); + for (Location li : lis){ + if (!li.isLocationApproved()){ + lisFiltered.add(li); + } + } + return lisFiltered; + } + + @Override // intended implementation at current: user data from templates/Landmarks/LandmarkFormTh.html is added to the Location table + public void addLocation(Location loc) { + String sql = "insert into locations( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) values (?,?,?,?,?,?)"; + + jdbc.update(sql,loc.getLocationName(),loc.getLocationEmail(),loc.getLocationDescription(),loc.getLocationPlace(),loc.getLocationTrailID(), false); + } + +// @Override +// public List<Location> getApprovedLocations(){ +// JdbcTemplate jdbc = new JdbcTemplate(); +// List<Location> locations = new LocationRepositoryJDBC(jdbc).getAllLocation(); +// List<Location> locationApprovalList= new ArrayList<Location>(); +// for (Location loc :locations){ +// if (loc.isLocationApproved()) { +// locationApprovalList.add(loc); +// } +// } return locationApprovalList; +// } +// +// @Override +// public List<Location> getApprovedLocations2(List<Location> list){ +// +// List<Location> locationApprovalList= new ArrayList<Location>(); +// for (Location loc :list){ +// if (loc.isLocationApproved()) { +// locationApprovalList.add(loc); +// } +// } return locationApprovalList; +// } +// + + +// @Override +// public List<Location> getUnapprovedLocations(){ +// List<Location> locations = getAllLocation(); +// List<Location> locationUnapprovedList= new ArrayList<Location>(); +// for (Location loc :locations){ +// if (!loc.isLocationApproved()) { +// locationUnapprovedList.add(loc); +// } +// } return locationUnapprovedList; +// } + + +// public JdbcTemplate getJdbc() { +// return jdbc; +// } + + +} diff --git a/src/main/java/Team5/SmartTowns/data/Main.java b/src/main/java/Team5/SmartTowns/data/Main.java new file mode 100644 index 0000000000000000000000000000000000000000..8f2a890b66299d6c3662b6bd7e68c6d897792847 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/Main.java @@ -0,0 +1,16 @@ +//package Team5.SmartTowns.Data; +// +//import org.springframework.beans.factory.annotation.Autowired; +// +//import java.util.List; +// +//public class Main { +// @Autowired +// private locationRepository locationRepository; +// List<Location> approvedNumber= locationRepository.approvedLocations(); +// public static void main(String[] args) { +// for (Location loc: approvedNumber){} +// +// +// } +//} diff --git a/src/main/java/Team5/SmartTowns/data/MockUser.java b/src/main/java/Team5/SmartTowns/data/MockUser.java new file mode 100644 index 0000000000000000000000000000000000000000..344dbbd77e6aeba32c362c4955c87464125ab0e4 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/MockUser.java @@ -0,0 +1,16 @@ +package Team5.SmartTowns.data; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; + +import java.util.List; + +public class MockUser { + + private JdbcTemplate jdbc; + private RowMapper<Trail> trailMapper; + public List<Trail> getAllTrails(){ + String sql= "SELECT * FROM trails"; + return jdbc.query(sql, trailMapper); + } +} diff --git a/src/main/java/Team5/SmartTowns/data/QRCodes.java b/src/main/java/Team5/SmartTowns/data/QRCodes.java new file mode 100644 index 0000000000000000000000000000000000000000..28ebf97c96d884a6629208ce8ce58505334b63b6 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/QRCodes.java @@ -0,0 +1,4 @@ +package Team5.SmartTowns.data; + +public class QRCodes { +} diff --git a/src/main/java/Team5/SmartTowns/data/Trail.java b/src/main/java/Team5/SmartTowns/data/Trail.java new file mode 100644 index 0000000000000000000000000000000000000000..f9056d64b47f0f5104216b6eb15f50f9301d843c --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/Trail.java @@ -0,0 +1,28 @@ +//Holds variable data for the trails table +package Team5.SmartTowns.data; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Trail { + private String trailsId; + private String trailName; + private String trailNumber; + + + public String getTrailsId() { + return trailsId; + } + + public String getTrailName() { + return trailName; + } + + public String getTrailNumber() { + return trailNumber; + } + + +} diff --git a/src/main/java/Team5/SmartTowns/data/TrailsRepository.java b/src/main/java/Team5/SmartTowns/data/TrailsRepository.java new file mode 100644 index 0000000000000000000000000000000000000000..7e55ce7d32a732cf645dedabf478d77dbc1b26a9 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/TrailsRepository.java @@ -0,0 +1,9 @@ +//Holds trails data repository +package Team5.SmartTowns.data; + +import java.util.List; + +public interface TrailsRepository { + List<Trail> getAllTrails(); + String getTrailNameWithID(String trailsID); +} diff --git a/src/main/java/Team5/SmartTowns/data/TrailsRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/data/TrailsRepositoryJDBC.java new file mode 100644 index 0000000000000000000000000000000000000000..695ba5b9faff496b3ee941f6cae25b40ab2996ad --- /dev/null +++ b/src/main/java/Team5/SmartTowns/data/TrailsRepositoryJDBC.java @@ -0,0 +1,39 @@ +//Implements the trails repository using JDBC +package Team5.SmartTowns.data; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public class TrailsRepositoryJDBC implements TrailsRepository { + private JdbcTemplate jdbc; + private RowMapper<Trail> trailMapper; + public TrailsRepositoryJDBC(JdbcTemplate aJdbc){ + this.jdbc = aJdbc; + settrailsMapper(); + } + private void settrailsMapper(){ + trailMapper = (rs, i) -> new Trail( + rs.getString("trailID"), + rs.getString("trailName"), + rs.getString("trailNumber") + ); + } + public List<Trail> getAllTrails(){ + String sql= "SELECT * FROM trails"; + return jdbc.query(sql, trailMapper); + } + @Override + public String getTrailNameWithID(String trailsID){ + String resultName = jdbc.queryForObject( + "SELECT trailName FROM trails WHERE trailID=?", String.class, trailsID); + return resultName; + + + } + + +} diff --git a/src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java b/src/main/java/Team5/SmartTowns/landmarks/Landmarks.java similarity index 87% rename from src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java rename to src/main/java/Team5/SmartTowns/landmarks/Landmarks.java index f9ceacf15728a5f7cdf9b36c2577dbb1aa0c7624..8f7471fcc84f95669e9a07aaa3e1f9782dc780d6 100644 --- a/src/main/java/Team5/SmartTowns/Landmarks/Landmarks.java +++ b/src/main/java/Team5/SmartTowns/landmarks/Landmarks.java @@ -1,8 +1,6 @@ -package Team5.SmartTowns.Landmarks; +package Team5.SmartTowns.landmarks; -import Team5.SmartTowns.trails.Trail; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotEmpty; import lombok.AllArgsConstructor; import lombok.Data; @@ -18,11 +16,11 @@ public class Landmarks { // Initialized object to getID from trail. //Predefined Landmark for Dragons Tale. - private static List<Landmarks> landmarksDragonstrail = List.of( + public 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 String trailID; private int landmarkID; @NotEmpty(message = "You must type in a username.") private String landmarkName; @@ -43,6 +41,4 @@ public class Landmarks { this.landmarkName = landmarkName; this.landmarkDescription = landmarkDescription; this.landmarkLocation = landmarkLocation; } - - } diff --git a/src/main/java/Team5/SmartTowns/Landmarks/LandmarksController.java b/src/main/java/Team5/SmartTowns/landmarks/LandmarksController.java similarity index 86% rename from src/main/java/Team5/SmartTowns/Landmarks/LandmarksController.java rename to src/main/java/Team5/SmartTowns/landmarks/LandmarksController.java index a94feef88935a8d3ca71f6326bdb8f44cda6dd0e..a5679aad7406be423fa165f553694ef1d02878a5 100644 --- a/src/main/java/Team5/SmartTowns/Landmarks/LandmarksController.java +++ b/src/main/java/Team5/SmartTowns/landmarks/LandmarksController.java @@ -1,7 +1,7 @@ -package Team5.SmartTowns.Landmarks; +package Team5.SmartTowns.landmarks; -import Team5.SmartTowns.Data.Location; -import Team5.SmartTowns.Data.locationRepository; +import Team5.SmartTowns.data.Location; +import Team5.SmartTowns.data.LocationRepository; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -26,7 +26,7 @@ public class LandmarksController { } @Autowired - private locationRepository locationRepository; + private LocationRepository locationRepository; @PostMapping("/landmarkSub") public ModelAndView landmarkSent(@Valid @ModelAttribute("landmarkData") Landmarks landmarks, BindingResult bindingResult, Model model ) { @@ -37,8 +37,7 @@ public class LandmarksController { } else{ // converts valid response using Location constructor into a submittable format to the sql table - Location loc= new Location(landmarks.getLandmarkName(), landmarks.getLandmarkEmail(), landmarks.getLandmarkDescription(), landmarks.getLandmarkLocation(), landmarks.getTrailID()); - System.out.println(loc); + Location loc= new Location(landmarks.getLandmarkName(), landmarks.getLandmarkEmail(), landmarks.getLandmarkDescription(), landmarks.getLandmarkLocation(), landmarks.getTrailID(), false); locationRepository.addLocation(loc); // adds valid landmark to locations table ModelAndView modelAndView = new ModelAndView("redirect:/home"); return modelAndView; diff --git a/src/main/java/Team5/SmartTowns/placeswithcoordinates/LocationsCoordinates.java b/src/main/java/Team5/SmartTowns/placeswithcoordinates/LocationsCoordinates.java new file mode 100644 index 0000000000000000000000000000000000000000..a242df3e8b84cee08f3fcdf044e550a49b111343 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/placeswithcoordinates/LocationsCoordinates.java @@ -0,0 +1,111 @@ +package Team5.SmartTowns.placeswithcoordinates; + + + +import Team5.SmartTowns.data.Location; +import Team5.SmartTowns.data.LocationRepositoryJDBC; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.jdbc.core.JdbcTemplate; + +import java.text.DecimalFormat; +import java.util.List; + +//@Data +@AllArgsConstructor +@NoArgsConstructor +public class LocationsCoordinates { + /// separate class to location to cover all locations within trails that have been approved and have long/lat coords attached for mapping. + private int locationID; + private Double locationCoordsLat; + private Double locationCoordsLong; + private JdbcTemplate jdbc; + +// public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc){ +// JdbcTemplate jdbcSuper= new LocationRepositoryJDBC().getJdbc(); +// return new LocationRepositoryJDBC(jdbcSuper).getApprovedLocations(); +// } + + + public int getLocationID() { + return locationID; + } + + public Double getLocationCoordsLong() { + return locationCoordsLong; + } + + public Double getLocationCoordsLat() { + return locationCoordsLat; + } + + public void setLocationCoordsLong(Double locationCoordsLong) { + this.locationCoordsLong = locationCoordsLong; + } + + public void setLocationCoordsLat(Double locationCoordsLat) { + this.locationCoordsLat = locationCoordsLat; + } + +// public LocationsCoordinates(JdbcTemplate aJdbc, int locationID, Double locationCoordsLat, Double locationCoordsLong) { +// super(aJdbc); +// this.locationID = locationID; +// this.locationCoordsLong = locationCoordsLong; +// this.locationCoordsLat = locationCoordsLat; +// } + +// public LocationsCoordinates(int locationID, Double locationCoordsLat, Double locationCoordsLong,JdbcTemplate jdbc) { +// super(jdbc); +// this.locationID = locationID; +// this.locationCoordsLong = locationCoordsLong; +// this.locationCoordsLat = locationCoordsLat; +// } + + +// public LocationsCoordinates(JdbcTemplate aJdbc, int locationID, Double locationCoordsLat, Double locationCoordsLong, JdbcTemplate jdbc) { +// super(aJdbc); +// this.locationID = locationID; +// this.locationCoordsLat = locationCoordsLat; +// this.locationCoordsLong = locationCoordsLong; +// this.jdbc = jdbc; +// } + + public LocationsCoordinates(int locationID, Double locationCoordsLat, Double locationCoordsLong) { + this.locationID = locationID; + this.locationCoordsLat = locationCoordsLat; + this.locationCoordsLong = locationCoordsLong; + } + +// public LocationsCoordinates(JdbcTemplate aJdbc) { +// super(aJdbc); +// } + + public List<Location> getFullListLocations(JdbcTemplate aJdbc){ +// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc); + return new LocationRepositoryJDBC(aJdbc).getAllLocation(); + } + + + +// public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc){ +// JdbcTemplate jdbcSuper= new LocationRepositoryJDBC().getJdbc(); +// return new LocationRepositoryJDBC(jdbcSuper).getApprovedLocations(); +// } +// +// public List<Location> getFullUnapprovedLocations(JdbcTemplate aJdbc){ +//// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc); +// return new LocationRepositoryJDBC(aJdbc).getUnapprovedLocations(); +// } + + + + + /// Need a constructor to create a locations list, approved collation list, unapproved locations list. + + + + + + +} diff --git a/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesController.java b/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesController.java new file mode 100644 index 0000000000000000000000000000000000000000..6511067e9e636a29d96063357df1e3c7bc4f34e6 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesController.java @@ -0,0 +1,116 @@ +package Team5.SmartTowns.placeswithcoordinates; + +import Team5.SmartTowns.data.Location; +import Team5.SmartTowns.data.LocationRepository; +import Team5.SmartTowns.data.Trail; +import Team5.SmartTowns.data.TrailsRepository; +import jakarta.validation.constraints.Max; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +import java.util.ArrayList; +import java.util.List; + +@Controller +public class PlacesController { + + @Autowired + private PlacesCoordinatesRepository placeRepo; + @Autowired + private LocationRepository locationRepo; + + @Autowired + private TrailsRepository trailsRepo; + + + @GetMapping("/checkpoints") + public ModelAndView getLocationPages(){ + ModelAndView modelAndView = new ModelAndView("landmarks/locationPage.html"); + List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords(); + List<Location> approvedLocations = locationRepo.getAllApprovedLocations(); + + modelAndView.addObject("location", approvedLocations); + modelAndView.addObject("locationCoords", locCoords); + return modelAndView; + } + + @RequestMapping(value="/location", method= RequestMethod.POST) + public String sendHtmlFragmentLocation(Model map) { + map.addAttribute("foo", "bar"); + return "checkpoint/checkpoint"; + } + + + + + @GetMapping("/checkpoints/{location}") + public ModelAndView getResultBySearchKeyLocation(@PathVariable String location) { + List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords(); + List<Location> approvedLocations = locationRepo.getAllApprovedLocations(); + + int locationID = 999; + for (int i=0;i<approvedLocations.size();i++){ + if ( (approvedLocations.get(i).getLocationName().replace(' ', '-').trim().equals(location)) ){ + locationID= i; + } + } + + String trailName=trailsRepo.getTrailNameWithID(approvedLocations.get(locationID).getLocationTrailID()).replace(' ', '-').trim(); + ModelAndView modelAndView= new ModelAndView("fragments/locationPageFrags :: locationSection"); + modelAndView.addObject("locCoord", locCoords.get(locationID)); + modelAndView.addObject("trail", trailName); + modelAndView.addObject("location", approvedLocations.get(locationID)); + return modelAndView; + } + + + + /// Trail webpage mapping + + + @GetMapping("/trails") + public ModelAndView getTrailsPage(){ + ModelAndView modelAndView = new ModelAndView("landmarks/trailsPage.html"); + List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords(); + List<Location> approvedLocations = locationRepo.getAllApprovedLocations(); + List<Trail> trailslocations = trailsRepo.getAllTrails(); + List<Location> locationCoordsWorkaround = new ArrayList<Location>(); + + modelAndView.addObject("trails", trailslocations); + modelAndView.addObject("locations", approvedLocations); + modelAndView.addObject("locationCoords", locCoords); + return modelAndView; + } + + @RequestMapping(value="/trail", method= RequestMethod.POST) + public String sendHtmlFragmentTrail(Model map) { + map.addAttribute("foo", "bar"); + return "trail/trail"; + } + + @GetMapping("/trails/{trail}") + public ModelAndView getResultBySearchKeyTrails(@PathVariable String trail) { + List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords(); + List<Location> approvedLocations = locationRepo.getAllApprovedLocations(); + List<Trail> trailslocations = trailsRepo.getAllTrails(); + int trailID = 999;// otherwise cases errors e.g. null used. 999 unlikely to be used so safe until then + for (int i=0;i<trailslocations.size();i++){ + + if (trailslocations.get(i).getTrailName().replace(' ', '-').trim().equals(trail)){ + trailID=i; + break;} + } + ModelAndView modelAndView= new ModelAndView("fragments/trailsPageFrags :: trailsSection"); + modelAndView.addObject("trail", trailslocations.get(trailID)); + modelAndView.addObject("locCoords", locCoords); + modelAndView.addObject("locations", approvedLocations); + return modelAndView; + } + +} diff --git a/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesRepository.java b/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesRepository.java new file mode 100644 index 0000000000000000000000000000000000000000..deea368752b4b41bebd49147ce2266e64d942440 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesRepository.java @@ -0,0 +1,21 @@ +package Team5.SmartTowns.placeswithcoordinates; + +import Team5.SmartTowns.data.Location; +import org.springframework.jdbc.core.JdbcTemplate; + +import java.util.List; + +public interface PlacesCoordinatesRepository { + + List<LocationsCoordinates> getAllLocationCoords(); + void addLocationCoord(LocationsCoordinates locCoord); + + List<TownWithTrails> getAllTownCoords(); + void addTownWithCoords(TownWithTrails town); + +// List<Location> getFullApprovedLocations(JdbcTemplate aJdbc); + + + + +} diff --git a/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesRepositoryJDBC.java new file mode 100644 index 0000000000000000000000000000000000000000..b90ee0b152d8734e8034e7cc33cd31585ea85fc4 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesRepositoryJDBC.java @@ -0,0 +1,548 @@ +package Team5.SmartTowns.placeswithcoordinates; + +import Team5.SmartTowns.data.Location; +import Team5.SmartTowns.data.LocationRepositoryJDBC; +import org.springframework.boot.autoconfigure.integration.IntegrationProperties; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + + +import java.util.List; +import java.util.Objects; + +@Repository +public class PlacesCoordinatesRepositoryJDBC implements PlacesCoordinatesRepository { + + + private JdbcTemplate jdbc; + private RowMapper<LocationsCoordinates> locationCoordMapper; + private RowMapper<TownWithTrails> townCoordMapper; + public PlacesCoordinatesRepositoryJDBC(JdbcTemplate aJdbc) { + this.jdbc = aJdbc; + setLocationCoordsMapper(); + setTownCoordsMapper(); + } + private void setLocationCoordsMapper(){ + locationCoordMapper = (rs, i) -> new LocationsCoordinates( + + rs.getInt("locationID"), + rs.getDouble("locationCoordsLat"), + rs.getDouble("locationCoordsLong") + + ); + } + private void setTownCoordsMapper(){ + townCoordMapper = (rs, i) -> new TownWithTrails( + + rs.getString("townName"), + rs.getString("townCentreCoordsLat"), + rs.getString("townCentreCoordsLong"), + rs.getString("townUppermostCoordsLat"), + rs.getString("townLowermostCoordsLat"), + rs.getString("townLeftmostCoordsLong"), + rs.getString("townRightmostCoordsLong") + + + ); + } + + + + public List<LocationsCoordinates> getAllLocationCoords(){ + String sql= "SELECT * FROM locationCoordinates"; + return jdbc.query(sql, locationCoordMapper); + } + + + + public List<TownWithTrails> getAllTownCoords(){ + String sql= "SELECT * FROM townswithtrails"; + return jdbc.query(sql, townCoordMapper); + } + + @Override + public void addLocationCoord(LocationsCoordinates locCoords) { + String sql = "insert into locationCoordinates(locationID, locationCoordsLat,locationCoordsLong) values (?,?,?)"; + + jdbc.update(sql,locCoords.getLocationID(), locCoords.getLocationCoordsLong(),locCoords.getLocationCoordsLat()); + + } + @Override + public void addTownWithCoords(TownWithTrails town) { + String sql = "insert into townswithtrails(townName,townCentreCoordsLat,townCentreCoordsLong,townUppermostCoordsLat,townLowermostCoordsLat,townLeftmostCoordsLong,townRightmostCoordsLong) values (?,?,?,?,?,?,?)"; + + jdbc.update(sql,town.getTownName(),town.getTownCentreCoordsLong(),town.getTownCentreCoordsLong(),town.getTownUppermostCoordsLat(),town.getTownLowermostCoordsLat(),town.getTownLeftmostCoordsLong(),town.getTownRightmostCoordsLong()); + + } + + +// public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc) { +//// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc); +// return new LocationRepositoryJDBC(aJdbc).getApprovedLocations(); +// } + +// @Override //TODO CHECK +// public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc) { +// return null; +// } + + + public boolean checkInputtedCoordsMatchTown(String inpLatCoords, String inpLongCoords, String townName){ + PlacesCoordinatesRepositoryJDBC jbdcsecond = new PlacesCoordinatesRepositoryJDBC(jdbc); + List<TownWithTrails> allTowns = jbdcsecond.getAllTownCoords(); + for (TownWithTrails town : allTowns){ + if (Objects.equals(townName, town.getTownName())){ + // check lon within boundaries + // convert values to doubles + double inpLat=Double.parseDouble(inpLatCoords); + double inpLong=Double.parseDouble(inpLongCoords); + double townBoundaryLatUppermost=Double.parseDouble(town.getTownUppermostCoordsLat()); + double townBoundaryLatLowermost=Double.parseDouble(town.getTownLowermostCoordsLat()); + + double townBoundaryLongLeftmost=Double.parseDouble(town.getTownLeftmostCoordsLong()); + double townBoundaryLongRightmost=Double.parseDouble(town.getTownRightmostCoordsLong()); + // check coords within respective town boundary (boundary decided by rough google maps red-line) + if ( (inpLat<=townBoundaryLatUppermost)&& (inpLat>=townBoundaryLatLowermost) && (inpLat<=townBoundaryLongLeftmost) && (inpLat<=townBoundaryLongRightmost)){ + // location within boundary + return true; + } else{ + System.out.println("Location outside town boundary. "); //todo scanner bad idea, add admin override? + return false; + } + + + + } + } + return true;} + int getLocationTableIDValue(List<Location> locations, String locationName){ + int index; + for(int i=0;i<locations.size();i++){ + if (Objects.equals(locations.get(i).getLocationName(), locationName)){ + index = i; + return index; + + } + } return index= Integer.parseInt(null); + + } + + + + // Method used to approve and add locations with associated coordinates. List<Location> unapprovedLocations +// public void approveLocationAndAddCoords(String locationsName, Double latCoords, Double longCoords,JdbcTemplate jdbc) { +// // need list too +// +// LocationsCoordinates jdbcTemp= new LocationsCoordinates(jdbc); +// List<Location> unapprovedLocations = jdbcTemp.getFullUnapprovedLocations(jdbc); +// List<Location> allLocations = jdbcTemp.getFullListLocations(jdbc); +// +// PlacesCoordinatesRepositoryJDBC jbdcsecond = new PlacesCoordinatesRepositoryJDBC(jdbc); +// List<TownWithTrails> allTowns = jbdcsecond.getAllTownCoords(); +// int unapporvedLocationsListIndex=99; // initialize variable to allow after if statement to run todo fix this +// for (int i=0; i<unapprovedLocations.size();i++){ // check if location exists +// if (Objects.equals(unapprovedLocations.get(i).getLocationName(), locationsName)){ +// unapporvedLocationsListIndex =i; +// break; +// +// } else if(!Objects.equals(unapprovedLocations.get(i).getLocationPlace(), locationsName)){ +// System.out.println("Error, location is not valid, please check your spelling or locations table."); +// +// return; +// } +// String toBeApprovedLocationTown=unapprovedLocations.get(unapporvedLocationsListIndex).getLocationPlace(); +// int tableLocationIDOfInputtedLocation= getLocationTableIDValue(allLocations, locationsName); +// LocationsCoordinates unapprovedLocation= new LocationsCoordinates(tableLocationIDOfInputtedLocation,latCoords, longCoords); +// boolean locationWithinTownBoundaries= checkInputtedCoordsMatchTown(Double.toString(latCoords) ,Double.toString(longCoords), toBeApprovedLocationTown); +// if (locationWithinTownBoundaries){ +// addLocationCoord(unapprovedLocation); +// return; +// +// +// } else { +// return;} +// +//// for (TownWithTrails town : allTowns){ +//// if (Objects.equals(toBeApprovedLocationTown, town.getTownName())){ +// +// +// } +// +// } + + + + + // check if location within respective town boundaries + } + + + + + + + /// if location id == unapproved location id,-> make sure coords within boundaries, -> approve and append lcoations table and add to coords table. + +// List<String> unapprovedLocationTowns = new ArrayList<String>(); +// for (int i=1;unapprovedLocations.size()>i;i++ ){ +// if (Objects.equals(unapprovedLocations.get(i).getLocationPlace(), town)){ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// } +// +//// +// // unapproved list +// // if matches name, approve +// // add long/lat coords +// //use to update table +// } +//} diff --git a/src/main/java/Team5/SmartTowns/placeswithcoordinates/TownWithTrails.java b/src/main/java/Team5/SmartTowns/placeswithcoordinates/TownWithTrails.java new file mode 100644 index 0000000000000000000000000000000000000000..b1049ffb389b893401af7e199fc771478f4317d2 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/placeswithcoordinates/TownWithTrails.java @@ -0,0 +1,51 @@ +package Team5.SmartTowns.placeswithcoordinates; + +public class TownWithTrails { + + private String townName; + private String townCentreCoordsLat; + private String townCentreCoordsLong; + private String townUppermostCoordsLat; + private String townLowermostCoordsLat; + private String townLeftmostCoordsLong; + private String townRightmostCoordsLong; + + public String getTownName() { + return townName; + } + + public String getTownCentreCoordsLat() { + return townCentreCoordsLat; + } + + public String getTownCentreCoordsLong() { + return townCentreCoordsLong; + } + + public String getTownUppermostCoordsLat() { + return townUppermostCoordsLat; + } + + public String getTownLowermostCoordsLat() { + return townLowermostCoordsLat; + } + + public String getTownLeftmostCoordsLong() { + return townLeftmostCoordsLong; + } + + public String getTownRightmostCoordsLong() { + return townRightmostCoordsLong; + } + + + public TownWithTrails(String townName, String townCentreCoordsLat, String townCentreCoordsLong, String townUppermostCoordsLat, String townLowermostCoordsLat, String townLeftmostCoordsLong, String townRightmostCoordsLong) { + this.townName = townName; + this.townCentreCoordsLat = townCentreCoordsLat; + this.townCentreCoordsLong = townCentreCoordsLong; + this.townUppermostCoordsLat = townUppermostCoordsLat; + this.townLowermostCoordsLat = townLowermostCoordsLat; + this.townLeftmostCoordsLong = townLeftmostCoordsLong; + this.townRightmostCoordsLong = townRightmostCoordsLong; + } +} diff --git a/src/main/java/Team5/SmartTowns/rewards/Badge.java b/src/main/java/Team5/SmartTowns/rewards/Badge.java index 25c231e14e3f0afdd4ecfc2d6e9f352925224097..976238804f5686bfd77e2bd028f7cc79ecf18698 100644 --- a/src/main/java/Team5/SmartTowns/rewards/Badge.java +++ b/src/main/java/Team5/SmartTowns/rewards/Badge.java @@ -1,51 +1,26 @@ /*AUTHOR: Gabriel Copat*/ package Team5.SmartTowns.rewards; -import lombok.Data; +import lombok.Getter; -import java.io.File; -import java.util.Objects; -@Data -public class Badge { +@Getter +public class Badge extends Reward { /* Badges can be earned by completing certain goals. * They are displayed in the user profile page * * For example, one might earn a badge after visiting 20 locations */ + static final String DEFAULT_IMAGE = "0.png"; - int id; - String name; - String description; - String imgPath; int difficulty; //1-5 public Badge(int id, String name, String description, int difficulty) { - this.id = id; - this.name = name; - this.description = description; + super(id, name, description); this.difficulty = difficulty; - imgPath = findImagePath(); - } - - private String findImagePath(){ - /* Finds the image in the Path folder, if image is not found assigns default image */ - String imgPath = "images/rewards/badges/" + id + ".jpg"; - String notFoundPath = "/images/rewards/badges/0.png"; - - File imgFile = new File("src/main/resources/static/" + imgPath); - return imgFile.exists() ? imgPath : notFoundPath; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Badge badge = (Badge) o; - return id == badge.id && Objects.equals(name, badge.name); } @Override - public int hashCode() { - return Objects.hash(id, name); + public String getImgFolder() { + return "badges"; } } diff --git a/src/main/java/Team5/SmartTowns/rewards/BadgesRepository.java b/src/main/java/Team5/SmartTowns/rewards/BadgesRepository.java deleted file mode 100644 index 56b1019cbe016a7c687b5ac83973679e8f498eef..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/rewards/BadgesRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -//Holds locations data repository -package Team5.SmartTowns.rewards; - -import java.util.List; - -public interface BadgesRepository { - List<Badge> getAllBadges(); -} - diff --git a/src/main/java/Team5/SmartTowns/rewards/BadgesRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/rewards/BadgesRepositoryJDBC.java deleted file mode 100644 index 7c22061e894a633bf9c047f69f575daf9366b493..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/rewards/BadgesRepositoryJDBC.java +++ /dev/null @@ -1,33 +0,0 @@ -//Implements the locations repository using JDBC -package Team5.SmartTowns.rewards; - -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class BadgesRepositoryJDBC implements BadgesRepository { - private JdbcTemplate jdbc; - private RowMapper<Badge> badgeMapper; - - public BadgesRepositoryJDBC(JdbcTemplate aJdbc) { - this.jdbc = aJdbc; - setBadgeMapper(); - } - private void setBadgeMapper(){ - badgeMapper = (rs, i) -> new Badge( - rs.getInt("badgeID"), - rs.getString("name"), - rs.getString("description"), - rs.getInt("difficulty") - ); - } - - @Override - public List<Badge> getAllBadges(){ - String sql= "SELECT * FROM badges"; - return jdbc.query(sql, badgeMapper); - } -} diff --git a/src/main/java/Team5/SmartTowns/rewards/Pack.java b/src/main/java/Team5/SmartTowns/rewards/Pack.java new file mode 100644 index 0000000000000000000000000000000000000000..ef7fe7409f6e4fdfee3494a0dc932981df2c6907 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/rewards/Pack.java @@ -0,0 +1,28 @@ +package Team5.SmartTowns.rewards; + +import lombok.Getter; + +import java.util.List; + +@Getter +public class Pack extends Reward{ + + int progression; //0-100%; + + public Pack(int id, String name, String description) { + super(id, name, description); + displayImg = super.findImagePath(); + } + + public void setProgression(List<Sticker> packStickers, List<Sticker> userStickers){ + /* Takes in a list with all stickers in the pack and a list with all userStickers from the pack + * These lists are taken from database in the Controllers via SQL query*/ + int totalAmount = packStickers.size(); + int hasAmount = userStickers.size(); + progression = (int) ((totalAmount/hasAmount) * 100); + } + @Override + public String getImgFolder() { + return "packs"; + } +} diff --git a/src/main/java/Team5/SmartTowns/rewards/Reward.java b/src/main/java/Team5/SmartTowns/rewards/Reward.java new file mode 100644 index 0000000000000000000000000000000000000000..0a2d9145817a6e6935e5cc7dca283c47c491ee53 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/rewards/Reward.java @@ -0,0 +1,37 @@ +package Team5.SmartTowns.rewards; + +import lombok.Getter; + +import java.io.File; + +@Getter +public abstract class Reward { + /* Abstract class for all rewards */ + + int id; + String displayImg; //Path to the image file + String name; + String description; + + public Reward(int id, String name, String description) { + //Default constructor + this.id = id; + this.name = name; + this.description = description; + } + + public abstract String getImgFolder(); + /*Returns folder in which images are located*/ + + public String getDefaultImg(){ + /*Returns the name of the default image to be used in case no image is found*/ + return "0.png"; + } + public String findImagePath(){ + /* Finds the image in the Path folder, if image is not found assigns default image */ + String imgPath = "images/rewards/" + getImgFolder() + "/" + id + ".png"; + String notFoundPath = "images/rewards/" + getImgFolder() + "/" + getDefaultImg(); + File imgFile = new File("src/main/resources/static/" + imgPath); + return imgFile.exists() ? imgPath : notFoundPath; + } +} diff --git a/src/main/java/Team5/SmartTowns/rewards/RewardsController.java b/src/main/java/Team5/SmartTowns/rewards/RewardsController.java deleted file mode 100644 index af9d33cba34dd12ac6aa5ca1e54320b8124af9d4..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/rewards/RewardsController.java +++ /dev/null @@ -1,7 +0,0 @@ -package Team5.SmartTowns.rewards; - -import org.springframework.stereotype.Controller; - -@Controller -public class RewardsController { -} diff --git a/src/main/java/Team5/SmartTowns/rewards/RewardsRepository.java b/src/main/java/Team5/SmartTowns/rewards/RewardsRepository.java new file mode 100644 index 0000000000000000000000000000000000000000..51bde7f297613873b38b0eec939f58d9c1dc1acd --- /dev/null +++ b/src/main/java/Team5/SmartTowns/rewards/RewardsRepository.java @@ -0,0 +1,18 @@ +//Holds locations data repository +package Team5.SmartTowns.rewards; + +import java.util.List; + +public interface RewardsRepository { + List<Sticker> getAllStickers(); + + List<Sticker> getAllStickersFromPack(int packID); + + List<Sticker> getAllStickersFromUser(int userID); + + List<Pack> getAllPacks(); + + Pack findPackByID(int id); + +} + diff --git a/src/main/java/Team5/SmartTowns/rewards/RewardsRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/rewards/RewardsRepositoryJDBC.java new file mode 100644 index 0000000000000000000000000000000000000000..74c97a5f29319ab6dbefc042bcbc10e364b4bd03 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/rewards/RewardsRepositoryJDBC.java @@ -0,0 +1,72 @@ +//Implements the locations repository using JDBC +package Team5.SmartTowns.rewards; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public class RewardsRepositoryJDBC implements RewardsRepository { + private final JdbcTemplate jdbc; + private RowMapper<Sticker> stickerMapper; + private RowMapper<Pack> packMapper; + + public RewardsRepositoryJDBC(JdbcTemplate aJdbc) { + this.jdbc = aJdbc; + setStickerMapper(); + setPackMapper(); + } + + private void setStickerMapper(){ + stickerMapper = (rs, i) -> new Sticker( + rs.getInt("packID"), + rs.getInt("stickerID"), + rs.getString("name"), + rs.getString("description"), + rs.getInt("rarity") + ); + } + private void setPackMapper(){ + packMapper = (rs, i) -> new Pack( + rs.getInt("id"), + rs.getString("name"), + rs.getString("description") + ); + } + + @Override + public List<Sticker> getAllStickers(){ + String sql= "SELECT * FROM stickers"; + return jdbc.query(sql, stickerMapper); + } + + @Override + public List<Pack> getAllPacks() { + String sql= "SELECT * FROM packs"; + return jdbc.query(sql, packMapper); + } + + @Override + public List<Sticker> getAllStickersFromPack(int packID){ + String sql= "SELECT * FROM stickers WHERE packID=?"; + return jdbc.query(sql, stickerMapper, packID); + } + + @Override + public List<Sticker> getAllStickersFromUser(int userID) { + /* FINDS ALL STICKERS UNLOCKED BY THE GIVEN USER */ + String sql= "SELECT * FROM stickers LEFT JOIN stickerprogress " + + "ON (stickers.id, stickers.packID) = (stickerprogress.stickerID, stickerprogress.packID) " + + "WHERE stickerprogress.username = ? "; + return jdbc.query(sql, stickerMapper, userID); + } + + @Override + public Pack findPackByID(int id){ + String sql= "SELECT * FROM packs WHERE id= ?"; + List<Pack> result = jdbc.query(sql, packMapper, id); + return result.isEmpty() ? null : result.get(0); + } +} diff --git a/src/main/java/Team5/SmartTowns/rewards/Sticker.java b/src/main/java/Team5/SmartTowns/rewards/Sticker.java index 4fa498c61e7d5748e7d6dcfc26c7c6442dfd8cc4..7e5315c651bea73aa31572856710b21bbc25457b 100644 --- a/src/main/java/Team5/SmartTowns/rewards/Sticker.java +++ b/src/main/java/Team5/SmartTowns/rewards/Sticker.java @@ -1,37 +1,29 @@ /*AUTHOR: Gabriel Copat*/ package Team5.SmartTowns.rewards; -import lombok.Data; +import lombok.Getter; -import java.io.File; -import java.util.Objects; -@Data -public class Sticker { - /* Stickers are trade-able rewards, they vary in rarity and are earned at random */ +@Getter +public class Sticker extends Reward{ + /* Stickers are randomly earned rewards from a specific pack */ + + final int rarity; //1-5 + final int packID; - int id; - String name; - String description; - String imgPath; - int rarity; //1-5 boolean hasSticker; - public Sticker(int id, String name, String description, int rarity) { - this.id = id; - this.name = name; - this.description = description; + + public Sticker(int packID, int id, String name, String description, int rarity) { + super(id, name, description); this.rarity = rarity; - imgPath = findImagePath(); + this.packID = packID; + displayImg = super.findImagePath(); } - private String findImagePath(){ - /* Finds the image in the Path folder, if image is not found assigns default image */ - String imgPath = "images/rewards/stickers/" + id + ".jpg"; - String notFoundPath = "images/rewards/stickers/0.png"; - - File imgFile = new File("src/main/resources/static/" + imgPath); - return imgFile.exists() ? imgPath : notFoundPath; + @Override + public String getImgFolder() { + return "stickers/" + getPackID(); } public boolean hasSticker(){ @@ -41,21 +33,7 @@ public class Sticker { this.hasSticker = hasSticker; } public String getVisibility(){ - return hasSticker? "" : "grayedOut"; - } - - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Sticker sticker = (Sticker) o; - return id == sticker.id && Objects.equals(name, sticker.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); + return hasSticker ? "gotSticker" : "grayedSticker"; } } diff --git a/src/main/java/Team5/SmartTowns/rewards/StickersRepository.java b/src/main/java/Team5/SmartTowns/rewards/StickersRepository.java deleted file mode 100644 index 869c2d07353a7aa090fb7fee79b2d44feacd9b12..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/rewards/StickersRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -//Holds locations data repository -package Team5.SmartTowns.rewards; - -import java.util.List; - -public interface StickersRepository { - List<Sticker> getAllStickers(); -} - diff --git a/src/main/java/Team5/SmartTowns/rewards/StickersRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/rewards/StickersRepositoryJDBC.java deleted file mode 100644 index 64df71bc3da3eff327377798185111aee3be7867..0000000000000000000000000000000000000000 --- a/src/main/java/Team5/SmartTowns/rewards/StickersRepositoryJDBC.java +++ /dev/null @@ -1,33 +0,0 @@ -//Implements the locations repository using JDBC -package Team5.SmartTowns.rewards; - -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class StickersRepositoryJDBC implements StickersRepository { - private JdbcTemplate jdbc; - private RowMapper<Sticker> stickerMapper; - - public StickersRepositoryJDBC(JdbcTemplate aJdbc) { - this.jdbc = aJdbc; - setStickerMapper(); - } - private void setStickerMapper(){ - stickerMapper = (rs, i) -> new Sticker( - rs.getInt("stickerID"), - rs.getString("name"), - rs.getString("description"), - rs.getInt("rarity") - ); - } - - @Override - public List<Sticker> getAllStickers(){ - String sql= "SELECT * FROM stickers"; - return jdbc.query(sql, stickerMapper); - } -} diff --git a/src/main/java/Team5/SmartTowns/security/SecurityConfiguration.java b/src/main/java/Team5/SmartTowns/security/SecurityConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..afce617e22c6e82aa040896794e144ba0558ae37 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/security/SecurityConfiguration.java @@ -0,0 +1,51 @@ +package Team5.SmartTowns.security; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.crypto.password.NoOpPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.provisioning.JdbcUserDetailsManager; +import org.springframework.security.provisioning.UserDetailsManager; +import org.springframework.security.web.SecurityFilterChain; + +import javax.sql.DataSource; + + +@Configuration +@EnableWebSecurity +public class SecurityConfiguration { + /* Configures the longin features and tracks logged on users on the page */ + + + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + http + .authorizeHttpRequests((requests) -> requests + .requestMatchers("/user/**", "/userProfile").authenticated() + .anyRequest().permitAll() + ) + .formLogin((login) -> login + .loginPage("/login").permitAll() + .defaultSuccessUrl("/userProfile") + ) + .logout((logout) -> logout.permitAll()); + + return http.build(); + } + @Bean + public PasswordEncoder passwordEncoder(){ + /* Nothing here yet, this just saves passwords in plaintext. TODO password encryption */ + return NoOpPasswordEncoder.getInstance(); + } + + @Bean + public UserDetailsManager userDetailsManager(DataSource dataSource){ + JdbcUserDetailsManager manager = new JdbcUserDetailsManager(dataSource); + return manager; + } + + +} diff --git a/src/main/java/Team5/SmartTowns/Towns/TownController.java b/src/main/java/Team5/SmartTowns/towns/TownController.java similarity index 94% rename from src/main/java/Team5/SmartTowns/Towns/TownController.java rename to src/main/java/Team5/SmartTowns/towns/TownController.java index aa15a341da7fe2ef346f5278ae1a55faaa3136fc..9063712be2de660379c504bb064254367dcaa3d8 100644 --- a/src/main/java/Team5/SmartTowns/Towns/TownController.java +++ b/src/main/java/Team5/SmartTowns/towns/TownController.java @@ -1,4 +1,4 @@ -package Team5.SmartTowns.Towns; +package Team5.SmartTowns.towns; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/Team5/SmartTowns/towns/TownStorage.java b/src/main/java/Team5/SmartTowns/towns/TownStorage.java new file mode 100644 index 0000000000000000000000000000000000000000..988a20223b33d27fbccab94007a1efb6e3088bbb --- /dev/null +++ b/src/main/java/Team5/SmartTowns/towns/TownStorage.java @@ -0,0 +1,44 @@ +package Team5.SmartTowns.towns; + +import java.util.ArrayList; +import java.util.List; + +public class TownStorage { + private List<Towns> townList; + private static TownStorage singleton; + + TownStorage() { + townList = new ArrayList<>(); + townList.addAll( + List.of( + new Towns("Caerphilly",01,3,70,"/images/banners/CaerphillyCastle.jpg"), + new Towns("Risca",02,2,34,"/images/banners/RiscaBanner.jpg"), + new Towns("Penarth",03,5,0,"/images/banners/PenarthBanner.jpg"), + new Towns("Penarth",03,5,50,"/images/banners/PenarthBanner.jpg"), + new Towns("Caerphilly",01,3,70,"/images/banners/CaerphillyCastle.jpg"), + new Towns("Risca",02,2,90,"/images/banners/RiscaBanner.jpg"), + new Towns("Penarth",03,5,100,"/images/banners/PenarthBanner.jpg") + + + + ) + + ); + + } + public static TownStorage getInstance() { + if (singleton == null) { + singleton = new TownStorage(); + + } + return singleton; + } + + public List<Towns> getTownList() { + return townList; + } + + + + +} diff --git a/src/main/java/Team5/SmartTowns/Towns/Towns.java b/src/main/java/Team5/SmartTowns/towns/Towns.java similarity index 97% rename from src/main/java/Team5/SmartTowns/Towns/Towns.java rename to src/main/java/Team5/SmartTowns/towns/Towns.java index a1b103f7abf6aa4379d877c645185f2c522a25ba..ebe6fd4797c205ace803727026e64837a2af93e6 100644 --- a/src/main/java/Team5/SmartTowns/Towns/Towns.java +++ b/src/main/java/Team5/SmartTowns/towns/Towns.java @@ -1,4 +1,4 @@ -package Team5.SmartTowns.Towns; +package Team5.SmartTowns.towns; import lombok.Data; diff --git a/src/main/java/Team5/SmartTowns/trails/TrailsController.java b/src/main/java/Team5/SmartTowns/trails/TrailsController.java index c91c7abb4f64270f948d4313070adf47b08c07c8..c6472019b4e17f3ff6aa4c60188ad524bfc10010 100644 --- a/src/main/java/Team5/SmartTowns/trails/TrailsController.java +++ b/src/main/java/Team5/SmartTowns/trails/TrailsController.java @@ -1,19 +1,19 @@ package Team5.SmartTowns.trails; -import Team5.SmartTowns.Landmarks.Landmarks; +import Team5.SmartTowns.landmarks.Landmarks; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import java.util.ArrayList; import java.util.List; +import java.util.Optional; -import static Team5.SmartTowns.Landmarks.Landmarks.getLandmarksDragonstrail; +import static Team5.SmartTowns.landmarks.Landmarks.landmarksDragonstrail; + +//import static Team5.SmartTowns.Landmarks.Landmarks.landmarksDragonstrail; @Controller public class TrailsController { @@ -40,21 +40,22 @@ public class TrailsController { @GetMapping("/dragonstale") public ModelAndView getDragonsTale(){ - List<Landmarks> landmarksList = getLandmarksDragonstrail(); - Landmarks landmarks = new Landmarks(); - int listSize = landmarksList.size(); + List<Landmarks> landmarksList = landmarksDragonstrail; 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() -// } + // +// @GetMapping("dragonstale/{qrCode}/{id}") +// public String qrCodeCheck(@PathVariable Optional<String> qrCode, @PathVariable Optional<Integer> id){ +// if (qrCode.isPresent()){ +// +// //Check if ID is present, if do this, if not dfo that. +// +// } +// } } diff --git a/src/main/java/Team5/SmartTowns/users/NewUser.java b/src/main/java/Team5/SmartTowns/users/NewUser.java new file mode 100644 index 0000000000000000000000000000000000000000..aa47adac9931083fb0d199375e50032ce30ccd60 --- /dev/null +++ b/src/main/java/Team5/SmartTowns/users/NewUser.java @@ -0,0 +1,26 @@ +package Team5.SmartTowns.users; + +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class NewUser { + + + @NotEmpty(message = "You must type in a username.") + @NotNull + String name; + + @NotEmpty(message = "You must type in a password.") + @NotNull + String password; + + @NotEmpty(message = "You must type in an email.") + @NotNull + String email; +} diff --git a/src/main/java/Team5/SmartTowns/users/User.java b/src/main/java/Team5/SmartTowns/users/User.java index 84887664fbee090abb68281f28b5f2b0832af9ae..96949fb1b8543684407118138878b21db47826fe 100644 --- a/src/main/java/Team5/SmartTowns/users/User.java +++ b/src/main/java/Team5/SmartTowns/users/User.java @@ -5,20 +5,20 @@ import Team5.SmartTowns.rewards.Sticker; import lombok.Data; import java.io.File; +import java.sql.Connection; +import java.sql.DriverManager; import java.util.HashMap; import java.util.Map; @Data public class User { - int id; String email; //Validation would be done by email, since they will have that String name; String imgPath; int dragonProgress; - - Map<Badge, Integer> badgeProgress = new HashMap<>(); // Demonstrates the progress towards a specific badge (0-100) Map<Sticker, Boolean> hasStickers = new HashMap<>(); // True if User has sticker (key) + Map<Integer, Boolean> dragonstaleLandmarkIDs = new HashMap<>(); // Storing the IDs of the landmarks associated with Dragonstale, as well as if the user has visited it before (boolean) public User(int id, String email, String name, int dragonProgress) { this.id = id; @@ -27,7 +27,11 @@ public class User { this.dragonProgress = dragonProgress; imgPath = findImagePath(); } - + public User(String email, String name) { + this.email = email; + this.name = name; + imgPath = findImagePath(); + } private String findImagePath(){ /* Finds the image in the Path folder, if image is not found assigns default image */ diff --git a/src/main/java/Team5/SmartTowns/users/UserController.java b/src/main/java/Team5/SmartTowns/users/UserController.java index d635c8a401d85ef6d930142882d69b5528f38fd7..e1acd4b66f1546db506ec5313c5680122e05587d 100644 --- a/src/main/java/Team5/SmartTowns/users/UserController.java +++ b/src/main/java/Team5/SmartTowns/users/UserController.java @@ -1,62 +1,139 @@ package Team5.SmartTowns.users; -import Team5.SmartTowns.rewards.Badge; -import Team5.SmartTowns.rewards.BadgesRepository; +import Team5.SmartTowns.rewards.Pack; +import Team5.SmartTowns.rewards.RewardsRepository; import Team5.SmartTowns.rewards.Sticker; -import Team5.SmartTowns.rewards.StickersRepository; +import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.User; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import java.util.List; -import java.util.Map; @Controller public class UserController { @Autowired private UserRepository userRepository; + @Autowired - private BadgesRepository badgesRepository; - @Autowired - private StickersRepository stickersRepository; + private RewardsRepository rewardsRepository; + /* LOGIN MAPPING & FUNCTIONS */ @GetMapping("/login") public ModelAndView getLoginPage() { - ModelAndView mav = new ModelAndView("rewards/login"); -// List<User> users = userRepository.getAllUsers(); -// mav.addObject("users", users); + ModelAndView mav = new ModelAndView("users/login"); + mav.addObject("user", new NewUser( "", "", "")); + mav.addObject("error", ""); + mav.addObject("status", ""); + System.out.println(userRepository.findUserByName("Admin").getName()); return mav; } - @GetMapping("/userList") - public ModelAndView userList() { - ModelAndView mav = new ModelAndView("towns/userData"); - List<User> users = userRepository.getAllUsers(); - mav.addObject("users", users); +// @GetMapping("/logout") +// public ModelAndView getLogOutPage(){ +// ModelAndView mav = new ModelAndView("users/logout"); +// return mav; +// } + + @PostMapping("/login/register") + public ModelAndView registerUser(@Valid @ModelAttribute("user") NewUser user, BindingResult bindingResult, Model model) { + ModelAndView mav = new ModelAndView("users/login", model.asMap()); + // TODO VALIDATE EMAIL INPUT + mav.addObject("status", "active"); + if (bindingResult.hasErrors()) { + ModelAndView modelAndView = new ModelAndView("users/login"); + modelAndView.addObject("errors", bindingResult); + return modelAndView; + } + + if ( userRepository.doesUserExist(user.getEmail()) ) { + mav.addObject("errors", "Email already in use"); + return mav; + } + + try { + userRepository.addUser(user.name, user.email, user.password); + mav.addObject("error", ""); + //TODO return user creation success + return mav; + } catch (DataAccessException e) { + mav.addObject("error", "User exists"); + } return mav; } - @GetMapping("/user/{id}") - public ModelAndView getUserPage(@PathVariable int id) { - ModelAndView mav = new ModelAndView("rewards/userProfile"); - List<Badge> badges = badgesRepository.getAllBadges(); /*DEPRECATED FOR THE MOMENT*/ - mav.addObject("badges", badges); - List<Sticker> allStickers = stickersRepository.getAllStickers(); - List<User> users = userRepository.getAllUsers(); - Map<Long, Boolean> userStickers = userRepository.getStickers(id); - - for (Long stickerID : userStickers.keySet()) { //Finds and updates visibility of stickers based on what the user has - allStickers.stream() - .filter(sticker -> sticker.getId()==stickerID) - .findFirst().ifPresent(sticker -> sticker.setVisibility(userStickers.get(stickerID))); - } + @GetMapping("/userProfile") + public ModelAndView userProfile(){ + ModelAndView mav = new ModelAndView("users/userProfile"); + List<Pack> allPacks = rewardsRepository.getAllPacks(); + mav.addObject("packs", allPacks); + + User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + mav.addObject("user", userRepository.findUserByName("Admin")); + mav.addAllObjects(getPackInfo("Admin", 1).getModelMap()); + return mav; + } + + + /* USER MAPPING & FUNCTIONS */ + @GetMapping("/user/{username}") + public ModelAndView getUserPage(@PathVariable String username) { + ModelAndView mav = new ModelAndView("users/userProfile"); + List<Pack> allPacks = rewardsRepository.getAllPacks(); + mav.addObject("user", userRepository.findUserByName("Admin")); + mav.addObject("packs", allPacks); + mav.addAllObjects(getPackInfo(username, 1).getModelMap()); + return mav; + } + + @GetMapping("/packInfo/{username}/{packID}") + public ModelAndView getPackInfo(@PathVariable String username, @PathVariable int packID) { + /* Displays on page the stickers present in the pack and colour the ones the + * user has acquired */ + + ModelAndView mav = new ModelAndView("users/userFrags :: stickersBox"); + List<Sticker> allStickers = rewardsRepository.getAllStickersFromPack(packID); + List<Long> userStickers = userRepository.getUserStickersFromPack(username, packID); + System.out.println(userStickers); + - mav.addObject("user", userRepository.getUser(id)); - mav.addObject("stickers", allStickers); + + mav.addObject("stickers", setStickerVisibility(allStickers, userStickers)); + mav.addObject("progress", getPackProgress(allStickers)); + mav.addObject("selectedPack", rewardsRepository.findPackByID(packID)); return mav; } + + public int getPackProgress(List<Sticker> userStickers){ + /* Returns the % of completion of given userStickers */ + double progress = 0; + if (!userStickers.isEmpty()) { + progress = userStickers.stream().filter(Sticker::hasSticker).count(); + progress = progress / userStickers.size(); + progress = Math.round(progress * 100); + } + return (int) progress; + } + + public List<Sticker> setStickerVisibility(List<Sticker> displayedStickers, List<Long> userStickers){ + /* Makes displayedStickers which are present in userStickers visible */ + for (Long stickerID : userStickers) { + displayedStickers.stream() + .filter(sticker -> sticker.getId()==stickerID) //Tries to find matching id from the two lists + .findFirst().ifPresent(sticker -> sticker.setVisibility(true)); + } + return displayedStickers; + } + + + + } diff --git a/src/main/java/Team5/SmartTowns/users/UserRepository.java b/src/main/java/Team5/SmartTowns/users/UserRepository.java index 9f4e828f17c231179df1a9fcd6a87cc5c8cf75b6..097598e24dce331a62b34346c3ec2326fa215934 100644 --- a/src/main/java/Team5/SmartTowns/users/UserRepository.java +++ b/src/main/java/Team5/SmartTowns/users/UserRepository.java @@ -2,11 +2,13 @@ package Team5.SmartTowns.users; import java.util.List; -import java.util.Map; public interface UserRepository { List<User> getAllUsers(); -// Map<Long, Integer> getBadgeProgress(int id); - Map<Long, Boolean> getStickers(int id); - User getUser(int id); + List<Long> getUserStickersFromPack(String username, int packID); + boolean unlockSticker(String username, int packID, int stickerID); + boolean addUser(String username, String email, String password); + boolean doesUserExist(String email); + User findUserByEmail(String email); + User findUserByName(String name); } diff --git a/src/main/java/Team5/SmartTowns/users/UserRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/users/UserRepositoryJDBC.java index 9b24461d06d300172d904272edf0cc20c51b99f0..a88ac6e1c91fc85e5eb19fb6f0f7fcef3b9cb833 100644 --- a/src/main/java/Team5/SmartTowns/users/UserRepositoryJDBC.java +++ b/src/main/java/Team5/SmartTowns/users/UserRepositoryJDBC.java @@ -1,19 +1,23 @@ //Implements the users repository using JDBC package Team5.SmartTowns.users; +import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; +import org.springframework.jdbc.object.SqlQuery; import org.springframework.stereotype.Repository; -import java.util.ArrayList; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.HashMap; import java.util.List; -import java.util.Map; +import java.util.Objects; @Repository public class UserRepositoryJDBC implements UserRepository{ - - private JdbcTemplate jdbc; + private final JdbcTemplate jdbc; private RowMapper<User> userMapper; public UserRepositoryJDBC(JdbcTemplate aJdbc){ @@ -21,13 +25,10 @@ public class UserRepositoryJDBC implements UserRepository{ setUserMapper(); } - private void setUserMapper(){ userMapper = (rs, i) -> new User( - rs.getInt("userID"), rs.getString("email"), - rs.getString("name"), - rs.getInt("dragonProgress") + rs.getString("username") ); } @@ -37,33 +38,59 @@ public class UserRepositoryJDBC implements UserRepository{ return jdbc.query(sql, userMapper); } + @Override - public User getUser(int id){ - String sql= "SELECT * FROM users WHERE userID="+id; - List<User> result = jdbc.query(sql, userMapper); - return result.get(0); + public List<Long> getUserStickersFromPack(String username, int packID) { + /* Returns a list with the stickerIDs of stickers that the specified user has unlocked from the given pack */ + String sql = "SELECT stickerID FROM stickerprogress WHERE (username, packID)= (?,?)"; + return jdbc.queryForList(sql, Long.class, username, packID); } @Override - public Map<Long, Boolean> getStickers(int id){ - String sql = "SELECT stickerID, hasSticker FROM stickerprogress WHERE userID=" + id; - List<Map<String, Object>> query = jdbc.queryForList(sql); - Map<Long, Boolean> progress = new HashMap<>(); - for (Map<String, Object> result : query) { - progress.put((Long)result.get("stickerID"), (boolean)result.get("hasSticker")); + public boolean unlockSticker(String username, int packID, int stickerID){ + /* Adds entry in the stickerprogress database, effectively unlocking the sticker for the user + * Returns false if no sticker is unlocked */ + String query = "SELECT COUNT(id) FROM stickers WHERE (stickerID, packID) = (?, ?)"; + + int stickerCount = jdbc.queryForObject(query, Integer.class, stickerID, packID); + + if (stickerCount == 1){ //Checks if sticker exists + String sql = "INSERT INTO stickerprogress (username, packID, stickerID) VALUES (?,?,?)"; + jdbc.update(sql, username, packID, stickerID); + return true; } - return progress; + return false; + } + + @Override + public boolean addUser(String username, String email, String password) throws DataAccessException{ + /* Adds new user to the database */ + String query = "INSERT INTO users (username, email, password) VALUES (?, ?, ?);"; + String query2= "INSERT INTO authorities (username, authority) VALUES (?,?);"; + jdbc.update(query, username, email, password); + jdbc.update(query2, username, "USER"); + return true; + } + @Override + public boolean doesUserExist(String email){ + /* Returns true if a user with given email already exists in the database */ + String query = "SELECT COUNT(email) FROM users WHERE (email) = (?)"; + return !(jdbc.queryForObject(query, Integer.class, email) == 0); } + @Override + public User findUserByEmail(String email) { + /* Finds user matching given email */ + String query = "SELECT * FROM users WHERE (email) = (?)"; + List<User> result = jdbc.query(query, userMapper, email); + return result.isEmpty() ? null : result.get(0); + } + @Override + public User findUserByName(String name) { + /* Finds user matching given name */ + String query = "SELECT * FROM users WHERE (username) = (?)"; + List<User> result = jdbc.query(query, userMapper, name); + return result.isEmpty() ? null : result.get(0); + } -// @Override -// public Map<Long, Integer> getBadgeProgress(int id){ -// String sql = "SELECT badgeID, progress FROM badgeprogress WHERE userID=" + id; -// List<Map<String, Object>> query = jdbc.queryForList(sql); -// Map<Long, Integer> progress = new HashMap<>(); -// for (Map<String, Object> result : query) { -// progress.put((Long)result.get("badgeID"), (int)result.get("progress")); -// } -// return progress; -// } } diff --git a/src/main/java/Team5/SmartTowns/Webpages/WebpageController.java b/src/main/java/Team5/SmartTowns/webpages/WebpageController.java similarity index 81% rename from src/main/java/Team5/SmartTowns/Webpages/WebpageController.java rename to src/main/java/Team5/SmartTowns/webpages/WebpageController.java index 37a30366e5335d1870c202d1a49b4a5d2bca474d..dcc9a14af56d65780dafcb02e92a90e3fce483a2 100644 --- a/src/main/java/Team5/SmartTowns/Webpages/WebpageController.java +++ b/src/main/java/Team5/SmartTowns/webpages/WebpageController.java @@ -1,4 +1,4 @@ -package Team5.SmartTowns.Webpages; +package Team5.SmartTowns.webpages; import org.springframework.ui.Model; @@ -27,6 +27,13 @@ public class WebpageController { return modelAndView; } + + @GetMapping("/maps") + public ModelAndView getMapTestAPI(){ + ModelAndView modelAndView = new ModelAndView("Towns/mapsTest/index"); + return modelAndView; + } + // @GetMapping("/home") // public ModelAndView getHome(){ // ModelAndView modelAndView = new ModelAndView("Towns/home/homePage"); @@ -34,12 +41,10 @@ public class WebpageController { // } - @RequestMapping(value="/test_ajax_frag", method=RequestMethod.POST) - public String sendHtmlFragment(Model map) { - //map.addAttribute("foo", "bar"); - return "fragments/temp_frags.html :: trailInfo2"; + } -} + + diff --git a/src/main/node_modules/.package-lock.json b/src/main/node_modules/.package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..c771511d25e96ca1a3c94f9d7d788bf956e3f0e2 --- /dev/null +++ b/src/main/node_modules/.package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "main", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/html5-qrcode": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/html5-qrcode/-/html5-qrcode-2.3.8.tgz", + "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==" + } + } +} diff --git a/src/main/node_modules/html5-qrcode/LICENSE b/src/main/node_modules/html5-qrcode/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/README.md b/src/main/node_modules/html5-qrcode/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/camera/core-impl.d.ts b/src/main/node_modules/html5-qrcode/camera/core-impl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/camera/core.d.ts b/src/main/node_modules/html5-qrcode/camera/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/camera/factories.d.ts b/src/main/node_modules/html5-qrcode/camera/factories.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/camera/permissions.d.ts b/src/main/node_modules/html5-qrcode/camera/permissions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/camera/retriever.d.ts b/src/main/node_modules/html5-qrcode/camera/retriever.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/core-impl.d.ts b/src/main/node_modules/html5-qrcode/cjs/camera/core-impl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/core-impl.js b/src/main/node_modules/html5-qrcode/cjs/camera/core-impl.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/core-impl.js.map b/src/main/node_modules/html5-qrcode/cjs/camera/core-impl.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/core.d.ts b/src/main/node_modules/html5-qrcode/cjs/camera/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/core.js b/src/main/node_modules/html5-qrcode/cjs/camera/core.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/core.js.map b/src/main/node_modules/html5-qrcode/cjs/camera/core.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/factories.d.ts b/src/main/node_modules/html5-qrcode/cjs/camera/factories.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/factories.js b/src/main/node_modules/html5-qrcode/cjs/camera/factories.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/factories.js.map b/src/main/node_modules/html5-qrcode/cjs/camera/factories.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/permissions.d.ts b/src/main/node_modules/html5-qrcode/cjs/camera/permissions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/permissions.js b/src/main/node_modules/html5-qrcode/cjs/camera/permissions.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/permissions.js.map b/src/main/node_modules/html5-qrcode/cjs/camera/permissions.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/retriever.d.ts b/src/main/node_modules/html5-qrcode/cjs/camera/retriever.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/retriever.js b/src/main/node_modules/html5-qrcode/cjs/camera/retriever.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/camera/retriever.js.map b/src/main/node_modules/html5-qrcode/cjs/camera/retriever.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/code-decoder.d.ts b/src/main/node_modules/html5-qrcode/cjs/code-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/code-decoder.js b/src/main/node_modules/html5-qrcode/cjs/code-decoder.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/code-decoder.js.map b/src/main/node_modules/html5-qrcode/cjs/code-decoder.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/core.d.ts b/src/main/node_modules/html5-qrcode/cjs/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/core.js b/src/main/node_modules/html5-qrcode/cjs/core.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/core.js.map b/src/main/node_modules/html5-qrcode/cjs/core.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/experimental-features.d.ts b/src/main/node_modules/html5-qrcode/cjs/experimental-features.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/experimental-features.js b/src/main/node_modules/html5-qrcode/cjs/experimental-features.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/experimental-features.js.map b/src/main/node_modules/html5-qrcode/cjs/experimental-features.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/html5-qrcode-scanner.d.ts b/src/main/node_modules/html5-qrcode/cjs/html5-qrcode-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/html5-qrcode-scanner.js b/src/main/node_modules/html5-qrcode/cjs/html5-qrcode-scanner.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/html5-qrcode-scanner.js.map b/src/main/node_modules/html5-qrcode/cjs/html5-qrcode-scanner.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/html5-qrcode.d.ts b/src/main/node_modules/html5-qrcode/cjs/html5-qrcode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/html5-qrcode.js b/src/main/node_modules/html5-qrcode/cjs/html5-qrcode.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/html5-qrcode.js.map b/src/main/node_modules/html5-qrcode/cjs/html5-qrcode.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/image-assets.d.ts b/src/main/node_modules/html5-qrcode/cjs/image-assets.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/image-assets.js b/src/main/node_modules/html5-qrcode/cjs/image-assets.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/image-assets.js.map b/src/main/node_modules/html5-qrcode/cjs/image-assets.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/index.d.ts b/src/main/node_modules/html5-qrcode/cjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/index.js b/src/main/node_modules/html5-qrcode/cjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/index.js.map b/src/main/node_modules/html5-qrcode/cjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/native-bar-code-detector.d.ts b/src/main/node_modules/html5-qrcode/cjs/native-bar-code-detector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/native-bar-code-detector.js b/src/main/node_modules/html5-qrcode/cjs/native-bar-code-detector.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/native-bar-code-detector.js.map b/src/main/node_modules/html5-qrcode/cjs/native-bar-code-detector.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/state-manager.d.ts b/src/main/node_modules/html5-qrcode/cjs/state-manager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/state-manager.js b/src/main/node_modules/html5-qrcode/cjs/state-manager.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/state-manager.js.map b/src/main/node_modules/html5-qrcode/cjs/state-manager.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/storage.d.ts b/src/main/node_modules/html5-qrcode/cjs/storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/storage.js b/src/main/node_modules/html5-qrcode/cjs/storage.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/storage.js.map b/src/main/node_modules/html5-qrcode/cjs/storage.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/strings.d.ts b/src/main/node_modules/html5-qrcode/cjs/strings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/strings.js b/src/main/node_modules/html5-qrcode/cjs/strings.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/strings.js.map b/src/main/node_modules/html5-qrcode/cjs/strings.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui.js b/src/main/node_modules/html5-qrcode/cjs/ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui.js.map b/src/main/node_modules/html5-qrcode/cjs/ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/base.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/base.js b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/base.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/base.js.map b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/base.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-selection-ui.js b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-selection-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-selection-ui.js.map b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-selection-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-zoom-ui.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-zoom-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-zoom-ui.js b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-zoom-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-zoom-ui.js.map b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/camera-zoom-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/file-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/file-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/file-selection-ui.js b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/file-selection-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/file-selection-ui.js.map b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/file-selection-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/scan-type-selector.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/scan-type-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/scan-type-selector.js b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/scan-type-selector.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/scan-type-selector.js.map b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/scan-type-selector.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/torch-button.d.ts b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/torch-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/torch-button.js b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/torch-button.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/ui/scanner/torch-button.js.map b/src/main/node_modules/html5-qrcode/cjs/ui/scanner/torch-button.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/utils.d.ts b/src/main/node_modules/html5-qrcode/cjs/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/utils.js b/src/main/node_modules/html5-qrcode/cjs/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/utils.js.map b/src/main/node_modules/html5-qrcode/cjs/utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/zxing-html5-qrcode-decoder.d.ts b/src/main/node_modules/html5-qrcode/cjs/zxing-html5-qrcode-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/zxing-html5-qrcode-decoder.js b/src/main/node_modules/html5-qrcode/cjs/zxing-html5-qrcode-decoder.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/cjs/zxing-html5-qrcode-decoder.js.map b/src/main/node_modules/html5-qrcode/cjs/zxing-html5-qrcode-decoder.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/code-decoder.d.ts b/src/main/node_modules/html5-qrcode/code-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/core.d.ts b/src/main/node_modules/html5-qrcode/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/core-impl.d.ts b/src/main/node_modules/html5-qrcode/es2015/camera/core-impl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/core-impl.js b/src/main/node_modules/html5-qrcode/es2015/camera/core-impl.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/core-impl.js.map b/src/main/node_modules/html5-qrcode/es2015/camera/core-impl.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/core.d.ts b/src/main/node_modules/html5-qrcode/es2015/camera/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/core.js b/src/main/node_modules/html5-qrcode/es2015/camera/core.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/core.js.map b/src/main/node_modules/html5-qrcode/es2015/camera/core.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/factories.d.ts b/src/main/node_modules/html5-qrcode/es2015/camera/factories.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/factories.js b/src/main/node_modules/html5-qrcode/es2015/camera/factories.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/factories.js.map b/src/main/node_modules/html5-qrcode/es2015/camera/factories.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/permissions.d.ts b/src/main/node_modules/html5-qrcode/es2015/camera/permissions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/permissions.js b/src/main/node_modules/html5-qrcode/es2015/camera/permissions.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/permissions.js.map b/src/main/node_modules/html5-qrcode/es2015/camera/permissions.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/retriever.d.ts b/src/main/node_modules/html5-qrcode/es2015/camera/retriever.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/retriever.js b/src/main/node_modules/html5-qrcode/es2015/camera/retriever.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/camera/retriever.js.map b/src/main/node_modules/html5-qrcode/es2015/camera/retriever.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/code-decoder.d.ts b/src/main/node_modules/html5-qrcode/es2015/code-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/code-decoder.js b/src/main/node_modules/html5-qrcode/es2015/code-decoder.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/code-decoder.js.map b/src/main/node_modules/html5-qrcode/es2015/code-decoder.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/core.d.ts b/src/main/node_modules/html5-qrcode/es2015/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/core.js b/src/main/node_modules/html5-qrcode/es2015/core.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/core.js.map b/src/main/node_modules/html5-qrcode/es2015/core.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/experimental-features.d.ts b/src/main/node_modules/html5-qrcode/es2015/experimental-features.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/experimental-features.js b/src/main/node_modules/html5-qrcode/es2015/experimental-features.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/experimental-features.js.map b/src/main/node_modules/html5-qrcode/es2015/experimental-features.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/html5-qrcode-scanner.d.ts b/src/main/node_modules/html5-qrcode/es2015/html5-qrcode-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/html5-qrcode-scanner.js b/src/main/node_modules/html5-qrcode/es2015/html5-qrcode-scanner.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/html5-qrcode-scanner.js.map b/src/main/node_modules/html5-qrcode/es2015/html5-qrcode-scanner.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/html5-qrcode.d.ts b/src/main/node_modules/html5-qrcode/es2015/html5-qrcode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/html5-qrcode.js b/src/main/node_modules/html5-qrcode/es2015/html5-qrcode.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/html5-qrcode.js.map b/src/main/node_modules/html5-qrcode/es2015/html5-qrcode.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/image-assets.d.ts b/src/main/node_modules/html5-qrcode/es2015/image-assets.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/image-assets.js b/src/main/node_modules/html5-qrcode/es2015/image-assets.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/image-assets.js.map b/src/main/node_modules/html5-qrcode/es2015/image-assets.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/index.d.ts b/src/main/node_modules/html5-qrcode/es2015/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/index.js b/src/main/node_modules/html5-qrcode/es2015/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/index.js.map b/src/main/node_modules/html5-qrcode/es2015/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/native-bar-code-detector.d.ts b/src/main/node_modules/html5-qrcode/es2015/native-bar-code-detector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/native-bar-code-detector.js b/src/main/node_modules/html5-qrcode/es2015/native-bar-code-detector.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/native-bar-code-detector.js.map b/src/main/node_modules/html5-qrcode/es2015/native-bar-code-detector.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/state-manager.d.ts b/src/main/node_modules/html5-qrcode/es2015/state-manager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/state-manager.js b/src/main/node_modules/html5-qrcode/es2015/state-manager.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/state-manager.js.map b/src/main/node_modules/html5-qrcode/es2015/state-manager.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/storage.d.ts b/src/main/node_modules/html5-qrcode/es2015/storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/storage.js b/src/main/node_modules/html5-qrcode/es2015/storage.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/storage.js.map b/src/main/node_modules/html5-qrcode/es2015/storage.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/strings.d.ts b/src/main/node_modules/html5-qrcode/es2015/strings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/strings.js b/src/main/node_modules/html5-qrcode/es2015/strings.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/strings.js.map b/src/main/node_modules/html5-qrcode/es2015/strings.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui.js b/src/main/node_modules/html5-qrcode/es2015/ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui.js.map b/src/main/node_modules/html5-qrcode/es2015/ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/base.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/base.js b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/base.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/base.js.map b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/base.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-selection-ui.js b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-selection-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-selection-ui.js.map b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-selection-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-zoom-ui.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-zoom-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-zoom-ui.js b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-zoom-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-zoom-ui.js.map b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/camera-zoom-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/file-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/file-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/file-selection-ui.js b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/file-selection-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/file-selection-ui.js.map b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/file-selection-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/scan-type-selector.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/scan-type-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/scan-type-selector.js b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/scan-type-selector.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/scan-type-selector.js.map b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/scan-type-selector.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/torch-button.d.ts b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/torch-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/torch-button.js b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/torch-button.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/ui/scanner/torch-button.js.map b/src/main/node_modules/html5-qrcode/es2015/ui/scanner/torch-button.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/utils.d.ts b/src/main/node_modules/html5-qrcode/es2015/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/utils.js b/src/main/node_modules/html5-qrcode/es2015/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/utils.js.map b/src/main/node_modules/html5-qrcode/es2015/utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/zxing-html5-qrcode-decoder.d.ts b/src/main/node_modules/html5-qrcode/es2015/zxing-html5-qrcode-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/zxing-html5-qrcode-decoder.js b/src/main/node_modules/html5-qrcode/es2015/zxing-html5-qrcode-decoder.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/es2015/zxing-html5-qrcode-decoder.js.map b/src/main/node_modules/html5-qrcode/es2015/zxing-html5-qrcode-decoder.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/core-impl.d.ts b/src/main/node_modules/html5-qrcode/esm/camera/core-impl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/core-impl.js b/src/main/node_modules/html5-qrcode/esm/camera/core-impl.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/core-impl.js.map b/src/main/node_modules/html5-qrcode/esm/camera/core-impl.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/core.d.ts b/src/main/node_modules/html5-qrcode/esm/camera/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/core.js b/src/main/node_modules/html5-qrcode/esm/camera/core.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/core.js.map b/src/main/node_modules/html5-qrcode/esm/camera/core.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/factories.d.ts b/src/main/node_modules/html5-qrcode/esm/camera/factories.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/factories.js b/src/main/node_modules/html5-qrcode/esm/camera/factories.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/factories.js.map b/src/main/node_modules/html5-qrcode/esm/camera/factories.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/permissions.d.ts b/src/main/node_modules/html5-qrcode/esm/camera/permissions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/permissions.js b/src/main/node_modules/html5-qrcode/esm/camera/permissions.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/permissions.js.map b/src/main/node_modules/html5-qrcode/esm/camera/permissions.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/retriever.d.ts b/src/main/node_modules/html5-qrcode/esm/camera/retriever.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/retriever.js b/src/main/node_modules/html5-qrcode/esm/camera/retriever.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/camera/retriever.js.map b/src/main/node_modules/html5-qrcode/esm/camera/retriever.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/code-decoder.d.ts b/src/main/node_modules/html5-qrcode/esm/code-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/code-decoder.js b/src/main/node_modules/html5-qrcode/esm/code-decoder.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/code-decoder.js.map b/src/main/node_modules/html5-qrcode/esm/code-decoder.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/core.d.ts b/src/main/node_modules/html5-qrcode/esm/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/core.js b/src/main/node_modules/html5-qrcode/esm/core.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/core.js.map b/src/main/node_modules/html5-qrcode/esm/core.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/experimental-features.d.ts b/src/main/node_modules/html5-qrcode/esm/experimental-features.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/experimental-features.js b/src/main/node_modules/html5-qrcode/esm/experimental-features.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/experimental-features.js.map b/src/main/node_modules/html5-qrcode/esm/experimental-features.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/html5-qrcode-scanner.d.ts b/src/main/node_modules/html5-qrcode/esm/html5-qrcode-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/html5-qrcode-scanner.js b/src/main/node_modules/html5-qrcode/esm/html5-qrcode-scanner.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/html5-qrcode-scanner.js.map b/src/main/node_modules/html5-qrcode/esm/html5-qrcode-scanner.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/html5-qrcode.d.ts b/src/main/node_modules/html5-qrcode/esm/html5-qrcode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/html5-qrcode.js b/src/main/node_modules/html5-qrcode/esm/html5-qrcode.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/html5-qrcode.js.map b/src/main/node_modules/html5-qrcode/esm/html5-qrcode.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/image-assets.d.ts b/src/main/node_modules/html5-qrcode/esm/image-assets.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/image-assets.js b/src/main/node_modules/html5-qrcode/esm/image-assets.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/image-assets.js.map b/src/main/node_modules/html5-qrcode/esm/image-assets.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/index.d.ts b/src/main/node_modules/html5-qrcode/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/index.js b/src/main/node_modules/html5-qrcode/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/index.js.map b/src/main/node_modules/html5-qrcode/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/native-bar-code-detector.d.ts b/src/main/node_modules/html5-qrcode/esm/native-bar-code-detector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/native-bar-code-detector.js b/src/main/node_modules/html5-qrcode/esm/native-bar-code-detector.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/native-bar-code-detector.js.map b/src/main/node_modules/html5-qrcode/esm/native-bar-code-detector.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/state-manager.d.ts b/src/main/node_modules/html5-qrcode/esm/state-manager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/state-manager.js b/src/main/node_modules/html5-qrcode/esm/state-manager.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/state-manager.js.map b/src/main/node_modules/html5-qrcode/esm/state-manager.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/storage.d.ts b/src/main/node_modules/html5-qrcode/esm/storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/storage.js b/src/main/node_modules/html5-qrcode/esm/storage.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/storage.js.map b/src/main/node_modules/html5-qrcode/esm/storage.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/strings.d.ts b/src/main/node_modules/html5-qrcode/esm/strings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/strings.js b/src/main/node_modules/html5-qrcode/esm/strings.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/strings.js.map b/src/main/node_modules/html5-qrcode/esm/strings.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui.d.ts b/src/main/node_modules/html5-qrcode/esm/ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui.js b/src/main/node_modules/html5-qrcode/esm/ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui.js.map b/src/main/node_modules/html5-qrcode/esm/ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/base.d.ts b/src/main/node_modules/html5-qrcode/esm/ui/scanner/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/base.js b/src/main/node_modules/html5-qrcode/esm/ui/scanner/base.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/base.js.map b/src/main/node_modules/html5-qrcode/esm/ui/scanner/base.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-selection-ui.js b/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-selection-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-selection-ui.js.map b/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-selection-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-zoom-ui.d.ts b/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-zoom-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-zoom-ui.js b/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-zoom-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-zoom-ui.js.map b/src/main/node_modules/html5-qrcode/esm/ui/scanner/camera-zoom-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/file-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/esm/ui/scanner/file-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/file-selection-ui.js b/src/main/node_modules/html5-qrcode/esm/ui/scanner/file-selection-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/file-selection-ui.js.map b/src/main/node_modules/html5-qrcode/esm/ui/scanner/file-selection-ui.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/scan-type-selector.d.ts b/src/main/node_modules/html5-qrcode/esm/ui/scanner/scan-type-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/scan-type-selector.js b/src/main/node_modules/html5-qrcode/esm/ui/scanner/scan-type-selector.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/scan-type-selector.js.map b/src/main/node_modules/html5-qrcode/esm/ui/scanner/scan-type-selector.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/torch-button.d.ts b/src/main/node_modules/html5-qrcode/esm/ui/scanner/torch-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/torch-button.js b/src/main/node_modules/html5-qrcode/esm/ui/scanner/torch-button.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/ui/scanner/torch-button.js.map b/src/main/node_modules/html5-qrcode/esm/ui/scanner/torch-button.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/utils.d.ts b/src/main/node_modules/html5-qrcode/esm/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/utils.js b/src/main/node_modules/html5-qrcode/esm/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/utils.js.map b/src/main/node_modules/html5-qrcode/esm/utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.d.ts b/src/main/node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js b/src/main/node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js.map b/src/main/node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/experimental-features.d.ts b/src/main/node_modules/html5-qrcode/experimental-features.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/html5-qrcode-scanner.d.ts b/src/main/node_modules/html5-qrcode/html5-qrcode-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/html5-qrcode.d.ts b/src/main/node_modules/html5-qrcode/html5-qrcode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/html5-qrcode.min.js b/src/main/node_modules/html5-qrcode/html5-qrcode.min.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/image-assets.d.ts b/src/main/node_modules/html5-qrcode/image-assets.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/index.d.ts b/src/main/node_modules/html5-qrcode/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/native-bar-code-detector.d.ts b/src/main/node_modules/html5-qrcode/native-bar-code-detector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/package.json b/src/main/node_modules/html5-qrcode/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bc7616ad5306f6afcea5b530326b51d8d2cc44c7 --- /dev/null +++ b/src/main/node_modules/html5-qrcode/package.json @@ -0,0 +1,93 @@ +{ + "name": "html5-qrcode", + "version": "2.3.8", + "description": "A cross platform HTML5 QR Code & bar code scanner", + "main": "./cjs/index.js", + "module": "./esm/index.js", + "typings": "./esm/index.d.ts", + "esnext": "./es2015/index.js", + "unpkg": "./html5-qrcode.min.js", + "scripts": { + "build-windows": "npm run build:es2015 && npm run build:esm && npm run build:esnext && npm run build:cjs && npm run build:umd_windows && npm run build:typing && npm run build:copy_windows", + "test": "npm run-script test:build && npm run-script test:run", + "test_windows": "npm run-script test:build && npm run-script test:run_windows", + "test:build": "tsc --build tsconfig.test.json", + "test:run_windows": ".\\scripts\\test-run.bat", + "test:run": "./scripts/test-run.sh", + "lint-md": "remark .", + "clean": "rm -Rf ./lib/* ./build/* ./meta/bundlesize/* ./meta/coverage/* ./.rpt2_cache ./dist/* ./src/*.d.ts", + "prebuild": "npm run clean", + "postbuild": "cp -R ./third_party ./dist/third_party", + "build": "npm run build:es2015 && npm run build:esm && npm run build:esnext && npm run build:cjs && npm run build:umd && npm run build:typing && npm run build:copy", + "build:es2015": "tsc --build tsconfig.lib-es2015.json", + "build:esm": "tsc --build tsconfig.lib-esm.json", + "build:esnext": "tsc --build tsconfig.lib-esm.json", + "build:cjs": "tsc --build tsconfig.lib-cjs.json", + "build:typing": "tsc --emitDeclarationOnly --outDir ./dist", + "build:umd": "./scripts/build-webpack.sh", + "build:umd_windows": ".\\scripts\\build-webpack.bat", + "build:copy": "cp README.md dist && cp package.json dist && cp LICENSE dist && cp -R src dist/src", + "build:copy_windows": "copy README.md dist && copy package.json dist && copy LICENSE dist", + "internal_release": "npm run build && cp dist/html5-qrcode.min.js minified/html5-qrcode.min.js", + "release": "npm run build && cp dist/html5-qrcode.min.js minified/html5-qrcode.min.js && cd dist && npm publish", + "release_windows": "npm run build && cp dist\\html5-qrcode.min.js minified\\html5-qrcode.min.js && cd dist && npm publish", + "doc_gen": "npx typedoc --excludePrivate src/index.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mebjas/html5-qrcode.git" + }, + "keywords": [ + "html5", + "qrcode", + "html", + "camera", + "scanner", + "barcode", + "barcode 1d", + "barcode 2d" + ], + "author": "minhazav@gmail.com", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/mebjas/html5-qrcode/issues" + }, + "homepage": "https://github.com/mebjas/html5-qrcode#readme", + "devDependencies": { + "@babel/cli": "^7.10.5", + "@babel/core": "^7.11.4", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/preset-env": "^7.11.0", + "@types/chai": "^4.3.0", + "@types/mocha": "^9.0.0", + "babel-minify": "^0.5.1", + "chai": "^4.3.4", + "docusaurus-plugin-typedoc": "^0.18.0", + "expose-loader": "^2.0.0", + "jsdom": "20.0.2", + "jsdom-global": "3.0.2", + "mocha": "^9.1.3", + "mocha-lcov-reporter": "^1.3.0", + "promise-polyfill": "^8.1.3", + "remark-cli": "^9.0.0", + "remark-preset-lint-recommended": "^5.0.0", + "rewire": "^5.0.0", + "ts-loader": "^9.1.2", + "ts-node": "^10.4.0", + "tsconfig-paths": "^3.12.0", + "typedoc": "^0.23.28", + "typedoc-plugin-markdown": "^3.14.0", + "typescript": "^4.3.2", + "typings": "^2.1.1", + "webpack": "^5.37.0", + "webpack-cli": "^4.7.0" + }, + "remarkConfig": { + "plugins": [ + "remark-preset-lint-recommended" + ] + }, + "publishConfig": { + "access": "public" + } +} diff --git a/src/main/node_modules/html5-qrcode/src/camera/core-impl.d.ts b/src/main/node_modules/html5-qrcode/src/camera/core-impl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/core-impl.ts b/src/main/node_modules/html5-qrcode/src/camera/core-impl.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/core.d.ts b/src/main/node_modules/html5-qrcode/src/camera/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/core.ts b/src/main/node_modules/html5-qrcode/src/camera/core.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/factories.d.ts b/src/main/node_modules/html5-qrcode/src/camera/factories.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/factories.ts b/src/main/node_modules/html5-qrcode/src/camera/factories.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/permissions.d.ts b/src/main/node_modules/html5-qrcode/src/camera/permissions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/permissions.ts b/src/main/node_modules/html5-qrcode/src/camera/permissions.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/retriever.d.ts b/src/main/node_modules/html5-qrcode/src/camera/retriever.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/camera/retriever.ts b/src/main/node_modules/html5-qrcode/src/camera/retriever.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/code-decoder.d.ts b/src/main/node_modules/html5-qrcode/src/code-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/code-decoder.ts b/src/main/node_modules/html5-qrcode/src/code-decoder.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/core.d.ts b/src/main/node_modules/html5-qrcode/src/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/core.ts b/src/main/node_modules/html5-qrcode/src/core.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/experimental-features.d.ts b/src/main/node_modules/html5-qrcode/src/experimental-features.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/experimental-features.ts b/src/main/node_modules/html5-qrcode/src/experimental-features.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/html5-qrcode-scanner.d.ts b/src/main/node_modules/html5-qrcode/src/html5-qrcode-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/html5-qrcode-scanner.ts b/src/main/node_modules/html5-qrcode/src/html5-qrcode-scanner.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/html5-qrcode.d.ts b/src/main/node_modules/html5-qrcode/src/html5-qrcode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/html5-qrcode.ts b/src/main/node_modules/html5-qrcode/src/html5-qrcode.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/image-assets.d.ts b/src/main/node_modules/html5-qrcode/src/image-assets.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/image-assets.ts b/src/main/node_modules/html5-qrcode/src/image-assets.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/index.d.ts b/src/main/node_modules/html5-qrcode/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/index.ts b/src/main/node_modules/html5-qrcode/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/native-bar-code-detector.d.ts b/src/main/node_modules/html5-qrcode/src/native-bar-code-detector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/native-bar-code-detector.ts b/src/main/node_modules/html5-qrcode/src/native-bar-code-detector.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/state-manager.d.ts b/src/main/node_modules/html5-qrcode/src/state-manager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/state-manager.ts b/src/main/node_modules/html5-qrcode/src/state-manager.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/storage.d.ts b/src/main/node_modules/html5-qrcode/src/storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/storage.ts b/src/main/node_modules/html5-qrcode/src/storage.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/strings.d.ts b/src/main/node_modules/html5-qrcode/src/strings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/strings.ts b/src/main/node_modules/html5-qrcode/src/strings.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui.d.ts b/src/main/node_modules/html5-qrcode/src/ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui.ts b/src/main/node_modules/html5-qrcode/src/ui.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/base.d.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/base.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/base.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-selection-ui.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-selection-ui.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-zoom-ui.d.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-zoom-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-zoom-ui.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/camera-zoom-ui.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/file-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/file-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/file-selection-ui.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/file-selection-ui.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/scan-type-selector.d.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/scan-type-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/scan-type-selector.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/scan-type-selector.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/torch-button.d.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/torch-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/ui/scanner/torch-button.ts b/src/main/node_modules/html5-qrcode/src/ui/scanner/torch-button.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/utils.d.ts b/src/main/node_modules/html5-qrcode/src/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/utils.ts b/src/main/node_modules/html5-qrcode/src/utils.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/zxing-html5-qrcode-decoder.d.ts b/src/main/node_modules/html5-qrcode/src/zxing-html5-qrcode-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/src/zxing-html5-qrcode-decoder.ts b/src/main/node_modules/html5-qrcode/src/zxing-html5-qrcode-decoder.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/state-manager.d.ts b/src/main/node_modules/html5-qrcode/state-manager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/storage.d.ts b/src/main/node_modules/html5-qrcode/storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/strings.d.ts b/src/main/node_modules/html5-qrcode/strings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/third_party/zxing-js.umd.d.ts b/src/main/node_modules/html5-qrcode/third_party/zxing-js.umd.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/third_party/zxing-js.umd.js b/src/main/node_modules/html5-qrcode/third_party/zxing-js.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui.d.ts b/src/main/node_modules/html5-qrcode/ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui/scanner/base.d.ts b/src/main/node_modules/html5-qrcode/ui/scanner/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui/scanner/camera-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/ui/scanner/camera-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui/scanner/camera-zoom-ui.d.ts b/src/main/node_modules/html5-qrcode/ui/scanner/camera-zoom-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui/scanner/file-selection-ui.d.ts b/src/main/node_modules/html5-qrcode/ui/scanner/file-selection-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui/scanner/scan-type-selector.d.ts b/src/main/node_modules/html5-qrcode/ui/scanner/scan-type-selector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/ui/scanner/torch-button.d.ts b/src/main/node_modules/html5-qrcode/ui/scanner/torch-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/utils.d.ts b/src/main/node_modules/html5-qrcode/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/node_modules/html5-qrcode/zxing-html5-qrcode-decoder.d.ts b/src/main/node_modules/html5-qrcode/zxing-html5-qrcode-decoder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/package-lock.json b/src/main/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..f87cd0fa617c70015c9a214b517c1c4ccb8d53ce --- /dev/null +++ b/src/main/package-lock.json @@ -0,0 +1,20 @@ +{ + "name": "main", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "main", + "version": "1.0.0", + "dependencies": { + "html5-qrcode": "^2.3.8" + } + }, + "node_modules/html5-qrcode": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/html5-qrcode/-/html5-qrcode-2.3.8.tgz", + "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==" + } + } +} diff --git a/src/main/package.json b/src/main/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b58ec6ea1338ef9ef2376b74567a94cef9c2efd5 --- /dev/null +++ b/src/main/package.json @@ -0,0 +1,7 @@ +{ + "name": "main", + "version": "1.0.0", + "dependencies": { + "html5-qrcode": "^2.3.8" + } +} diff --git a/src/main/resources/QRCodeScanner.html b/src/main/resources/QRCodeScanner.html deleted file mode 100644 index 11da0658b1421e28159c97fc5abae82030ff3630..0000000000000000000000000000000000000000 --- a/src/main/resources/QRCodeScanner.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>QR Camera</title> -</head> -<body> - -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 95f46c69ab2c6b38e1c520a5b8438c8f87aba0a3..52e81d219c68d4702643665e6f9d58c7aebb8308 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -3,3 +3,4 @@ spring.datasource.username=root spring.datasource.password=comsc spring.sql.init.mode=always +spring.sql.init.data-locations=classpath:data.sql, classpath:/static/sql/user-data.sql, classpath:/static/sql/user-progress-data.sql diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index c32f7fec9a996cf9c828449300ea76f36f4813a8..389042e16e7a3acdc3cb53ca62ce1a7438747069 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -1,62 +1,104 @@ -delete from users; -insert into users (email, name, dragonProgress) value ('hannah@gmail.com', 'Hannah', '90'); -insert into users (userID, email, name, dragonProgress) value ('2', 'nigel@gmail.com', 'Nigel', '40'); +# delete from users; +# insert into users (email, name) value ('hannah@gmail.com', 'Hannah'); +# insert into users (email, name) value ('nigel@gmail.com', 'Nigel'); delete from trails; -insert into trails ( Name) value ( 'Caerphilly Coffee Trail'); -insert into trails ( Name) value ( 'Penarth Dragon Trail'); +insert into trails ( trailID, trailName, trailNumber) value ( 0101,'Caerphilly Castle Trail','0101'); +insert into trails ( trailID, trailName, trailNumber) value ( 0102,'Caerphilly Pub Trail','0102'); +insert into trails ( trailID, trailName, trailNumber) value ( 0103,'Caerphilly Heritage Trail','0103'); +insert into trails ( trailID, trailName, trailNumber) value ( 0201,'Risca Heritage Trail','0201'); +insert into trails ( trailID, trailName, trailNumber) value ( 0301,'Penarth Esplanade Trail','0301'); delete from locations; -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'St Cenydd','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'The Castle','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Medieval Trades','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'The Queen''s War','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'The Green Lady','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Armoury','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Architecture','','Location description here','Caerphilly',0101); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( '21st Century Landmark','','Location description here','Caerphilly',0101); - -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'JD Wetherspoons-Malcolm Uphill','','Location description here','Caerphilly',0102); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Caerphilly Cwtch','','Location description here','Caerphilly',0102); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Caerphilly Conservative Club','','Location description here','Caerphilly',0102); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'The King''s Arms','','Location description here','Caerphilly',0102); - -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Caerphilly Bus Station','','Location description here','Caerphilly',0103); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'The Medieval Courthouse','','Location description here','Caerphilly',0103); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('Caerphilly Castle','','Location description here','Caerphilly',0103); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Ty Vaughan House','','Location description here','Caerphilly',0103); - -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Risca Colliery','','Location description here','Risca',0201); -insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'Black Vein Colliery Disaster','','Location description here','Risca',0201); - - -insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (19, 'The Esplanade','','Location description here','Penarth',0301); -insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (20, 'The Old Swimming Baths','','Location description here','Penarth',0301); -delete from badges; -insert into badges (name, description, difficulty) value ('TownConnoisseur', 'You know the town very well!', '2'); -insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); -insert into badges (name, description, difficulty) value ('TownMaster', 'You visited the town 7 days in a row!', '1'); -insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); -insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); - -delete from stickers; -insert into stickers (name, description, rarity) value ('TownConnoisseur', 'You know the town very well!', '2'); -insert into stickers (name, description, rarity) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); -insert into stickers (name, description, rarity) value ('TownMaster', 'You visited the town 7 days in a row!', '1'); -insert into stickers (name, description, rarity) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); -insert into stickers (name, description, rarity) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); - -delete from badgeprogress; -insert into badgeprogress (userID, badgeID, progress) value ('1', '1', '40'); -insert into badgeprogress (userID, badgeID, progress) value ('1', '2', '70'); -insert into badgeprogress (userID, badgeID, progress) value ('2', '2', '70'); - -delete from stickerprogress; -insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '1', true); -insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '3', true); -insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true); - -delete from localauthority; -insert into localauthority ( localAuthorityName, address1, address2, city, county, postcode, website) value ( 'Caerphilly County Borough Council', 'Tredomen Park','', 'Ystrad Mynach, Hengoed', '', 'CF82 7PG', 'https://www.caerphilly.gov.uk/main.aspx?lang=en-GB'); -insert into localauthority ( localAuthorityName, address1, address2, city, county, postcode, website) value ( 'Risca Town Council', 'Unit B, 75 Tredegar Street', '', 'Risca', '', 'NP11 6BW', 'https://www.riscatowncouncil.org.uk/'); -insert into localauthority ( localAuthorityName, address1, address2, city, county, postcode, website) value ( 'Penarth Town Council West House', 'Stanwell Road', '', 'Penarth', '', 'CF64 2YG', 'https://www.penarthtowncouncil.gov.uk/your-council/'); \ No newline at end of file +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'St Cenydd','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Castle','','Location description here','Caerphilly',0101, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Medieval Trades','','Location description here','Caerphilly',0101, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Queen''s War','','Location description here','Caerphilly',0101, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Green Lady','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Armoury','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Architecture','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( '21st Century Landmark','','Location description here','Caerphilly',0101, false); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'JD Wetherspoons-Malcolm Uphill','','Location description here','Caerphilly',0102, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Cwtch','','Location description here','Caerphilly',0102, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Conservative Club','','Location description here','Caerphilly',0102, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The King''s Arms','','Location description here','Caerphilly',0102, false); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Bus Station','','Location description here','Caerphilly',0103, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Medieval Courthouse','','Location description here','Caerphilly',0103, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ('Caerphilly Castle','','Location description here','Caerphilly',0103, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Ty Vaughan House','','Location description here','Caerphilly',0103, false); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Risca Colliery','','Location description here','Risca',0201, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Black Vein Colliery Disaster','','Location description here','Risca',0201, true); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Esplanade','','Location description here','Penarth',0301, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Old Swimming Baths','','Location description here','Penarth',0301, true); + + +# delete from badges; +# insert into badges (name, description, difficulty) value ('TownConnoisseur', 'You know the town very well!', '2'); +# insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); +# insert into badges (name, description, difficulty) value ('TownMaster', 'You visited the town 7 days in a row!', '1'); +# insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); +# insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); + + + +delete from packs; +insert into packs (name, description) value ('Wales Football Team', 'Pack of Welsh Football Players in the National Team'); +insert into packs (name, description) value ('Wales Rugby Team', 'Pack of Welsh Rugby Players in the National Team'); +insert into packs (name, description) value ('Welsh Heritage', 'Pack About Welsh Heritage'); + + +DELETE FROM stickers; +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 1, 'wayne_hennessey', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 2, 'neco_williams', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 3, 'joe_morrell', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 4, 'ethan_ampadu', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 5, 'connor_roberts', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 1, 'Taine_Basham', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 2, 'Adam Beard', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 3, 'Elliot Dee', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 4, 'Corey Domachowski', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 5, 'Ryan Elias', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 1, 'Welsh Lady', 'Welsh Heritage', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 2, 'Welsh Outline', 'Welsh Heritage', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 3, 'Welsh Spoon', 'Welsh Heritage', '1'); + +# delete from stickerprogress; +# insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '1', true); +# insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '3', true); +# insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true); + +delete from locationCoordinates; +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (2, 51.57623, -3.21910 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (3, 51.575372, -3.219186); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (4, 51.576363, -3.220712 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (9, 51.57239, -3.21992); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (10, 51.57230, -3.21938 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (13, 51.57168, -3.21861); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (14, 51.57465, -3.22022 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (17, 51.61117, -3.10198 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (18, 51.61655, -3.12371 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (19, 51.43484, -3.16492 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (20, 51.43547, -3.16789 ); + + + + + +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 1); +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 2); +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 3); +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 5); +# insert into stickerprogress (userID, packID, stickerID) value (1, 2, 1); +# insert into stickerprogress (userID, packID, stickerID) value (1, 2, 3); + + + +# +delete from townsWithTrails; +insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Caerphilly', '51.57903','-3.22075 ','51.60418','51.55093','-3.25222','-3.17696'); +insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Risca','51.61195','-3.09648','51.63039','51.59175','-3.12129','-3.06438'); +insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Penarth','51.43893','-3.17354','51.44878','51.41233','-3.20271','-3.16005'); \ No newline at end of file diff --git a/src/main/resources/index.html b/src/main/resources/index.html deleted file mode 100644 index 489349d1b63d75904028b48ddd4eb36d29f63650..0000000000000000000000000000000000000000 --- a/src/main/resources/index.html +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>Home Page</title> -</head> -<body> -<h1>Welcome to the home page</h1> - -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 43f6da94fe471a5e173b409570cd7d61f9e41792..6a2f0ee317773ffb4f36e8b87037a5c250bcb1c4 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -1,12 +1,34 @@ + +/* DELETES AND RECREATES DATABASE EVERY TIME THE SYSTEM IS BOOTED*/ +DROP DATABASE IF EXISTS towns; +CREATE DATABASE IF NOT EXISTS towns; +USE towns; +/****************************************************************/ + +/* DROPS ALL TABLES IF THEY EXIST (they wont but just in case) */ + +drop table if exists locationCoordinates; +drop table if exists locations; drop table if exists trails; +DROP TABLE IF EXISTS users; +DROP TABLE IF EXISTS stickers; +DROP TABLE IF EXISTS packs; +DROP TABLE IF EXISTS stickerProgress; + + + +/****************************************************************/ + +/* CREATES ALL TABLES */ create table if not exists trails ( - trailID bigint auto_increment primary key, - name varchar(128) + trailID varchar(128) primary key, + trailName varchar(128), + trailNumber varchar(128) ) engine=InnoDB; +drop table if exists locationCoordinates; drop table if exists locations; - create table if not exists locations ( locationID bigint auto_increment primary key, @@ -14,60 +36,83 @@ create table if not exists locations locationEmail varchar(128), locationDescription longtext, locationPlace varchar(255), - locationTrailID varchar(128) + locationTrailID varchar(128), + locationApproved boolean ) engine=InnoDB; -drop table if exists users; -create table if not exists users -( - userID bigint auto_increment primary key, + +CREATE TABLE IF NOT EXISTS users ( + username varchar(30) primary key NOT NULL, + id bigint auto_increment unique, /*DEPRECATED COLUMN, LEFT IN WHILE SOME OTHER FUNCTIONS STILL USE IT*/ email varchar(128), - name varchar(128), - dragonProgress int -) engine=InnoDB; + password varchar(30) NOT NULL, + enabled boolean default true +); -drop table if exists badges; -create table if not exists badges -( - badgeID bigint auto_increment primary key, - name varchar(128), - description varchar(128), - difficulty bigint -) engine=InnoDB; - -drop table if exists stickers; -create table if not exists stickers -( - stickerID bigint auto_increment primary key, - name varchar(128), - description varchar(128), - rarity bigint -) engine=InnoDB; - -drop table if exists badgeProgress; -create table if not exists badgeProgress -( - userID bigint, - badgeID bigint, - progress int /*0-100*/ -) engine=InnoDB; +CREATE TABLE IF NOT EXISTS authorities ( + id bigint primary key auto_increment NOT NULL, + username varchar(30) NOT NULL , + authority varchar(45) NOT NULL +); + +CREATE TABLE IF NOT EXISTS packs ( + id bigint auto_increment primary key, + name varchar(20) NOT NULL, + description text +); + +CREATE TABLE IF NOT EXISTS stickers ( + id bigint auto_increment primary key, + packID bigint NOT NULL, + FOREIGN KEY (packID) REFERENCES packs(id) + ON DELETE CASCADE + ON UPDATE RESTRICT, + stickerID bigint NOT NULL, /*STICKER ID NUMBER WITHIN ITS OWN PACK*/ + name varchar(30) NOT NULL, + description text NOT NULL, + rarity tinyint +); +CREATE TABLE IF NOT EXISTS stickerProgress ( + id bigint auto_increment primary key, + username varchar(30) NOT NULL, + FOREIGN KEY (username) REFERENCES users(username) + ON DELETE CASCADE + ON UPDATE RESTRICT, + packID bigint NOT NULL, + FOREIGN KEY (packID) REFERENCES packs(id) + ON DELETE CASCADE + ON UPDATE RESTRICT, + stickerID bigint NOT NULL, + FOREIGN KEY (stickerID) REFERENCES stickers(id) + ON DELETE CASCADE + ON UPDATE RESTRICT +); -create table if not exists stickerProgress +create table if not exists locationCoordinates ( - userID bigint, - stickerID bigint, - hasSticker boolean /*Has sticker or not*/ -) engine=InnoDB; + locationCoordID bigint auto_increment primary key, + locationID bigint, + Foreign Key (locationID) REFERENCES locations(locationID) + ON DELETE CASCADE + ON UPDATE RESTRICT, + locationCoordsLat DECIMAL(8,6), + locationCoordsLong DECIMAL(8,6) -drop table if exists localAuthority; -create table if not exists localAuthority + +)engine=InnoDB; + + +drop table if exists townsWithTrails; +create table if not exists townsWithTrails ( - localAuthorityID bigint auto_increment primary key, - localAuthorityName varchar(250), - address1 varchar(250), - address2 varchar(250), - city varchar(100), - county varchar(75), - postcode varchar(15), - website varchar(250) -) engine=InnoDB; \ No newline at end of file + townID bigint auto_increment primary key, + townName varchar(128), + townCentreCoordsLat varchar(128), + townCentreCoordsLong varchar(128), + townUppermostCoordsLat varchar(128), + townLowermostCoordsLat varchar(128), + townLeftmostCoordsLong varchar(128), + townRightmostCoordsLong varchar(128) + +)engine=InnoDB; + diff --git a/src/main/resources/static/css/locationPageFragsStyle.css b/src/main/resources/static/css/locationPageFragsStyle.css new file mode 100644 index 0000000000000000000000000000000000000000..db091e112e77a7abc0c507fc0305e6a2a2244317 --- /dev/null +++ b/src/main/resources/static/css/locationPageFragsStyle.css @@ -0,0 +1,34 @@ +.locationFragment{ + background-color: rgb(206, 153, 253); + color: black; + border-color: white; + align-content: center; + text-align: center; + border-radius: 25px; + max-width: 800px; + margin: 0 auto; + +} +.locationPageFrag{ + background: rgb(41, 41, 41); + color: wheat; +} + +#return{ + padding-bottom: 10px; +} +iframe{ + margin-top: 20px; + margin-bottom: 60px; + border: white 2px solid; +} +H1{ + padding-top: 5px; + padding-bottom:3px ; + margin-bottom: 0; +} +#townHeader{ + margin: 0; + padding: 0; + +} \ No newline at end of file diff --git a/src/main/resources/static/css/login.css b/src/main/resources/static/css/login.css new file mode 100644 index 0000000000000000000000000000000000000000..023566c253e9354e789e85744cd1e4989d523845 --- /dev/null +++ b/src/main/resources/static/css/login.css @@ -0,0 +1,372 @@ +@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap'); + +:root { + --container-colour: #2a2a2a; + --details-colour: var(--primary-light); + --details-light: #512da8; + + --font-buttons: 14px; + --font-size-1: 14px; + --font-size-2: 200px; + --font-size-3: 300px; + + --error-colour: red; +} + +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Montserrat', sans-serif; + color: white; +} + +body{ + align-items: center; + height: 100svh; +} + +main { + height: 90%; + width: 90%; + display: flex; + align-items: center; + justify-content: center; +} + +@keyframes move{ + 0%, 49.99%{ + opacity: 0; + z-index: 1; + } + 50%, 100%{ + opacity: 1; + z-index: 5; + } +} + +@media only screen +and (min-device-width: 650px) { + .container{ + background-color: var(--container-colour); + border-radius: 30px; + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35); + position: relative; + overflow: hidden; + min-width: 768px; + max-width: 100%; + min-height: 480px; + } + + .container p{ + font-size: 14px; + line-height: 20px; + letter-spacing: 0.3px; + margin: 20px 0; + } + + + .container a{ + font-size: var(--font-size-1); + text-decoration: none; + margin: 15px 0 10px; + } + + .container button{ + background-color: var(--details-colour)/*#512da8*/; + color: #fff; + font-size: var(--font-buttons); + padding: 10px 45px; + border: 1px solid transparent; + border-radius: 8px; + font-weight: 600; + letter-spacing: 0.5px; + text-transform: uppercase; + margin-top: 10px; + cursor: pointer; + } + + .container button.hidden{ + background-color: transparent; + border-color: #fff; + } + + .container form{ + background-color: var(--container-colour); + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + padding: 0 40px; + height: 100%; + } + + .container input{ + background-color: #eee; + border: none; + margin: 8px 0; + padding: 10px 15px; + font-size: 13px; + border-radius: 8px; + width: 100%; + outline: none; + } + + .form-container{ + position: absolute; + top: 0; + height: 100%; + transition: all 0.6s ease-in-out; + } + + .sign-in{ + left: 0; + width: 50%; + z-index: 2; + } + + .container.active .sign-in{ + transform: translateX(100%); + } + + .sign-up{ + left: 0; + width: 50%; + opacity: 0; + z-index: 1; + } + + .container.active .sign-up{ + transform: translateX(100%); + opacity: 1; + z-index: 5; + animation: move 0.6s; + } + + + + .toggle-container{ + position: absolute; + top: 0; + left: 50%; + width: 50%; + height: 100%; + overflow: hidden; + transition: all 0.6s ease-in-out; + border-radius: 150px 0 0 100px; + z-index: 1000; + } + + .container.active .toggle-container{ + transform: translateX(-100%); /*BG THING*/ + border-radius: 0 150px 100px 0; + } + + .toggle{ + background-color: var(--details-colour); + height: 100%; + background: linear-gradient(to right, var(--details-light), var(--details-colour)); + color: #fff; + position: relative; + left: -100%; + height: 100%; + width: 200%; + transform: translateX(0); + transition: all 0.6s ease-in-out; + } + + .container.active .toggle{ + transform: translateX(50%); + } + + .toggle-panel{ + position: absolute; + width: 50%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + padding: 0 30px; + text-align: center; + top: 0; + transform: translateX(0); + transition: all 0.6s ease-in-out; + } + + .toggle-left{ + transform: translateX(-200%); + } + + .container.active .toggle-left{ + transform: translateX(0); + } + + .toggle-right{ + right: 0; + transform: translateX(0); + } + + .container.active .toggle-right{ + transform: translateX(200%); + } + .input { + color: black; + } + +} +@media only screen +and (max-device-width: 640px) { + .container { + position: relative; + + background-color: var(--container-colour); + border-radius: 30px; + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35); + + overflow: hidden; + + width: 100%; + height: 100%; + + display: flex; + flex-direction: column; + justify-content: space-evenly; + } + .form-container { + height: 100%; + transition: all 0.6s ease-in-out; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + } + .form-container form { + display: flex; + + flex-direction: column; + align-items: center; + font-size: 3em; + margin-inline: 5%; + } + .form-container input { + flex: 1 1; + font-size: 1em; + color: black; + margin-block: 5%; + padding: 2%; + border-radius: 30px; + } + + .form-container button { + flex: 1 1; + font-size: 1em; + } + .toggle-container { + position: absolute; + top: 0; + width: 100%; + height: 50%; + transition: all 0.6s ease-in-out; + overflow: hidden; + border-radius: 0 0 150px 150px; + z-index: 1000; + + } + .container.active .toggle-container{ + transform: translateY(100%); /*BG THING*/ + border-radius: 150px 150px 0 0; + } + .toggle { + position: absolute; + width: 100%; + height: 200%; + display: flex; + flex-direction: column-reverse; + align-items: center; + justify-content: space-evenly; + background: linear-gradient(to bottom, var(--details-light), var(--details-colour)); + /*background-color: red;*/ + } + .toggle-panel { + flex: 1 1; + width: 100%; + } + .container .toggle-right { + transform: translateY(0); + opacity: 1; + } + .container .toggle-left { + transform: translateY(-100%); + opacity: 0; + } + .container.active .toggle-right{ + transform: translateY(-100%); + opacity: 0; + } + .container.active .toggle-left{ + transform: translateY(-100%); + opacity: 1; + } + + .container .sign-up { + opacity: 0; + z-index: -1; + transform: translateY(100%); + } + .container .sign-in { + opacity: 1; + z-index: 5; + } + + .container.active .sign-in{ + transform: translateY(-100%); + opacity: 0; + z-index: -1; + } + .container.active .sign-up{ + animation: move 0.6s; + opacity: 1; + z-index: 5; + transform: translateY(0); + } + + + .toggle-panel { + transition: all 0.6s ease-in-out; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: xxx-large; + + } + .toggle-panel p { + margin-inline: 10%; + margin-block: 5%; + line-height: 1.5em; + } + .container button{ + background-color: var(--details-colour)/*#512da8*/; + color: #fff; + font-size: xxx-large; + padding: 40px 40px; + border: 5px solid transparent; + border-radius: 14px; + font-weight: 600; + letter-spacing: 1px; + text-transform: uppercase; + margin-top: 30px; + cursor: pointer; + } + + .container button.hidden{ + background-color: transparent; + border-color: #fff; + } +} +.alert { + color: var(--error-colour); + text-shadow: var(--error-colour) 0 0 10px; +} + diff --git a/src/main/resources/static/css/qrstyle.css b/src/main/resources/static/css/qrstyle.css new file mode 100644 index 0000000000000000000000000000000000000000..b0c851a93e488b09a7ebb4c36b09579ac7dedf88 --- /dev/null +++ b/src/main/resources/static/css/qrstyle.css @@ -0,0 +1,65 @@ +/*style sheet for QR code - R Nute*/ +/*Modified from (https://www.geeksforgeeks.org/create-a-qr-code-scanner-or-reader-in-html-css-javascript/)*/ + +body { + display: flex; + justify-content: center; + margin: 0; + padding: 0; + height: 100vh; + box-sizing: border-box; + text-align: center; + background: rgb(84 33 128 / 66%); +} +.container { + width: 100%; + max-width: 500px; + margin: 5px; +} +.container h1 { + color: rgb(84 33 128); +} +.section { + background-color: rgb(84 33 128); + padding: 50px 30px; + border: 2px solid #b2b2b2; + border-radius: 0.5em; + box-shadow: 0 20px 25px rgba(0, 0, 0, 30); +} +#qr-code-reader { + padding: 20px !important; + border: 2px solid #b2b2b2 !important; + border-radius: 10px; +} +#qr-code-reader img[alt="Information icon"] { + display: none; +} +#qr-code-reader img[alt="QR Code Scan"] { + width: 100px !important; + height: 100px !important; +} +button { + padding: 15px 25px; + border: 2px solid #b2b2b2; + outline: none; + border-radius: 0.5em; + color: grey; + font-size: 25px; + cursor: default; + margin-top: 20px; + margin-bottom: 15px; + background-color: rgb(84 33 128); + transition: 0.5s background-color; +} +button:hover { + background-color: rgb(84 33 128); +} +#html-qrcode-scan-type-change { + text-decoration: none !important; + color: #1d9bf0; +} +stickers { + width: 100% !important; + border: 2px solid #b2b2b2 !important; + border-radius: 0.5em; +} diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 08273bc1bba5a74c518361f71f7d88bb53774811..934cac13d9ed4bfebab932cc72b6839e0869b25b 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -1,210 +1,87 @@ * { - box-sizing: border-box; - padding: 0; - margin: 0; + margin: 0; + padding: 0; + box-sizing: border-box; } -#homeHead{ - color: inherit; - text-decoration: none; - padding: 0; - margin: 0;} +* { + /*COLOUR PALETTE*/ + @media (prefers-color-scheme: dark) { + --primary-darker: hsl(272, 100%, 10%); + --primary-dark: hsl(271, 100%, 20%); + --primary-colour: hsl(271, 100%, 30%); + --primary-light: hsl(271, 100%, 40%); + --primary-lighter: hsl(271, 100%, 50%); + + --secondary-colour: hsl(12, 81%, 46%); + --accent-colour: hsl(12, 82%, 32%); + --accent-border: hsl(12, 81%, 25%); + + --accent-shadow: rgba(0, 0, 0, 0.7) 0 0.5em 1em -0.5em; + + color: white; -.center { - text-align: center; -} -body { - background-color: rgb(41, 41, 41); - margin: 0%; -} -.headerBlock { - background-color: rgb(15, 15, 15); - padding-bottom: 20px; - box-shadow: 0 10px 20px black; - .headerTitle { - text-align: center; - padding: 10px 10px 0 10px; - margin: 0 50px 0 50px; - letter-spacing: 10px; - font-size: 50px; - font-style: italic; - color: blueviolet; - text-shadow: black 3px 3px 5px; - border-bottom: 3px blueviolet solid; - } - .headerBanner { - display: flex; - flex-direction: column; - justify-content: center; - overflow: hidden; - position: relative; - height: 200px; - border-top: grey solid 2px; - border-bottom: grey solid 2px; - - .bannerBack { - opacity: 0.6; - width: 100%; - left: 0; - top: 0; - position: absolute - } - .bigTitle { - color:white; - text-align: center; - position: relative; - font-size: 50px; - margin: 20px 20px 5px; - } - .smallTitle { - position: relative; - color:white; - text-align: center; - font-size: 20px; - margin: 5px 20px 20px; - } } -} + @media (prefers-color-scheme: light) { + --primary-darker: hsl(272, 100%, 10%); + --primary-dark: hsl(271, 100%, 20%); + --primary-colour: hsl(271, 100%, 30%); + --primary-light: hsl(271, 100%, 40%); + --primary-lighter: hsl(271, 100%, 50%); + --secondary-colour: hsl(12, 81%, 46%); + --accent-colour: hsl(12, 82%, 32%); + --accent-border: hsl(12, 81%, 25%); + + --accent-shadow: rgba(0, 0, 0, 0.7) 0 0.5em 1em -0.5em; + + color: white; -.mainTrails{ - overflow: hidden; - position: relative; - height: 200px; - border-top: grey solid 2px; - border-bottom: grey solid 2px; -} -.trailList { - .ulHeader { - margin: 30px; - display: flex; - list-style: none; - justify-content: center; - padding: 0px; - border-bottom: solid black 5px; - - .liHeader { - - flex: 1 1 0px; - padding-left: 10px; - padding-right: 10px; - color: white; - text-align: center; - } - .liHeader:hover { - color: blueviolet; - border-bottom: solid blueviolet 2px; - } - .selected { - flex: 1 1 0px; - padding-left: 10px; - padding-right: 10px; - color: rgb(154, 69, 234); - border-bottom: solid blueviolet 2px; - text-align: center; - } } - } -.mainBlock { + +body { + background: linear-gradient(to bottom right, + var(--primary-darker), + var(--primary-dark), + var(--primary-darker)); + display: flex; - min-width: 300px; - flex-wrap: wrap; - margin-top: 20px; - margin-bottom: 100px; + flex-direction: column; + justify-content: center; + align-content: center; } -.mainBlock .trailStats{ - background-color: rgb(206, 153, 253); - flex: 0 0 0px; - min-width: 400px; - height: 600px; - margin: auto; - margin-bottom: 20px; - box-shadow: 0px 0px 20px rgb(20, 20, 20); - border-radius: 30px; - .stats { - display: block; - width: 200px; - margin: auto; - } - .textStats { - display: block; - text-align: left; - margin: 20px; - } -} -.mainBlock .trailInfo{ - background-color: rgb(206, 153, 253); - flex: 0 0 0px; - min-width: 400px; - height: 600px; - margin: auto; - margin-bottom: 20px; - box-shadow: 0px 10px 10px rgb(20, 20, 20); - border-radius: 30px; - .trailInfoTxt { - margin: 15px; - } -} -.titleH1 { - padding: 0px; - margin: 10px 30px 20px 30px; - text-align: center; - font-size: 40px; - font-style: italic; - border-bottom: solid black 1px; -} -.mainBlock p { - font-size: 25px; - text-align: left; - padding: 1px; -} -main .badgesBlock{ - bottom: 0%; - background-color: rgb(222, 75, 255); - flex: 0 0 0px; - min-width: 500px; - min-height: 100px; - margin: auto; - margin-bottom: 10px; - box-shadow: 0px 10px 10px rgb(20, 20, 20); - border-radius: 30px; -} -.badgesList { +.centerAll { display: flex; -} -.badgeImg { - flex: 0 1 0px; - width: 60px; - margin: auto; - margin-bottom: 20px; - + flex-direction: column; + align-items: center; + justify-content: center; } -footer { - z-index: 99; - bottom: 0%; - left: 0%; - position: fixed; - width: 100%; - min-width: 300px; -} -footer .footerBar { - display: flex; - list-style: none; - padding: 0; - margin: 0; - +/*PHONES PORTRAIT*/ +@media only screen +and (min-device-width: 320px) +and (max-device-width: 640px) { + body { + position: fixed; + width: 100vw; + height: 100svh; + } + html { + position: fixed; + width: 100vw; + height: 100svh; + } } -footer .footerButton { - padding: 20px; - text-align: center; - flex: 1 1 0px; - color:crimson; - background-color: white; - + +/*PHONES LANDSCAPE*/ +@media only screen +and (min-device-width: 640px) +and (max-device-width: 1000px) { + + } -footer .footerButton:hover { - background-color: black; -} \ No newline at end of file + +/*LARGER SCREENS*/ +@media only screen and (min-device-width: 1000px) {} \ No newline at end of file diff --git a/src/main/resources/static/css/styling.css b/src/main/resources/static/css/styling.css new file mode 100644 index 0000000000000000000000000000000000000000..01d36eeb7098b8a007c84c09d60d3a5b4f5d965d --- /dev/null +++ b/src/main/resources/static/css/styling.css @@ -0,0 +1,2 @@ +/*@import "../../templates/towns/mapsTest/node_modules/ol/ol.css";*/ +@import "../nodeMods/node_modules/ol/ol.css"; diff --git a/src/main/resources/static/css/trailsPageFragsStyle.css b/src/main/resources/static/css/trailsPageFragsStyle.css new file mode 100644 index 0000000000000000000000000000000000000000..1e2a067eb8819da6c8d0b69c8486cc5055795023 --- /dev/null +++ b/src/main/resources/static/css/trailsPageFragsStyle.css @@ -0,0 +1,36 @@ +.trailsFragment{ + background-color: rgb(206, 153, 253); + color: black; + border-color: white; + align-content: center; + text-align: center; + border-radius: 25px; + max-width: 800px; + margin: 0 auto; + +} +.trailsPageFrag{ + background: rgb(41, 41, 41); + color: wheat; +} + +iframe{ + margin-top: 20px; + margin-bottom: 20px; + border: white 2px solid; +} +H1{ + padding-top: 15px; + padding-bottom:3px ; + margin-bottom: 0; +} +#trailHeader{ + margin: 0; + padding: 0; + +} + +#checkpointList{ + list-style: none; + padding-bottom: 10px; +} \ No newline at end of file diff --git a/src/main/resources/static/css/userProfile.css b/src/main/resources/static/css/userProfile.css deleted file mode 100644 index 8ceb77b4e82d8c44f9aefdcf9c1f54493771e668..0000000000000000000000000000000000000000 --- a/src/main/resources/static/css/userProfile.css +++ /dev/null @@ -1,363 +0,0 @@ -/* AUTHOR: Gabriel Copat*/ -@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap'); - -/*COLOUR PALETTE*/ -* { - --main-colour: #e47201; - --secondary-colour: #e47201; - --accent-colour: #e47201; - --accent-border: #b25901; - - --accent-shadow: rgba(0, 0, 0, 0.7) 0 0.5em 1em -0.5em; -} - - -/*FONTS, TYPOGRAPHY & BACKGROUNDS*/ -* { - margin: 0; - padding: 0; - - & h1, & h2 { - letter-spacing: 0.25vw; - line-height: 1.3; - text-align: center; - color: white; - text-justify: inter-word; - } - & label { - color: white; - } - -} -@media only screen and (max-device-width: 500px) { - /*ADJUSTING FOR SMALLER SCREENS*/ - * { - & h1, & h2 { text-shadow: rgba(0, 0, 0, 0.7) 0 0.5svh 1svh;} - & p { line-height: 1.1; color: white;} - } -} - -body { - background: linear-gradient(135deg, #f7e8fd, #9914d1); - height: 100svh; - display: flex; - flex-direction: column; - justify-content: space-evenly; -} -main { - background: linear-gradient(to bottom, #1e1e1e 10%, darkgoldenrod 50%, #1e1e1e 90%); - border-radius: 1vw; - margin-inline: 5%; - /*margin-block: 5%;*/ - width: auto; - padding-block: 2svh; - margin-top: 6em; - padding-inline: 1vw; - box-shadow: rgba(0, 0, 0, 0.7) 0 0.5svh max(1vw, 1em); - - -} -.userInfo { - display: flex; - flex-direction: column; - /*padding: min(2vw, 4em);*/ - text-align: center; - - & #userPicture { - width: min(30vw, 30em); - margin-inline: auto; - border-radius: 100%; - border: solid #a2a2a2 4px; - box-shadow: rgba(0, 0, 0, 0.7) 0 0.5svh max(1vw, 1em); - } - - & h1 { - font-size: max(5vw, 2em); - margin: 1svh 25%; - color:white; - border-bottom: #36454F solid 2px; - border-radius: 5vw; - box-shadow: rgba(0, 0, 0, 0.7) 0 0.5svh 1vw -1vw; - } -} -#badgesBar::-webkit-scrollbar { - display: none; - -ms-scrollbar-darkshadow-color: transparent; -} -#badgesBar { - display: grid; - grid-template-areas: - "header" - "badges"; - overflow-x: scroll; - overflow-y: hidden; - color: white; - padding-bottom: 2%; - @media only screen and (min-device-width: 501px) { - height: 24vw; - } - & h2 { - position: absolute; - grid-area: header; - margin-inline: 5vw; - padding-inline: 2vw; - margin-block: -1svh; - box-shadow: rgba(0, 0, 0, 0.7) 0 0.5svh 1vw -1vw; - border-bottom: #36454F solid 2px; - font-size: 4vw; - width: 7em; - height: 1.2em; - - } - & #allBadgesContainer { - margin-top: 3svh; - grid-area: badges; - height: 10svh; - align-content: center; - display: flex; - @media only screen and (min-device-width: 501px) { - height: 20vw; - margin-top: 6vw; - } - } - & .badgeImg { - margin-inline: 3vw; - height: 8svh; - z-index: 50; - @media only screen and (min-device-width: 501px) { - height: 15vw; - } - transition: 0.3s ease-out 100ms; - } - & .badgeImg:hover { - /*box-shadow: 0 0 20px 10px #bbbb00;*/ - transform: scale(1.5,1.5); - - } -} - -#stickersBox { - padding-top: 5%; - display: flex; - flex-direction: column; - /* border-bottom-left-radius: 2vw; */ - /* border-bottom-right-radius: 2vw; */ - /*background: linear-gradient(to bottom, darkgoldenrod, transparent 90%);*/ - margin-top: -1%; - & h2 { - font-size: 4em; - text-align: center; - box-shadow: rgba(0, 0, 0, 0.7) 0 2vw 2vw -2vw; - border-bottom: #36454F solid 2px; - margin-block: 1svh; - margin-inline: 25%; - } - & .stickersContainer { - margin-block: 1svh; - display: flex; - flex-wrap: wrap; - justify-content: space-around; - width: 100%; - - & .stickerImg { - width: 20vw; - margin-block: 1em; - - } - } -} -.locked { - filter: grayscale(100%); -} - -.dragonProgression { - position: relative; - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; - height: 16svh; - box-sizing: content-box; - /*background: linear-gradient(to bottom, transparent -50%, darkgoldenrod 50%);*/ - width: 100%; - /*padding-top: 1svh;*/ - - @media only screen and (min-device-width: 501px) { - height: 28vw; - margin-bottom: 0; - padding-bottom: 5svh; - } - & h1 { - font-size: 3em; - font-family: 'MedievalSharp', cursive; - letter-spacing: 1vw; - box-shadow: rgba(0, 0, 0, 0.7) 0 2vw 2vw -2vw; - border-bottom: #36454F solid 2px; - border-top: #36454F solid 2px; - margin-inline: 15%; - margin-bottom: 1%; - } - & .dragonContainer { - position: relative; - margin: auto; - } - & .dragonImg { - height: 10svh; - width: 16svh; - @media only screen and (min-device-width: 501px) { - height: 22vw; - width: 30vw; - } - - } - & .dragonFill { - position: absolute; - overflow: hidden; - width: 40%; - } - & .dragonOut { - /*position: absolute;*/ - overflow: hidden; - } -} -header { - z-index: 99; - top: 0.5svh; - left: 0; - position: fixed; - width: 100vw; - justify-content: center; - display: flex; -} -header .footerBar { - display: flex; - list-style: none; - border-radius: 1vw; - overflow: hidden; - justify-content: space-evenly; - background-color: rgba(0, 0, 0, 0.7); -} -header .footerButton { - padding: 1vw; - text-align: center; - /*flex: 1 1;*/ - color:crimson; - background-color: rgba(31, 31, 31, 0.7); - font-size: 2.5em; - width: 15vw; -} -header .footerButton:hover { - background-color: #36454F; -} - -.grayedOut { - filter: grayscale(1); -} - -.solidBg { - background: #1e1e1e; - display: flex; -} -.loginWrapper { - margin-inline: auto; - margin-block: 5svh; - display: flex; - text-align: center; - justify-content: center; - background: rgba(196, 92, 239, 0.75); - padding: 2em; - flex: 0 0; - border-radius: 1vw; - box-shadow: rgba(0, 0, 0, 0.7) 0 0.5svh max(1vw, 1em); - & h2 { - margin-left: 0; - margin-right: auto; - margin-bottom: 0.5em; - } - & form{ - margin-block: auto; - font-size: 3em; - display: flex; - flex-direction: column; - } - & label { - position: relative; - margin-top: 1em; - /*width: fit-content;*/ - font-size: 0.8em; - & b { - float: left; - } - & a { - position: absolute; - font-size: 0.4em; - right: 0.2em; - bottom: 0.2em; - height: fit-content; - } - - } - & input { - font-size: 0.6em; - height: 1.5em; - width: 40vw; - border-radius: 0.2em; - padding-inline: 0.4em; - border: transparent solid 0.1em; - margin-bottom: 1em; - } - & button { - font-size: 1em; - height: 2em; - width: 4em; - box-shadow: var(--accent-shadow); - margin:auto; - margin-top: 1em; - background-color: var(--accent-colour); - border: 0.1em solid var(--accent-border); - border-radius: 1em; - color: white; - - } - & button:hover{ - background-color: var(--accent-border); - border: 0.1em solid var(--accent-colour); - } -} -.label { - position: relative; -} -.invalid-tooltip { - color: red; - width: fit-content; - opacity: 0; - font-size: 0.6em; - text-shadow: red 0 0.2em 1em; - transition: 0.3s ease-in-out 1ms; - padding:0.1em; - position: absolute; - right: 0.2em; - bottom: 0.2em; - height: fit-content; -} -.invalid-field { - box-shadow: red 0 0 1em; - transition: 0.3s ease-in-out 1ms; -} -.valid-field { - box-shadow: #40ff00 0 0 1em; - border: #40ff00 solid 0.1em; - transition: 0.3s ease-in-out 1ms; -} - - -#invalidLogin { - color: red; - text-shadow: black 0 0.1em 0.2em; - width: auto; - height: auto; - font-size: 0.6em; - opacity: 0; - transition: 0.5s ease-in-out 1ms; -} \ No newline at end of file diff --git a/src/main/resources/static/css/userProfile2.css b/src/main/resources/static/css/userProfile2.css new file mode 100644 index 0000000000000000000000000000000000000000..0c5c0e9c4aef739bda2f4d38039fa4735a3e30bb --- /dev/null +++ b/src/main/resources/static/css/userProfile2.css @@ -0,0 +1,293 @@ +/* AUTHOR: Gabriel Copat*/ +@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap'); + + + + + +/* DEFAULT CSS MADE FOR SCREEN SIZES WIDTHS + BETWEEN 320px and 640px:*/ + +body { + background: linear-gradient(to bottom right, + var(--primary-darker), + var(--primary-dark), + var(--primary-darker)); + + display: flex; + flex-direction: column; + justify-content: center; + align-content: center; + + position: fixed; + width: 100vw; + height: 100svh; +} + +.grayedSticker { + filter: grayscale(1); +} +.gotSticker { + filter: drop-shadow(0 0 10px yellow); +} + + +html { + position: fixed; + width: 100vw; + height: 100svh; +} +main { + width: 90%; + height: 95%; + background: linear-gradient(to bottom left, #1f1f1f, #1e1e1e, #1f1f1f); + overflow-x: hidden; + overflow-y: scroll; + margin-inline: auto; + + display: flex; + flex-direction: column; + align-content: flex-start; + align-items: center; + border-radius: 5vw; +} +.userContainer { + width: 90%; + padding-block: 2em; + margin-block: 1em; + border-radius: 5vw; + display: flex; + flex-direction: row-reverse; + /*align-items: center;*/ + justify-content: space-evenly; + + row-gap: 1svh; + + & h1 { + font-size: 5em; + text-align: center; + text-shadow: black 0 0.2em 0.5em; + letter-spacing: 0.1em; + width: 40vw; + max-height: 40vw; + /*border-bottom: black solid 3px;*/ + padding-inline: 5%; + padding-block: 2%; + border-radius: 35%; + /*box-shadow: var(--accent-shadow);*/ + /*background: var(--accent-border);*/ + align-self: center; + text-wrap: normal; + } + & #userPicture { + border-radius: 100%; + box-shadow: var(--accent-shadow); + overflow: hidden; + } + +} + + +.rewards { + position: relative; + display: flex; + flex-direction: column; + overflow: visible; + width: 100%; +} +#packsBar { + position: relative; + display: flex; + flex-direction: column; + justify-content: space-evenly; + text-align: center; + width: 100%; + & h2 { + font-size: 4em; + letter-spacing: 0.1em; + border-bottom: 10px solid darkred; + margin-inline: 5%; + } + +} +#allPacksContainer { + padding-top: 3em; + display: flex; + overflow-x: scroll; + padding-inline: 20%; + justify-content: space-between; + border-bottom: 10px solid rgba(139, 0, 0, 0.5); + margin-bottom: 2em; + & .packName { + font-size: 2em; + height: 2.4em; + overflow: hidden; + padding-bottom: 1em; + display: flex; + justify-content: center; + align-content: flex-start; + + } + & .packImg { + transition: 0.5s ease-in-out 1ms; + border-radius: 20%; + } +} +.packImg:hover { + transform: scale(1.5, 1.5) +} +.progressionContainer { + display: flex; + flex-direction: column; + height: 18svh; + & h1 { + font-size: 4em; + width: 100%; + font-family: 'MedievalSharp', cursive; + text-align: center; + overflow-x: scroll; + overflow-y: hidden; + } + & .progImgContainer { + position: relative; + margin-inline: auto; + & .progImg { + height: 14svh; + /*width: 16svh;*/ + border-radius: 20%; + } + & .progImgFill { + position: absolute; + overflow: hidden; + width: 50%; + } + & .progImgOutline { + opacity: 0.1; + filter: grayscale(1); + } + & .progText { + font-family: Consolas, serif; + opacity: 0.5; + -webkit-text-stroke: 1px black; + position: absolute; + text-align: center; + width: 16svh; + left:50%; + transform: translate(-50%, 150%); + font-size: 3em; + } + + } + +} + +#stickersBox { + width: 100%; +} +.stickersContainer { + display: flex; + flex-wrap: wrap; + justify-content: center; + margin-top: 2em; + row-gap: 2em; + height: 100%; + +} +.stickerImg { + height: 17em; + margin: 1.5em; +} +/* LOGIN FORM PAGE */ + + + + + + +/* MEDIA TYPE UPDATES*/ +@media only screen +and (min-device-width: 320px) +and (max-device-width: 640px) { + #userPicture { + width: 30vw; + height: 30vw; + border: solid #989898 0.8em; + } + .packImg { + height: 10svh; + width: 15em; + padding-inline: 1em; + margin-inline: 1em; + } + #allPacksContainer::-webkit-scrollbar { + display: none; + -ms-scrollbar-darkshadow-color: transparent; + } +} + +@media only screen +and (min-device-width: 1000px) { + #userPicture { + width: 200px; + height: 200px; + border: solid #989898 10px; + } + #allPacksContainer { + padding:0; + margin-block: 50px; + width: 100%; + height: 100%; + overflow: visible; + border: 5px solid rgba(139, 0, 0, 0.5); + justify-content: space-evenly; + } + .packImg { + height: 100px; + width: 125px; + padding-inline: 1em; + margin-inline: 3em; + } + .packImg:hover{ + transform: scale(2,2); + } + .packImg:hover ~ .packName{ + visibility: visible; + opacity: 1; + } + & .packName { + position: absolute; + visibility: hidden; + text-align: center; + left: 50%; + transform: translate(-50%); + opacity: 0; + transition: opacity 1s; + } + #packsBar { + /*height: 250px;*/ + & h2 { + display: none; + } + } + .progressionContainer { + height: 20svh; + } +} + +.container { + width: 500px; + margin-block: 5%; + background-color: var(--accent-colour); + border-radius: 10em; + display: flex; + flex-direction: column; + align-items: center; + & form { + margin-inline: auto; + margin-block: 5%; + } +} +.container-active { + background: black; +} diff --git a/src/main/resources/static/images/LinkedIn.jpg b/src/main/resources/static/images/LinkedIn.jpg deleted file mode 100644 index 6bf094d20c89883756ec5a105ec2cea1f9eeaf76..0000000000000000000000000000000000000000 Binary files a/src/main/resources/static/images/LinkedIn.jpg and /dev/null differ diff --git a/src/main/resources/static/images/QRAllTrails.png b/src/main/resources/static/images/QRAllTrails.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1d4465b3c286eba618b9a459b5a35295bacc8d Binary files /dev/null and b/src/main/resources/static/images/QRAllTrails.png differ diff --git a/src/main/resources/static/images/QR_code_for_mobile_English_Wikipedia.svg.png b/src/main/resources/static/images/QR_code_for_mobile_English_Wikipedia.svg.png new file mode 100644 index 0000000000000000000000000000000000000000..a66fb3c2a1596251164075828413368656bfb0c9 Binary files /dev/null and b/src/main/resources/static/images/QR_code_for_mobile_English_Wikipedia.svg.png differ diff --git "a/src/main/resources/static/images/Twitter-Log\320\276.png" "b/src/main/resources/static/images/Twitter-Log\320\276.png" deleted file mode 100644 index c475939bfacb4be3559aab3d58a9a5eadf036afb..0000000000000000000000000000000000000000 Binary files "a/src/main/resources/static/images/Twitter-Log\320\276.png" and /dev/null differ diff --git a/src/main/resources/static/images/badges.png b/src/main/resources/static/images/badges.png deleted file mode 100644 index 57e379c719f5fe28ba827d7007be9637cfd9ff73..0000000000000000000000000000000000000000 Binary files a/src/main/resources/static/images/badges.png and /dev/null differ diff --git a/src/main/resources/static/images/CaerphillyCastle.jpg b/src/main/resources/static/images/banners/CaerphillyCastle.jpg similarity index 100% rename from src/main/resources/static/images/CaerphillyCastle.jpg rename to src/main/resources/static/images/banners/CaerphillyCastle.jpg diff --git a/src/main/resources/static/images/PenarthBanner.jpg b/src/main/resources/static/images/banners/PenarthBanner.jpg similarity index 100% rename from src/main/resources/static/images/PenarthBanner.jpg rename to src/main/resources/static/images/banners/PenarthBanner.jpg diff --git a/src/main/resources/static/images/RiscaBanner.jpg b/src/main/resources/static/images/banners/RiscaBanner.jpg similarity index 100% rename from src/main/resources/static/images/RiscaBanner.jpg rename to src/main/resources/static/images/banners/RiscaBanner.jpg diff --git a/src/main/resources/static/images/Facebook.png b/src/main/resources/static/images/icons/Facebook.png similarity index 100% rename from src/main/resources/static/images/Facebook.png rename to src/main/resources/static/images/icons/Facebook.png diff --git a/src/main/resources/static/images/Instagram.jpg b/src/main/resources/static/images/icons/Instagram.jpg similarity index 100% rename from src/main/resources/static/images/Instagram.jpg rename to src/main/resources/static/images/icons/Instagram.jpg diff --git a/src/main/resources/static/images/Linkedin.png b/src/main/resources/static/images/icons/Linkedin.png similarity index 100% rename from src/main/resources/static/images/Linkedin.png rename to src/main/resources/static/images/icons/Linkedin.png diff --git a/src/main/resources/static/images/Twitter.jpg b/src/main/resources/static/images/icons/Twitter.jpg similarity index 100% rename from src/main/resources/static/images/Twitter.jpg rename to src/main/resources/static/images/icons/Twitter.jpg diff --git a/src/main/resources/static/images/VZTA.png b/src/main/resources/static/images/icons/VZTA.png similarity index 100% rename from src/main/resources/static/images/VZTA.png rename to src/main/resources/static/images/icons/VZTA.png diff --git a/src/main/resources/static/images/rewards/packs/0.png b/src/main/resources/static/images/rewards/packs/0.png new file mode 100644 index 0000000000000000000000000000000000000000..af986ffdeaf3478c06e47ca8f8231b62ee54e862 Binary files /dev/null and b/src/main/resources/static/images/rewards/packs/0.png differ diff --git a/src/main/resources/static/images/rewards/packs/1.png b/src/main/resources/static/images/rewards/packs/1.png new file mode 100644 index 0000000000000000000000000000000000000000..af986ffdeaf3478c06e47ca8f8231b62ee54e862 Binary files /dev/null and b/src/main/resources/static/images/rewards/packs/1.png differ diff --git a/src/main/resources/static/images/rewards/packs/2.png b/src/main/resources/static/images/rewards/packs/2.png new file mode 100644 index 0000000000000000000000000000000000000000..49e1ffc1ddad8ce3d6806f388f4dd70cd59c233e Binary files /dev/null and b/src/main/resources/static/images/rewards/packs/2.png differ diff --git a/src/main/resources/static/images/rewards/dragonFilled.png b/src/main/resources/static/images/rewards/packs/3.png similarity index 100% rename from src/main/resources/static/images/rewards/dragonFilled.png rename to src/main/resources/static/images/rewards/packs/3.png diff --git a/src/main/resources/static/images/rewards/stickers/1/1.png b/src/main/resources/static/images/rewards/stickers/1/1.png new file mode 100644 index 0000000000000000000000000000000000000000..82eda396931e573eb4885e99348a6da6af12dd3d Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/1/1.png differ diff --git a/src/main/resources/static/images/rewards/stickers/1/2.png b/src/main/resources/static/images/rewards/stickers/1/2.png new file mode 100644 index 0000000000000000000000000000000000000000..c3a83c4dc354c66e76318159bf406a82720c1a83 Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/1/2.png differ diff --git a/src/main/resources/static/images/rewards/stickers/1/3.png b/src/main/resources/static/images/rewards/stickers/1/3.png new file mode 100644 index 0000000000000000000000000000000000000000..197da770196d927d3321f17c6fa2b05846a3e589 Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/1/3.png differ diff --git a/src/main/resources/static/images/rewards/stickers/1/4.png b/src/main/resources/static/images/rewards/stickers/1/4.png new file mode 100644 index 0000000000000000000000000000000000000000..824de21bcd8a979419585b88f68b892337905285 Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/1/4.png differ diff --git a/src/main/resources/static/images/rewards/stickers/1/5.png b/src/main/resources/static/images/rewards/stickers/1/5.png new file mode 100644 index 0000000000000000000000000000000000000000..ea442315db144974ad10319936a3f66976b7fc7f Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/1/5.png differ diff --git a/src/main/resources/static/images/rewards/stickers/2/1.png b/src/main/resources/static/images/rewards/stickers/2/1.png new file mode 100644 index 0000000000000000000000000000000000000000..9db9fe209598c122fac00f272b9a0dac20925b06 Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/2/1.png differ diff --git a/src/main/resources/static/images/rewards/stickers/2/2.png b/src/main/resources/static/images/rewards/stickers/2/2.png new file mode 100644 index 0000000000000000000000000000000000000000..8235ea3febeeeae29076d810dc0a989df02c7b3a Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/2/2.png differ diff --git a/src/main/resources/static/images/rewards/stickers/2/3.png b/src/main/resources/static/images/rewards/stickers/2/3.png new file mode 100644 index 0000000000000000000000000000000000000000..81f9ca020c4596076834fdbebb6ca2d51a3b5a35 Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/2/3.png differ diff --git a/src/main/resources/static/images/rewards/stickers/2/4.png b/src/main/resources/static/images/rewards/stickers/2/4.png new file mode 100644 index 0000000000000000000000000000000000000000..43a57a6f9d580bd669eb7bc88b1cd56fb43b5c3c Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/2/4.png differ diff --git a/src/main/resources/static/images/rewards/stickers/2/5.png b/src/main/resources/static/images/rewards/stickers/2/5.png new file mode 100644 index 0000000000000000000000000000000000000000..8926f0b96019ca755895a071a34e7368533ff23d Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/2/5.png differ diff --git a/src/main/resources/static/images/rewards/stickers/3/1.png b/src/main/resources/static/images/rewards/stickers/3/1.png new file mode 100644 index 0000000000000000000000000000000000000000..d759091a2ffb55680062749f999a238a6ae9c26e Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/3/1.png differ diff --git a/src/main/resources/static/images/rewards/stickers/3/2.png b/src/main/resources/static/images/rewards/stickers/3/2.png new file mode 100644 index 0000000000000000000000000000000000000000..9d03b83e1e071ab15c4f9fed3a6cb6df597ffb1a Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/3/2.png differ diff --git a/src/main/resources/static/images/rewards/stickers/3/3.png b/src/main/resources/static/images/rewards/stickers/3/3.png new file mode 100644 index 0000000000000000000000000000000000000000..db70b88cd891c33fcbb3ef5c2b3bcfc8ba6cefb9 Binary files /dev/null and b/src/main/resources/static/images/rewards/stickers/3/3.png differ diff --git a/src/main/resources/static/images/stats.png b/src/main/resources/static/images/stats.png deleted file mode 100644 index 39904f1cfc911df01306fb85ab78b015e7d0386c..0000000000000000000000000000000000000000 Binary files a/src/main/resources/static/images/stats.png and /dev/null differ diff --git a/src/main/resources/static/images/trails.jpg b/src/main/resources/static/images/trails.jpg deleted file mode 100644 index 20481a4f8a914ae8b272f490e2006dd0afaa5a2b..0000000000000000000000000000000000000000 Binary files a/src/main/resources/static/images/trails.jpg and /dev/null differ diff --git a/src/main/resources/static/maptestnext.html b/src/main/resources/static/maptestnext.html new file mode 100644 index 0000000000000000000000000000000000000000..36a66b6e27fdb03115ba51d913407f357698ecea --- /dev/null +++ b/src/main/resources/static/maptestnext.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Quick Start</title> + <link rel="stylesheet" href="./mapteststyle.css" type="text/css"> +</head> +<body> +<div id="map"></div> +<script type="module" src="./maptestscript.js"></script> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/static/maptestscript.js b/src/main/resources/static/maptestscript.js new file mode 100644 index 0000000000000000000000000000000000000000..bce3be7a0396ed75d5bf94cb523bae0ca21e7b32 --- /dev/null +++ b/src/main/resources/static/maptestscript.js @@ -0,0 +1,18 @@ + +import Map from '../nodeMods/node_modules/ol/Map.js'; +import OSM from './node_modules/ol/source/OSM.js'; +import TileLayer from './node_modules/ol/layer/Tile.js'; +import View from './node_modules/ol/View.js'; + +const map = new Map({ + target: 'map', + layers: [ + new TileLayer({ + source: new OSM(), + }), + ], + view: new View({ + center: [0, 0], + zoom: 2, + }), +}); \ No newline at end of file diff --git a/src/main/resources/static/mapteststyle.css b/src/main/resources/static/mapteststyle.css new file mode 100644 index 0000000000000000000000000000000000000000..a92fb54cf0d6b83efb6540db8e2e45994abd88d4 --- /dev/null +++ b/src/main/resources/static/mapteststyle.css @@ -0,0 +1,14 @@ +@import "./node_modules/ol/ol.css"; + +html, +body { + margin: 0; + height: 100%; +} + +#map { + position: absolute; + top: 0; + bottom: 0; + width: 100%; +} \ No newline at end of file diff --git a/src/main/resources/static/nodeMods/package-lock.json b/src/main/resources/static/nodeMods/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..7780830d1f71e5cd6f2f03f69b670b5fd5ce3b43 --- /dev/null +++ b/src/main/resources/static/nodeMods/package-lock.json @@ -0,0 +1,1213 @@ +{ + "name": "box-selection", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "box-selection", + "dependencies": { + "ol": "8.2.0" + }, + "devDependencies": { + "vite": "^3.2.3" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", + "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", + "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@petamoriken/float16": { + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.4.tgz", + "integrity": "sha512-kB+NJ5Br56ZhElKsf0pM7/PQfrDdDVMRz8f0JM6eVOGE+L89z9hwcst9QvWBBnazzuqGTGtPsJNZoQ1JdNiGSQ==" + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", + "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "dependencies": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "node_modules/color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, + "node_modules/esbuild": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", + "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz", + "integrity": "sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz", + "integrity": "sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz", + "integrity": "sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", + "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz", + "integrity": "sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz", + "integrity": "sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz", + "integrity": "sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz", + "integrity": "sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz", + "integrity": "sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz", + "integrity": "sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz", + "integrity": "sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz", + "integrity": "sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz", + "integrity": "sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz", + "integrity": "sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz", + "integrity": "sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz", + "integrity": "sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz", + "integrity": "sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz", + "integrity": "sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz", + "integrity": "sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz", + "integrity": "sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/geotiff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.0.tgz", + "integrity": "sha512-B/iFJuFfRpmPHXf8aIRPRgUWwfaNb6dlsynkM8SWeHAPu7CpyvfqEa43KlBt7xxq5OTVysQacFHxhCn3SZhRKQ==", + "dependencies": { + "@petamoriken/float16": "^3.4.7", + "lerc": "^3.0.0", + "pako": "^2.0.4", + "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", + "web-worker": "^1.2.0", + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" + }, + "engines": { + "node": ">=10.19" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/lerc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz", + "integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww==" + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/ol": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", + "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", + "dependencies": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "pbf": "3.2.1", + "rbush": "^3.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/openlayers" + } + }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" + }, + "node_modules/parse-headers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==" + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/pbf": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", + "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/postcss": { + "version": "8.4.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", + "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" + }, + "node_modules/quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, + "node_modules/rbush": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", + "dependencies": { + "quickselect": "^2.0.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "node_modules/rollup": { + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/vite": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz", + "integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==", + "dev": true, + "dependencies": { + "esbuild": "^0.15.9", + "postcss": "^8.4.18", + "resolve": "^1.22.1", + "rollup": "^2.79.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/web-worker": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", + "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==" + }, + "node_modules/xml-utils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.7.0.tgz", + "integrity": "sha512-bWB489+RQQclC7A9OW8e5BzbT8Tu//jtAOvkYwewFr+Q9T9KDGvfzC1lp0pYPEQPEoPQLDkmxkepSC/2gIAZGw==" + }, + "node_modules/zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" + } + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", + "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", + "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "dev": true, + "optional": true + }, + "@petamoriken/float16": { + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.4.tgz", + "integrity": "sha512-kB+NJ5Br56ZhElKsf0pM7/PQfrDdDVMRz8f0JM6eVOGE+L89z9hwcst9QvWBBnazzuqGTGtPsJNZoQ1JdNiGSQ==" + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "color-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", + "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", + "requires": { + "color-name": "^1.0.0" + } + }, + "color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "requires": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, + "earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, + "esbuild": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", + "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "esbuild-android-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz", + "integrity": "sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz", + "integrity": "sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz", + "integrity": "sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", + "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz", + "integrity": "sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz", + "integrity": "sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz", + "integrity": "sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz", + "integrity": "sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz", + "integrity": "sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz", + "integrity": "sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz", + "integrity": "sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz", + "integrity": "sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz", + "integrity": "sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz", + "integrity": "sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz", + "integrity": "sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz", + "integrity": "sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz", + "integrity": "sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz", + "integrity": "sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz", + "integrity": "sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz", + "integrity": "sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==", + "dev": true, + "optional": true + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "geotiff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.0.tgz", + "integrity": "sha512-B/iFJuFfRpmPHXf8aIRPRgUWwfaNb6dlsynkM8SWeHAPu7CpyvfqEa43KlBt7xxq5OTVysQacFHxhCn3SZhRKQ==", + "requires": { + "@petamoriken/float16": "^3.4.7", + "lerc": "^3.0.0", + "pako": "^2.0.4", + "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", + "web-worker": "^1.2.0", + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" + } + }, + "hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "lerc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz", + "integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww==" + }, + "nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true + }, + "ol": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz", + "integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==", + "requires": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "pbf": "3.2.1", + "rbush": "^3.0.1" + } + }, + "pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" + }, + "parse-headers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "pbf": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", + "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", + "requires": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + } + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "postcss": { + "version": "8.4.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", + "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "dev": true, + "requires": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" + }, + "quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==" + }, + "quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, + "rbush": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", + "requires": { + "quickselect": "^2.0.0" + } + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "requires": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "rollup": { + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "vite": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz", + "integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==", + "dev": true, + "requires": { + "esbuild": "^0.15.9", + "fsevents": "~2.3.2", + "postcss": "^8.4.18", + "resolve": "^1.22.1", + "rollup": "^2.79.1" + } + }, + "web-worker": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", + "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==" + }, + "xml-utils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.7.0.tgz", + "integrity": "sha512-bWB489+RQQclC7A9OW8e5BzbT8Tu//jtAOvkYwewFr+Q9T9KDGvfzC1lp0pYPEQPEoPQLDkmxkepSC/2gIAZGw==" + }, + "zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" + } + } +} diff --git a/src/main/resources/static/nodeMods/package.json b/src/main/resources/static/nodeMods/package.json new file mode 100644 index 0000000000000000000000000000000000000000..78be07f225c43e51803bab02b08008eac5d5aa40 --- /dev/null +++ b/src/main/resources/static/nodeMods/package.json @@ -0,0 +1,13 @@ +{ + "name": "box-selection", + "dependencies": { + "ol": "8.2.0" + }, + "devDependencies": { + "vite": "^3.2.3" + }, + "scripts": { + "start": "vite", + "build": "vite build" + } +} \ No newline at end of file diff --git a/src/main/resources/static/qr-scanner.html b/src/main/resources/static/qr-scanner.html new file mode 100644 index 0000000000000000000000000000000000000000..2e93c18b5decfdb0f2b2f3e390e87dd9a8600661 --- /dev/null +++ b/src/main/resources/static/qr-scanner.html @@ -0,0 +1,29 @@ +<!--setup html page for QR codes - R Nute--> +<!--Modified from (https://www.geeksforgeeks.org/create-a-qr-code-scanner-or-reader-in-html-css-javascript/)--> + +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewpoint" content="width-device-width, initial-scale=1.0"> + <link rel="stylesheet" href="css/templatingstyle.css"> + <link rel="stylesheet" href="css/qrstyle.css"> + <script src="https://unpkg.com/html5-qrcode"></script> + <script type="module" src="scripts/qr-script.js"></script> + <title>QR Code</title> +</head> + +<body> + <header th:insert="towns/Templating.html :: header"></header> + + <div class="container"> + <h1>Scan location QR code</h1> + <div class="section"> + <div id="qr-code-reader"> + </div> + </div> + </div> + + <div th:insert="towns/Templating.html :: footer"></div> +</body> +</html> diff --git a/src/main/resources/static/scripts/login.js b/src/main/resources/static/scripts/login.js index 929b8b61e7a6f0f71a97937b2bdf2fcd83a5ce4f..df3b4ddf21b32933d0b283c60141be8e8eb5197c 100644 --- a/src/main/resources/static/scripts/login.js +++ b/src/main/resources/static/scripts/login.js @@ -1,49 +1,73 @@ -let username = document.forms["loginForm"]["username"]; -let password = document.forms["loginForm"]["password"]; -let pattern = new RegExp("^[a-z0-9_-]{3,15}$"); - -username.addEventListener("input", validateUsername) -password.addEventListener("input", validatePassword) - -function validateUsername() { - if (!(username.value === "") && pattern.test(username.value)){ - username.classList.remove("invalid-field"); - username.classList.add("valid-field"); - document.getElementById(username.name+"Invalid").style.opacity = 0; - username.style.borderColor = "green"; - return true; - } else if( ! (username.classList.contains("invalid-field") ) ){ - username.classList.add("invalid-field"); - username.classList.remove("valid-field"); - document.getElementById(username.name+"Invalid").style.opacity = 1; - username.style.borderColor = "red"; +const container = document.getElementById('container'); +const registerBtn = document.getElementById('register'); +const loginBtn = document.getElementById('login'); + +registerBtn.addEventListener('click', () => { + container.classList.add("active"); +}); + +loginBtn.addEventListener('click', () => { + container.classList.remove("active"); +}); + + +const emailRegEx = new RegExp(/^[A-Za-z0-9.-_]+@[A-Za-z0-9.-]+\.[A-Za-z]+$/m); +const passwordRegEx = new RegExp(/^[A-Za-z0-9_!#$%&'*+\/=?`{|}~^.-]+$/m); +const usernameRegEx = new RegExp(/^[A-Za-z ]+$/m); + +function loginFormValidation(){ + let pass= true; + let email = $("#login-email").val(); + let password = $("#login-password").val(); + if (email === "") { + alert("Email cannot be empty"); + pass = false; + } else if ( !(emailRegEx.test(email)) ) { + pass = false; + alert("Invalid Email address") } - return false; -} -function validatePassword(){ - if (password.value === "") { - password.classList.add("invalid-field"); - password.classList.remove("valid-field"); - document.getElementById(password.name+"Invalid").style.opacity = 1; - password.style.borderColor = "red"; - return false; - } else if( ! (password.classList.contains("valid-field") ) ) { - password.classList.remove("invalid-field"); - password.classList.add("valid-field"); - document.getElementById(password.name+"Invalid").style.opacity = 0; - password.style.borderColor = "green"; + if (password === "") { + alert("Password cannot be empty"); + pass = false; + } else if ( !(passwordRegEx.test(password)) ) { + pass = false; + alert("Password contains invalid characters"); } - return true; + return pass; } -function validateForm(){ - if (validateUsername() & validatePassword()) { //Using just & so it checks both, even if the first is false (it applies the style) - console.log("VALID"); - return false; - } else { - console.log("Invalid"); - document.getElementById("invalidLogin").style.opacity = 1; - return false; +function registerFormValidation(){ + /*WHYTF THIS DONT WORK*/ + let pass=true; + let email = $("#register-email").val(); + let username = $("#register-username").val(); + let password = $("#register-password").val(); + + if (email == "") { + console.log("Email empty bit") + pass = false; + alert("Email cannot be empty"); + } else if ( !(emailRegEx.test(email)) ) { + console.log("Email no match") + pass = false; + alert("Invalid Email address"); + } + + if (username == "") { + pass = false; + alert("Username cannot be empty") + } else if ( !(usernameRegEx.test(username)) ) { + console.log(!usernameRegEx.test(username)); + pass = false; + alert("Invalid username"); + } + + if (password == "") { + pass = false; + alert("Password cannot be empty"); + } else if ( !(passwordRegEx.test(password)) ) { + pass = false; + alert("Password contains invalid characters"); } - //TODO SERVER SIDE VALIDATION AND CHECK AGAINST USERS DB TABLE + return pass; } \ No newline at end of file diff --git a/src/main/resources/static/scripts/mapAPI.js b/src/main/resources/static/scripts/mapAPI.js new file mode 100644 index 0000000000000000000000000000000000000000..8b81c394af31962757934756bdd48a299881b03f --- /dev/null +++ b/src/main/resources/static/scripts/mapAPI.js @@ -0,0 +1,153 @@ +// import GeoJSON from '/nodeMods/node_modules/ol/format/GeoJSON.js'; +// import Map from '/nodeMods/node_modules/ol/Map.js'; +// import VectorLayer from '/nodeMods/node_modules/ol/source/Vector.js' +// import VectorSource from '/nodeMods/node_modules/ol/source/Vector.js'; +// import View from '/nodeMods/node_modules/ol/View.js'; +// import {DragBox, Select} from '/nodeMods/node_modules/ol/interaction.js'; +// import {Fill, Stroke, Style} from '/nodeMods/node_modules/ol/style.js'; +// import {getWidth} from '/nodeMods/node_modules/ol/extent.js'; +// import {platformModifierKeyOnly} from '/nodeMods/node_modules/ol/events/condition.js'; +// // //Invesitgate created directories mnode module mapstest and extent.js +// // import GeoJSON from '/node_modules/ol/format/GeoJSON.js'; +// // import Map from '/ol/Map.js'; +// // import VectorLayer from '/ol/layer/Vector.js'; +// // import VectorSource from '/ol/source/Vector.js'; +// // import View from '/ol/View.js'; +// // import {DragBox, Select} from '/ol/interaction.js'; +// // import {Fill, Stroke, Style} from '/ol/style.js'; +// // import {getWidth} from '/ol/extent.js'; +// // import {platformModifierKeyOnly} from '/ol/events/condition.js'; +// // +// +// const vectorSource = new VectorSource({ +// url: 'https://openlayers.org/data/vector/ecoregions.json', +// format: new GeoJSON(), +// }); +// +// const style = new Style({ +// fill: new Fill({ +// color: '#eeeeee', +// }), +// }); +// +// const map = new Map({ +// layers: [ +// new VectorLayer({ +// source: vectorSource, +// background: '#1a2b39', +// style: function (feature) { +// const color = feature.get('COLOR_BIO') || '#eeeeee'; +// style.getFill().setColor(color); +// return style; +// }, +// }), +// ], +// target: 'map', +// view: new View({ +// center: [0, 0], +// zoom: 2, +// constrainRotation: 16, +// }), +// }); +// +// const selectedStyle = new Style({ +// fill: new Fill({ +// color: 'rgba(255, 255, 255, 0.6)', +// }), +// stroke: new Stroke({ +// color: 'rgba(255, 255, 255, 0.7)', +// width: 2, +// }), +// }); +// +// // a normal select interaction to handle click +// const select = new Select({ +// style: function (feature) { +// const color = feature.get('COLOR_BIO') || '#eeeeee'; +// selectedStyle.getFill().setColor(color); +// return selectedStyle; +// }, +// }); +// map.addInteraction(select); +// +// const selectedFeatures = select.getFeatures(); +// +// // a DragBox interaction used to select features by drawing boxes +// const dragBox = new DragBox({ +// condition: platformModifierKeyOnly, +// }); +// +// map.addInteraction(dragBox); +// +// dragBox.on('boxend', function () { +// const boxExtent = dragBox.getGeometry().getExtent(); +// +// // if the extent crosses the antimeridian process each world separately +// const worldExtent = map.getView().getProjection().getExtent(); +// const worldWidth = getWidth(worldExtent); +// const startWorld = Math.floor((boxExtent[0] - worldExtent[0]) / worldWidth); +// const endWorld = Math.floor((boxExtent[2] - worldExtent[0]) / worldWidth); +// +// for (let world = startWorld; world <= endWorld; ++world) { +// const left = Math.max(boxExtent[0] - world * worldWidth, worldExtent[0]); +// const right = Math.min(boxExtent[2] - world * worldWidth, worldExtent[2]); +// const extent = [left, boxExtent[1], right, boxExtent[3]]; +// +// const boxFeatures = vectorSource +// .getFeaturesInExtent(extent) +// .filter( +// (feature) => +// !selectedFeatures.getArray().includes(feature) && +// feature.getGeometry().intersectsExtent(extent) +// ); +// +// // features that intersect the box geometry are added to the +// // collection of selected features +// +// // if the view is not obliquely rotated the box geometry and +// // its extent are equalivalent so intersecting features can +// // be added directly to the collection +// const rotation = map.getView().getRotation(); +// const oblique = rotation % (Math.PI / 2) !== 0; +// +// // when the view is obliquely rotated the box extent will +// // exceed its geometry so both the box and the candidate +// // feature geometries are rotated around a common anchor +// // to confirm that, with the box geometry aligned with its +// // extent, the geometries intersect +// if (oblique) { +// const anchor = [0, 0]; +// const geometry = dragBox.getGeometry().clone(); +// geometry.translate(-world * worldWidth, 0); +// geometry.rotate(-rotation, anchor); +// const extent = geometry.getExtent(); +// boxFeatures.forEach(function (feature) { +// const geometry = feature.getGeometry().clone(); +// geometry.rotate(-rotation, anchor); +// if (geometry.intersectsExtent(extent)) { +// selectedFeatures.push(feature); +// } +// }); +// } else { +// selectedFeatures.extend(boxFeatures); +// } +// } +// }); +// +// // clear selection when drawing a new box and when clicking on the map +// dragBox.on('boxstart', function () { +// selectedFeatures.clear(); +// }); +// +// const infoBox = document.getElementById('info'); +// +// selectedFeatures.on(['add', 'remove'], function () { +// const names = selectedFeatures.getArray().map((feature) => { +// return feature.get('ECO_NAME'); +// }); +// if (names.length > 0) { +// infoBox.innerHTML = names.join(', '); +// } else { +// infoBox.innerHTML = 'None'; +// } +// }); \ No newline at end of file diff --git a/src/main/resources/static/scripts/qr-script.js b/src/main/resources/static/scripts/qr-script.js new file mode 100644 index 0000000000000000000000000000000000000000..ff2bbf82d70a4bbf152239e568ccc7052b4c8438 --- /dev/null +++ b/src/main/resources/static/scripts/qr-script.js @@ -0,0 +1,28 @@ +//qr-script file - R Nute +//Modified from (https://www.geeksforgeeks.org/create-a-qr-code-scanner-or-reader-in-html-css-javascript/) +function domReady(fn){ + if ( + document.readyState === "complete" || + document.readyState === "interactive" + ){ + setTimeout(fn, 1000); + } else { + document.addEventListener("DOMContentLoaded", fn); + } +} +domReady(function (message){ + //if QR code found + function onScanSuccess(decodeText, decodeResult){ + alert("You have collected: " + decodeText, decodeResult); + // Open the result, what methods are available through the HTML5 Qr scanner node package? + window.open(decodeText); + // Record the result, see above. + // Get user and tie to user account, intergrate with database, retrieving and storing under user info. + } + let htmlscanner = new Html5QrcodeScanner( + "qr-code-reader", + { fps: 20, qrbos: 250} + ); + htmlscanner.render(onScanSuccess); +}); + diff --git a/src/main/resources/static/scripts/userPage.js b/src/main/resources/static/scripts/userPage.js new file mode 100644 index 0000000000000000000000000000000000000000..a7b036197965493cbdd621b241350c56167bac08 --- /dev/null +++ b/src/main/resources/static/scripts/userPage.js @@ -0,0 +1,11 @@ +function updatePack(url) { + /* Updates the trail being shown on screen */ + $.get(url).done(function (fragment) { + let packRewardsWrapper = $("#packRewardsWrapper"); + + packRewardsWrapper.fadeTo("slow", 0, function () { + packRewardsWrapper.html(fragment) + packRewardsWrapper.fadeTo("slow", 1); + }) + }); +} \ No newline at end of file diff --git a/src/main/resources/static/sql/user-data.sql b/src/main/resources/static/sql/user-data.sql new file mode 100644 index 0000000000000000000000000000000000000000..333ec4091f3ab1578e91009cca9fe9e3d9b7872d --- /dev/null +++ b/src/main/resources/static/sql/user-data.sql @@ -0,0 +1,7 @@ +INSERT INTO users (username, password) VALUE ('Admin', 'admin'); +INSERT INTO users (username, password) VALUE ('Hannah', 'root'); +INSERT INTO users (username, password) VALUE ('Nigel', 'root'); +INSERT INTO users (username, password) VALUE ('Oscar', 'root'); + +INSERT INTO authorities (username, authority) VALUE ('Admin', 'ADMIN'); +INSERT INTO authorities (username, authority) VALUE ('Hannah', 'USER'); diff --git a/src/main/resources/static/sql/user-progress-data.sql b/src/main/resources/static/sql/user-progress-data.sql new file mode 100644 index 0000000000000000000000000000000000000000..e9223384658ac8bd55456a60f9b8e52423b3d429 --- /dev/null +++ b/src/main/resources/static/sql/user-progress-data.sql @@ -0,0 +1,7 @@ +DELETE FROM stickerprogress; +INSERT INTO stickerprogress (username, packID, stickerID) VALUE ('Admin', 1, 1); +INSERT INTO stickerprogress (username, packID, stickerID) VALUE ('Admin', 1, 2); +INSERT INTO stickerprogress (username, packID, stickerID) VALUE ('Admin', 1, 3); +INSERT INTO stickerprogress (username, packID, stickerID) VALUE ('Admin', 1, 5); +INSERT INTO stickerprogress (username, packID, stickerID) VALUE ('Admin', 2, 1); +INSERT INTO stickerprogress (username, packID, stickerID) VALUE ('Admin', 2, 3); \ No newline at end of file diff --git a/src/main/resources/static/test.html b/src/main/resources/static/test.html deleted file mode 100644 index 98a5d8ce3c443e9b3c9e183848b038b11f2df7de..0000000000000000000000000000000000000000 --- a/src/main/resources/static/test.html +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>asdasd</title> -</head> -<body> -sadasdasdasd - -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/static/users.html b/src/main/resources/static/users.html deleted file mode 100644 index 566549bdf8fae810809c1a81066000687cb338f6..0000000000000000000000000000000000000000 --- a/src/main/resources/static/users.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>Title</title> -</head> -<body> - -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/templates/allTrails/allTrails.html b/src/main/resources/templates/allTrails/allTrails.html index 746762b68f64b62190bf71e102edf0ff309772d9..0fefa92c95a928454c100894149bf18340015baf 100644 --- a/src/main/resources/templates/allTrails/allTrails.html +++ b/src/main/resources/templates/allTrails/allTrails.html @@ -10,8 +10,8 @@ </head> <body> -<header th:replace="~{/towns/Templating.html :: header}"></header> - +<header th:replace="~{/fragments/Templating.html :: header}"></header> +<div>TEST</div> <main> <section id="allTrailsBar" class="centerFlex"> <img class="trailsImages" @@ -31,7 +31,7 @@ </section> </main> -<footer th:insert="~{/towns/Templating.html :: footer}"></footer> +<footer th:insert="~{/fragments/Templating.html :: footer}"></footer> <script type="text/javascript" th:src="@{scripts/allTrails.js}"></script> diff --git a/src/main/resources/templates/towns/Templating.html b/src/main/resources/templates/fragments/Templating.html similarity index 55% rename from src/main/resources/templates/towns/Templating.html rename to src/main/resources/templates/fragments/Templating.html index 328ea5ea93adc87daa598c14ba9daa94bfe97369..e3afc23854e38d5973a596f44e8d546305b59b83 100644 --- a/src/main/resources/templates/towns/Templating.html +++ b/src/main/resources/templates/fragments/Templating.html @@ -2,22 +2,22 @@ <link rel="stylesheet" href="../../static/css/templatingstyle.css"> <header class="headerBar" th:fragment="header"> <div class="Logo"> - <img src="/images/VZTA.png" height="97" width="400" alt="VZTA Logo"/> + <img src="/images/icons/VZTA.png" height="97" width="400" alt="VZTA Logo"/> </div> <nav class="navBar"> <ul> <li><a id="homeHead" href="/home">Home</a></li> <li>FAQs</li> <li>Contact us</li> + <li th:if="${#authentication.principal}!=anonymousUser"><a href="/logout">Log Out</a></li> + <li th:if="${#authentication.principal}==anonymousUser"><a href="/login">Log In</a></li> </ul> - <label class="work">Who we Work with:</label> - <select> - <ul> - <option value="localauthorities"><a href="/local-authorities">Local Authorities</a></option> - <option value="towns">Towns</option> - <option value="businesses">Businesses</option> - <option value="consumers">Consumers</option> - </ul> + <label for="stakeholders" class="work">Who we Work with:</label> + <select id="stakeholders"> + <option value="localauthorities">Local Authorities</option> + <option value="towns">Towns</option> + <option value="businesses">Businesses</option> + <option value="consumers">Consumers</option> </select> </nav> </header> @@ -41,10 +41,10 @@ <div class="centerFooter"> <span class="footerText"> <h3>Follow Us</h3> - <a href="https://www.facebook.com/VZTAsmarttowns/" class="icon"><img src="/images/Facebook.png" height="25" width="25" alt="Facebook Logo" class="icon"/></a> - <a href="https://www.twitter.com/VZTAsmarttowns/" class="icon"><img src="/images/Twitter.jpg" height="25" width="25" alt="X (formally Twitter) Logo" class="icon"/></a> - <a href="https://www.instagram.com/vztasmarttowns/" class="icon"><img src="/images/Instagram.jpg" height="25" width="25" alt="Instagram Logo" class="icon"/></a> - <a href="https://www.linkin.com/company/vztasmarttowns/" class="icon"><img src="/images/Linkedin.png" height="25" width="25" alt="Linkedin Logo" class="icon"/></a><br> + <a href="https://www.facebook.com/VZTAsmarttowns/" class="icon"><img src="/images/icons/Facebook.png" height="25" width="25" alt="Facebook Logo" class="icon"/></a> + <a href="https://www.twitter.com/VZTAsmarttowns/" class="icon"><img src="/images/icons/Twitter.jpg" height="25" width="25" alt="X (formally Twitter) Logo" class="icon"/></a> + <a href="https://www.instagram.com/vztasmarttowns/" class="icon"><img src="/images/icons/Instagram.jpg" height="25" width="25" alt="Instagram Logo" class="icon"/></a> + <a href="https://www.linkin.com/company/vztasmarttowns/" class="icon"><img src="/images/icons/Linkedin.png" height="25" width="25" alt="Linkedin Logo" class="icon"/></a><br> </span> </div> <div class="copyright" style="text-align: left"> diff --git a/src/main/resources/templates/fragments/locationPageFrags.html b/src/main/resources/templates/fragments/locationPageFrags.html new file mode 100644 index 0000000000000000000000000000000000000000..ba7813ecf7e24927302cd49b1ca1523d959cae17 --- /dev/null +++ b/src/main/resources/templates/fragments/locationPageFrags.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html lang="en" th:fragment="locationSection" class="locationPageFrag"> +<head> + <meta charset="UTF-8"> + <title th:text="${location.getLocationName()}"></title> + + <link rel="stylesheet" th:href="@{/css/templatingstyle.css}"> + <link rel="stylesheet" th:href="@{/css/locationPageFragsStyle.css}"> +</head> +<body > +<header th:insert="~{/fragments/Templating.html::header}"></header> + <main> + + <hr style="height:40px; visibility:hidden;" /> + <article class="locationFragment"> + + <H1 th:text="${location.getLocationName()}" > </H1> + <H4 th:text="${location.getLocationPlace()}" id="townHeader"> </H4> + <p th:text="${location.getLocationDescription()}"></p> + + + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://maps.google.com/maps?q='+ ${locCoord.getLocationCoordsLat()} +','+ ${locCoord.getLocationCoordsLong()} +'&hl=en&z=20&output=embed'"> + </iframe> + <H2 id="return"> + <a th:href="@{'/trails/'+${trail}}">Return</a></H2> + + </article> + <hr style="height:40px; visibility:hidden;" /> + </main> + +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/fragments/temp_frags.html b/src/main/resources/templates/fragments/temp_frags.html deleted file mode 100644 index 03efad3ee73e973e0faf7401b7d3b0de2e1578e4..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/fragments/temp_frags.html +++ /dev/null @@ -1,23 +0,0 @@ -<header th:fragment="header" class="headerBlock"> - <h1 class="headerTitle">SMART-TOWNS</h1> - <div class="headerBanner"> - <img src="images/trails.jpg" alt="Trails" class="bannerBack"> -<!-- <div class="bannerText">--> - <h1 class="bigTitle">Smart Town Trails</h1> - <h2 class="smallTitle">Information about trails for your town</h2> -<!-- </div>--> - </div> -</header> -<footer th:fragment="footer"> - <ul class="footerBar"> - <li class="footerButton">Home</li> - <li class="footerButton">About</li> - <li class="footerButton">Map</li> - <li class="footerButton">Facilities</li> - <li class="footerButton">Search</li> - </ul> -</footer> - -<article class="trailInfo" th:fragment="trailInfo2"> - <h1 class="titleH1" th:text="${trail.name}">Trail Info</h1> -</article> \ No newline at end of file diff --git a/src/main/resources/templates/fragments/trailsPageFrags.html b/src/main/resources/templates/fragments/trailsPageFrags.html new file mode 100644 index 0000000000000000000000000000000000000000..296cd2d153d1671b467a27a78f5a1994bdb77806 --- /dev/null +++ b/src/main/resources/templates/fragments/trailsPageFrags.html @@ -0,0 +1,114 @@ +<!DOCTYPE html> +<html lang="en" th:fragment="trailsSection" class="trailsPageFrag"> +<head> + <meta charset="UTF-8"> + <title th:text="${trail.getTrailName()}"></title> + + <link rel="stylesheet" th:href="@{/css/templatingstyle.css}"> + <link rel="stylesheet" th:href="@{/css/trailsPageFragsStyle.css}"> + + +</head> +<body > +<header th:insert="~{/fragments/Templating.html::header}"></header> +<main> + + <hr style="height:40px; visibility:hidden;" /> + <article class="trailsFragment"> + + <H1 th:text="*{trail.getTrailName()}" id="trailHeader"></H1> + + <div th:if="*{trail.getTrailName()=='Caerphilly Castle Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + src="https://www.google.com/maps/dir/51.57623,-3.21910/51.575372,-3.219186/51.576363,-3.220712//@11z"> + </iframe> + <div><a href="https://www.google.com/maps/dir/51.57623,-3.21910/51.575372,-3.219186/51.576363,-3.220712//@11z">Trail Map</a></div> + + </div> + + <div th:if="*{trail.getTrailName()=='Caerphilly Pub Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.57239,-3.21992/51.57230,-3.21938//@&hl=en&z=20&output=embed'"> + </iframe> + <div><a href="https://www.google.com/maps/dir/51.57239,-3.21992/51.57230,-3.21938//@11z">Trail Map</a></div> + + </div> + <div th:if="*{trail.getTrailName()=='Caerphilly Heritage Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.57168,-3.21861/51.57465,-3.22022//@11z'"> + </iframe> + <div> + <a href="https://www.google.com/maps/dir/51.57168,-3.21861/51.57465,-3.22022//@11z">Trail Map</a></div> + + </div> + <div th:if="*{trail.getTrailName()=='Risca Heritage Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.61117,-3.10198/51.61655,-3.12371 //@11z'"> + </iframe> + <div><a href="https://www.google.com/maps/dir/51.61117,-3.10198/51.61655,-3.12371 //@11z">Trail Map</a></div> + </div> + <div th:if="*{trail.getTrailName()=='Penarth Esplanade Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.43484,-3.16492/51.43547,-3.16789//@11z'"> + </iframe> + <div> + <a href="https://www.google.com/maps/dir/51.43484,-3.16492/51.43547,-3.16789//@11z">Trail Map</a> + </div> + </div> + <H3>Checkpoints:</H3> +<!-- With the trial name, we go through locations list to get --> + <div th:each="locationCoord, indexValue:${locCoords}" > + <div th:if="${locations[indexValue.index].getLocationTrailID()==trail.getTrailsId()}"> + <li id="checkpointList"> + <div><a th:href="'/checkpoints/'+${locations[indexValue.index].getLocationName().replace(' ', '-')}" th:text="${locations[indexValue.index].getLocationName()}"></a></div> + <ul></ul> + </li> + + + + + </div> + + + + + + + </div> + </article> + <hr style="height:40px; visibility:hidden;" /> +</main> + +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> +</body> +</html> diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html deleted file mode 100644 index 47b1dc1353c7c96bcb3409f54558ff18c4da6cf4..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/home.html +++ /dev/null @@ -1,51 +0,0 @@ -<!DOCTYPE html> -<html> - -<head> - <title>Website Web</title> - <link rel="stylesheet" th:href="@{css/style.css}"> - <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> -</head> - -<body> - <header th:replace="fragments/temp_frags.html :: header"></header> - <main> - <div class="trailList"> - <ul class="ulHeader"> - <li onclick="selectTrail('trail1', this)" class="liHeader" id="trail1" >Trail 1</li> - <li onclick="selectTrail('trail2', this)" class="liHeader selected" id="trail2" >Trail 2</li> - <li onclick="selectTrail('trail3', this)" class="liHeader" id="trail3" >Trail 3</li> - <li onclick="updateOutput()" class="liHeader" id="trail4" >Trail 4</li> - </ul> - </div> - - <section class="mainBlock"> - <article class="trailStats"> - <h1 class="titleH1">Trail Stats</h1> - <img src="../static/images/stats.png" alt="Stats" class="stats"> - <div class="textStats"> - <p><b>Explored:</b> 60%</p> - <p><b>Landmarks Visited:</b> 3/5</p> - <p><b>Shops Visited:</b> 6/10</p> - </div> - </article> - <article id="trailInfoBox" class="trailInfo"></article> - <article class="badgesBlock"> - <h1 class="titleH1">Badges</h1> - <div class="badgesList"> - <img src="../static/images/badges.png" alt="Badge" class="badgeImg"> - <img src="../static/images/badges.png" alt="Badge" class="badgeImg"> - <img src="../static/images/badges.png" alt="Badge" class="badgeImg"> - <img src="../static/images/badges.png" alt="Badge" class="badgeImg"> - <img src="../static/images/badges.png" alt="Badge" class="badgeImg"> - </div> - - </article> - </section> - </main> - - <footer th:replace="fragments/temp_frags.html :: footer"></footer> - <script src="https://code.jquery.com/jquery-1.9.1.js"></script> - <script type="text/javascript" th:src="@{scripts/gabScripts.js}"></script> -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/templates/Landmarks/LandmarkFormTh.html b/src/main/resources/templates/landmarks/LandmarkFormTh.html similarity index 92% rename from src/main/resources/templates/Landmarks/LandmarkFormTh.html rename to src/main/resources/templates/landmarks/LandmarkFormTh.html index b77bb90ece04cc582bc5fa5ea369bd8ba45e864b..646632ce015eb3e16d14e7da06c604cc2ae10c5b 100644 --- a/src/main/resources/templates/Landmarks/LandmarkFormTh.html +++ b/src/main/resources/templates/landmarks/LandmarkFormTh.html @@ -10,7 +10,7 @@ </head> <body> -<header th:insert="~{/towns/Templating.html :: header}"></header> +<header th:insert="~{/fragments/Templating.html :: header}"></header> <hr style="height:20px; visibility:hidden;" /> <H2 id="landmarkFormTitle"> Interested in joining our trails? Sign up Here! </H2> <main> @@ -42,7 +42,7 @@ <select th:field="*{trailID}"> <option value=0 hidden="true">Select Trail</option> <option value=0 disabled selected>Select Trail</option> - <option value=0101>(Caerphilly) Castle Trail</option> + <option value=101>(Caerphilly) Castle Trail</option> <option value=0102>(Caerphilly) Pub Trail</option> <option value=0103>(Caerphilly) Heritage Trail</option> <option value=0201>(Risca) Heritage and Culture Trail</option> @@ -60,6 +60,6 @@ </main> -<footer th:insert="~{/towns/Templating.html :: footer}"></footer> +<footer th:insert="~{/fragments/Templating.html :: footer}"></footer> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/landmarks/locationPage.html b/src/main/resources/templates/landmarks/locationPage.html new file mode 100644 index 0000000000000000000000000000000000000000..7cf62c6f4cb81dd98416bf95f89c973b7714c40f --- /dev/null +++ b/src/main/resources/templates/landmarks/locationPage.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Checkpoint</title> +<!-- todo make this a list per trail or per town that when clicked brings to unique location page--> + <link rel="stylesheet" th:href="@{/css/templatingstyle.css}"> +</head> +<body> + +<main> + <header th:insert="~{/fragments/Templating.html::header}"></header> + <div th:each="coord, indexValue:${locationCoords}"> + <p th:text="*{coord.getLocationID()}"></p> +<!-- <p th:text="${locations[indexValue.index]}"></p>--> + <H1 th:text="${location[indexValue.index].getLocationName()}"> </H1> + <H4 th:text="${location[indexValue.index].getLocationPlace()}"> </H4> + <p th:text="${location[indexValue.index].getLocationDescription()}"></p> + + + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://maps.google.com/maps?q='+ ${coord.getLocationCoordsLat()} +','+ ${coord.getLocationCoordsLong()} +'&hl=en&z=20&output=embed'"> + </iframe> + <br /> +<!-- <small>--> +<!--<!– <a–> //https://maps.google.com/maps?q=51.57623,-3.21910&hl=es&z=14&output=embed">--> +<!-- th:href="https://maps.google.com/maps?q='+{coord.getLocationCoordsLat()}+','+*{coord.getLocationCoordsLong()}+'&hl=es;z=14&output=embed"--> +<!-- style="color:#0000FF;text-align:left"--> +<!-- target="_blank"--> +<!-- >--> +<!-- See map bigger--> +<!-- </a>--> +<!-- </small>--> + + </div> + + +</main> +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/landmarks/trailsPage.html b/src/main/resources/templates/landmarks/trailsPage.html new file mode 100644 index 0000000000000000000000000000000000000000..4316d94fe409ebeba57db4005b31fbba6178bc70 --- /dev/null +++ b/src/main/resources/templates/landmarks/trailsPage.html @@ -0,0 +1,98 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Trails</title> + <link rel="stylesheet" th:href="@{/css/templatingstyle.css}"> +</head> +<body> +<header th:insert="~{/fragments/Templating.html::header}"></header> +<main> + <div th:each="trail, indexValue:${trails}"> + <H1 th:text="*{trail.getTrailName()}"></H1> + + <div th:if="*{trail.getTrailName()=='Caerphilly Castle Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + src="https://www.google.com/maps/dir/51.57623,-3.21910/51.575372,-3.219186/51.576363,-3.220712//@11z"> + </iframe> + + </div> + + <div th:if="*{trail.getTrailName()=='Caerphilly Pub Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.57239,-3.21992/51.57230,-3.21938//@11z'"> + </iframe> + + </div> + <div th:if="*{trail.getTrailName()=='Caerphilly Heritage Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.57168,-3.21861/51.57465,-3.22022//@11z'"> + </iframe> + + </div> + <div th:if="*{trail.getTrailName()=='Risca Heritage Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.61117,-3.10198/51.61655,-3.12371 //@11z'"> + </iframe> + + </div> + <div th:if="*{trail.getTrailName()=='Penarth Esplanade Trail'}"> + <iframe + width="600" + height="400" + frameborder="0" + scrolling="yes" + marginheight="0" + marginwidth="0" + th:src="'https://www.google.com/maps/dir/51.43484,-3.16492/51.43547,-3.16789//@11z'"> + </iframe> + + </div> + <H3>Checkpoints:</H3> + + <div th:each="locationCoord, indexValue2:${locationCoords}" > + <div th:if="${locations[indexValue2.index].getLocationTrailID()==trail.getTrailsId()}"> + <li style="list-style: none"> + <a th:href="'/checkpoints/'+${locations[indexValue2.index].getLocationName().replace(' ', '-')}" th:text="${locations[indexValue2.index].getLocationName()}"></a> + <ul></ul> + </li> + + + + + </div> + + + + + + + </div> +</main> +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/rewards/login.html b/src/main/resources/templates/rewards/login.html deleted file mode 100644 index 9c7aea8b67c0d18e2910b8c067ea576899fa6340..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/rewards/login.html +++ /dev/null @@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>User Log In</title> - <link rel="stylesheet" th:href="@{/css/userProfile.css}"> - -</head> -<body> - -<header> - <ul class="footerBar"> - <li class="footerButton"><b>Home</b></li> - <li class="footerButton"><b>About</b></li> - <li class="footerButton"><b>Map</b></li> - <li class="footerButton"><b>Facilities</b></li> - <li class="footerButton"><b>Log In</b></li> - </ul> -</header> -<main class="solidBg"> - <div class="loginWrapper"> - <form action="" onsubmit="return validateForm()" method="post" name="loginForm"> - <h2>Log In</h2> - <div class="label"> - <label for="username"><b>Username</b><br></label> - <div id="usernameInvalid" class="invalid-tooltip">Please fill out this field.</div> - </div> - <input type="text" name="username" id="username" placeholder="Enter Username" title="Username Input"> - - <div class="label"> - <label for="password"><b>Password</b><br></label> - <div id="passwordInvalid" class="invalid-tooltip">Please fill out this field.</div> - </div> - <input type="password" id="password" name="password"> - <div id="invalidLogin">Username and/or Password incorrect. Please try again.</div> - <button type="submit"><b>Log In</b></button> - </form> - - </div> - -</main> - - - -<script type="text/javascript" th:src="@{scripts/login.js}"></script> - -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/templates/rewards/userProfile.html b/src/main/resources/templates/rewards/userProfile.html deleted file mode 100644 index a193bf7614603637614dd0cfdc0974fdd8c44767..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/rewards/userProfile.html +++ /dev/null @@ -1,73 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title th:text="'VZLA Profile Page of ' + ${user.getName()}"></title> - <link rel="stylesheet" th:href="@{/css/userProfile.css}"> -<!-- <link rel="stylesheet" th:href="@{/css/templatingstyle.css}">--> -</head> -<body> - -<header> - <ul class="footerBar"> - <li class="footerButton"><b>Home</b></li> - <li class="footerButton"><b>About</b></li> - <li class="footerButton"><b>Map</b></li> - <li class="footerButton"><b>Facilities</b></li> - <li class="footerButton"><b>Log In</b></li> - </ul> -</header> - -<main> - <!--PICTURE - DATA - BADGES --> - <div class="userInfo"> - <img th:src="@{${user.getImgPath()}}" - th:alt="${user.getName()}" - id="userPicture" - > - <h1 th:text="${user.getName()}"></h1> - <!--TODO add some progression info here?--> - </div> - <section class="rewards"> <!--Reward lists, badges on top, stickers (larger) on the bottom--> - <article id="badgesBar"> - <h2>Your Badges: </h2> <!--Shows first earned badges, followed by greyed out badges--> - <div id="allBadgesContainer" class="centerFlex"> - <img class="badgeImg" th:each="badge : ${badges}" th:src="@{'..' + ${badge.getImgPath()}}" - th:id="'img' + ${badge.getId()}" th:alt="${badge.getName()}" > - </div> - </article> - <article class="dragonProgression"> - <h1>The Dragon's Tale</h1> - <div class="dragonContainer"> - <div class="dragonFill" th:style="'width:'+ ${user.getDragonProgress()} + '%;'"> - <img th:src="@{/images/rewards/dragonFilled.png}" - alt="Filled Dragon" id="FilledDragon" class="dragonImg"> - </div> - <div class="dragonOut"> - <img th:src="@{/images/rewards/dragonOutline.png}" - alt="Outline Dragon" id="OutlineDragon" class="dragonImg"> - </div> - </div> - <h2 th:text="${user.getDragonProgress()} + '%'"></h2> - </article> - <article id="stickersBox"> <!--Need a controller to show earned stickers --> - <h2> STICKERS! </h2> - <div class="stickersContainer"> - <img th:class="'stickerImg ' + ${sticker.getVisibility()}" th:each="sticker : ${stickers}" th:src="@{'../' + ${sticker.getImgPath()}}" - th:id="'img' + ${sticker.getId()}" th:alt="${sticker.getName()}" > - </div> - </article> - </section> - - -</main> - -<footer> - -</footer> - - -<script> -</script> -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/templates/towns/caerphilly.html b/src/main/resources/templates/towns/caerphilly.html index 912da813737475d83dfc3af4c0ff4010189ec7f5..11d4aabb9ef479d9e67bc5c19419ec0f9c47d3eb 100644 --- a/src/main/resources/templates/towns/caerphilly.html +++ b/src/main/resources/templates/towns/caerphilly.html @@ -171,7 +171,7 @@ <link rel="stylesheet" th:href="@{/css/templatingstyle.css}"> </head> <body> -<header th:insert="~{/towns/Templating.html::header}"></header> +<header th:insert="~{/fragments/Templating.html::header}"></header> <main> <div class="container"> <h1 class="townName"> Welcome to the town of Caerphilly.</h1> @@ -215,7 +215,7 @@ </div> </main> -<footer th:insert="~{/towns/Templating.html::footer}"></footer> +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/towns/home/homePage.html b/src/main/resources/templates/towns/home/homePage.html index 2cdc1e854fba95f89dd2da702bbeb6d5011ed5d8..ec489ae7d334997390462ef1ffbe0d3ceaf5c828 100644 --- a/src/main/resources/templates/towns/home/homePage.html +++ b/src/main/resources/templates/towns/home/homePage.html @@ -8,7 +8,7 @@ </head> <body> -<header th:insert="~{/towns/Templating.html::header}"></header> +<header th:insert="~{/fragments/Templating.html::header}"></header> <main> <div class="gridContainer1"> <H1 id="homeTitle"> VZTA Smart Towns - Trails</H1> @@ -56,7 +56,7 @@ rough % outline; </div> </main> -<footer th:insert="~{/towns/Templating.html::footer}"></footer> +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> </body> </html> diff --git a/src/main/resources/templates/towns/home/homePageOld.html b/src/main/resources/templates/towns/home/homePageOld.html index bf35e662607a4b2a101aeef83f3a05a65fd50ad2..ce51066c3313d03de40e19be1b1bf951bcc9b6b7 100644 --- a/src/main/resources/templates/towns/home/homePageOld.html +++ b/src/main/resources/templates/towns/home/homePageOld.html @@ -9,7 +9,7 @@ </head> <body> -<header th:insert="~{/towns/Templating.html::header}"></header> +<header th:insert="~{/fragments/Templating.html::header}"></header> <main> <div class="gridContainer1"> <H1 id="homeTitle"> VZTA Smart Towns - Trails</H1> @@ -60,7 +60,7 @@ </main> -<footer th:insert="~{/towns/Templating.html::footer}"></footer> +<footer th:insert="~{/fragments/Templating.html::footer}"></footer> </body> </html> diff --git a/src/main/resources/templates/towns/mapsTest/index.html b/src/main/resources/templates/towns/mapsTest/index.html new file mode 100644 index 0000000000000000000000000000000000000000..564d189b468ef43294c8b5a16f0865b41efd30b4 --- /dev/null +++ b/src/main/resources/templates/towns/mapsTest/index.html @@ -0,0 +1,64 @@ +<!--<!DOCTYPE html>--> +<!--<html lang="en">--> +<!--<head>--> +<!-- <meta charset="UTF-8">--> +<!-- <title>MAPTEST</title>--> +<!-- <link rel="stylesheet" th:href="@{/css/templatingstyle.css}">--> +<!-- <link rel="stylesheet" th:href="@{/css/styling.css}">--> +<!-- <script type="module" src="/scripts/mapAPI.js"></script>--> +<!--<!– href="node_modules/ol/ol.css">–>--> + +<!-- <style>--> + +<!-- #map{--> +<!-- position: absolute;--> +<!-- top: 0;--> +<!-- bottom: 0;--> +<!-- width: 100%;--> +<!-- }--> + +<!-- </style>--> +<!--</head>--> +<!--<body>--> +<!--<header th:insert="~{/towns/Templating.html::header}"></header>--> +<!--<main>--> + + +<!-- <H1> Map API Test Here</H1>--> + +<!--<!– <div class="map2">–>--> +<!--<!–<!– test data from hackathon–>–>--> +<!--<!– <p> Google maps embedding;</p>–>--> +<!--<!– <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d9933.490822613407!2d-3.1845439261935375!3d51.506377949006364!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x486e1c8d0919099f%3A0x60bea7f0ae155f28!2sRoath%20Park!5e0!3m2!1sen!2suk!4v1698921027199!5m2!1sen!2suk" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>–>--> +<!--<!– </div>–>--> + +<!-- <div id="map" ></div>--> +<!-- <div>Selected regions: <span id="info">None</span></div>--> + + + + +<!--</main>--> +<!--<footer th:insert="~{/towns/Templating.html::footer}"></footer>--> +<!--</body>--> +<!--</html>--> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Box Selection</title> + <link rel="stylesheet" href="/nodeMods/node_modules/ol/ol.css"> + <style> + .map { + width: 100%; + height: 400px; + } + </style> +</head> +<body> +<div id="map" class="map"></div> +<div>Selected regions: <span id="info">None</span></div> + +<script type="module" src="/scripts/mapAPI.js"></script> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/towns/templates.server/Templating.html b/src/main/resources/templates/towns/templates.server/Templating.html deleted file mode 100644 index 14343a76ea3cc2974dbdd50cc7bd3ade124adc17..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/towns/templates.server/Templating.html +++ /dev/null @@ -1,149 +0,0 @@ -<header class="headerBar th:fragment="header"> - - <div class="Logo"> - <img th:src="@{images/VZTA.png}" alt="VZTA Logo"> - </div> - <nav class="navBar"> - <ul> - <li>Home</li> - <li>FAQs</li> - <li>Contact us</li> - </ul> - <label class="work">Who we Work with:</label> - <select> - <ul> - <option value="localauthorities">Local Authorities</option> - <option value="towns">Towns</option> - <option value="businesses">Businesses</option> - <option value="consumers">Consumers</option> - </ul> - </select> - </nav> - </header> - - <div class="footerBar" th:fragment="footer"> - <div class="containerFooter"> - <div class="leftFooter"> - <h3>VZTA</h3> - Near Me Now LTD - <br>Britania House - <br>Caerphilly Business Park - <br>Caerphilly - <br>CF83 3GG - </div> - <div class="rightFooter"> - <h3>Connect with us</h3> - <p>Be the first to know about updates by joining out Community page</p> - (C) VZTA 2022<br> - Policy Terms and Conditions - </div> - <div class="centerFooter"> - <span class="footerText"> - <h3>Follow Us</h3> - <a th:href=="https://www.facebook.com/VZTAsmarttowns/" class="icon"></a><img th:src="@{images/Facebook.png}" alt="Facebook Logo" class="picture"> - <a th:href=="https://www.twitter.com/VZTAsmarttowns/" class="icon"></a><img th:src="@{images/Twitter-Logo.png}" alt="X (formally Twitter) Logo" class="picture"> - <a th:href=="https://www.instagram.com/vztasmarttowns/" class="icon"></a><img th:src="@{images/Instagram.jpg}" alt="Instagram Logo" class="picture"> - <a th:href=="https://'www.linkin.com/company/vztasmarttowns/" class="icon"></a><img th:src="@{images/LinkedIn.jpg}" alt="Linkedin Logo" class="picture"> <br> - </span> - </div> - <div class="copyright" style="text-align: left"> - - </div> - </div> - </div> -</div> -<style> - /* Header */ - .headerBar { - border-bottom: 2px rgb(230, 230, 230) solid; - margin-bottom: 20px; - display: flex; - background: blueviolet; - } - /* Navbar Links */ - .navBar { - margin-top: 50px; - margin-left: auto; - margin-right:20px; - text-align: right; - } - .work{ - color: rgb(255, 255, 255); - } - .navBar ul { - list-style: none; - display: flex; - margin-left: 100px; - } - .navBar a { - border-left: 2px rgb(185, 185, 185) solid; - padding: 10px 40px; - text-decoration: none; - color:rgb(87, 86, 86); - white-space: nowrap; - overflow: hidden; - float: right; - } - .navBar a:hover { - background-color: rgb(209, 209, 209); - } - .navBar li{ - margin-left: 10px; - margin-right: 10px; - color: rgb(255, 255, 255); - } - .navListLast { - border-right: 2px rgb(185, 185, 185) solid; - margin-right:40px; - } - - /* Navbar Logo */ - .Logo { - margin-left:10px; - padding: 20px; - width: fit-content; - } - .Logo img { - width: 120px; - margin-left:15px; - } - - /* Footer */ - footer { - margin-top:20px; - display: flex; - justify-content: center; - } - .footerBar{ - border-top: 2px rgb(230, 230, 230) solid; - text-align: left; - display: flex; - background: blueviolet; - color: rgb(255, 255, 255); - padding-left: 30px; - } - .footerBar ul { - list-style: none; - display: flex; - } - .copyright{ - text-align: left; - display: flex; - } - .containerFooter{ - display: flex; - flex-direction: row; - } - .leftFooter{ - flex:1; - color: rgb(255, 255,255); - } - .centerFooter{ - flex: 1; - color: rgb(255, 255,255); - } - .rightFooter{ - flex:1; - color: rgb(255, 255, 255); - } -</style> \ No newline at end of file diff --git a/src/main/resources/templates/towns/trails/dragonstale/index.html b/src/main/resources/templates/towns/trails/dragonstale/index.html index 80aa32934673ddca22af19a7f7772a378ce9c774..7cf5948e993116ac247cf9c8aaac3d1ece2e8762 100644 --- a/src/main/resources/templates/towns/trails/dragonstale/index.html +++ b/src/main/resources/templates/towns/trails/dragonstale/index.html @@ -8,7 +8,7 @@ <script src="./node_modules/html5-qrcode/html5-qrcode.min.js"></script> </head> <body> - <header th:insert="towns/Templating.html :: header"></header> + <header th:insert="fragments/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"> @@ -49,7 +49,7 @@ <button type="button" id="begin">Click here!</button> </div> - <div th:insert="towns/Templating.html :: footer"></div> + <div th:insert="fragments/Templating.html :: footer"></div> <script> diff --git a/src/main/resources/templates/users/login.html b/src/main/resources/templates/users/login.html new file mode 100644 index 0000000000000000000000000000000000000000..82f791b9acfff17bada66a547b3f2e3e7d79d29b --- /dev/null +++ b/src/main/resources/templates/users/login.html @@ -0,0 +1,78 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>User Log In</title> + <link rel="stylesheet" th:href="@{/css/style.css}"> + <link rel="stylesheet" th:href="@{/css/login.css}"> + <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> + +</head> +<body> + +<header> + <form name="logoutForm" th:action="@{/logout}" method="post" th:hidden="false"> + <input hidden type="submit" value="Sign Out"/> + <button type="submit">CLICK ME OT LOG OUT</button> + </form> +</header> + +<main> + <!--CODE MODIFIED FROM: https://github.com/AsmrProg-YT/Modern-Login --> + <div class="container sign-in"> + <div class="container" th:classappend="${status}" id="container"> + <div class="form-container sign-up"> + <form th:object="${user}" action="#" th:action="@{/login/register}" th:method="POST" onsubmit="return registerFormValidation()"> + <h1>Create Account</h1> + <div th:if="${error.equals('User exists')}" class="alert alert-error">User already exist</div> + <label> + <input class="input" th:field="*{name}" id="register-username" type="text" placeholder="Name"> + </label> + <label> + <input class="input" th:field="*{email}" id="register-email" type="email" placeholder="Email"> + </label> + <label> + <input class="input" th:field="*{password}" id="register-password" type="password" placeholder="Password"> + </label> + <button type="submit" >Sign Up</button> + </form> + </div> + <div class="form-container sign-in"> + <form name="f" th:action="@{/login}" th:method="POST"> + <h1>Sign In</h1> + <div th:if="${param.error}" class="alert alert-error">Invalid Username or Password</div> + <label> + <input class="input" id="username" type="text" name="username" placeholder="Email"> + </label> + <label> + <input class="input" id="password" type="password" name="password" placeholder="Password"> + </label> + <a href="#" class="text">Forget Your Password?</a> + <button type="submit">Sign In</button> + </form> + </div> + <div class="toggle-container"> + <div class="toggle"> + <div class="toggle-panel toggle-left"> + <h1>Welcome Back!</h1> + <p>Enter your personal details and start tracking your landmarks!</p> + <button class="hidden" id="login">Sign In</button> + </div> + <div class="toggle-panel toggle-right"> + <div th:if="${param.logout}" class="alert alert-success">Successfully Logged out</div> + <h1 th:if="!${param.logout}">Hello, Welcome!</h1> + <p th:if="!${param.logout}">Register with your personal details and start earning stickers!</p> + <button class="hidden" id="register">Sign Up</button> + </div> + </div> + </div> + </div> + </div> +</main> + + + +<script type="text/javascript" th:src="@{scripts/login.js}"></script> + +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/users/logout.html b/src/main/resources/templates/users/logout.html new file mode 100644 index 0000000000000000000000000000000000000000..69107ce66e4b6c4b3ed49219e191e5335de6d9a2 --- /dev/null +++ b/src/main/resources/templates/users/logout.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Logged Out Successfully</title> + <link rel="stylesheet" th:href="@{/css/style.css}"> + <link rel="stylesheet" th:href="@{/css/login.css}"> +</head> +<body> +<main> + <div class="container centerAll"> + <h1>You have successfully logged out</h1> + </div> +</main> + +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/users/userFrags.html b/src/main/resources/templates/users/userFrags.html new file mode 100644 index 0000000000000000000000000000000000000000..5b5e8201f805bdcbed9234da8c39d6a4b79e94f7 --- /dev/null +++ b/src/main/resources/templates/users/userFrags.html @@ -0,0 +1,28 @@ +<!-- @thymesVar id="sticker" type="Team5.SmartTowns.rewards.Sticker" --> +<!-- @thymesVar id="user" type="Team5.SmartTowns.users.User" --> +<!-- @thymesVar id="selectedPack" type="Team5.SmartTowns.rewards.Pack" --> +<div th:fragment="stickersBox" id="packRewardsWrapper"> + <article class="progressionContainer"> + <h1 th:text="${selectedPack.getName()}"></h1> + <div class="progImgContainer"> + <div class="progImgFill" th:style="'width:'+ ${progress} + '%;'"> + <img th:src="@{'../' + ${selectedPack.getDisplayImg()}}" + alt="Filled Dragon" id="FilledDragon" class="progImg"> + </div> + <div class="progText"> + <p th:text="${progress} + '%'"></p> + </div> + <div class="progImgOutline"> + <img th:src="@{'../' + ${selectedPack.getDisplayImg()}}" + alt="Outline Dragon" id="OutlineDragon" class="progImg"> + </div> + </div> + </article> + + <article id="stickersBox"> + <div class="stickersContainer"> + <img th:class="'stickerImg ' + ${sticker.getVisibility()}" th:each="sticker : ${stickers}" th:src="@{'../' + ${sticker.getDisplayImg()}}" + th:id="'img' + ${sticker.getId()}" th:alt="${sticker.getName()}" > + </div> + </article> +</div> \ No newline at end of file diff --git a/src/main/resources/templates/users/userProfile.html b/src/main/resources/templates/users/userProfile.html new file mode 100644 index 0000000000000000000000000000000000000000..edbe13918a53d466e7194ba42ff9dcf86bebdc56 --- /dev/null +++ b/src/main/resources/templates/users/userProfile.html @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title th:text="'VZLA Profile Page of ' + ${user.getName()}"></title> + <link rel="stylesheet" th:href="@{/css/style.css}"> + <link rel="stylesheet" th:href="@{/css/userProfile2.css}"> + <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> +<!-- <link rel="stylesheet" th:href="@{/css/templatingstyle.css}">--> +</head> +<body> + +<!--<header>--> +<!-- <ul class="footerBar">--> +<!-- <li class="footerButton"><b>Home</b></li>--> +<!-- <li class="footerButton"><b>About</b></li>--> +<!-- <li class="footerButton"><b>Map</b></li>--> +<!-- <li class="footerButton"><b>Facilities</b></li>--> +<!-- <li class="footerButton"><b>Log In</b></li>--> +<!-- </ul>--> +<!--</header>--> + +<main> + <!--PICTURE - DATA - BADGES --> + <div class="userContainer"> + <h1 th:text="${user.getName()}"></h1> + <img th:src="@{${user.getImgPath()}}" + th:alt="${user.getName()}" + id="userPicture" + > + + <!--TODO add some progression info here?--> + </div> + <section class="rewards"> <!--Reward lists, badges on top, stickers (larger) on the bottom--> + <article id="packsBar"> + <h2>Packs</h2> + <!--Shows first earned badges, followed by greyed out badges--> + <div id="allPacksContainer" class="centerFlex"> + <div th:each="pack : ${packs}" class="packContainer"> + <img class="packImg" th:src="@{'../' + ${pack.getDisplayImg()}}" + th:id="'packImg' + ${pack.getId()}" th:alt="${pack.getName()}" + th:data-url="@{/packInfo/{username}/{packID}(username=${user.getName()}, packID=${pack.getId()})}" + onclick="updatePack(this.getAttribute('data-url'))"> + <h4 class="packName" th:text="${pack.getName()}"></h4> + </div> + </div> + </article> + <article th:replace="~{users/userFrags.html::stickersBox}" id="stickersBox"></article> + </section> + + +</main> + +<footer> + +</footer> +<script type="text/javascript" th:src="@{../scripts/userPage.js}"></script> + +<script> +</script> +</body> +</html> \ No newline at end of file diff --git a/src/test/java/Team5/SmartTowns/DataSourceConfig.java b/src/test/java/Team5/SmartTowns/DataSourceConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..568065a262e3a45668c889f8a8ddc6c1048bba01 --- /dev/null +++ b/src/test/java/Team5/SmartTowns/DataSourceConfig.java @@ -0,0 +1,19 @@ +package Team5.SmartTowns; + +import javax.sql.DataSource; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.jdbc.datasource.DriverManagerDataSource; + +@Configuration +public class DataSourceConfig { + + @Bean + public DataSource dataSource(){ + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setUrl("jdbc:mariadb://localhost:3306/test_towns"); + dataSource.setUsername("root"); + dataSource.setPassword("comsc"); + return dataSource; + } +} \ No newline at end of file diff --git a/src/test/java/Team5/SmartTowns/LocationRepositoryTest.java b/src/test/java/Team5/SmartTowns/LocationRepositoryTest.java new file mode 100644 index 0000000000000000000000000000000000000000..0c029bd95f7e372481c2a64c0aa2394b8794ff73 --- /dev/null +++ b/src/test/java/Team5/SmartTowns/LocationRepositoryTest.java @@ -0,0 +1,120 @@ +package Team5.SmartTowns; + +import Team5.SmartTowns.data.Location; +import Team5.SmartTowns.data.LocationRepository; + +import Team5.SmartTowns.data.TrailsRepository; +import Team5.SmartTowns.placeswithcoordinates.LocationsCoordinates; +import Team5.SmartTowns.placeswithcoordinates.PlacesCoordinatesRepository; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.jdbc.core.JdbcTemplate; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import static junit.framework.TestCase.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@SpringBootTest +public class LocationRepositoryTest { + + @Autowired + TrailsRepository trailsRepo; + @Autowired + LocationRepository locationRepository; + + + @Autowired + PlacesCoordinatesRepository placesRepository; + + @Autowired + JdbcTemplate jdbcTemplate; + + + +// @BeforeEach +// public void beforeEachTest(){ +// jdbcTemplate.update("DELETE FROM locations"); +// } + + @Test + public void testGetAllApprovedLocations() { + List<Location> approvedLocations = locationRepository.getAllApprovedLocations(); + List<Location> allLocations = locationRepository.getAllLocation(); + for (int i=0;i<allLocations.size();i++){ // iterate over all location, removing authorised=true + for (Location app : approvedLocations){ + if (Objects.equals(allLocations.get(i).getLocationName(), app.getLocationName())){ + allLocations.remove(allLocations.get(i)); + } + } + } boolean noApporvedLeft=false; + for (Location loc2: allLocations){ + if (loc2.isLocationApproved()){ + noApporvedLeft=false; + break; + } else{ + noApporvedLeft=true; + } + } assertTrue(noApporvedLeft); + } + + + @Test + public void testGetAllUnapprovedLocations() { + List<Location> unapprovedLocations = locationRepository.getAllUnapprovedLocations(); + List<Location> allLocations = locationRepository.getAllLocation(); + for (int i=0;i<allLocations.size();i++){ // iterate over all location, removing authorised=false + for (Location app : unapprovedLocations){ + if (Objects.equals(allLocations.get(i).getLocationName(), app.getLocationName())){ + allLocations.remove(allLocations.get(i)); + } + } + } boolean noUnapporvedLeft=false; + for (Location loc2: allLocations){ + if (!loc2.isLocationApproved()){ + noUnapporvedLeft=false; + break; + } else{ + noUnapporvedLeft=true; + } + } assertTrue(noUnapporvedLeft); + } + @Test + public void ensureApprovedLocationsAndCoordinatessAreTheSameSize(){ + List<Location> approvedLocations = locationRepository.getAllApprovedLocations(); + List<LocationsCoordinates> coordinatesLocations = placesRepository.getAllLocationCoords(); + assertSame(approvedLocations.size(),coordinatesLocations.size() ); + + } + + + @Test + public void ensureApprovedLocationsAndCoordinatessTableLineUpTest(){ + List<Location> approvedLocations = locationRepository.getAllApprovedLocations(); + List<LocationsCoordinates> coordinatesLocations = placesRepository.getAllLocationCoords(); + List<Integer> coordinatesLocationsID = new ArrayList<>(); + boolean doTheyMatch=false; + for (int i=0;i<coordinatesLocations.size();i++){ + int locID=coordinatesLocations.get(i).getLocationID(); + String coordName = jdbcTemplate.queryForObject("SELECT locationName FROM locations WHERE locationID=?", String.class, locID); + + if (Objects.equals(coordName, approvedLocations.get(i).getLocationName())){ + doTheyMatch=true; + } else{ + doTheyMatch=false; + break; + } + // for loop goes through entire list, if there were any discrepancies, the loop would break, resulting in a fail + + + } assertTrue(doTheyMatch); + } +} diff --git a/src/test/java/Team5/SmartTowns/SmartTownsApplicationTests.java b/src/test/java/Team5/SmartTowns/SmartTownsApplicationTests.java index d9c15a4bf0557ca94619ec9f61d0d83d2180c7c3..4b281aab3e06da893c6862fda7dd47b2b3c54e65 100644 --- a/src/test/java/Team5/SmartTowns/SmartTownsApplicationTests.java +++ b/src/test/java/Team5/SmartTowns/SmartTownsApplicationTests.java @@ -1,13 +1,92 @@ -package Team5.SmartTowns; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class SmartTownsApplicationTests { - - @Test - void contextLoads() { - } - -} +//package Team5.SmartTowns; +// +//import Team5.SmartTowns.data.DatabaseController; +//import Team5.SmartTowns.data.Location; +//import Team5.SmartTowns.data.LocationRepository; +//import Team5.SmartTowns.data.LocationRepositoryJDBC; +//import Team5.SmartTowns.landmarks.Landmarks; +//import org.junit.jupiter.api.BeforeAll; +//import org.junit.jupiter.api.Test; +//import org.mockito.InjectMocks; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; +//import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.jdbc.core.JdbcTemplate; +// +//import static org.junit.jupiter.api.Assertions.assertEquals; +// +//import java.lang.annotation.Inherited; +//import java.util.List; +// +// +// +//@DataJpaTest +//@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) +////@SpringBootTest +//class SmartTownsApplicationTests { +// +// @Autowired +// private LocationRepository locationRepository; +// +// +// @Test +// void contextLoads() { +// } +// +// @Test +// void test(){ +// Location location = new Location(); +// location.setLocationName("Test"); +// location.setLocationEmail("test@test"); +// location.setLocationDescription("Description Here"); +// location.setLocationPlace("Caerphilly"); +// location.setLocationTrailID("0103"); +// location.setLocationApproved(false); +// +// int locSize1 = locationRepository.getAllLocation().size(); +// locationRepository.addLocation(location); +// int locSize2 = locationRepository.getAllLocation().size(); +// assertEquals(1, (locSize2-locSize1)); +// +// +// } +// +// +// +// +// +//// private static Location location; +//// private static locationRepositoryJDBC locationRepo; +//// private static JdbcTemplate jdbc; +//// @BeforeAll +//// public static void before() { +//// location = new Location(); +//// locationRepo = new locationRepositoryJDBC(jdbc);} +//// @BeforeAll +//// public static void before2() { +//// locationRepo = new locationRepositoryJDBC(jdbc); } +//// @Autowired +//// private locationRepository locationRepository; +// +//// @Test +//// public void whenAddingLocationsNonApprovedLocationsDontShowInTrails(){ +//// /// Discover number of approved/unapproved locations before adding tests +//// List<Location> approvedNumber = locationRepo.approvedLocations(); +//// } +////// Location loc1= new Location("TestFail", "Test@PleaseFail.test", "Fail Description here", +////// "Caerphilly", 103, false); +////// Location loc2= new Location("TestFail", "Test@PleaseFail2.test", "Fail Description here", +////// "Caerphilly", 103, false); +////// Location loc3= new Location("TestPass", "Test@PleasePass.test", "Pass Description here", +////// "Caerphilly", 103, true); +////// locationRepository.addLocation(loc1); +////// locationRepository.addLocation(loc2); +////// locationRepository.addLocation(loc3); +////// List<Location> ApprovedNumberAfter=locationRepository.approvedLocations(); +////// +////// assertEquals(1,( ApprovedNumber.size()-ApprovedNumberAfter.size())); +//// } +// } +// +//// create test where getFullListLocations and getFullApproved/Unapporved lcopations from lcoationcooirds matches locationJDBC diff --git a/src/test/java/Team5/SmartTowns/TrailsRepositoryTest.java b/src/test/java/Team5/SmartTowns/TrailsRepositoryTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c0d8d91555c8a68955b49b61ba78c2589f7a507e --- /dev/null +++ b/src/test/java/Team5/SmartTowns/TrailsRepositoryTest.java @@ -0,0 +1,44 @@ +package Team5.SmartTowns; + +import Team5.SmartTowns.data.LocationRepository; +import Team5.SmartTowns.data.TrailsRepository; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.jdbc.core.JdbcTemplate; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +@SpringBootTest +public class TrailsRepositoryTest { + @Autowired + TrailsRepository trailsRepo; + + @Autowired + JdbcTemplate jdbcTemplate; + + @Test + public void getTrailNameWithIDTest(){ + String trailsID="101"; + String trailName= trailsRepo.getTrailNameWithID(trailsID); + assertEquals("Caerphilly Castle Trail",trailName); + trailsID="102"; + trailName= trailsRepo.getTrailNameWithID(trailsID); + assertEquals("Caerphilly Pub Trail",trailName); + trailsID="103"; + trailName= trailsRepo.getTrailNameWithID(trailsID); + assertEquals("Caerphilly Heritage Trail",trailName); + trailsID="201"; + trailName= trailsRepo.getTrailNameWithID(trailsID); + assertEquals("Risca Heritage Trail",trailName); + trailsID="301"; + trailName= trailsRepo.getTrailNameWithID(trailsID); + assertEquals("Penarth Esplanade Trail",trailName); + } // test whether function works correctly for all instances + + + + +} diff --git a/src/test/java/Team5/SmartTowns/data/LocationRepositoryJDBCTest.java b/src/test/java/Team5/SmartTowns/data/LocationRepositoryJDBCTest.java new file mode 100644 index 0000000000000000000000000000000000000000..73792324a036bc848146988f73abe5bbc9a268c2 --- /dev/null +++ b/src/test/java/Team5/SmartTowns/data/LocationRepositoryJDBCTest.java @@ -0,0 +1,44 @@ +//package Team5.SmartTowns.data; +// +//import org.junit.jupiter.api.Test; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.jdbc.core.JdbcTemplate; +//import org.springframework.jdbc.core.RowMapper; +// +//@SpringBootTest +//class LocationRepositoryJDBCTest { +// private JdbcTemplate jdbcTemplate; +// private LocationRepositoryJDBC locationRepositoryJDBC; +// +// private RowMapper<Location> locationMapper; +// +// +// @Autowired +// public void setlocationMapper(){ +// locationMapper = (rs, i) -> new Location( +// +// rs.getString("locationName"), +// rs.getString("locationEmail"), +// rs.getString("locationDescription"), +// rs.getString("locationPlace"), +// rs.getString("locationTrailID"), +// rs.getBoolean("locationApproved") +// ); +// } +// @Autowired +// public void LocationRepositoryJDBC(JdbcTemplate jdbc){ +// this.jdbcTemplate = jdbc; +// locationRepositoryJDBC = new LocationRepositoryJDBC(jdbc); +// } +// +// +// +// +// @Test +// public void test(){ +// +// } +// +// +//} \ No newline at end of file diff --git a/src/test/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesTest.java b/src/test/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesTest.java new file mode 100644 index 0000000000000000000000000000000000000000..933541d774f1666db611121fd72377a02c73c78c --- /dev/null +++ b/src/test/java/Team5/SmartTowns/placeswithcoordinates/PlacesCoordinatesTest.java @@ -0,0 +1,82 @@ +package Team5.SmartTowns.placeswithcoordinates; + +import org.junit.jupiter.api.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.jdbc.core.JdbcTemplate; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@SpringBootTest +class PlacesCoordinatesTest { + + @Autowired + PlacesCoordinatesRepository placesCoordinatesRepository; + + @Autowired + JdbcTemplate jdbcTemplate; + + @BeforeEach + void setUp() { + /* Ensures that each test starts with a clean table*/ + jdbcTemplate.update("DELETE FROM locationCoordinates"); + } + + @AfterEach + void tearDown() { + jdbcTemplate.update("DELETE FROM locationCoordinates"); + } + + @Test + void getAllLocationCoords() { + jdbcTemplate.update("insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (2, 51.57623, -3.21910 )"); + jdbcTemplate.update("insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (3, 51.57623, -3.21910 )"); + jdbcTemplate.update("insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (4, 51.57623, -3.21910 )"); + + List<Long> expected = jdbcTemplate.queryForList("SELECT locationID FROM locationcoordinates", Long.class); + List<LocationsCoordinates> allObjects = placesCoordinatesRepository.getAllLocationCoords(); + assertEquals(expected.size(), allObjects.size()); + assertEquals(expected.get(0), allObjects.get(0).getLocationID()); + assertEquals(expected.get(1), allObjects.get(1).getLocationID()); + assertEquals(expected.get(2), allObjects.get(2).getLocationID()); + } + + @Test + void getAllTownCoords() { + } + + @Test + void addLocationCoord() { + int locationID = 1; + double locationCoordsLat = 1.5; + double locationCoordsLong = 1.5; + placesCoordinatesRepository.addLocationCoord( + new LocationsCoordinates(1, locationCoordsLat, locationCoordsLong) + ); + + double resultLat = jdbcTemplate.queryForObject( + "SELECT locationCoordsLat FROM locationcoordinates WHERE locationID=?", + Double.class, locationID); + double resultLong = jdbcTemplate.queryForObject( + "SELECT locationCoordsLat FROM locationcoordinates WHERE locationID=?", + Double.class, locationID); + + + + assertEquals(locationCoordsLat, resultLat); + assertEquals(locationCoordsLong, resultLong); + } + + + @Test + void getFullApprovedLocations() { + + } + + @Test + void getLocationTableIDValue() { + } +} \ No newline at end of file diff --git a/src/test/java/Team5/SmartTowns/testUsers.java b/src/test/java/Team5/SmartTowns/testUsers.java new file mode 100644 index 0000000000000000000000000000000000000000..2145c47165ed072b8a4c3478774da7410f881414 --- /dev/null +++ b/src/test/java/Team5/SmartTowns/testUsers.java @@ -0,0 +1,79 @@ +package Team5.SmartTowns; + +import Team5.SmartTowns.rewards.RewardsRepository; +import Team5.SmartTowns.users.NewUser; +import Team5.SmartTowns.users.User; +import Team5.SmartTowns.users.UserRepository; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.ArrayList; +import java.util.List; + +import static junit.framework.TestCase.*; + +@SpringBootTest +public class testUsers { + + + @Autowired + UserRepository userRepository; + @Autowired + RewardsRepository rewardsRepository; + + @Test + public void getAllUsersTest(){ // test if we can get all users, admin is sa known user + List<User> users = userRepository.getAllUsers(); + User user = new User("Admin","Admin"); + Assertions.assertEquals("Admin", users.get(0).getName()); + } + + @Test // test if new users can be added + public void addAUserTest(){ + int userNumberBeforeAdd = userRepository.getAllUsers().size(); + NewUser newuser = new NewUser("Meow","Woof","Cat@Dogs.com"); + boolean trueIfAdded= userRepository.addUser(newuser.getName(), newuser.getEmail(), newuser.getPassword()); + int userNumberAfterAdd = userRepository.getAllUsers().size(); + assertTrue(trueIfAdded); + } + + @Test // test if new users and inserted users can be found + public void doesUserExistTest(){ + Boolean insertedUserFoundByEmail = userRepository.doesUserExist("Kevin@Gmail.com"); + NewUser newuser = new NewUser("MeowMeow","WoofMeow","CatMeow@Dogs.com"); + Boolean newUser = userRepository.addUser(newuser.getName(), newuser.getEmail(), newuser.getPassword()); + Boolean newUserFoundByEmail = userRepository.doesUserExist(newuser.getEmail()); + int compareTwoSearches = Boolean.compare(insertedUserFoundByEmail, newUserFoundByEmail); + assertEquals(0,compareTwoSearches); // if 0, both values are the same + + + } + + @Test + public void canUsersUnlockStickersTest(){ + NewUser newuser = new NewUser("MeowMeowMeow","WoofMeowMeow","CatMeowMeow@Dogs.com"); + Boolean newUser = userRepository.addUser(newuser.getName(), newuser.getEmail(), newuser.getPassword()); + Boolean doesStickerUnlock = userRepository.unlockSticker(newuser.getName(),2,2); + System.out.println(doesStickerUnlock); + assertTrue(doesStickerUnlock); + } + @Test + public void canUsersUnlockStickersAndViewThemTest(){ + NewUser newuser = new NewUser("MeowMeowMeowMeow","WoofMeowMeowMeow","CatMeowMeowMeow@Dogs.com"); + NewUser newuserTwo = new NewUser("Jumper","Baa","Sheep@Wool.com"); + Boolean newUser = userRepository.addUser(newuser.getName(), newuser.getEmail(), newuser.getPassword()); + Boolean newUserTwo = userRepository.addUser(newuserTwo.getName(), newuserTwo.getEmail(), newuserTwo.getPassword()); + Boolean doesStickerUnlock = userRepository.unlockSticker(newuser.getName(),1,2); + List<Long> newUserStickerCollection = userRepository.getUserStickersFromPack(newuser.getName(),1); + List<Long> newUserStickerCollectionTwo = userRepository.getUserStickersFromPack(newuserTwo.getName(),1); // compare and see if only new suer that has unlocked a sticker ahs one in their collection for pack 1 + int newUserStickerList = newUserStickerCollection.size(); + int newUserStickerListTwo = newUserStickerCollectionTwo.size(); // should have different sizes + assertNotSame(newUserStickerList,newUserStickerListTwo); + + } + + +} diff --git a/src/test/java/testTwo.java b/src/test/java/testTwo.java new file mode 100644 index 0000000000000000000000000000000000000000..225fb28724e8c0dc26ba5ad295dd166b52498969 --- /dev/null +++ b/src/test/java/testTwo.java @@ -0,0 +1,52 @@ +////package Team5.SmartTowns.data; +// +////import org.junit.platform.commons.util.Preconditions; +//// +//import Team5.SmartTowns.data.Location; +//import Team5.SmartTowns.data.LocationRepository; +//import Team5.SmartTowns.data.LocationRepositoryJDBC; +//import org.junit.jupiter.api.BeforeAll; +//import org.junit.jupiter.api.Test; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.jdbc.core.JdbcTemplate; +//import org.springframework.jdbc.core.RowMapper; +// +//import static org.junit.jupiter.api.Assertions.assertEquals; +// +// +////@SpringBootTest +//public class testTwo { +// +//private JdbcTemplate jdbcTemplate; +//private LocationRepositoryJDBC locationRepositoryJDBC; +// +//private RowMapper<Location> locationMapper; +// +//@Autowired +//private LocationRepository locationRepository; +// +// +//@Autowired +// public void LocationRepositoryJDBC(JdbcTemplate jdbc){ +// this.jdbcTemplate = jdbc; +// locationRepositoryJDBC = new LocationRepositoryJDBC(jdbc); +//} +// +// +//@BeforeAll +//public static void setUp(){ +// locationRepository = new LocationRepositoryJDBC.getAllLocation(); +//// locationRepository = (LocationRepositoryJDBC) locationRepository.getAllLocation(); +//} +// +//@Test +//public void test(){ +// int aa=1; +// assertEquals(1,aa); +// +// } +// +// +// +//} diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties new file mode 100644 index 0000000000000000000000000000000000000000..83f47c5db5a7390e1ab3dadf4882c3ddf1e3b4ea --- /dev/null +++ b/src/test/resources/application.properties @@ -0,0 +1,8 @@ +spring.datasource.url=jdbc:mariadb://localhost:3306/ +spring.datasource.username=root +spring.datasource.password=comsc + +spring.sql.init.mode=always +spring.sql.init.platform=test +spring.sql.init.schema-locations=classpath:schema-test.sql +spring.sql.init.data-locations=classpath:test-data.sql \ No newline at end of file diff --git a/src/test/resources/data.sql b/src/test/resources/data.sql new file mode 100644 index 0000000000000000000000000000000000000000..c2259e46e52a7b84e4dabf968a3c315118ff253a --- /dev/null +++ b/src/test/resources/data.sql @@ -0,0 +1,74 @@ +# delete from users; +# insert into users (email, name) value ('hannah@gmail.com', 'Hannah'); +# insert into users (email, name) value ('nigel@gmail.com', 'Nigel'); +# +# +# insert into trails ( trailID, trailName, trailNumber) value ( 0101,'Caerphilly Castle Trail','0101'); +# insert into trails ( trailID, trailName, trailNumber) value ( 0102,'Caerphilly Pub Trail','0102'); +# insert into trails ( trailID, trailName, trailNumber) value ( 0103,'Caerphilly Heritage Trail','0103'); +# insert into trails ( trailID, trailName, trailNumber) value ( 0201,'Risca Heritage Trail','0201'); +# insert into trails ( trailID, trailName, trailNumber) value ( 0301,'Penarth Esplanade Trail','0301'); +# +# +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'St Cenydd','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Castle','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Medieval Trades','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Queen''s War','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Green Lady','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Armoury','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Architecture','','Location description here','Caerphilly',0101, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( '21st Century Landmark','','Location description here','Caerphilly',0101, true); +# +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'JD Wetherspoons-Malcolm Uphill','','Location description here','Caerphilly',0102, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Cwtch','','Location description here','Caerphilly',0102, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Conservative Club','','Location description here','Caerphilly',0102, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The King''s Arms','','Location description here','Caerphilly',0102, true); +# +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Bus Station','','Location description here','Caerphilly',0103, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Medieval Courthouse','','Location description here','Caerphilly',0103, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ('Caerphilly Castle','','Location description here','Caerphilly',0103, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Ty Vaughan House','','Location description here','Caerphilly',0103, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Risca Colliery','','Location description here','Risca',0201, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Black Vein Colliery Disaster','','Location description here','Risca',0201, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Esplanade','','Location description here','Penarth',0301, true); +# insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Old Swimming Baths','','Location description here','Penarth',0301, true); +# +# +# +# insert into packs (name, description) value ('Wales Football Team', 'Pack of Welsh Football Players in the National Team'); +# insert into packs (name, description) value ('Wales Rugby Team', 'Pack of Welsh Rugby Players in the National Team'); +# insert into packs (name, description) value ('Welsh Heritage', 'Pack About Welsh Heritage'); +# +# +# +# insert into stickers (packID, stickerID, name, description, rarity) value (1, 1, 'wayne_hennessey', 'Wales Football Team Player', '2'); +# insert into stickers (packID, stickerID, name, description, rarity) value (1, 2, 'neco_williams', 'Wales Football Team Player', '2'); +# insert into stickers (packID, stickerID, name, description, rarity) value (1, 3, 'joe_morrell', 'Wales Football Team Player', '2'); +# insert into stickers (packID, stickerID, name, description, rarity) value (1, 4, 'ethan_ampadu', 'Wales Football Team Player', '2'); +# insert into stickers (packID, stickerID, name, description, rarity) value (1, 5, 'connor_roberts', 'Wales Football Team Player', '2'); +# insert into stickers (packID, stickerID, name, description, rarity) value (2, 1, 'Taine_Basham', 'Wales Rugby Team Player', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (2, 2, 'Adam Beard', 'Wales Rugby Team Player', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (2, 3, 'Elliot Dee', 'Wales Rugby Team Player', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (2, 4, 'Corey Domachowski', 'Wales Rugby Team Player', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (2, 5, 'Ryan Elias', 'Wales Rugby Team Player', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (3, 1, 'Welsh Lady', 'Welsh Heritage', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (3, 2, 'Welsh Outline', 'Welsh Heritage', '1'); +# insert into stickers (packID, stickerID, name, description, rarity) value (3, 3, 'Welsh Spoon', 'Welsh Heritage', '1'); +# +# +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (2, 51.57623, -3.21910 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (3, 51.575372, -3.219186); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (4, 51.576363, -3.220712 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (9, 51.57239, -3.21992); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (10, 51.57230, -3.21938 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (13, 51.57168, -3.21861); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (14, 51.57465, -3.22022 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (17, 51.61117, -3.10198 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (18, 51.61655, -3.12371 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (19, 51.43484, -3.16492 ); +# insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (20, 51.43547, -3.16789 ); +# +# +# insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Caerphilly', '51.57903','-3.22075 ','51.60418','51.55093','-3.25222','-3.17696'); +# insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Risca','51.61195','-3.09648','51.63039','51.59175','-3.12129','-3.06438'); +# insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Penarth','51.43893','-3.17354','51.44878','51.41233','-3.20271','-3.16005'); \ No newline at end of file diff --git a/src/test/resources/schema-test.sql b/src/test/resources/schema-test.sql new file mode 100644 index 0000000000000000000000000000000000000000..60304bee1fb5f57502846d60fea88d90713c1735 --- /dev/null +++ b/src/test/resources/schema-test.sql @@ -0,0 +1,121 @@ + + + + +DROP DATABASE IF EXISTS test_towns; +CREATE DATABASE IF NOT EXISTS test_towns; +USE test_towns; +/****************************************************************/ + +/* DROPS ALL TABLES IF THEY EXIST (they wont but just in case) */ + +drop table if exists locationCoordinates; +drop table if exists locations; +drop table if exists trails; +DROP TABLE IF EXISTS users; +DROP TABLE IF EXISTS stickers; +DROP TABLE IF EXISTS packs; +DROP TABLE IF EXISTS stickerProgress; + + + +/****************************************************************/ + +/* CREATES ALL TABLES */ + +create table if not exists trails +( + trailID varchar(128) primary key, + trailName varchar(128), + trailNumber varchar(128) +) engine=InnoDB; + +drop table if exists locationCoordinates; +drop table if exists locations; +create table if not exists locations +( + locationID bigint auto_increment primary key, + locationName varchar(128), + locationEmail varchar(128), + locationDescription longtext, + locationPlace varchar(255), + locationTrailID varchar(128), + locationApproved boolean +) engine=InnoDB; + + +CREATE TABLE IF NOT EXISTS users ( + username varchar(30) primary key NOT NULL, + id bigint auto_increment unique, /*DEPRECATED COLUMN, LEFT IN WHILE SOME OTHER FUNCTIONS STILL USE IT*/ + email varchar(128), + password varchar(30) NOT NULL, + enabled boolean default true +); + +CREATE TABLE IF NOT EXISTS authorities ( + id bigint primary key auto_increment NOT NULL, + username varchar(30) NOT NULL , + authority varchar(45) NOT NULL +); + +CREATE TABLE IF NOT EXISTS packs ( + id bigint auto_increment primary key, + name varchar(20) NOT NULL, + description text +); + +CREATE TABLE IF NOT EXISTS stickers ( + id bigint auto_increment primary key, + packID bigint NOT NULL, + FOREIGN KEY (packID) REFERENCES packs(id) + ON DELETE CASCADE + ON UPDATE RESTRICT, + stickerID bigint NOT NULL, /*STICKER ID NUMBER WITHIN ITS OWN PACK*/ + name varchar(30) NOT NULL, + description text NOT NULL, + rarity tinyint +); +CREATE TABLE IF NOT EXISTS stickerProgress ( + id bigint auto_increment primary key, + username varchar(30) NOT NULL, + FOREIGN KEY (username) REFERENCES users(username) + ON DELETE CASCADE + ON UPDATE RESTRICT, + packID bigint NOT NULL, + FOREIGN KEY (packID) REFERENCES packs(id) + ON DELETE CASCADE + ON UPDATE RESTRICT, + stickerID bigint NOT NULL, + FOREIGN KEY (stickerID) REFERENCES stickers(id) + ON DELETE CASCADE + ON UPDATE RESTRICT +); + +create table if not exists locationCoordinates +( + locationCoordID bigint auto_increment primary key, + locationID bigint, + Foreign Key (locationID) REFERENCES locations(locationID) + ON DELETE CASCADE + ON UPDATE RESTRICT, + locationCoordsLat DECIMAL(8,6), + locationCoordsLong DECIMAL(8,6) + + +)engine=InnoDB; + + +drop table if exists townsWithTrails; +create table if not exists townsWithTrails +( + townID bigint auto_increment primary key, + townName varchar(128), + townCentreCoordsLat varchar(128), + townCentreCoordsLong varchar(128), + townUppermostCoordsLat varchar(128), + townLowermostCoordsLat varchar(128), + townLeftmostCoordsLong varchar(128), + townRightmostCoordsLong varchar(128) + +)engine=InnoDB; + diff --git a/src/test/resources/schema.sql b/src/test/resources/schema.sql new file mode 100644 index 0000000000000000000000000000000000000000..70cf59c3ea7e21770133191348ff79616c78622a --- /dev/null +++ b/src/test/resources/schema.sql @@ -0,0 +1,108 @@ +# DROP DATABASE test_towns; +# CREATE DATABASE test_towns; +# USE test_towns; +# +# +# drop table if exists locationCoordinates; +# drop table if exists locations; +# drop table if exists trails; +# +# create table if not exists trails +# ( +# trailID varchar(128) primary key, +# trailName varchar(128), +# trailNumber varchar(128) +# ) engine=InnoDB; +# +# +# create table if not exists locations +# ( +# locationID bigint auto_increment primary key, +# locationName varchar(128), +# locationEmail varchar(128), +# locationDescription longtext, +# locationPlace varchar(255), +# locationTrailID varchar(128), +# Foreign Key (locationTrailID) REFERENCES trails(trailID) +# ON DELETE CASCADE +# ON UPDATE RESTRICT, +# locationApproved boolean +# ) engine=InnoDB; +# +# +# drop table if exists users; +# drop table if exists stickers; +# drop table if exists packs; +# drop table if exists stickerProgress; +# +# create table if not exists users +# ( +# id bigint auto_increment primary key, +# email varchar(128), +# name varchar(30), +# dragonProgress int, +# dragonsLandmarkIDs longtext +# ) engine=InnoDB; +# +# +# create table if not exists packs +# ( +# id bigint auto_increment primary key, +# name varchar(20), +# description text +# ) engine=InnoDB; +# +# create table if not exists stickers +# ( +# id bigint auto_increment primary key, +# packID bigint, +# FOREIGN KEY (packID) REFERENCES packs(id) +# ON DELETE CASCADE +# ON UPDATE RESTRICT, +# stickerID bigint, /*STICKER ID NUMBER WITHIN ITS OWN PACK*/ +# name varchar(30), +# description text, +# rarity tinyint +# +# ) engine=InnoDB; +# +# create table if not exists stickerProgress +# ( +# id bigint auto_increment primary key, +# userID bigint, +# stickerID bigint +# ) engine=InnoDB; +# +# +# +# +# +# create table if not exists locationCoordinates +# ( +# locationCoordID bigint auto_increment primary key, +# locationID bigint, +# Foreign Key (locationID) REFERENCES locations(locationID) +# ON DELETE CASCADE +# ON UPDATE RESTRICT, +# locationCoordsLat DECIMAL(8,6), +# locationCoordsLong DECIMAL(8,6) +# +# +# )engine=InnoDB; +# +# +# drop table if exists townsWithTrails; +# create table if not exists townsWithTrails +# ( +# townID bigint auto_increment primary key, +# townName varchar(128), +# townCentreCoordsLat varchar(128), +# townCentreCoordsLong varchar(128), +# townUppermostCoordsLat varchar(128), +# townLowermostCoordsLat varchar(128), +# townLeftmostCoordsLong varchar(128), +# townRightmostCoordsLong varchar(128) +# +# )engine=InnoDB; +# +# diff --git a/src/test/resources/test-data.sql b/src/test/resources/test-data.sql new file mode 100644 index 0000000000000000000000000000000000000000..f2e5430167e4ec54f04063fc60dd41c28d216b0a --- /dev/null +++ b/src/test/resources/test-data.sql @@ -0,0 +1,104 @@ +# delete from users; +# insert into users (email, name) value ('hannah@gmail.com', 'Hannah'); +# insert into users (email, name) value ('nigel@gmail.com', 'Nigel'); + +delete from trails; +insert into trails ( trailID, trailName, trailNumber) value ( 0101,'Caerphilly Castle Trail','0101'); +insert into trails ( trailID, trailName, trailNumber) value ( 0102,'Caerphilly Pub Trail','0102'); +insert into trails ( trailID, trailName, trailNumber) value ( 0103,'Caerphilly Heritage Trail','0103'); +insert into trails ( trailID, trailName, trailNumber) value ( 0201,'Risca Heritage Trail','0201'); +insert into trails ( trailID, trailName, trailNumber) value ( 0301,'Penarth Esplanade Trail','0301'); + +delete from locations; +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'St Cenydd','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Castle','','Location description here','Caerphilly',0101, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Medieval Trades','','Location description here','Caerphilly',0101, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Queen''s War','','Location description here','Caerphilly',0101, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Green Lady','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Armoury','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Architecture','','Location description here','Caerphilly',0101, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( '21st Century Landmark','','Location description here','Caerphilly',0101, false); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'JD Wetherspoons-Malcolm Uphill','','Location description here','Caerphilly',0102, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Cwtch','','Location description here','Caerphilly',0102, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Conservative Club','','Location description here','Caerphilly',0102, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The King''s Arms','','Location description here','Caerphilly',0102, false); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Caerphilly Bus Station','','Location description here','Caerphilly',0103, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Medieval Courthouse','','Location description here','Caerphilly',0103, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ('Caerphilly Castle','','Location description here','Caerphilly',0103, false); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Ty Vaughan House','','Location description here','Caerphilly',0103, false); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Risca Colliery','','Location description here','Risca',0201, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'Black Vein Colliery Disaster','','Location description here','Risca',0201, true); + +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Esplanade','','Location description here','Penarth',0301, true); +insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID, locationApproved) value ( 'The Old Swimming Baths','','Location description here','Penarth',0301, true); + +DELETE FROM locationCoordinates; +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (2, 51.57623, -3.21910 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (3, 51.575372, -3.219186); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (4, 51.576363, -3.220712 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (9, 51.57239, -3.21992); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (10, 51.57230, -3.21938 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (13, 51.57168, -3.21861); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (14, 51.57465, -3.22022 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (17, 51.61117, -3.10198 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (18, 51.61655, -3.12371 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (19, 51.43484, -3.16492 ); +insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (20, 51.43547, -3.16789 ); + +# delete from badges; +# insert into badges (name, description, difficulty) value ('TownConnoisseur', 'You know the town very well!', '2'); +# insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); +# insert into badges (name, description, difficulty) value ('TownMaster', 'You visited the town 7 days in a row!', '1'); +# insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); +# insert into badges (name, description, difficulty) value ('TownRegular', 'You visited the town 3 days in a row!', '1'); + + + +delete from packs; +insert into packs (name, description) value ('Wales Football Team', 'Pack of Welsh Football Players in the National Team'); +insert into packs (name, description) value ('Wales Rugby Team', 'Pack of Welsh Rugby Players in the National Team'); +insert into packs (name, description) value ('Welsh Heritage', 'Pack About Welsh Heritage'); + + +DELETE FROM stickers; +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 1, 'wayne_hennessey', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 2, 'neco_williams', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 3, 'joe_morrell', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 4, 'ethan_ampadu', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (1, 5, 'connor_roberts', 'Wales Football Team Player', '2'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 1, 'Taine_Basham', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 2, 'Adam Beard', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 3, 'Elliot Dee', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 4, 'Corey Domachowski', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (2, 5, 'Ryan Elias', 'Wales Rugby Team Player', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 1, 'Welsh Lady', 'Welsh Heritage', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 2, 'Welsh Outline', 'Welsh Heritage', '1'); +INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 3, 'Welsh Spoon', 'Welsh Heritage', '1'); + +# delete from stickerprogress; +# insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '1', true); +# insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '3', true); +# insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true); + + + + + + +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 1); +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 2); +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 3); +# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 5); +# insert into stickerprogress (userID, packID, stickerID) value (1, 2, 1); +# insert into stickerprogress (userID, packID, stickerID) value (1, 2, 3); + + + +# +delete from townsWithTrails; +insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Caerphilly', '51.57903','-3.22075 ','51.60418','51.55093','-3.25222','-3.17696'); +insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Risca','51.61195','-3.09648','51.63039','51.59175','-3.12129','-3.06438'); +insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Penarth','51.43893','-3.17354','51.44878','51.41233','-3.20271','-3.16005'); \ No newline at end of file