This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tool.html
106 lines (98 loc) · 4.42 KB
/
tool.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Eastward Translator Tool</title>
<link rel="shortcut icon" href="./assets/sam.png" type="image/x-icon">
<link rel="stylesheet" href="./styles/index.css">
<script src="./scripts/tailwindcss.min.js"></script>
<script src="./scripts/papaparse.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body class="bg-[#101725]">
<div
class="fixed flex items-center justify-between bg-gray/80 backdrop-blur-md back-drop w-full border-b-[1px] border-[#315573]">
<div class="flex">
<input type="file" name="file-input" id="file-input" class="block w-[500px] border border-gray-200 shadow-sm text-sm focus:z-10 focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600
file:border-0 file:me-4
file:h-[36px] file:px-4
file:bg-[#283141] file:text-gray-400 h-[36px]">
<div class="h-[36px] w-[1px] bg-[#315573]"></div>
<div>
<button id="btn-load" type="button" onclick="document.getElementById('progress-input').click()"
class="h-[36px] px-4 bg-[#0E2639] text-[#02A4DC] text-sm">
Load CSV
</button>
<input type="file" id="progress-input" class="hidden" accept=".csv">
</div>
<div class="h-[36px] w-[1px] bg-[#315573]"></div>
<button id="btn-save" type="button" class="h-[36px] px-4 bg-[#0E2639] text-[#02A4DC] text-sm">
Save CSV
</button>
<div class="h-[36px] w-[1px] bg-[#315573]"></div>
<button id="openModal" type="button" class="h-[36px] px-4 bg-[#0E2639] text-[#02A4DC] text-sm">
Diff
</button>
<div class="h-[36px] w-[1px] bg-[#315573]"></div>
<button id="btn-export" type="button" class="h-[36px] px-4 bg-[#0E2639] text-[#02A4DC] text-sm">
Export to file
</button>
<div class="h-[36px] w-[1px] bg-[#315573]"></div>
</div>
<div class="flex gap-5 pr-4 text-slate-500 text-sm">
<p id="bar-save-file-load">Load file: _</p>
<p id="bar-status">Status: _</p>
<p id="bar-file-size">File size: _</p>
<p id="bar-line">Lines: _</p>
</div>
</div>
<div id="content" class="py-[50px] text-white px-3 gap-10 flex flex-col">
</div>
<div id="modalContainer" class="fixed inset-0 bg-black/20 backdrop-blur-sm hidden flex items-center justify-center">
<div class="bg-white p-6 rounded shadow-lg w-1/2">
<button class="closeModal absolute top-0 right-0 m-4 text-gray-700 hover:text-gray-900">
×
</button>
<!-- Modal content -->
<div class="flex justify-between items-center mb-4">
<div class="flex gap-3 items-center">
<h2 class="text-xl font-bold">Show diff</h2>
<p id="modal-status" class="text-slate-400 text-sm"></p>
</div>
<p class="closeModal font-bold cursor-pointer">X</p>
</div>
<div class="modal-content flex flex-col gap-2 max-h-[350px] overflow-y-scroll"></div>
</div>
</div>
<script>
// Function to open the modal
function openModal() {
document.getElementById('modalContainer').classList.remove('hidden');
}
// Function to close the modal
function closeModal() {
document.getElementById('modalContainer').classList.add('hidden');
}
// Event listener for the "Open Modal" button
document.getElementById('openModal').addEventListener('click', openModal);
// Event listener for the "Close" button in the modal
document.querySelectorAll('.closeModal').forEach(el => el.addEventListener('click', closeModal));
// Event listener to close the modal if clicking outside the modal content
document.getElementById('modalContainer').addEventListener('click', function (event) {
if (event.target === this) {
closeModal();
}
});
// Event listener to close the modal if pressing the Escape key
document.addEventListener('keydown', function (event) {
if (event.key === 'Escape') {
closeModal();
}
});
</script>
<script src="./scripts/main.js"></script>
</body>
</html>