ninegrid2 6.873.0 → 6.874.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/aiMessage.js +48 -10
- package/dist/bundle.cjs.js +48 -10
- package/dist/bundle.esm.js +48 -10
- package/package.json +1 -1
- package/src/ai/aiMessage.js +48 -10
package/dist/ai/aiMessage.js
CHANGED
|
@@ -229,9 +229,11 @@ class aiMyMessage extends HTMLElement
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// aiProgressMessage 클래스 정의
|
|
232
|
+
// aiProgressMessage 클래스 정의 수정
|
|
232
233
|
class aiProgressMessage extends HTMLElement {
|
|
233
234
|
#progressData = []; // 진행 상태 데이터를 저장할 배열
|
|
234
235
|
#progressElements = new Map(); // 각 진행 단계의 DOM 요소를 저장할 Map
|
|
236
|
+
#animationIntervals = new Map(); // 각 항목의 애니메이션 인터벌 ID를 저장할 Map
|
|
235
237
|
|
|
236
238
|
constructor() {
|
|
237
239
|
super();
|
|
@@ -252,14 +254,18 @@ class aiProgressMessage extends HTMLElement {
|
|
|
252
254
|
|
|
253
255
|
/**
|
|
254
256
|
* 진행 상태 데이터를 초기화하고 화면에 표시합니다.
|
|
255
|
-
* @param {Array<Object>} data - [{id: 'step1', message: '
|
|
257
|
+
* @param {Array<Object>} data - [{id: 'step1', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.'}, ...]
|
|
256
258
|
*/
|
|
257
259
|
initialize(data) {
|
|
258
|
-
|
|
260
|
+
// 초기 상태는 'pending'으로 설정하고, 원본 메시지 저장 (애니메이션용)
|
|
261
|
+
this.#progressData = data.map(item => ({
|
|
262
|
+
...item,
|
|
263
|
+
status: 'pending',
|
|
264
|
+
originalMessage: item.message // 애니메이션을 위해 원본 메시지 저장
|
|
265
|
+
}));
|
|
259
266
|
setTimeout(() => {
|
|
260
267
|
this.#renderProgress();
|
|
261
268
|
}, 300);
|
|
262
|
-
|
|
263
269
|
}
|
|
264
270
|
|
|
265
271
|
/**
|
|
@@ -270,8 +276,11 @@ class aiProgressMessage extends HTMLElement {
|
|
|
270
276
|
updateProgress(id, status) {
|
|
271
277
|
const itemIndex = this.#progressData.findIndex(item => item.id === id);
|
|
272
278
|
if (itemIndex > -1) {
|
|
273
|
-
|
|
274
|
-
|
|
279
|
+
// 기존 상태와 다를 경우에만 업데이트
|
|
280
|
+
if (this.#progressData[itemIndex].status !== status) {
|
|
281
|
+
this.#progressData[itemIndex].status = status;
|
|
282
|
+
this.#updateProgressItem(this.#progressData[itemIndex]);
|
|
283
|
+
}
|
|
275
284
|
}
|
|
276
285
|
}
|
|
277
286
|
|
|
@@ -279,26 +288,55 @@ class aiProgressMessage extends HTMLElement {
|
|
|
279
288
|
const progressList = this.shadowRoot.querySelector(".progress-list");
|
|
280
289
|
progressList.innerHTML = ''; // 기존 목록 초기화
|
|
281
290
|
this.#progressElements.clear(); // 기존 요소 Map 초기화
|
|
291
|
+
this.#animationIntervals.forEach(intervalId => clearInterval(intervalId)); // 기존 애니메이션 정리
|
|
292
|
+
this.#animationIntervals.clear();
|
|
282
293
|
|
|
283
294
|
this.#progressData.forEach((item, index) => {
|
|
284
295
|
const li = document.createElement("li");
|
|
285
296
|
li.setAttribute("data-id", item.id);
|
|
286
|
-
li.classList.add("progress-item"
|
|
297
|
+
li.classList.add("progress-item");
|
|
298
|
+
// 번호와 초기 메시지 설정
|
|
287
299
|
li.innerHTML = `
|
|
288
|
-
<span class="
|
|
300
|
+
<span class="step-number">${index + 1}.</span>
|
|
289
301
|
<span class="text">${item.message}</span>
|
|
290
|
-
|
|
302
|
+
<span class="animated-dots"></span>
|
|
303
|
+
`; // animated-dots 스판 추가
|
|
291
304
|
progressList.appendChild(li);
|
|
292
|
-
this.#progressElements.set(item.id, li);
|
|
305
|
+
this.#progressElements.set(item.id, li);
|
|
306
|
+
|
|
307
|
+
// 초기 상태에 따라 업데이트 (특히 애니메이션 시작)
|
|
308
|
+
this.#updateProgressItem(item);
|
|
293
309
|
});
|
|
294
310
|
}
|
|
295
311
|
|
|
296
312
|
#updateProgressItem(item) {
|
|
297
313
|
const li = this.#progressElements.get(item.id);
|
|
298
314
|
if (li) {
|
|
315
|
+
// 기존 애니메이션 중지
|
|
316
|
+
if (this.#animationIntervals.has(item.id)) {
|
|
317
|
+
clearInterval(this.#animationIntervals.get(item.id));
|
|
318
|
+
this.#animationIntervals.delete(item.id);
|
|
319
|
+
}
|
|
320
|
+
|
|
299
321
|
li.classList.remove('pending', 'completed'); // 기존 클래스 제거
|
|
300
322
|
li.classList.add(item.status); // 새 상태 클래스 추가
|
|
301
|
-
|
|
323
|
+
|
|
324
|
+
const textSpan = li.querySelector(".text");
|
|
325
|
+
const dotsSpan = li.querySelector(".animated-dots");
|
|
326
|
+
|
|
327
|
+
if (item.status === 'completed') {
|
|
328
|
+
textSpan.textContent = item.completedMessage;
|
|
329
|
+
dotsSpan.textContent = ''; // 완료 시 점 제거
|
|
330
|
+
} else { // pending 상태일 경우
|
|
331
|
+
textSpan.textContent = item.originalMessage; // 원본 메시지로 복원
|
|
332
|
+
let dotsCount = 0;
|
|
333
|
+
// 애니메이션 시작
|
|
334
|
+
const intervalId = setInterval(() => {
|
|
335
|
+
dotsCount = (dotsCount + 1) % 4; // 0, 1, 2, 3 반복
|
|
336
|
+
dotsSpan.textContent = '.'.repeat(dotsCount);
|
|
337
|
+
}, 300); // 300ms마다 점 업데이트
|
|
338
|
+
this.#animationIntervals.set(item.id, intervalId);
|
|
339
|
+
}
|
|
302
340
|
}
|
|
303
341
|
}
|
|
304
342
|
}
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -121866,9 +121866,11 @@ class aiMyMessage extends HTMLElement
|
|
|
121866
121866
|
}
|
|
121867
121867
|
|
|
121868
121868
|
// aiProgressMessage 클래스 정의
|
|
121869
|
+
// aiProgressMessage 클래스 정의 수정
|
|
121869
121870
|
class aiProgressMessage extends HTMLElement {
|
|
121870
121871
|
#progressData = []; // 진행 상태 데이터를 저장할 배열
|
|
121871
121872
|
#progressElements = new Map(); // 각 진행 단계의 DOM 요소를 저장할 Map
|
|
121873
|
+
#animationIntervals = new Map(); // 각 항목의 애니메이션 인터벌 ID를 저장할 Map
|
|
121872
121874
|
|
|
121873
121875
|
constructor() {
|
|
121874
121876
|
super();
|
|
@@ -121889,14 +121891,18 @@ class aiProgressMessage extends HTMLElement {
|
|
|
121889
121891
|
|
|
121890
121892
|
/**
|
|
121891
121893
|
* 진행 상태 데이터를 초기화하고 화면에 표시합니다.
|
|
121892
|
-
* @param {Array<Object>} data - [{id: 'step1', message: '
|
|
121894
|
+
* @param {Array<Object>} data - [{id: 'step1', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.'}, ...]
|
|
121893
121895
|
*/
|
|
121894
121896
|
initialize(data) {
|
|
121895
|
-
|
|
121897
|
+
// 초기 상태는 'pending'으로 설정하고, 원본 메시지 저장 (애니메이션용)
|
|
121898
|
+
this.#progressData = data.map(item => ({
|
|
121899
|
+
...item,
|
|
121900
|
+
status: 'pending',
|
|
121901
|
+
originalMessage: item.message // 애니메이션을 위해 원본 메시지 저장
|
|
121902
|
+
}));
|
|
121896
121903
|
setTimeout(() => {
|
|
121897
121904
|
this.#renderProgress();
|
|
121898
121905
|
}, 300);
|
|
121899
|
-
|
|
121900
121906
|
}
|
|
121901
121907
|
|
|
121902
121908
|
/**
|
|
@@ -121907,8 +121913,11 @@ class aiProgressMessage extends HTMLElement {
|
|
|
121907
121913
|
updateProgress(id, status) {
|
|
121908
121914
|
const itemIndex = this.#progressData.findIndex(item => item.id === id);
|
|
121909
121915
|
if (itemIndex > -1) {
|
|
121910
|
-
|
|
121911
|
-
|
|
121916
|
+
// 기존 상태와 다를 경우에만 업데이트
|
|
121917
|
+
if (this.#progressData[itemIndex].status !== status) {
|
|
121918
|
+
this.#progressData[itemIndex].status = status;
|
|
121919
|
+
this.#updateProgressItem(this.#progressData[itemIndex]);
|
|
121920
|
+
}
|
|
121912
121921
|
}
|
|
121913
121922
|
}
|
|
121914
121923
|
|
|
@@ -121916,26 +121925,55 @@ class aiProgressMessage extends HTMLElement {
|
|
|
121916
121925
|
const progressList = this.shadowRoot.querySelector(".progress-list");
|
|
121917
121926
|
progressList.innerHTML = ''; // 기존 목록 초기화
|
|
121918
121927
|
this.#progressElements.clear(); // 기존 요소 Map 초기화
|
|
121928
|
+
this.#animationIntervals.forEach(intervalId => clearInterval(intervalId)); // 기존 애니메이션 정리
|
|
121929
|
+
this.#animationIntervals.clear();
|
|
121919
121930
|
|
|
121920
121931
|
this.#progressData.forEach((item, index) => {
|
|
121921
121932
|
const li = document.createElement("li");
|
|
121922
121933
|
li.setAttribute("data-id", item.id);
|
|
121923
|
-
li.classList.add("progress-item"
|
|
121934
|
+
li.classList.add("progress-item");
|
|
121935
|
+
// 번호와 초기 메시지 설정
|
|
121924
121936
|
li.innerHTML = `
|
|
121925
|
-
<span class="
|
|
121937
|
+
<span class="step-number">${index + 1}.</span>
|
|
121926
121938
|
<span class="text">${item.message}</span>
|
|
121927
|
-
|
|
121939
|
+
<span class="animated-dots"></span>
|
|
121940
|
+
`; // animated-dots 스판 추가
|
|
121928
121941
|
progressList.appendChild(li);
|
|
121929
|
-
this.#progressElements.set(item.id, li);
|
|
121942
|
+
this.#progressElements.set(item.id, li);
|
|
121943
|
+
|
|
121944
|
+
// 초기 상태에 따라 업데이트 (특히 애니메이션 시작)
|
|
121945
|
+
this.#updateProgressItem(item);
|
|
121930
121946
|
});
|
|
121931
121947
|
}
|
|
121932
121948
|
|
|
121933
121949
|
#updateProgressItem(item) {
|
|
121934
121950
|
const li = this.#progressElements.get(item.id);
|
|
121935
121951
|
if (li) {
|
|
121952
|
+
// 기존 애니메이션 중지
|
|
121953
|
+
if (this.#animationIntervals.has(item.id)) {
|
|
121954
|
+
clearInterval(this.#animationIntervals.get(item.id));
|
|
121955
|
+
this.#animationIntervals.delete(item.id);
|
|
121956
|
+
}
|
|
121957
|
+
|
|
121936
121958
|
li.classList.remove('pending', 'completed'); // 기존 클래스 제거
|
|
121937
121959
|
li.classList.add(item.status); // 새 상태 클래스 추가
|
|
121938
|
-
|
|
121960
|
+
|
|
121961
|
+
const textSpan = li.querySelector(".text");
|
|
121962
|
+
const dotsSpan = li.querySelector(".animated-dots");
|
|
121963
|
+
|
|
121964
|
+
if (item.status === 'completed') {
|
|
121965
|
+
textSpan.textContent = item.completedMessage;
|
|
121966
|
+
dotsSpan.textContent = ''; // 완료 시 점 제거
|
|
121967
|
+
} else { // pending 상태일 경우
|
|
121968
|
+
textSpan.textContent = item.originalMessage; // 원본 메시지로 복원
|
|
121969
|
+
let dotsCount = 0;
|
|
121970
|
+
// 애니메이션 시작
|
|
121971
|
+
const intervalId = setInterval(() => {
|
|
121972
|
+
dotsCount = (dotsCount + 1) % 4; // 0, 1, 2, 3 반복
|
|
121973
|
+
dotsSpan.textContent = '.'.repeat(dotsCount);
|
|
121974
|
+
}, 300); // 300ms마다 점 업데이트
|
|
121975
|
+
this.#animationIntervals.set(item.id, intervalId);
|
|
121976
|
+
}
|
|
121939
121977
|
}
|
|
121940
121978
|
}
|
|
121941
121979
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121862,9 +121862,11 @@ class aiMyMessage extends HTMLElement
|
|
|
121862
121862
|
}
|
|
121863
121863
|
|
|
121864
121864
|
// aiProgressMessage 클래스 정의
|
|
121865
|
+
// aiProgressMessage 클래스 정의 수정
|
|
121865
121866
|
class aiProgressMessage extends HTMLElement {
|
|
121866
121867
|
#progressData = []; // 진행 상태 데이터를 저장할 배열
|
|
121867
121868
|
#progressElements = new Map(); // 각 진행 단계의 DOM 요소를 저장할 Map
|
|
121869
|
+
#animationIntervals = new Map(); // 각 항목의 애니메이션 인터벌 ID를 저장할 Map
|
|
121868
121870
|
|
|
121869
121871
|
constructor() {
|
|
121870
121872
|
super();
|
|
@@ -121885,14 +121887,18 @@ class aiProgressMessage extends HTMLElement {
|
|
|
121885
121887
|
|
|
121886
121888
|
/**
|
|
121887
121889
|
* 진행 상태 데이터를 초기화하고 화면에 표시합니다.
|
|
121888
|
-
* @param {Array<Object>} data - [{id: 'step1', message: '
|
|
121890
|
+
* @param {Array<Object>} data - [{id: 'step1', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.'}, ...]
|
|
121889
121891
|
*/
|
|
121890
121892
|
initialize(data) {
|
|
121891
|
-
|
|
121893
|
+
// 초기 상태는 'pending'으로 설정하고, 원본 메시지 저장 (애니메이션용)
|
|
121894
|
+
this.#progressData = data.map(item => ({
|
|
121895
|
+
...item,
|
|
121896
|
+
status: 'pending',
|
|
121897
|
+
originalMessage: item.message // 애니메이션을 위해 원본 메시지 저장
|
|
121898
|
+
}));
|
|
121892
121899
|
setTimeout(() => {
|
|
121893
121900
|
this.#renderProgress();
|
|
121894
121901
|
}, 300);
|
|
121895
|
-
|
|
121896
121902
|
}
|
|
121897
121903
|
|
|
121898
121904
|
/**
|
|
@@ -121903,8 +121909,11 @@ class aiProgressMessage extends HTMLElement {
|
|
|
121903
121909
|
updateProgress(id, status) {
|
|
121904
121910
|
const itemIndex = this.#progressData.findIndex(item => item.id === id);
|
|
121905
121911
|
if (itemIndex > -1) {
|
|
121906
|
-
|
|
121907
|
-
|
|
121912
|
+
// 기존 상태와 다를 경우에만 업데이트
|
|
121913
|
+
if (this.#progressData[itemIndex].status !== status) {
|
|
121914
|
+
this.#progressData[itemIndex].status = status;
|
|
121915
|
+
this.#updateProgressItem(this.#progressData[itemIndex]);
|
|
121916
|
+
}
|
|
121908
121917
|
}
|
|
121909
121918
|
}
|
|
121910
121919
|
|
|
@@ -121912,26 +121921,55 @@ class aiProgressMessage extends HTMLElement {
|
|
|
121912
121921
|
const progressList = this.shadowRoot.querySelector(".progress-list");
|
|
121913
121922
|
progressList.innerHTML = ''; // 기존 목록 초기화
|
|
121914
121923
|
this.#progressElements.clear(); // 기존 요소 Map 초기화
|
|
121924
|
+
this.#animationIntervals.forEach(intervalId => clearInterval(intervalId)); // 기존 애니메이션 정리
|
|
121925
|
+
this.#animationIntervals.clear();
|
|
121915
121926
|
|
|
121916
121927
|
this.#progressData.forEach((item, index) => {
|
|
121917
121928
|
const li = document.createElement("li");
|
|
121918
121929
|
li.setAttribute("data-id", item.id);
|
|
121919
|
-
li.classList.add("progress-item"
|
|
121930
|
+
li.classList.add("progress-item");
|
|
121931
|
+
// 번호와 초기 메시지 설정
|
|
121920
121932
|
li.innerHTML = `
|
|
121921
|
-
<span class="
|
|
121933
|
+
<span class="step-number">${index + 1}.</span>
|
|
121922
121934
|
<span class="text">${item.message}</span>
|
|
121923
|
-
|
|
121935
|
+
<span class="animated-dots"></span>
|
|
121936
|
+
`; // animated-dots 스판 추가
|
|
121924
121937
|
progressList.appendChild(li);
|
|
121925
|
-
this.#progressElements.set(item.id, li);
|
|
121938
|
+
this.#progressElements.set(item.id, li);
|
|
121939
|
+
|
|
121940
|
+
// 초기 상태에 따라 업데이트 (특히 애니메이션 시작)
|
|
121941
|
+
this.#updateProgressItem(item);
|
|
121926
121942
|
});
|
|
121927
121943
|
}
|
|
121928
121944
|
|
|
121929
121945
|
#updateProgressItem(item) {
|
|
121930
121946
|
const li = this.#progressElements.get(item.id);
|
|
121931
121947
|
if (li) {
|
|
121948
|
+
// 기존 애니메이션 중지
|
|
121949
|
+
if (this.#animationIntervals.has(item.id)) {
|
|
121950
|
+
clearInterval(this.#animationIntervals.get(item.id));
|
|
121951
|
+
this.#animationIntervals.delete(item.id);
|
|
121952
|
+
}
|
|
121953
|
+
|
|
121932
121954
|
li.classList.remove('pending', 'completed'); // 기존 클래스 제거
|
|
121933
121955
|
li.classList.add(item.status); // 새 상태 클래스 추가
|
|
121934
|
-
|
|
121956
|
+
|
|
121957
|
+
const textSpan = li.querySelector(".text");
|
|
121958
|
+
const dotsSpan = li.querySelector(".animated-dots");
|
|
121959
|
+
|
|
121960
|
+
if (item.status === 'completed') {
|
|
121961
|
+
textSpan.textContent = item.completedMessage;
|
|
121962
|
+
dotsSpan.textContent = ''; // 완료 시 점 제거
|
|
121963
|
+
} else { // pending 상태일 경우
|
|
121964
|
+
textSpan.textContent = item.originalMessage; // 원본 메시지로 복원
|
|
121965
|
+
let dotsCount = 0;
|
|
121966
|
+
// 애니메이션 시작
|
|
121967
|
+
const intervalId = setInterval(() => {
|
|
121968
|
+
dotsCount = (dotsCount + 1) % 4; // 0, 1, 2, 3 반복
|
|
121969
|
+
dotsSpan.textContent = '.'.repeat(dotsCount);
|
|
121970
|
+
}, 300); // 300ms마다 점 업데이트
|
|
121971
|
+
this.#animationIntervals.set(item.id, intervalId);
|
|
121972
|
+
}
|
|
121935
121973
|
}
|
|
121936
121974
|
}
|
|
121937
121975
|
}
|
package/package.json
CHANGED
package/src/ai/aiMessage.js
CHANGED
|
@@ -229,9 +229,11 @@ class aiMyMessage extends HTMLElement
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// aiProgressMessage 클래스 정의
|
|
232
|
+
// aiProgressMessage 클래스 정의 수정
|
|
232
233
|
class aiProgressMessage extends HTMLElement {
|
|
233
234
|
#progressData = []; // 진행 상태 데이터를 저장할 배열
|
|
234
235
|
#progressElements = new Map(); // 각 진행 단계의 DOM 요소를 저장할 Map
|
|
236
|
+
#animationIntervals = new Map(); // 각 항목의 애니메이션 인터벌 ID를 저장할 Map
|
|
235
237
|
|
|
236
238
|
constructor() {
|
|
237
239
|
super();
|
|
@@ -252,14 +254,18 @@ class aiProgressMessage extends HTMLElement {
|
|
|
252
254
|
|
|
253
255
|
/**
|
|
254
256
|
* 진행 상태 데이터를 초기화하고 화면에 표시합니다.
|
|
255
|
-
* @param {Array<Object>} data - [{id: 'step1', message: '
|
|
257
|
+
* @param {Array<Object>} data - [{id: 'step1', message: '분석중입니다.', completedMessage: '분석이 완료되었습니다.'}, ...]
|
|
256
258
|
*/
|
|
257
259
|
initialize(data) {
|
|
258
|
-
|
|
260
|
+
// 초기 상태는 'pending'으로 설정하고, 원본 메시지 저장 (애니메이션용)
|
|
261
|
+
this.#progressData = data.map(item => ({
|
|
262
|
+
...item,
|
|
263
|
+
status: 'pending',
|
|
264
|
+
originalMessage: item.message // 애니메이션을 위해 원본 메시지 저장
|
|
265
|
+
}));
|
|
259
266
|
setTimeout(() => {
|
|
260
267
|
this.#renderProgress();
|
|
261
268
|
}, 300);
|
|
262
|
-
|
|
263
269
|
}
|
|
264
270
|
|
|
265
271
|
/**
|
|
@@ -270,8 +276,11 @@ class aiProgressMessage extends HTMLElement {
|
|
|
270
276
|
updateProgress(id, status) {
|
|
271
277
|
const itemIndex = this.#progressData.findIndex(item => item.id === id);
|
|
272
278
|
if (itemIndex > -1) {
|
|
273
|
-
|
|
274
|
-
|
|
279
|
+
// 기존 상태와 다를 경우에만 업데이트
|
|
280
|
+
if (this.#progressData[itemIndex].status !== status) {
|
|
281
|
+
this.#progressData[itemIndex].status = status;
|
|
282
|
+
this.#updateProgressItem(this.#progressData[itemIndex]);
|
|
283
|
+
}
|
|
275
284
|
}
|
|
276
285
|
}
|
|
277
286
|
|
|
@@ -279,26 +288,55 @@ class aiProgressMessage extends HTMLElement {
|
|
|
279
288
|
const progressList = this.shadowRoot.querySelector(".progress-list");
|
|
280
289
|
progressList.innerHTML = ''; // 기존 목록 초기화
|
|
281
290
|
this.#progressElements.clear(); // 기존 요소 Map 초기화
|
|
291
|
+
this.#animationIntervals.forEach(intervalId => clearInterval(intervalId)); // 기존 애니메이션 정리
|
|
292
|
+
this.#animationIntervals.clear();
|
|
282
293
|
|
|
283
294
|
this.#progressData.forEach((item, index) => {
|
|
284
295
|
const li = document.createElement("li");
|
|
285
296
|
li.setAttribute("data-id", item.id);
|
|
286
|
-
li.classList.add("progress-item"
|
|
297
|
+
li.classList.add("progress-item");
|
|
298
|
+
// 번호와 초기 메시지 설정
|
|
287
299
|
li.innerHTML = `
|
|
288
|
-
<span class="
|
|
300
|
+
<span class="step-number">${index + 1}.</span>
|
|
289
301
|
<span class="text">${item.message}</span>
|
|
290
|
-
|
|
302
|
+
<span class="animated-dots"></span>
|
|
303
|
+
`; // animated-dots 스판 추가
|
|
291
304
|
progressList.appendChild(li);
|
|
292
|
-
this.#progressElements.set(item.id, li);
|
|
305
|
+
this.#progressElements.set(item.id, li);
|
|
306
|
+
|
|
307
|
+
// 초기 상태에 따라 업데이트 (특히 애니메이션 시작)
|
|
308
|
+
this.#updateProgressItem(item);
|
|
293
309
|
});
|
|
294
310
|
}
|
|
295
311
|
|
|
296
312
|
#updateProgressItem(item) {
|
|
297
313
|
const li = this.#progressElements.get(item.id);
|
|
298
314
|
if (li) {
|
|
315
|
+
// 기존 애니메이션 중지
|
|
316
|
+
if (this.#animationIntervals.has(item.id)) {
|
|
317
|
+
clearInterval(this.#animationIntervals.get(item.id));
|
|
318
|
+
this.#animationIntervals.delete(item.id);
|
|
319
|
+
}
|
|
320
|
+
|
|
299
321
|
li.classList.remove('pending', 'completed'); // 기존 클래스 제거
|
|
300
322
|
li.classList.add(item.status); // 새 상태 클래스 추가
|
|
301
|
-
|
|
323
|
+
|
|
324
|
+
const textSpan = li.querySelector(".text");
|
|
325
|
+
const dotsSpan = li.querySelector(".animated-dots");
|
|
326
|
+
|
|
327
|
+
if (item.status === 'completed') {
|
|
328
|
+
textSpan.textContent = item.completedMessage;
|
|
329
|
+
dotsSpan.textContent = ''; // 완료 시 점 제거
|
|
330
|
+
} else { // pending 상태일 경우
|
|
331
|
+
textSpan.textContent = item.originalMessage; // 원본 메시지로 복원
|
|
332
|
+
let dotsCount = 0;
|
|
333
|
+
// 애니메이션 시작
|
|
334
|
+
const intervalId = setInterval(() => {
|
|
335
|
+
dotsCount = (dotsCount + 1) % 4; // 0, 1, 2, 3 반복
|
|
336
|
+
dotsSpan.textContent = '.'.repeat(dotsCount);
|
|
337
|
+
}, 300); // 300ms마다 점 업데이트
|
|
338
|
+
this.#animationIntervals.set(item.id, intervalId);
|
|
339
|
+
}
|
|
302
340
|
}
|
|
303
341
|
}
|
|
304
342
|
}
|