-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (60 loc) · 2.48 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CIH Project</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<link rel='stylesheet' href='style.css' type='text/css' media='all' />
</head>
<body>
<div class="main-content">
<div class="content">
<div class="info"> <p>Click on the canvas to add a node.</p></div>
<canvas id="canvas" width="800" height="580"></canvas>
<button id="refreshButton" onclick="resetApp()">Reset</button>
</div>
<div class="right-bar">
<ul class="tabs">
<li class="active" data-tab="tab1">Log - Flow Details</li>
<li data-tab="tab2">Distance Table</li>
</ul>
<div id="tab1" class="tab-content active">
<!-- <textarea id="flowText" rows="100%"></textarea> -->
<div id="flowText" ></div>
</div>
<div id="tab2" class="tab-content">
<table class="table" id="distanceTable">
<thead>
<tr>
<th>From</th>
<th>To</th>
<th>Distance</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<footer>
<p>© 2025 CIH Project | Crafted with <span style="color: #e74c3c;">♥</span> by <a style="color: white;" target="_blank" href="https://hangga.github.io/">Hangga Aji Sayekti</a></p>
</footer>
<script src="script.js"></script>
<script>
// script untuk mengatur pergantian tab
const tabs = document.querySelectorAll('.tabs li');
const contents = document.querySelectorAll('.tab-content');
tabs.forEach(tab => {
tab.addEventListener('click', () => {
// Hapus class 'active' dari semua tab dan konten
tabs.forEach(t => t.classList.remove('active'));
contents.forEach(c => c.classList.remove('active'));
// Tambahkan class 'active' pada tab yang diklik
tab.classList.add('active');
document.getElementById(tab.dataset.tab).classList.add('active');
});
});
</script>
</body>
</html>