Skip to content

Commit 4837b12

Browse files
authored
Merge pull request #83 from hyosung-second-team1/jsp-calendar
[feat] 알람창 알람 삭제
2 parents ca8833a + 67ae3c5 commit 4837b12

File tree

4 files changed

+76
-51
lines changed

4 files changed

+76
-51
lines changed

src/main/resources/static/css/inc/alarm.css

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
z-index: 50; /* 다른 요소 위에 표시하기 위해 z-index를 설정합니다. */
3737
border-radius: 10px;
3838
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 가로, 세로, 흐림 정도, 색상 */;
39-
padding: 10px;
39+
/*padding: 10px;*/
40+
padding: 10px 0;
4041
/* border-radius: .3rem; */
4142
background-color: #ffffff;
4243
/* border-color: #4FD1C5; */
@@ -52,7 +53,8 @@
5253
display: flex;
5354
flex-direction: column;
5455
height: 100vh;
55-
width: 86%;
56+
width: 100%;
57+
align-items: center;
5658
/*box-shadow: left only;*/
5759
}
5860

@@ -67,7 +69,7 @@
6769
/* 오버레이를 표시합니다. */
6870
.overlay-container.show-overlay {
6971
display: block;
70-
width: 310px;
72+
width: 235px;
7173
}
7274

7375

@@ -77,38 +79,40 @@
7779
flex-direction: column;
7880
align-items: center;
7981
height: 90%;
82+
width: 100%;
8083
background-color: #ffffff;
8184
overflow-y: scroll; /* 세로 스크롤 사용 */
8285
}
8386

8487
/* 스크롤바 전체 영역 */
8588
::-webkit-scrollbar {
86-
width: 10px; /* 세로축 스크롤바 폭 너비 */
89+
width: 1px; /* 세로축 스크롤바 폭 너비 */
8790
height: 20px; /* 가로축 스크롤바 폭 너비 */
8891
}
8992

90-
/* 스크롤바 막대 */
91-
::-webkit-scrollbar-thumb {
92-
background: rgba(83, 166, 249, 0.75);
93-
border-radius: 2em;
94-
height: 5px;
95-
}
93+
/*!* 스크롤바 막대 *!*/
94+
/*::-webkit-scrollbar-thumb {*/
95+
/* background: rgba(83, 166, 249, 0.75);*/
96+
/* border-radius: 2em;*/
97+
/* height: 5px;*/
98+
/*}*/
9699

97-
::-webkit-scrollbar-thumb:hover {
98-
background-color:#eeeef1;
99-
}
100+
/*::-webkit-scrollbar-thumb:hover {*/
101+
/* background-color:#eeeef1;*/
102+
/*}*/
100103

101-
/* 스크롤이 움직이는 뒷 배경 */
102-
::-webkit-scrollbar-track {
103-
background: rgba(220, 20, 60, .1); /*스크롤바 뒷 배경 색상*/
104-
}
104+
/*!* 스크롤이 움직이는 뒷 배경 *!*/
105+
/*::-webkit-scrollbar-track {*/
106+
/* background: rgba(220, 20, 60, .1); !*스크롤바 뒷 배경 색상*!*/
107+
/*}*/
105108

106109
/*일정상세카드*/
107110
.card-outer {
108111
display: flex;
109112
flex-direction: column;
110113
align-items: center;
111-
width: 220px;
114+
/*width: 220px;*/
115+
width: 200px;
112116
/*height: 200px;*/
113117
font-size: small;
114118
margin-bottom: 5px;
@@ -147,6 +151,12 @@
147151
border-radius: 5px;
148152
margin-bottom: 10px;
149153
box-shadow: 0px -5px 10px rgba(0, 0, 0, 0.05), 0px 5px 10px rgba(0, 0, 0, 0.1);
154+
/*box-shadow: 0 1px 2px rgba(0,0,0,0.03),*/
155+
/* 0 2px 4px rgba(0,0,0,0.03),*/
156+
/* 0 4px 8px rgba(0,0,0,0.03),*/
157+
/* 0 8px 16px rgba(0,0,0,0.03),*/
158+
/* 0 16px 32px rgba(0,0,0,0.03),*/
159+
/* 0 32px 64px rgba(0,0,0,0.01);*/
150160
font-weight: bold;
151161
padding: 10px 10px;
152162
}

