-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF46.html
More file actions
324 lines (264 loc) · 9.85 KB
/
F46.html
File metadata and controls
324 lines (264 loc) · 9.85 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Autumn | Lead Edge Ash Tree Reflex</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
padding-top: 50px;
background-color: white;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 100%;
}
.input-group {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 100%;
border: 2px solid deepskyblue;
padding: 15px;
margin-bottom: 20px;
}
.input-group:nth-child(even) {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 100%;
border-left: none;
}
.input-group:nth-child(odd) {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 100%;
/*
border-right: none;
*/
}
#googleSheetFrame {
width: 875px;
height: 1200px;
border: none;
}
.row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
max-width: 100%;
--bs-gutter-x: 0;
}
textarea#responseField {
width: 65%; /* Adjust the width as needed */
height: 100px; /* Adjust the height as needed */
padding: 10px;
margin-top: 20px;
border-radius: 5px;
background-color: whitesmoke;
resize: none; /* Prevents resizing */
}
</style>
</head>
<body>
<div class="container">
<div class="text-center mb-4">
<img src="https://static.wixstatic.com/media/2451db_4f17959671e243e780f959689a435b86~mv2.png" alt="Autumn" style="max-width: 70%; height:auto;">
<br>
<br>
<br>
<h2 style="color: black; font-weight: bold;">Autumn | Lead Edge Ash Tree Reflex</h2>
<br>
</div>
<!-- Input groups -->
<div class="row">
<div class="col-md-6">
<div class="input-group">
<!-- Group 1 -->
<!-- inputs: F4,F5 results: F6,F7,F8,F9 -->
<form id="inputForm1" class="form-input" action="#" method="post">
<div class="mb-3">
<label for="input1" class="form-label">Cognition Input:</label>
<input type="number" class="form-control" id="input1">
</div>
<div class="mb-3">
<label for="input2" class="form-label">Attribute Input:</label>
<input type="number" class="form-control" id="input2">
</div>
<button type="button" class="btn btn-primary" id="submitForm1">Submit</button>
</form>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<!-- Group 2 -->
<!-- inputs: F13,F14 results: F15,F16,F17,F18 -->
<form id="inputForm2" class="form-input" action="#" method="post">
<div class="mb-3">
<label for="input3" class="form-label">Cognition Input:</label>
<input type="number" class="form-control" id="input3">
</div>
<div class="mb-3">
<label for="input4" class="form-label">Attribute Input:</label>
<input type="number" class="form-control" id="input4">
</div>
<button type="button" class="btn btn-primary" id="submitForm2">Submit</button>
</form>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="input-group">
<!-- Group 3 -->
<!-- inputs: F22,F23 results: F24,F25,F26,F27 -->
<form id="inputForm3" class="form-input" action="#" method="post">
<div class="mb-3">
<label for="input5" class="form-label">Tool Input:</label>
<input type="number" class="form-control" id="input5">
</div>
<div class="mb-3">
<label for="input6" class="form-label">Attribute Input:</label>
<input type="number" class="form-control" id="input6">
</div>
<button type="button" class="btn btn-primary" id="submitForm3">Submit</button>
</form>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<!-- Group 4 -->
<!-- inputs: F31,F32 results: F33,F34,F35,F36 -->
<form id="inputForm4" class="form-input" action="#" method="post">
<div class="mb-3">
<label for="input7" class="form-label">Tool Input:</label>
<input type="number" class="form-control" id="input7">
</div>
<div class="mb-3">
<label for="input8" class="form-label">Attribute Input:</label>
<input type="number" class="form-control" id="input8">
</div>
<button type="button" class="btn btn-primary" id="submitForm4">Submit</button>
</form>
</div>
</div>
</div>
<br>
<br>
<div id="results">
<!-- Results will be displayed here -->
</div>
<div class="container">
<h2>Autumn Ash Sculpt</h2>
<form id="userInputForm">
<label for="userInput">Enter your message:</label>
<input type="text" id="userInput" name="encodetoAutumn" placeholder="Type something...">
<button type="button" onclick="submitUserInput()" style="background-color: deepskyblue; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer;">Submit</button>
</form>
<textarea id="responseField" placeholder="Autumn : " rows="4" cols="50" disabled></textarea>
</div>
<br>
<button type="button" onclick="downloadResponse()" style="background-color: deepskyblue; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer;">Download Ash Sculpt</button>
<!--
<form id="myForm">
<input type="text" name="encodetoAutumn" placeholder="Enter text here">
<input type="button" value="Submit" onclick="submitForm()" style="background-color: deepskyblue; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer;">
</form>
-->
<br>
<br>
<iframe id="googleSheetFrame" src="https://docs.google.com/spreadsheets/d/1JGum3AZL8gw8CFSsG5Ah-wGSenTWPgSk063FFEnTUNQ/edit?usp=drivesdk"></iframe>
<br>
</div>
<script>
function submitUserInput() {
var userInput = document.getElementById('userInput').value;
var formData = new FormData();
formData.append('encodetoAutumn', userInput);
fetch('https://script.google.com/macros/s/AKfycbwaeerB10ld4TiKw-Mlz53BXBnzIuA-m1u4kjMwVGzohf2mP8xlEs4_9TrG4j2jSk8M/exec', {
method: 'POST',
body: formData,
})
.then(response => response.text())
.then(text => {
document.getElementById('responseField').innerText = text; // Display Autumn's response
})
.catch(error => console.error('Error:', error));
}
function downloadResponse() {
var response = document.getElementById('responseField').value;
var blob = new Blob([response], {type: "text/plain"});
var anchor = document.createElement("a");
anchor.download = "Autumn.ash";
anchor.href = window.URL.createObjectURL(blob);
anchor.style.display = "none"; // Don't show the element
document.body.appendChild(anchor);
anchor.click();
document.body.removeChild(anchor);
}
/*
// Function to handle form submission with group parameter
// Function to handle form submission with group parameter
function handleFormSubmit(formId, inputFields, group) {
$("#" + formId).click(function(e) {
e.preventDefault();
var formData = {
group: group // Include the group in the formData
};
inputFields.forEach(function(inputId) {
formData[inputId] = $("#" + inputId).val();
});
$.ajax({
type: 'POST',
url: 'https://script.google.com/macros/s/AKfycbx9jR6DEejEoi85FlpQSRXBjc-ypNgLjKQSlSxm8deK8b_ubplMkX1frWyFF0t06w-lBQ/exec', // Replace with your actual Apps Script URL
data: formData,
success: function(data) {
// Assuming the output will be in HTML format and can be directly inserted
$("#results").html(data);
// Clear the input fields after successful submission
inputFields.forEach(function(inputId) {
$("#" + inputId).val(''); // Clear each input field
});
},
error: function(xhr, status, error) {
$("#results").html("<p>Error fetching results. Please try again.</p>");
console.error("Error: " + status + " - " + error);
}
});
});
}
*/
$(document).ready(function() {
// Initialize form handlers with group parameter
handleFormSubmit('submitForm1', ['input1', 'input2'], '1'); // Group 1
handleFormSubmit('submitForm2', ['input3', 'input4'], '2'); // Group 2
handleFormSubmit('submitForm3', ['input5', 'input6'], '3'); // Group 3
handleFormSubmit('submitForm4', ['input7', 'input8'], '4'); // Group 4
});
function submitForm() {
var form = document.getElementById('myForm');
var formData = new FormData(form);
fetch('https://script.google.com/macros/s/AKfycbwGm_NNIKu7rV0azfnGarR5BZL1KWW-jOGSBCRkT12mLFRFQinRUtHZ2EfutE3DqAqRhA/exec', {
method: 'POST',
body: formData,
})
.then(response => response.text())
.then(data => alert(data)) // Show success message or handle as needed
.catch(error => console.error('Error:', error));
}
</script>
</body>
</html>