Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] UI 변경 #120

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/resources/static/css/crossroad/signal.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
width: 50px;
height: 50px;
border-radius: 50%;
background-color: rgb(252, 83, 83);
background-color: white;
color: white;
text-align: center;
line-height: 3;
margin: 10px;
Expand Down
14 changes: 9 additions & 5 deletions src/main/resources/static/js/crossroad/tMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,21 @@ function updateUI(data) {
const state = data[0][stateKey];
const time = data[0][timeKey];
const circle = document.getElementById(dir);
const card = document.getElementById("card");

/* const statusColors = {
"stop-And-Remain": "red",
"protected-Movement-Allowed": "green",
"permissive-Movement-Allowed": "gray"
};*/

if (!state) {
circle.style.display = "none"; // null 상태는 숨김
} else if(state){
circle.style.display = "block";
if(!state){
circle.style.backgroundColor = "white";
circle.style.color = "white";
}
else if(state){
card.style.visibility = "visible";
circle.style.color = "black";
circle.style.backgroundColor = state; // 상태 색상
minTime = Math.min(minTime, time)+10; // 최소 남은 시간 계산
}
Expand Down Expand Up @@ -157,7 +161,7 @@ function handleCountdown() {
function time(){
// 최소 남은 시간 표시
const timeSpan = document.querySelector(".text-body-secondary");
timeSpan.textContent = `${minTime/10} s Left`;
timeSpan.textContent = `${Math.ceil(minTime/10)} s Left`;
}

// 1초마다 카운트다운 실행
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

<tr>
<td colspan="3" style="height: 50px;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td class="h4">즐겨찾기</td>
<td>
<td class="h4" style="visibility: hidden">즐겨찾기</td>
<td style="visibility: hidden">
<div class="nav-item">
<button class="btn btn-outline-warning" id="bookmark">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-bookmark-star" viewBox="0 0 16 16">
Expand All @@ -63,8 +63,8 @@
</tr>

<tr>
<td id = card_td1 colspan="5" >
<div class="card" id="signal">
<td id = card colspan="5" style="visibility: hidden">
<div class="card" id="signal" >
<div class="card-body">
<h5 class="card-title">위치 &nbsp;
<span><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-geo-alt" viewBox="0 0 16 16">
Expand Down
Loading