src/main/resources/static/js/calendar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ $(document).ready(function() {
165165

166166
// 가져온 일정 데이터를 시작 시간을 기준으로 정렬
167167
events.sort((a, b) => {
168-
return new Date(a.start) - new Date(b.start);
168+
return new Date(a.startDate) - new Date(b.startDate);
169169
});
170170

171171
// 가져온 일정 데이터를 리스트 형식으로 추가
@@ -174,6 +174,7 @@ $(document).ready(function() {
174174
'flex-direction': 'column'
175175
});
176176

177+
console.log(events)
177178

178179
events.forEach(event => {
179180
let li = $('<li>').addClass('event-item');

src/main/resources/static/js/inc/alarm.js

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $("#alarmIcon").click(function () {
1010
overlay.toggleClass("show-overlay");
1111
});
1212

13-
$(document).ready(function() {
13+
$(".msg-overlay-bubble-list").ready(function() {
1414
// 페이지가 완전히 로드된 후에 알림을 띄우는 함수 실행
1515
showNotifications();
1616
// x 버튼 클릭 시 ...
@@ -23,10 +23,16 @@ $(document).ready(function() {
2323
console.log("notifyID")
2424
console.log(notifyID)
2525
console.log(isRead)
26-
if (isRead) {
27-
// 해당 일정의 부모 요소를 숨깁니다.
28-
$(this).closest('.card-outer').remove();
29-
} else {
26+
// if (isRead) {
27+
// // 해당 일정의 부모 요소를 숨깁니다.
28+
// $(this).closest('.card-outer').remove();
29+
// } else {
30+
// isRead = true; // isRead 의 값이 false 인 경우, x 버튼을 누르면 true 로 바꾸기
31+
// console.log("false -> true")
32+
// console.log(isRead)
33+
// }
34+
35+
if (isRead != true) {
3036
isRead = true; // isRead 의 값이 false 인 경우, x 버튼을 누르면 true 로 바꾸기
3137
console.log("false -> true")
3238
console.log(isRead)
@@ -41,20 +47,19 @@ $(document).ready(function() {
4147
},
4248
success: function (response) {
4349
console.log('데이터 전송 성공:', response);
44-
// if (isRead === true) {
45-
// // 해당 일정의 부모 요소를 숨깁니다.
46-
// $(this).closest('.card-outer').hide();
47-
// }
50+
51+
// let $this = $(this);
52+
// $this.closest('.card-outer').remove();
53+
54+
//$(this).closest('.card-outer').remove();
55+
56+
let $cardToRemove = $(document).find('[data-notify-id="' + notifyID + '"]').closest('.card-outer');
57+
$cardToRemove.remove();
4858
},
4959
error: function (xhr, status, error) {
5060
console.error('데이터 전송 실패:', error);
5161
}
5262
})
53-
54-
// if (isRead === true) {
55-
// // 해당 일정의 부모 요소를 숨깁니다.
56-
// $(this).closest('.card-outer').hide();
57-
// }
5863
})
5964

6065
$(document).on('click', '.card-outer', function() {
@@ -66,14 +71,14 @@ $(document).ready(function() {
6671
console.log(scheduleId)
6772
console.log(notifyCategoryId)
6873

69-
if (notifyCategoryId === 1) {
70-
window.location.href = '/schedule/vote?scheduleId=' + scheduleId;
71-
} else if (notifyCategoryId === 2) {
74+
if (notifyCategoryId === 1) { // 모임 일정 초대
75+
location.href = '/schedule/vote?scheduleId=' + scheduleId;
76+
} else if (notifyCategoryId === 2) { // 모임 일정 장소 확정
7277
// 카드 상세 페이지로 이동
73-
window.location.href = '/schedule/datail?scheduleId=' + scheduleId;
74-
} else if (notifyCategoryId === 3) {
78+
location.href = '/schedule/detail?scheduleId=' + scheduleId;
79+
} else if (notifyCategoryId === 3) { // 일정 예고
7580
// 카드 상세 페이지로 이동
76-
window.location.href = '/schedule/detail?scheduleId=' + scheduleId;
81+
location.href = '/schedule/detail?scheduleId=' + scheduleId;
7782
}
7883

7984
});
@@ -115,9 +120,20 @@ function showNotifications() {
115120
let startTimeArray = startTime.split(":");
116121
let startTimewithoutSec = startTimeArray[0] + ":" + startTimeArray[1];
117122

123+
// 메세지 가공
124+
let fullMessage = card.message;
125+
let fullMessageArray = fullMessage.split(".");
126+
let message1 = fullMessageArray[0];
127+
let message2 = fullMessageArray[1];
128+
if(message2 === null) {
129+
$cardName.append(fullMessage);
130+
} else {
131+
$cardName.append(message1 + "<br>" + message2);
132+
}
133+
118134

119135
// 데이터 추가
120-
$cardName.append(card.message);
136+
// $cardName.append(card.message);
121137
$cardMain1.append("<h3 style='font-weight: bold; font-size: 15px;'>" + card.name + "</h3>");
122138
//$cardMain2.append('<p><i class="bi bi-calendar-check"> </i>' + startDate + '</p>');
123139
$cardMain3.append('<p style="font-size: 12px;"><i class="bi bi-calendar-check" style="margin-top: 16px;"> </i>' + startDate + '</p>');
@@ -133,18 +149,18 @@ function showNotifications() {
133149
$cardMain.append($cardMain3);
134150
$(".msg-overlay-bubble-list").append($cardOuter);
135151

136-
if (card.placeName === null) {
137-
$cardMain2.append('<p style="font-size: 12px;"><i class="bi bi-geo-alt" style="margin-top: 16px;"> </i>' + '투표중' + '</p>')
138-
} else {
139-
$cardMain2.append('<p style="font-size: 12px;"><i class="bi bi-geo-alt" style="margin-top: 16px;"> </i>' + card.placeName + '</p>')
140-
}
152+
// if (card.placeName === null) {
153+
// $cardMain2.append('<p style="font-size: 12px;"><i class="bi bi-geo-alt" style="margin-top: 16px;"> </i>' + '투표중' + '</p>')
154+
// } else {
155+
// $cardMain2.append('<p style="font-size: 12px;"><i class="bi bi-geo-alt" style="margin-top: 16px;"> </i>' + card.placeName + '</p>')
156+
// }
141157

142158
if (card.voteDeadline === null) { // 투표 마감일 X = 개인 일정
143159
$cardMain2.append("");
144160
} else if (card.voteDeadline < today) { // 투표 마감일 지남
145161
//$cardMain3.append("<p style='margin-top: 16px;'>" + "투표 마감</p>");
146-
$cardMain2.append("");
147-
} else { // 투표 마감일 전
162+
$cardMain2.append(card.placeName);
163+
} else { // 투표 마감일 전 (투표중)
148164
let deadline = card.voteDeadline;
149165
let deadlineArray = deadline.split(" ");
150166
let deadlineDate = deadlineArray[0];
@@ -160,7 +176,7 @@ function showNotifications() {
160176
// console.log(deadlineDateArray[1]) // 05
161177
// console.log('day')
162178
// console.log(deadlineDateArray[2]) // 17
163-
$cardMain3.append("<p style='font-size: 12px;'>" + deadlineMonth + "/" + deadlineDay + " <br>투표 마감</p>");
179+
$cardMain2.append("<p style='font-size: 12px;'><i class=\"bi bi-geo-alt\" style=\"margin-top: 16px;\"> </i>" + deadlineMonth + "/" + deadlineDay + " 투표 마감</p>");
164180
}
165181

166182
$cardMain2.append(

src/main/webapp/WEB-INF/views/calendar/calendar.jsp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ pageEncoding="UTF-8"%>
6565
</jsp:include>
6666

6767
<!-- 알람 include -->
68-
<jsp:include page="/WEB-INF/views/inc/alarm.jsp">
69-
<jsp:param value="calendar" name="scheduleName" />
70-
</jsp:include>
68+
<jsp:include page="/WEB-INF/views/inc/alarm.jsp"></jsp:include>
7169

7270
<div class="full-contentbox">
7371
<!--메인부분-->

0 commit comments

Comments
 (0)