-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar_table.html
169 lines (139 loc) · 4.98 KB
/
sidebar_table.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-ApFsAeIkXa2AVdS0UK8dqkLCG2APuMlUyoYg3ayu77H5dMQOx9VfPnoHpRFgePA4WZuWJzVQyTR0Ol5r3IiLCA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script>
function runFunction() {
var input = document.getElementById('arrayInput').value;
var hf = document.getElementById('hfInput').value
var array = input.split(',').map(Number);
var hfarr = hf.length == 0 ? [] : hf.split(',').map(Number);
google.script.run.withSuccessHandler(showResult).myFunction(array, hfarr);
}
function showResult(result) {
document.getElementById('result').innerHTML = result;
}
function copyToClipboard() {
var resultElement = document.getElementById('result');
var range = document.createRange();
range.selectNode(resultElement);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand('copy');
window.getSelection().removeAllRanges();
google.script.run.showMsg('結果をクリップボードにコピーしました');
}
</script>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
padding: 20px;
}
input[type="text"] {
padding: 10px;
border-radius: 7px;
border: 1px solid #ccc;
width: 220px;
margin-right: 10px;
}
button {
padding: 8px 16px;
border-radius: 7px;
border: none;
background-color: #4CAF50;
color: #fff;
cursor: pointer;
transition: background-color 0.3s ease;
margin-bottom:20px;
margin-top:10px;
}
button:hover {
background-color: #45a049;
}
#result {
margin-top: 3px;
padding: 13px;
border-radius: 4px;
border: 1px solid #ccc;
background-color: #fff;
min-height:15px;
overflow-x:scroll;
white-space: nowrap;
}
.fb1 {
bottom: 20px;
right: 20px;
}
.fb2 {
bottom: 90px;
right: 20px;
}
.floating-button {
position: fixed;
z-index: 9999;
background-color: #4CAF50;
color: #fff;
border-radius: 50%;
border: none;
width: 60px;
height: 60px;
font-size: 24px;
text-align: center;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
cursor: pointer;
}
.floating-button:hover {
background-color: #327535;
}
.separator{
border-top: 1px solid #cccccc;
margin: 5px 0px 20px 0px;
}
.tooltip {
visibility: hidden;
position: absolute;
right:72px;
background-color: #000;
color: #fff;
padding: 5px;
border-radius: 4px;
font-size: 12px;
opacity: 0;
transition: opacity 0.3s, visibility 0s linear 0.3s;
height:18px;
width:85px;
text-align: center;
}
.floating-button:hover .tooltip {
visibility: visible;
opacity: 1;
transition-delay: 0s;
}
</style>
</head>
<body>
<div class="content">
<label for="arrayInput">小数点以下の桁数を指定する配列をカンマで区切って入力してください</label><br>
<input type="text" id="arrayInput"><br><br>
<label for="arrayInput">ヘッダー行の行数とフッター行の行数をカンマで区切って入力してください</label><br>
<input type="text" id="hfInput"><br>
<button onclick="runFunction()">関数を実行</button><br>
<div class="separator"></div>
<label for="arrayInput">以下にLaTeX形式の表が表示されます</label><br>
<div id="result"></div>
<button onclick="copyToClipboard()">結果をクリップボードにコピー</button>
</div>
<button class="floating-button fb2" onclick="runFunction()">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 14 14" id="IconChangeColor"> <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z" id="mainIconPathAttribute" fill="#ffffff"></path> </svg>
<span class="tooltip">関数を実行</span>
</button>
<button class="floating-button fb1" onclick="copyToClipboard()">
<svg style="color: white; --darkreader-inline-color: #ffffff;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" data-darkreader-inline-color="">
<path d="M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z" fill="white"></path>
</svg>
<span class="tooltip">結果をコピー</span>
</button>
</body>
</html>