Skip to content

Commit f7f533f

Browse files
committed
updated the buttons on the top to a nav bar, final version
1 parent 3e580de commit f7f533f

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

src/main/resources/static/style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ body {
2424
z-index: 999;
2525
}
2626

27+
/*Image redendering size controll*/
28+
.image-container {
29+
max-width: 350px; /* Set the maximum width for the image container */
30+
margin: auto; /* Center the container horizontally */
31+
cursor: pointer; /* Show the pointer cursor when hovering */
32+
}
33+
34+
.image-container img {
35+
width: 100%; /* Make the image fill the container */
36+
height: auto; /* Maintain aspect ratio */
37+
transition: transform 0.3s; /* Add a smooth transition effect */
38+
}
39+
40+
.image-container img:hover {
41+
transform: scale(1.2); /* Scale the image to 120% on hover */
42+
}
2743

2844
/*NavBar style*/
2945
.navbar {

src/main/resources/templates/litter_details.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ <h4><span class="text-muted">Description:</span></h4>
2626
<p><span th:text="${description}"></span></p>
2727

2828
<h4><span class="text-muted">Image:</span></h4>
29-
<img th:src="@{'data:image/png;base64,' + ${image}}" alt="Litter Image" />
29+
<div class="image-container" onclick="expandImage()">
30+
<img th:src="@{'data:image/png;base64,' + ${image}}" alt="Litter Image" />
31+
</div>
32+
3033

3134
<h4><span class="text-muted">Status:</span></h4>
3235
<p><span th:text="${status}"></span></p>
@@ -35,4 +38,11 @@ <h4><span class="text-muted">Status:</span></h4>
3538

3639
</div>
3740

41+
<script>
42+
function expandImage() {
43+
var img = document.querySelector('.image-container img');
44+
img.style.transform = img.style.transform === 'scale(1.2)' ? 'none' : 'scale(1.2)';
45+
}
46+
</script>
47+
3848

src/main/resources/templates/welcome.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<nav class="navbar sticky-top navbar-expand-lg bg-body-tertiary">
2727
<div class="container-fluid">
28-
<a class="navbar-brand" style=" color:blue;" th:href="@{/}">LitterSnap</a>
28+
<a class="navbar-brand" style=" color:#1c5485;" th:href="@{/thy/litter}">LitterSnap</a>
2929
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
3030
<span class="navbar-toggler-icon"></span>
3131
</button>
@@ -38,6 +38,9 @@
3838
<li class="nav-item">
3939
<a class="nav-link active" th:href="@{/thy/users}">View Users</a>
4040
</li>
41+
<li class="nav-item">
42+
<a class="nav-link active" aria-current="page" th:href="@{/}">Logout</a>
43+
</li>
4144

4245
</ul>
4346

0 commit comments

Comments
 (0)