Skip to content

Commit

Permalink
Added the navbar in the right pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ms@Nicro authored and ms@Nicro committed Jan 11, 2024
1 parent cef61dd commit fb96b37
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 32 deletions.
2 changes: 0 additions & 2 deletions src/main/webapp/CSS/homepagepatient.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
.card {
display: flex;
flex-direction: column;
align-items: flex-direction;
gap: 16px;
padding: 20px;
position: relative;
Expand Down Expand Up @@ -88,7 +87,6 @@
.errorcard {
display: flex;
flex-direction: column;
align-items: flex-direction;
gap: 16px;
padding: 20px;
position: relative;
Expand Down
12 changes: 9 additions & 3 deletions src/main/webapp/CSS/messageCenter.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ body {
background: #ccc;
}

#navbarContainer{
display: none;
}

.background-green {
position: absolute;
top: 0;
Expand Down Expand Up @@ -424,8 +428,13 @@ img {
}

@media (max-width: 768px) {
#navbarContainer{
display: flex;
}

.main-container {
flex-direction: column;
height: 80vh;
}
.main-container .left-container,
.main-container .right-container {
Expand All @@ -444,9 +453,6 @@ img {
}
/* CSS rules for back button */
#back-button {
position: fixed;
top: 0;
left: 0;
display: none; /* initially hidden */
}
.main-container.show-right #back-button {
Expand Down
28 changes: 18 additions & 10 deletions src/main/webapp/CSS/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@
padding: 0;
}

body{
width: 100%;
}

#navbarDiv{
width: 100%;
height: 100%;
#navbarDiv {
display: flex;
height: 10vh;
width: 100%;
background: white;
flex-direction: row;
justify-content: center;
align-items: center;
position: fixed;
bottom: 0;
left: 0;
z-index: 1000;
}

.divButtons{
.divButtons {
display: flex;
justify-content: center;
width: 25%;
height: 3em;
}
height: 50%;
}

.navbarIcon {
width: 100%;
height: 100%;
object-fit: inherit;
}
5 changes: 3 additions & 2 deletions src/main/webapp/JS/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ const profileIconS = $("#profileIconSelected")



const USERTYPE = $("#userInfo").data("type");
let USERTYPE
const page = window.location.pathname.split('/').pop()
const homePages = ["homePagePatient.jsp"] //TODO: Mettere le pagine da considerare "Home"
const homePages = ["homePagePatient.jsp", "patientReport.jsp"] //TODO: Mettere le pagine da considerare "Home"
const messagePages = ["messageCenter.jsp"] //TODO: Mettere le pagine da considerare "Message"
const calendarPages = ["schedule.jsp"] //TODO: Mettere le pagine da considerare "Calendar"
const profilePages = ["userArea.jsp"] //TODO: Mettere le pagine da considerare "Profile"

$("document").ready(()=>{
USERTYPE = $("#userInfo").data("type");
hideSelectedIcons();
showRightIcons();
manageOnClick();
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/JSP/exercise.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
data-type = "<%= exercise.getType()%>"
></div>
<div id="userInfo" hidden
data-userType = "<%= session.getAttribute("type")%>"
data-type = "<%= session.getAttribute("type")%>"
></div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous"></script>
Expand Down
15 changes: 9 additions & 6 deletions src/main/webapp/JSP/homePagePatient.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<%@page contentType="text/html;charset=UTF-8"%>
<meta charset="utf-8" />
<link rel="stylesheet" href="../CSS/homepagepatient.css" />
<title>Homepage</title>
</head>


Expand Down Expand Up @@ -156,12 +157,8 @@
</div>
</div>
</div>
<div id="userInfo" hidden
data-userType = "<%= session.getAttribute("type")%>"
></div>
<div>
<jsp:include page="navbar.jsp"></jsp:include>
</div>




<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
Expand All @@ -182,6 +179,12 @@
});
</script>

<div>
<jsp:include page="navbar.jsp"></jsp:include>
<div id="userInfo" hidden
data-type = "<%= session.getAttribute("type")%>"
></div>
</div>
</body>
</html>
<% } %>
8 changes: 8 additions & 0 deletions src/main/webapp/JSP/messageCenter.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,13 @@
</div>

</div>

<div id="navbarContainer">
<jsp:include page="navbar.jsp"></jsp:include>
<div id="userInfo" hidden
data-type = "<%= session.getAttribute("type")%>"
></div>
</div>

</body>
</html>
16 changes: 8 additions & 8 deletions src/main/webapp/JSP/navbar.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<body>
<div id="navbarDiv" >
<div id="home" class="divButtons">
<img id="homeIcon" src="../images/home.svg" alt="homeIcon">
<img id="homeIconSelected" src="../images/homeSelected.svg" alt="homeIconSelected">
<img id="homeIcon" class="navbarIcon" src="../images/home.svg" alt="homeIcon">
<img id="homeIconSelected" class="navbarIcon" src="../images/homeSelected.svg" alt="homeIconSelected">
</div>
<div id="message" class="divButtons">
<img id="messageIcon" src="../images/message.svg" alt="messageIcon">
<img id="messageIconSelected" src="../images/messageSelected.svg" alt="messageIconSelected">
<img id="messageIcon" class="navbarIcon" src="../images/message.svg" alt="messageIcon">
<img id="messageIconSelected" class="navbarIcon" src="../images/messageSelected.svg" alt="messageIconSelected">
</div>
<div id="calendar" class="divButtons">
<img id="calendarIcon" src="../images/calendar.svg" alt="calendarIcon">
<img id="calendarIconSelected" src="../images/calendarSelected.svg" alt="calendarIconSelected">
<img id="calendarIcon" class="navbarIcon" src="../images/calendar.svg" alt="calendarIcon">
<img id="calendarIconSelected" class="navbarIcon" src="../images/calendarSelected.svg" alt="calendarIconSelected">
</div>
<div id="profile" class="divButtons">
<img id="profileIcon" src="../images/profile.svg" alt="profileIcon">
<img id="profileIconSelected" src="../images/profileSelected.svg" alt="profileIconSelected">
<img id="profileIcon" class="navbarIcon" src="../images/profile.svg" alt="profileIcon">
<img id="profileIconSelected" class="navbarIcon" src="../images/profileSelected.svg" alt="profileIconSelected">
</div>
</div>
</body>
Expand Down
6 changes: 6 additions & 0 deletions src/main/webapp/JSP/patientReport.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
});
</script>
</div>
<div>
<jsp:include page="navbar.jsp"></jsp:include>
<div id="userInfo" hidden
data-type = "<%= session.getAttribute("type")%>"
></div>
</div>
</body>
</html>
<%
Expand Down
6 changes: 6 additions & 0 deletions src/main/webapp/JSP/schedule.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@
document.getElementById('popup').style.display = 'none';
}
</script>
<div id="navbarContainer">
<jsp:include page="navbar.jsp"></jsp:include>
<div id="userInfo" hidden
data-type = "<%= session.getAttribute("type")%>"
></div>
</div>

</body>
</html>
Expand Down
8 changes: 8 additions & 0 deletions src/main/webapp/JSP/userArea.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,13 @@
e.printStackTrace();
}
%>

<div id="navbarContainer">
<jsp:include page="navbar.jsp"></jsp:include>
<div id="userInfo" hidden
data-type = "<%= session.getAttribute("type")%>"
></div>
</div>

</body>
</html>

0 comments on commit fb96b37

Please sign in to comment.