Spaces:
Running
Running
Update index.html
Browse files- index.html +257 -131
index.html
CHANGED
@@ -6,6 +6,47 @@
|
|
6 |
<title>Google Apps Script Generator</title>
|
7 |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
8 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
.code-block {
|
10 |
font-family: 'Courier New', Courier, monospace;
|
11 |
white-space: pre-wrap;
|
@@ -13,211 +54,296 @@
|
|
13 |
color: #e2e8f0;
|
14 |
padding: 1rem;
|
15 |
border-radius: 0.5rem;
|
16 |
-
height: calc(
|
|
|
17 |
overflow-y: auto;
|
18 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
19 |
border: 1px solid rgba(255, 255, 255, 0.2);
|
20 |
}
|
21 |
.section { display: none; }
|
22 |
.section.active { display: block; }
|
23 |
-
|
|
|
24 |
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
25 |
-
background: rgba(255, 255, 255, 0.
|
26 |
color: #1e293b;
|
27 |
-
border: 1px solid rgba(255, 255, 255, 0.
|
28 |
width: 100%;
|
|
|
|
|
29 |
}
|
30 |
-
.input-field
|
|
|
31 |
border-color: #3b82f6;
|
32 |
-
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.
|
|
|
33 |
}
|
34 |
-
.btn {
|
35 |
-
transition: background-color 0.2s ease, transform 0.1s ease;
|
36 |
backdrop-filter: blur(8px);
|
37 |
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
.
|
45 |
-
.btn.bg-gray-200 { background: #e5e7eb; color: #1f2937; }
|
46 |
-
|
47 |
-
/* Hover effects with slightly darker/lighter shades */
|
48 |
-
.btn.bg-blue-600:hover { background: #1d4ed8; transform: translateY(-1px); }
|
49 |
-
.btn.bg-green-600:hover { background: #15803d; transform: translateY(-1px); }
|
50 |
-
.btn.bg-gray-700:hover { background: #1f2937; transform: translateY(-1px); }
|
51 |
-
.btn.bg-gray-600:hover { background: #374151; transform: translateY(-1px); }
|
52 |
-
.btn.bg-red-600:hover { background: #b91c1c; transform: translateY(-1px); }
|
53 |
-
.btn.bg-gray-200:hover { background: #d1d5db; transform: translateY(-1px); }
|
54 |
-
|
55 |
-
.btn:active { transform: translateY(0); }
|
56 |
-
.step-indicator {
|
57 |
background: rgba(255, 255, 255, 0.1);
|
58 |
backdrop-filter: blur(5px);
|
59 |
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
-
.step-indicator.active {
|
62 |
-
background: rgba(59, 130, 246, 0.
|
63 |
color: white;
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
|
|
65 |
.glass-container {
|
66 |
-
background: rgba(255, 255, 255, 0.
|
67 |
backdrop-filter: blur(12px);
|
68 |
-
border: 1px solid rgba(255, 255, 255, 0.
|
69 |
-
box-shadow: 0
|
|
|
|
|
70 |
}
|
71 |
|
72 |
-
/* Mobile-specific styles */
|
73 |
@media (max-width: 640px) {
|
74 |
body {
|
75 |
-
padding:
|
|
|
|
|
76 |
}
|
77 |
.glass-container {
|
78 |
-
padding:
|
79 |
-
margin: 0;
|
80 |
}
|
81 |
.code-block {
|
82 |
-
height: calc(
|
83 |
-
padding: 0.
|
|
|
84 |
}
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
flex-direction: column;
|
87 |
-
}
|
88 |
-
.space-x-3 > * + * {
|
89 |
-
margin-left: 0;
|
90 |
-
margin-top: 0.5rem;
|
91 |
-
}
|
92 |
-
.space-x-4 > * + * {
|
93 |
-
margin-left: 0;
|
94 |
-
margin-top: 0.75rem;
|
95 |
-
}
|
96 |
-
.btn {
|
97 |
width: 100%;
|
98 |
-
|
99 |
-
padding: 0.75rem;
|
100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
.step-indicator {
|
102 |
-
width:
|
103 |
-
|
104 |
-
font-size: 0.875rem;
|
105 |
-
}
|
106 |
-
.text-2xl {
|
107 |
-
font-size: 1.25rem;
|
108 |
-
}
|
109 |
-
.text-xl {
|
110 |
-
font-size: 1.125rem;
|
111 |
-
}
|
112 |
-
.mb-6 {
|
113 |
-
margin-bottom: 1rem;
|
114 |
-
}
|
115 |
-
.space-y-4 > * + * {
|
116 |
-
margin-top: 1rem;
|
117 |
-
}
|
118 |
-
.column-input {
|
119 |
-
padding: 0.5rem;
|
120 |
-
}
|
121 |
-
.flex-wrap {
|
122 |
-
flex-wrap: wrap;
|
123 |
-
}
|
124 |
-
.gap-2 {
|
125 |
-
gap: 0.5rem;
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
|
|
|
|
128 |
@media (min-width: 641px) {
|
129 |
body {
|
130 |
-
padding:
|
|
|
|
|
131 |
}
|
132 |
.glass-container {
|
133 |
-
padding:
|
134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
}
|
|
|
136 |
</style>
|
137 |
</head>
|
138 |
-
<body class="bg-gradient-to-br from-gray-200 via-gray-300 to-gray-400 min-h-screen font-sans">
|
139 |
-
|
140 |
-
|
|
|
141 |
</header>
|
142 |
|
143 |
-
|
144 |
-
|
145 |
-
<
|
146 |
-
|
147 |
-
|
148 |
</section>
|
149 |
|
150 |
-
|
151 |
-
|
152 |
-
<div class="step-indicator
|
153 |
-
<div class="step-indicator
|
154 |
-
<div class="step-indicator flex items-center justify-center w-10 h-10 rounded-full text-gray-700 font-semibold">3</div>
|
155 |
</div>
|
156 |
|
157 |
-
|
158 |
-
<div class="max-w-4xl mx-auto glass-container rounded-xl">
|
159 |
-
<!-- Set Columns Section -->
|
160 |
<div id="columns" class="section active">
|
161 |
-
<
|
162 |
-
<div id="columnInputs" class="space-y-4">
|
163 |
-
<div class="flex space-x-3">
|
164 |
-
<input type="text" class="column-input input-field flex-1
|
165 |
-
|
166 |
-
<svg
|
167 |
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
168 |
-
</svg>
|
169 |
</button>
|
170 |
</div>
|
171 |
-
|
172 |
-
<input type="text" class="column-input input-field flex-1
|
173 |
-
<button onclick="removeColumn(this)" class="
|
174 |
-
<svg
|
175 |
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
176 |
-
</svg>
|
177 |
</button>
|
178 |
</div>
|
179 |
</div>
|
180 |
-
<div class="
|
181 |
-
<button onclick="
|
182 |
-
<button onclick="nextSection('code')" class="btn bg-green-600 text-white px-6 py-3 rounded-lg text-base font-medium">Next</button>
|
183 |
</div>
|
184 |
</div>
|
185 |
|
186 |
-
<!-- Generated Code Section -->
|
187 |
<div id="code" class="section">
|
188 |
-
<
|
189 |
-
<div class="flex flex-col sm:flex-row justify-between items-center mb-4
|
190 |
-
|
191 |
-
<button onclick="copyCode()" class="btn bg-gray-700 p-2 rounded-lg" title="Copy to clipboard">
|
192 |
<svg class="w-6 h-6 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-2M8 5a2 2 0 002 2h4a2 2 0 002-2M8 5a2 2 0 012-2h4a2 2 0 012 2"></path></svg>
|
|
|
193 |
</button>
|
194 |
</div>
|
195 |
-
<div id="codePreview" class="code-block"></div>
|
196 |
-
|
197 |
-
<button onclick="nextSection('
|
198 |
-
<button onclick="nextSection('howto')" class="btn bg-green-600 text-white px-6 py-3 rounded-lg text-base font-medium">Next</button>
|
199 |
</div>
|
200 |
</div>
|
201 |
|
202 |
-
<!-- How to Use Section -->
|
203 |
<div id="howto" class="section">
|
204 |
-
<
|
205 |
-
|
206 |
-
|
207 |
-
<button class="curl-button btn
|
208 |
-
<button class="curl-button btn
|
209 |
-
<button class="curl-button btn
|
210 |
-
<button class="curl-button btn
|
211 |
-
<button class="curl-button btn
|
212 |
-
<button class="curl-button btn
|
|
|
213 |
</div>
|
214 |
-
<div id="curlExamples" class="code-block"></div>
|
215 |
-
<div class="flex justify-start
|
216 |
-
<button onclick="nextSection('code')" class="btn bg-gray-600 text-white px-6 py-3 rounded-lg text-base font-medium">Back</button>
|
217 |
</div>
|
218 |
</div>
|
219 |
</div>
|
220 |
|
|
|
221 |
<script>
|
222 |
function nextSection(sectionId) {
|
223 |
document.querySelectorAll('.section').forEach(section => section.classList.remove('active'));
|
|
|
6 |
<title>Google Apps Script Generator</title>
|
7 |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
8 |
<style>
|
9 |
+
/* Base body padding for fixed header */
|
10 |
+
body {
|
11 |
+
padding-top: 5rem; /* Start with a base padding */
|
12 |
+
}
|
13 |
+
|
14 |
+
/* Hero section base style */
|
15 |
+
#heroSection {
|
16 |
+
display: flex; /* Use flex by default */
|
17 |
+
transition: opacity 0.3s ease-out, max-height 0.3s ease-out; /* Add transition */
|
18 |
+
opacity: 1;
|
19 |
+
max-height: 500px; /* Estimate max height */
|
20 |
+
overflow: hidden;
|
21 |
+
}
|
22 |
+
/* Style to hide hero section smoothly */
|
23 |
+
#heroSection.hidden-section {
|
24 |
+
opacity: 0;
|
25 |
+
max-height: 0;
|
26 |
+
padding-top: 0;
|
27 |
+
padding-bottom: 0;
|
28 |
+
margin-bottom: 0;
|
29 |
+
/* display: none; /* Re-add if transition is not desired or causes layout shifts */
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
/* Progress steps base style */
|
34 |
+
#progressSteps {
|
35 |
+
display: flex; /* Use flex by default */
|
36 |
+
transition: opacity 0.3s ease-out, max-height 0.3s ease-out; /* Add transition */
|
37 |
+
opacity: 1;
|
38 |
+
max-height: 100px; /* Estimate max height */
|
39 |
+
overflow: hidden;
|
40 |
+
}
|
41 |
+
/* Style to hide steps smoothly */
|
42 |
+
#progressSteps.hidden-section {
|
43 |
+
opacity: 0;
|
44 |
+
max-height: 0;
|
45 |
+
margin-bottom: 0;
|
46 |
+
/* display: none; */
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
.code-block {
|
51 |
font-family: 'Courier New', Courier, monospace;
|
52 |
white-space: pre-wrap;
|
|
|
54 |
color: #e2e8f0;
|
55 |
padding: 1rem;
|
56 |
border-radius: 0.5rem;
|
57 |
+
height: calc(80vh - 22rem); /* Adjusted height slightly */
|
58 |
+
min-height: 150px; /* Adjusted min-height */
|
59 |
overflow-y: auto;
|
60 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
61 |
border: 1px solid rgba(255, 255, 255, 0.2);
|
62 |
}
|
63 |
.section { display: none; }
|
64 |
.section.active { display: block; }
|
65 |
+
|
66 |
+
.input-field {
|
67 |
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
68 |
+
background: rgba(255, 255, 255, 0.25);
|
69 |
color: #1e293b;
|
70 |
+
border: 1px solid rgba(255, 255, 255, 0.4);
|
71 |
width: 100%;
|
72 |
+
padding: 0.65rem 0.75rem; /* Adjusted padding slightly */
|
73 |
+
border-radius: 0.375rem; /* Standard Tailwind rounded-md */
|
74 |
}
|
75 |
+
.input-field::placeholder { color: #4b5563; opacity: 1; }
|
76 |
+
.input-field:focus {
|
77 |
border-color: #3b82f6;
|
78 |
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
|
79 |
+
background: rgba(255, 255, 255, 0.35);
|
80 |
}
|
81 |
+
.btn {
|
82 |
+
transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
|
83 |
backdrop-filter: blur(8px);
|
84 |
border: 1px solid rgba(255, 255, 255, 0.2);
|
85 |
+
padding: 0.75rem 1.25rem; /* Default padding */
|
86 |
+
border-radius: 0.375rem; /* Standard Tailwind rounded-md */
|
87 |
+
font-weight: 500; /* Medium weight */
|
88 |
+
text-align: center;
|
89 |
+
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
|
90 |
+
}
|
91 |
+
.btn:hover {
|
92 |
+
transform: translateY(-1px);
|
93 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
94 |
+
}
|
95 |
+
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
|
96 |
+
|
97 |
+
/* Specific Button Colors */
|
98 |
+
.btn-blue { background: #2563eb; color: white; } .btn-blue:hover { background: #1d4ed8; }
|
99 |
+
.btn-green { background: #16a34a; color: white; } .btn-green:hover { background: #15803d; }
|
100 |
+
.btn-gray-dark { background: #374151; color: white; } .btn-gray-dark:hover { background: #1f2937; }
|
101 |
+
.btn-gray { background: #4b5563; color: white; } .btn-gray:hover { background: #374151; }
|
102 |
+
.btn-red { background: #dc2626; color: white; } .btn-red:hover { background: #b91c1c; }
|
103 |
+
.btn-light { background: #e5e7eb; color: #1f2937; } .btn-light:hover { background: #d1d5db; }
|
104 |
+
.btn-light-active { background: #dbeafe; color: #1e40af; } /* For active cURL button */
|
105 |
+
|
106 |
+
|
107 |
+
/* Small icon button style (e.g., delete, copy) */
|
108 |
+
.btn-icon {
|
109 |
+
padding: 0.5rem; /* Smaller padding for icons */
|
110 |
+
flex-shrink: 0; /* Prevent shrinking */
|
111 |
+
line-height: 1; /* Ensure icon aligns well */
|
112 |
}
|
113 |
+
.btn-icon svg {
|
114 |
+
width: 1.25rem; /* w-5 */
|
115 |
+
height: 1.25rem; /* h-5 */
|
116 |
+
}
|
117 |
+
|
118 |
+
.step-indicator {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
background: rgba(255, 255, 255, 0.1);
|
120 |
backdrop-filter: blur(5px);
|
121 |
border: 1px solid rgba(255, 255, 255, 0.2);
|
122 |
+
width: 2.5rem; /* w-10 */
|
123 |
+
height: 2.5rem; /* h-10 */
|
124 |
+
border-radius: 9999px; /* rounded-full */
|
125 |
+
display: flex;
|
126 |
+
align-items: center;
|
127 |
+
justify-content: center;
|
128 |
+
font-weight: 600; /* semibold */
|
129 |
+
color: #4b5563; /* gray-600 text */
|
130 |
+
transition: all 0.3s ease-in-out;
|
131 |
}
|
132 |
+
.step-indicator.active {
|
133 |
+
background: rgba(59, 130, 246, 0.9);
|
134 |
color: white;
|
135 |
+
box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
|
136 |
+
}
|
137 |
+
.step-indicator.completed { /* Style for completed steps */
|
138 |
+
background: rgba(22, 163, 74, 0.8); /* Green */
|
139 |
+
color: white;
|
140 |
}
|
141 |
+
|
142 |
.glass-container {
|
143 |
+
background: rgba(255, 255, 255, 0.15);
|
144 |
backdrop-filter: blur(12px);
|
145 |
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
146 |
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
|
147 |
+
border-radius: 0.75rem; /* rounded-xl */
|
148 |
+
padding: 1.5rem; /* Default padding */
|
149 |
}
|
150 |
|
151 |
+
/* --- Mobile-specific styles --- */
|
152 |
@media (max-width: 640px) {
|
153 |
body {
|
154 |
+
padding-top: 4.5rem; /* Adjust for potentially smaller header */
|
155 |
+
padding-left: 0.5rem;
|
156 |
+
padding-right: 0.5rem;
|
157 |
}
|
158 |
.glass-container {
|
159 |
+
padding: 1rem; /* Reduce padding slightly */
|
|
|
160 |
}
|
161 |
.code-block {
|
162 |
+
height: calc(70vh - 15rem); /* Adjust height calc for mobile */
|
163 |
+
padding: 0.75rem;
|
164 |
+
min-height: 120px;
|
165 |
}
|
166 |
+
|
167 |
+
/* Input row layout */
|
168 |
+
.column-input-row {
|
169 |
+
flex-direction: row; /* Keep input and button in a row */
|
170 |
+
align-items: center;
|
171 |
+
gap: 0.75rem; /* space-x-3 equivalent */
|
172 |
+
}
|
173 |
+
.column-input-row input {
|
174 |
+
flex-grow: 1; /* Allow input to take space */
|
175 |
+
}
|
176 |
+
.column-input-row .btn-icon {
|
177 |
+
/* Delete button already has flex-shrink-0 */
|
178 |
+
}
|
179 |
+
|
180 |
+
/* Button container for main actions */
|
181 |
+
.button-container-mobile-stack {
|
182 |
+
display: flex;
|
183 |
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
width: 100%;
|
185 |
+
gap: 0.75rem; /* space-y-3 */
|
|
|
186 |
}
|
187 |
+
.button-container-mobile-stack .btn {
|
188 |
+
width: 100%; /* Make buttons full width */
|
189 |
+
}
|
190 |
+
|
191 |
+
/* Make specific containers stack buttons */
|
192 |
+
#columns .button-container,
|
193 |
+
#code .button-container,
|
194 |
+
#howto .button-container {
|
195 |
+
flex-direction: column;
|
196 |
+
gap: 0.75rem;
|
197 |
+
}
|
198 |
+
#columns .button-container .btn,
|
199 |
+
#code .button-container .btn,
|
200 |
+
#howto .button-container .btn {
|
201 |
+
width: 100%; /* Ensure buttons inside stack full width */
|
202 |
+
margin-left: 0 !important; /* Override potential sm: space-x */
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
.step-indicator {
|
207 |
+
width: 2.25rem; height: 2.25rem; /* Slightly smaller */
|
208 |
+
font-size: 0.875rem; /* text-sm */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
210 |
+
|
211 |
+
/* Adjust heading sizes for mobile */
|
212 |
+
.text-4xl { font-size: 1.875rem; line-height: 2.25rem; } /* text-3xl */
|
213 |
+
.text-2xl { font-size: 1.25rem; line-height: 1.75rem; } /* text-xl */
|
214 |
+
.text-xl { font-size: 1.125rem; line-height: 1.75rem; } /* text-lg */
|
215 |
+
.text-lg { font-size: 1rem; line-height: 1.5rem; } /* text-base */
|
216 |
+
|
217 |
+
/* Adjust margins */
|
218 |
+
.mb-12 { margin-bottom: 2rem; } /* mb-8 */
|
219 |
+
.mb-8 { margin-bottom: 1.5rem; } /* mb-6 */
|
220 |
+
.mb-6 { margin-bottom: 1rem; } /* mb-4 */
|
221 |
+
.mt-6 { margin-top: 1rem; } /* mt-4 */
|
222 |
+
.py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; } /* py-10 */
|
223 |
+
|
224 |
+
/* cURL buttons adjustments */
|
225 |
+
#howto .flex-wrap {
|
226 |
+
gap: 0.5rem; /* gap-2 */
|
227 |
+
}
|
228 |
+
#howto .flex-wrap .btn {
|
229 |
+
padding: 0.5rem 0.75rem; /* Smaller padding */
|
230 |
+
font-size: 0.875rem; /* text-sm */
|
231 |
+
}
|
232 |
+
|
233 |
+
/* Copy button on mobile */
|
234 |
+
#code .flex > .btn-icon {
|
235 |
+
/* padding: 0.6rem; /* Slightly larger tap area if needed */
|
236 |
+
}
|
237 |
}
|
238 |
+
|
239 |
+
/* Larger screen adjustments */
|
240 |
@media (min-width: 641px) {
|
241 |
body {
|
242 |
+
padding-top: 6rem; /* Restore larger padding */
|
243 |
+
padding-left: 1rem;
|
244 |
+
padding-right: 1rem;
|
245 |
}
|
246 |
.glass-container {
|
247 |
+
padding: 2rem; /* Restore larger padding */
|
248 |
}
|
249 |
+
/* Restore row layout for buttons on desktop */
|
250 |
+
#columns .button-container,
|
251 |
+
#code .button-container {
|
252 |
+
flex-direction: row;
|
253 |
+
justify-content: space-between;
|
254 |
+
gap: 1rem; /* space-x-4 */
|
255 |
+
}
|
256 |
+
#columns .button-container .btn,
|
257 |
+
#code .button-container .btn {
|
258 |
+
width: auto; /* Allow buttons to size naturally */
|
259 |
+
}
|
260 |
+
/* How-to back button on desktop */
|
261 |
+
#howto .button-container {
|
262 |
+
justify-content: flex-start;
|
263 |
+
flex-direction: row; /* Ensure it's row */
|
264 |
+
}
|
265 |
+
#howto .button-container .btn {
|
266 |
+
width: auto;
|
267 |
+
}
|
268 |
+
|
269 |
}
|
270 |
+
|
271 |
</style>
|
272 |
</head>
|
273 |
+
<body class="bg-gradient-to-br from-gray-200 via-gray-300 to-gray-400 min-h-screen font-sans text-gray-800">
|
274 |
+
|
275 |
+
<header class="fixed top-0 left-0 w-full bg-white shadow-md p-4 z-50">
|
276 |
+
<div class="max-w-6xl mx-auto text-xl font-bold text-gray-900">GSheet2DB</div>
|
277 |
</header>
|
278 |
|
279 |
+
<section id="heroSection" class="flex flex-col justify-center items-center text-center px-6 py-16 mb-12">
|
280 |
+
<h1 class="text-4xl font-bold text-gray-900">Convert Google Sheets to a Database</h1>
|
281 |
+
<p class="text-lg text-gray-700 mt-3 max-w-2xl">
|
282 |
+
Generate Google Apps Script code to turn your spreadsheet into a simple REST API. Fast, simple, and free!
|
283 |
+
</p>
|
284 |
</section>
|
285 |
|
286 |
+
<div id="progressSteps" class="max-w-xl mx-auto flex justify-center space-x-4 mb-8 px-4">
|
287 |
+
<div data-step="columns" class="step-indicator">1</div>
|
288 |
+
<div data-step="code" class="step-indicator">2</div>
|
289 |
+
<div data-step="howto" class="step-indicator">3</div>
|
|
|
290 |
</div>
|
291 |
|
292 |
+
<div class="max-w-4xl mx-auto glass-container mb-12">
|
|
|
|
|
293 |
<div id="columns" class="section active">
|
294 |
+
<h2 class="text-2xl font-extrabold text-gray-900 mb-6 text-center">Step 1: Define Your Columns</h2>
|
295 |
+
<div id="columnInputs" class="space-y-4 mb-6">
|
296 |
+
<div class="flex items-center space-x-3 column-input-row">
|
297 |
+
<input type="text" class="column-input input-field flex-1" placeholder="Column name (e.g., Status)" value="word">
|
298 |
+
<button onclick="removeColumn(this)" class="btn btn-icon btn-red" aria-label="Remove column">
|
299 |
+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>
|
|
|
|
|
300 |
</button>
|
301 |
</div>
|
302 |
+
<div class="flex items-center space-x-3 column-input-row">
|
303 |
+
<input type="text" class="column-input input-field flex-1" placeholder="Column name (e.g., Category)" value="meaning">
|
304 |
+
<button onclick="removeColumn(this)" class="btn btn-icon btn-red" aria-label="Remove column">
|
305 |
+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>
|
|
|
|
|
306 |
</button>
|
307 |
</div>
|
308 |
</div>
|
309 |
+
<div class="mt-6 button-container"> <button onclick="addColumn()" class="btn btn-blue w-full sm:w-auto">Add Column</button>
|
310 |
+
<button onclick="nextSection('code')" class="btn btn-green w-full sm:w-auto">Next: Generate Code</button>
|
|
|
311 |
</div>
|
312 |
</div>
|
313 |
|
|
|
314 |
<div id="code" class="section">
|
315 |
+
<h2 class="text-2xl font-extrabold text-gray-900 mb-6 text-center">Step 2: Generated Apps Script Code</h2>
|
316 |
+
<div class="flex flex-col sm:flex-row justify-between items-center mb-4 gap-3 sm:gap-0"> <h3 class="text-xl font-semibold text-gray-800">Code Preview</h3>
|
317 |
+
<button onclick="copyCode()" class="btn btn-icon btn-gray-dark self-end sm:self-center" title="Copy to clipboard" aria-label="Copy code to clipboard">
|
|
|
318 |
<svg class="w-6 h-6 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-2M8 5a2 2 0 002 2h4a2 2 0 002-2M8 5a2 2 0 012-2h4a2 2 0 012 2"></path></svg>
|
319 |
+
<span class="sr-only">Copy Code</span>
|
320 |
</button>
|
321 |
</div>
|
322 |
+
<div id="codePreview" class="code-block mb-6"></div>
|
323 |
+
<div class="mt-6 button-container"> <button onclick="nextSection('columns')" class="btn btn-gray w-full sm:w-auto">Back</button>
|
324 |
+
<button onclick="nextSection('howto')" class="btn btn-green w-full sm:w-auto">Next: How to Use</button>
|
|
|
325 |
</div>
|
326 |
</div>
|
327 |
|
|
|
328 |
<div id="howto" class="section">
|
329 |
+
<h2 class="text-2xl font-extrabold text-gray-900 mb-6 text-center">Step 3: How to Use the API</h2>
|
330 |
+
<h3 class="text-lg font-semibold text-gray-800 mb-3">Example cURL Commands:</h3>
|
331 |
+
<div class="flex flex-wrap gap-2 mb-6 pb-2">
|
332 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('appendSingle', this)">Append Single</button>
|
333 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('appendMultiple', this)">Append Multiple</button>
|
334 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('fetchAll', this)">Fetch All</button>
|
335 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('fetchRange', this)">Fetch Range</button>
|
336 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('search', this)">Search</button>
|
337 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('update', this)">Update</button>
|
338 |
+
<button class="curl-button btn btn-light text-sm px-3 py-1.5" onclick="showCurlExample('delete', this)">Delete</button>
|
339 |
</div>
|
340 |
+
<div id="curlExamples" class="code-block mb-6"></div>
|
341 |
+
<div class="mt-6 flex justify-start button-container"> <button onclick="nextSection('code')" class="btn btn-gray w-full sm:w-auto">Back</button>
|
|
|
342 |
</div>
|
343 |
</div>
|
344 |
</div>
|
345 |
|
346 |
+
|
347 |
<script>
|
348 |
function nextSection(sectionId) {
|
349 |
document.querySelectorAll('.section').forEach(section => section.classList.remove('active'));
|