-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
810 lines (745 loc) · 29.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>레드판다스 ICAM - 혁신적인 투자사 업무 효율 향상 관리 시스템</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
<style>
:root {
--bg-color: #0a0a0a;
--text-color: #ffffff;
--accent-color: #FF4500;
--secondary-color: #1E90FF;
--card-bg: #1a1a1a;
--section-bg-1: #0f0f0f;
--section-bg-2: #141414;
}
body {
font-family: 'Noto Sans KR', sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
h1, h2, h3 {
margin-bottom: 1rem;
}
.hero {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
position: relative;
overflow: hidden;
}
.hero-content {
z-index: 2;
}
.hero h1 {
font-size: 3em;
margin-bottom: 20px;
}
.hero p {
font-size: 1.2em;
max-width: 600px;
margin: 0 auto 30px;
}
.logo {
width: 150px;
height: 150px;
margin: 0 auto 30px;
background-color: var(--accent-color);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 1.2em;
color: var(--text-color);
}
.section {
padding: 100px 0;
}
.section:nth-of-type(odd) {
background-color: var(--section-bg-1);
}
.section:nth-of-type(even) {
background-color: var(--section-bg-2);
}
.section-title {
text-align: center;
margin-bottom: 50px;
font-size: 2.5em;
color: var(--accent-color);
}
.features {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
}
.feature {
background-color: var(--card-bg);
padding: 30px;
border-radius: 10px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(255,69,0,0.1);
}
.feature h3 {
color: var(--accent-color);
font-size: 1.5em;
margin-bottom: 15px;
display: flex;
align-items: center;
}
.feature h3 .material-icons {
margin-right: 10px;
font-size: 1.2em;
}
.cta {
text-align: center;
padding: 100px 20px;
background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
}
.cta-button {
display: inline-block;
background-color: var(--text-color);
color: var(--accent-color);
padding: 15px 30px;
text-decoration: none;
border-radius: 50px;
font-weight: bold;
transition: all 0.3s ease;
font-size: 1.2em;
}
.cta-button:hover {
background-color: var(--accent-color);
color: var(--text-color);
transform: scale(1.05);
}
.tech-stack {
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
}
.tech-item {
width: 120px;
height: 120px;
margin: 20px;
background-color: var(--card-bg);
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-weight: bold;
color: var(--text-color);
transition: transform 0.3s ease;
}
.tech-item:hover {
transform: scale(1.1);
}
.tech-icon {
font-size: 48px;
margin-bottom: 10px;
}
.bg-animation {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, var(--bg-color), var(--accent-color), var(--secondary-color));
opacity: 0.1;
z-index: 1;
}
@media (max-width: 768px) {
.hero h1 {
font-size: 2em;
}
.feature {
padding: 20px;
}
}
footer {
background-color: var(--bg-color);
color: var(--text-color);
padding: 40px 0;
font-size: 0.9em;
}
.footer-content {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.company-info {
margin-bottom: 20px;
}
.company-info h3 {
color: var(--accent-color);
margin-bottom: 10px;
}
.company-info p {
margin: 5px 0;
}
.copyright {
text-align: center;
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 768px) {
.footer-content {
text-align: center;
}
}
#matrix-canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
/* 추가: 펀드 섹션 그래프 스타일 */
.icam-features {
position: relative;
overflow: hidden;
padding: 100px 0;
}
.icam-features-content {
position: relative;
z-index: 2;
background-color: rgba(10, 10, 10, 0.2); /* 배경색을 반투명하게 변경 */
padding: 20px;
border-radius: 10px;
}
#fund-performance-graph {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
/* 추가: 텍스트 가독성을 위한 스타일 */
.icam-features .feature {
background-color: rgba(26, 26, 26, 0.2); /* 각 기능 카드의 배경도 약간 투명하게 */
}
.icam-features .section-title,
.icam-features .feature h3,
.icam-features .feature p {
text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* 텍스트에 그림자 추가로 가독성 향상 */
}
</style>
</head>
<body>
<div class="hero">
<canvas id="matrix-canvas"></canvas>
<div class="hero-content">
<div class="logo">레드판다스</div>
<h1>레드판다스 ICAM</h1>
<p>혁신적인 투자사 업무 효율 향상 관리 시스템으로 금융의 미래를 선도합니다</p>
<a href="" class="cta-button">문의하기</a>
</div>
</div>
<div class="container">
<section class="section icam-features">
<canvas id="fund-performance-graph"></canvas>
<div class="icam-features-content">
<h2 class="section-title">ICAM의 핵심 기능</h2>
<div class="features">
<div class="feature">
<h3><span class="material-icons">assignment</span> 종합 업무시스템</h3>
<p>펀드회계, 펀드사 맞춤 데이터 정리 통합 솔루션</p>
</div>
<div class="feature">
<h3><span class="material-icons">trending_up</span> Front Office (OMS)</h3>
<p>다양한 엑셀 양식에 따른 편리한 자동화 툴</p>
</div>
<div class="feature">
<h3><span class="material-icons">balance</span> Middle Office</h3>
<p>데이터 관리 및 통계 분석 툴 개발 전문 기업</p>
</div>
</div>
</div>
</section>
<!-- 테이블 -->
<style>
.fund-management-section {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #000000;
color: #ffffff;
cursor: pointer;
}
th:hover {
background-color: #333333;
}
.sortable::after {
content: " ↕";
}
.value {
transition: color 0.3s ease, transform 0.3s ease;
}
.value.changing {
transform: scale(1.1);
}
.positive-1 { color: #4CAF50; }
.positive-2 { color: #45a049; }
.positive-3 { color: #3d9142; }
.positive-4 { color: #36833b; }
.negative-1 { color: #f44336; }
.negative-2 { color: #e53935; }
.negative-3 { color: #d32f2f; }
.negative-4 { color: #c62828; }
.stock-row {
background-color: #f9f9f9;
font-size: 0.9em;
}
.stock-name {
padding-left: 20px;
}
</style>
<div class="fund-management-section">
<h1>Comprehensive Return Management System</h1>
<table id="fundTable">
<thead>
<tr>
<th>펀드명</th>
<th class="sortable" data-sort="threeMonth">3개월 (%)</th>
<th class="sortable" data-sort="sixMonth">6개월 (%)</th>
<th class="sortable" data-sort="oneYear">1년 (%)</th>
<th class="sortable" data-sort="threeYear">3년 (%)</th>
<th class="sortable" data-sort="sinceLaunch">설정이후 (%)</th>
<th class="sortable" data-sort="size">펀드규모 (억)</th>
</tr>
</thead>
<tbody id="fundTableBody">
<!-- JavaScript will populate this -->
</tbody>
</table>
</div>
<div class="container">
<section class="section">
<h2 class="section-title">왜 레드판다스 ICAM인가?</h2>
<div class="features">
<div class="feature">
<h3><span class="material-icons">psychology</span> 경제 전문가 + IT 전문가</h3>
<p>경제학 전공자와 컴퓨터 공학 전공자 모두를 통해 니즈를 정확히 분석하고 제공하겠습니다.</p>
</div>
<div class="feature">
<h3><span class="material-icons">bolt</span> 신뢰도 높은 24시간 원활한 서비스 유지</h3>
<p>24시간 원활한 웹 서비스 제공. 언제든지 서비스에 접속하세요.</p>
</div>
<div class="feature">
<h3><span class="material-icons">extension</span> 맞춤형 솔루션</h3>
<p>고객사의 니즈에 맞춘 유연한 시스템 구성 및 지원. 고객의 업무 효율성의 향상은 자사의 보람입니다.</p>
</div>
</div>
</section>
</div>
<section class="section success-cases">
<div class="section-content">
<h2 class="section-title">고객 성공 사례</h2>
<div class="section-details">
<div class="features">
<div class="feature">
<h3><span class="material-icons">pie_chart</span> 사단법인 경x 협회</h3>
<p>업무효율 향상을 위해, 맞춤형 전산 프로그램 및 접수자 관리 시스템 도입</p>
</div>
<div class="feature">
<h3><span class="material-icons">account_balance</span> 대한 체육회 소속 사단법인 xx시 협회</h3>
<p>경기 데이터 수집 최적화 및 각종 활용 및 분석 자동화</p>
</div>
<div class="feature">
<h3><span class="material-icons">handshake</span> C 투자자문사</h3>
<p>각종 엑셀 데이터 웹 클라우드에서 관리를 통한 팀원간 업무 효율화 향상, 자문사 맞춤 부가기능 및 분석 기능 제공.</p>
</div>
</div>
</div>
</div>
</section>
<style>
.success-cases {
position: relative;
background-image: url('https://preview.redd.it/5ie8ygjqnzf61.jpg?vthumb=1&s=a32d27649edaad9d54e27104cbc6d0949fcddedb');
background-size: cover;
background-position: center;
background-attachment: fixed;
color: white;
}
.success-cases::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 1;
}
.success-cases .section-content {
position: relative;
z-index: 2;
}
.success-cases .section-title,
.success-cases .feature h3,
.success-cases .feature p {
color: white;
}
.success-cases .feature {
background-color: rgba(26, 26, 26, 0.8);
}
@media (max-width: 768px) {
.success-cases {
background-attachment: scroll;
}
}
</style>
<section class="section">
<h2 class="section-title">ICAM의 핵심 기술 스택</h2>
<div class="tech-stack">
<div class="tech-item">
<span class="material-icons tech-icon">code</span>
<span>Django</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">engineering</span>
<span>Python</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">memory</span>
<span>AI</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">analytics</span>
<span>Pandas</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">table_chart</span>
<span>Excel</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">storage</span>
<span>Redis</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">category</span>
<span>Docker</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">dns</span>
<span>PostgreSQL</span>
</div>
<div class="tech-item">
<span class="material-icons tech-icon">cloud</span>
<span>Heroku</span>
</div>
</div>
</section>
</div>
<div class="cta">
<div class="container">
<h2>금융의 미래를 함께 만들어갈 준비가 되셨나요?</h2>
<p>레드판다스 ICAM과 함께 새로운 금융 혁신의 주인공이 되어보세요</p>
<a href="" class="cta-button">상담하기</a>
</div>
</div>
<!-- 푸터 추가 -->
<footer>
<div class="footer-content">
<div class="company-info">
<h3>레드판다스컴퍼니 주식회사 (Red Pandas Company)</h3>
<p>대표이사: 김희진</p>
<p>법인등록번호: 110111-8867157</p>
<p>주소: 서울특별시 강남구 강남대로112길 47, 2층 에이 1414호(논현동)</p>
</div>
<div class="copyright">
© 2024 레드판다스컴퍼니 주식회사. All rights reserved.
</div>
</div>
</footer>
<script>
anime({
targets: '.bg-animation',
translateX: ['0%', '100%'],
translateY: ['0%', '100%'],
rotate: '1turn',
easing: 'linear',
duration: 15000,
loop: true
});
anime({
targets: '.feature, .tech-item',
translateY: [50, 0],
opacity: [0, 1],
delay: anime.stagger(100),
easing: 'easeOutQuad',
duration: 800
});
</script>
<script>
// Matrix Digital Rain 스크립트
const canvas = document.getElementById('matrix-canvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const katakana = '19283286710293709127903871971987891203957097293716745985742815027399037796749076930';
const latin = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const nums = '0123456789';
const alphabet = katakana + latin + nums;
const fontSize = 16;
const columns = canvas.width / fontSize;
const rainDrops = [];
for (let x = 0; x < columns; x++) {
rainDrops[x] = 1;
}
const draw = () => {
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = '#0F0';
ctx.font = fontSize + 'px monospace';
for (let i = 0; i < rainDrops.length; i++) {
const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
ctx.fillText(text, i * fontSize, rainDrops[i] * fontSize);
if (rainDrops[i] * fontSize > canvas.height && Math.random() > 0.975) {
rainDrops[i] = 0;
}
rainDrops[i]++;
}
};
setInterval(draw, 200);
// 화면 크기 변경 시 캔버스 크기 조정
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
});
</script>
<!-- 펀드 그래프 -->
<script>
// Fund Performance Graph 순수 JavaScript 구현
(function() {
const canvas = document.getElementById('fund-performance-graph');
const ctx = canvas.getContext('2d');
let width, height;
const dataPoints = 600;
const funds = ['Fund A', 'Fund B', 'Fund C'];
const colors = ['#8884d8', '#82ca9d', '#ffc658'];
const timeRange = 3000; // 5분 (300초) 범위를 표시
let data = [];
let startTime = Date.now();
function resizeCanvas() {
width = canvas.width = canvas.offsetWidth;
height = canvas.height = canvas.offsetHeight;
}
function updateData() {
const currentTime = Date.now();
const elapsedTime = currentTime - startTime;
// 새로운 데이터 포인트 추가
const newValues = data.length > 0
? data[data.length - 1].values.map(v => Math.max(-10, Math.min(10, v + (Math.random() - 0.5) * 0.5)))
: [0, 0, 0];
data.push({ time: elapsedTime, values: newValues });
// 시간 범위를 벗어난 데이터 제거
while (data.length > 0 && data[0].time < elapsedTime - timeRange) {
data.shift();
}
// 3000초(5분)가 지나면 시작 시간 리셋
if (elapsedTime > timeRange) {
startTime = currentTime;
data = data.map(point => ({ ...point, time: point.time - timeRange }));
}
}
function drawGraph() {
ctx.clearRect(0, 0, width, height);
// Draw axes
// ctx.strokeStyle = '#ffffff';
// ctx.beginPath();
// ctx.moveTo(50, 20);
// ctx.lineTo(50, height - 30);
// ctx.lineTo(width - 20, height - 30);
// ctx.stroke();
// Draw Y-axis label
ctx.save();
ctx.translate(20, height / 2);
ctx.rotate(-Math.PI / 2);
ctx.fillStyle = '#ffffff';
ctx.textAlign = 'center';
ctx.fillText('Return Rate (%)', 0, 0);
ctx.restore();
// Draw X-axis label
ctx.fillStyle = '#ffffff';
ctx.textAlign = 'center';
ctx.fillText('Time (seconds)', width / 2, height - 10);
// Draw graph lines
const xStep = (width - 70) / (timeRange / 1000);
const yMiddle = (height - 50) / 2;
funds.forEach((fund, fundIndex) => {
ctx.strokeStyle = colors[fundIndex];
ctx.beginPath();
data.forEach((point, index) => {
const x = 50 + (point.time / 1000) * xStep;
const y = height - 30 - (yMiddle + point.values[fundIndex] * yMiddle / 10);
if (index === 0) ctx.moveTo(x, y);
else ctx.lineTo(x, y);
});
ctx.stroke();
});
// Draw legend
funds.forEach((fund, fundIndex) => {
ctx.fillStyle = colors[fundIndex];
ctx.fillRect(width - 100, 20 + fundIndex * 20, 15, 15);
ctx.fillStyle = '#ffffff';
ctx.textAlign = 'left';
ctx.fillText(fund, width - 80, 32 + fundIndex * 20);
});
}
function animate() {
updateData();
drawGraph();
requestAnimationFrame(animate);
}
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
animate();
})();
</script>
<!-- 펀드 테이블 -->
<script>
const fundsData = [
{
name: "DB바이오헬스케어증권자투자신탁제1호[주식]ClassA-E",
threeMonth: 11.12, sixMonth: 24.12, oneYear: 42.03, threeYear: 2.28, sinceLaunch: 42.94, size: 71
},
{
name: "미래에셋연금한국헬스케어증권자투자신탁1호주식CPe",
threeMonth: 10.33, sixMonth: 17.97, oneYear: 13.57, threeYear: -13.88, sinceLaunch: 27.50, size: 184
},
{
name: "미래에셋한국헬스케어증권자투자신탁1호(주식)A-e",
threeMonth: 10.32, sixMonth: 17.92, oneYear: 13.43, threeYear: -14.11, sinceLaunch: 161.55, size: 109
},
{
name: "웰컴액티브공모주코스닥벤처기업증권투자신탁[주혼]Ae",
threeMonth: 7.54, sixMonth: 30.24, oneYear: 25.31, threeYear: 0, sinceLaunch: 12, size: 1.05
},
{
name: "삼성ABF코리아장기채권인덱스증권투자신탁[채권]I",
threeMonth: 4.49, sixMonth: 5.78, oneYear: 11.08, threeYear: 0.85, sinceLaunch: 85.18, size: 157
}
];
function getRandomChange() {
return (Math.random() - 0.5) * 2; // Random number between -1 and 1
}
function updateFundData() {
fundsData.forEach(fund => {
fund.threeMonth += getRandomChange();
fund.sixMonth += getRandomChange();
fund.oneYear += getRandomChange();
fund.threeYear += getRandomChange();
fund.sinceLaunch += getRandomChange();
fund.size += getRandomChange() * 10;
});
}
function getColorClass(value) {
const absValue = Math.abs(value);
if (absValue >= 20) return value >= 0 ? 'positive-4' : 'negative-4';
if (absValue >= 15) return value >= 0 ? 'positive-3' : 'negative-3';
if (absValue >= 10) return value >= 0 ? 'positive-2' : 'negative-2';
if (absValue >= 5) return value >= 0 ? 'positive-1' : 'negative-1';
return '';
}
function renderTable() {
const tableBody = document.getElementById('fundTableBody');
tableBody.innerHTML = '';
fundsData.forEach(fund => {
const fundRow = document.createElement('tr');
fundRow.innerHTML = `
<td>${fund.name}</td>
<td class="value ${getColorClass(fund.threeMonth)}" data-value="${fund.threeMonth}">${fund.threeMonth.toFixed(2)}%</td>
<td class="value ${getColorClass(fund.sixMonth)}" data-value="${fund.sixMonth}">${fund.sixMonth.toFixed(2)}%</td>
<td class="value ${getColorClass(fund.oneYear)}" data-value="${fund.oneYear}">${fund.oneYear.toFixed(2)}%</td>
<td class="value ${getColorClass(fund.threeYear)}" data-value="${fund.threeYear}">${fund.threeYear.toFixed(2)}%</td>
<td class="value ${getColorClass(fund.sinceLaunch)}" data-value="${fund.sinceLaunch}">${fund.sinceLaunch.toFixed(2)}%</td>
<td class="value" data-value="${fund.size}">${fund.size.toFixed(2)}</td>
`;
tableBody.appendChild(fundRow);
});
}
function sortTable(column) {
fundsData.sort((a, b) => b[column] - a[column]);
}
function animateValue(element, start, end, duration) {
let startTimestamp = null;
element.classList.add('changing');
const step = (timestamp) => {
if (!startTimestamp) startTimestamp = timestamp;
const progress = Math.min((timestamp - startTimestamp) / duration, 1);
const currentValue = start + progress * (end - start);
element.textContent = currentValue.toFixed(2) + '%';
element.className = `value ${getColorClass(currentValue)}`;
if (progress < 1) {
window.requestAnimationFrame(step);
} else {
element.classList.remove('changing');
}
};
window.requestAnimationFrame(step);
}
function updateTableWithAnimation() {
const valueElements = document.querySelectorAll('.value');
updateFundData();
valueElements.forEach((element, index) => {
const column = element.cellIndex - 1; // Subtract 1 because the first column is the fund name
const fund = fundsData[Math.floor(index / 6)]; // Divide by 6 because there are 6 value columns per fund
const newValue = Object.values(fund)[column + 1]; // Add 1 to skip the name property
const oldValue = parseFloat(element.dataset.value);
if (newValue !== oldValue) {
animateValue(element, oldValue, newValue, 1000);
element.dataset.value = newValue;
}
});
}
document.querySelectorAll('th.sortable').forEach(th => {
th.addEventListener('click', () => {
const column = th.dataset.sort;
sortTable(column);
renderTable();
});
});
// Initial render
renderTable();
// Update data and re-render every 3 seconds
setInterval(updateTableWithAnimation, 3000);
</script>
</body>
</html>