Spaces:
Running
Running
Update index.html
Browse files- index.html +49 -21
index.html
CHANGED
@@ -9,8 +9,8 @@
|
|
9 |
.code-block {
|
10 |
font-family: 'Courier New', Courier, monospace;
|
11 |
white-space: pre-wrap;
|
12 |
-
background-color: #1e293b;
|
13 |
-
color: #e2e8f0;
|
14 |
padding: 1.5rem;
|
15 |
border-radius: 0.5rem;
|
16 |
height: calc(100vh - 8rem);
|
@@ -20,7 +20,16 @@
|
|
20 |
.tab-content { display: none; }
|
21 |
.tab-content.active { display: block; }
|
22 |
.curl-button.active { background-color: #1d4ed8; color: white; }
|
23 |
-
.sidebar {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
.input-field {
|
25 |
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
26 |
background-color: #f1f5f9;
|
@@ -34,12 +43,26 @@
|
|
34 |
.btn:hover { transform: translateY(-1px); }
|
35 |
.btn:active { transform: translateY(0); }
|
36 |
.tab-button.active { border-color: #3b82f6; color: #3b82f6; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
</style>
|
38 |
</head>
|
39 |
-
<body class="bg-gray-100
|
40 |
<!-- Sidebar -->
|
41 |
-
<div class="
|
42 |
-
<
|
|
|
|
|
|
|
|
|
|
|
43 |
<div id="columnInputs" class="space-y-5">
|
44 |
<div>
|
45 |
<label class="block text-sm font-medium text-gray-700 mb-2">Columns</label>
|
@@ -59,16 +82,21 @@
|
|
59 |
</div>
|
60 |
|
61 |
<!-- Main Content -->
|
62 |
-
<div class="w-3/4 p-8">
|
63 |
-
|
64 |
-
|
65 |
-
<
|
|
|
|
|
|
|
|
|
|
|
66 |
</div>
|
67 |
|
68 |
<!-- Code Preview Tab -->
|
69 |
<div id="code" class="tab-content active">
|
70 |
-
<div class="flex justify-between items-center mb-4">
|
71 |
-
<h2 class="text-2xl font-semibold text-gray-800">Generated Code</h2>
|
72 |
<button onclick="copyCode()" class="btn bg-gray-700 p-2 rounded-lg hover:bg-gray-600 transition-colors duration-200" title="Copy to clipboard">
|
73 |
<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>
|
74 |
</button>
|
@@ -78,15 +106,15 @@
|
|
78 |
|
79 |
<!-- How to Use Tab -->
|
80 |
<div id="howto" class="tab-content">
|
81 |
-
<h2 class="text-2xl font-semibold text-gray-800 mb-4">How to Use (cURL Examples)</h2>
|
82 |
-
<div class="flex
|
83 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('appendSingle')">Append Single</button>
|
84 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('appendMultiple')">Append Multiple</button>
|
85 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('fetchAll')">Fetch All</button>
|
86 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('fetchRange')">Fetch Range</button>
|
87 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('search')">Search</button>
|
88 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('update')">Update</button>
|
89 |
-
<button class="curl-button btn px-4 py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('delete')">Delete</button>
|
90 |
</div>
|
91 |
<div id="curlExamples" class="code-block"></div>
|
92 |
</div>
|
|
|
9 |
.code-block {
|
10 |
font-family: 'Courier New', Courier, monospace;
|
11 |
white-space: pre-wrap;
|
12 |
+
background-color: #1e293b;
|
13 |
+
color: #e2e8f0;
|
14 |
padding: 1.5rem;
|
15 |
border-radius: 0.5rem;
|
16 |
height: calc(100vh - 8rem);
|
|
|
20 |
.tab-content { display: none; }
|
21 |
.tab-content.active { display: block; }
|
22 |
.curl-button.active { background-color: #1d4ed8; color: white; }
|
23 |
+
.sidebar {
|
24 |
+
transition: all 0.3s ease;
|
25 |
+
position: fixed;
|
26 |
+
top: 0;
|
27 |
+
left: -100%;
|
28 |
+
width: 75%;
|
29 |
+
max-width: 300px;
|
30 |
+
z-index: 50;
|
31 |
+
}
|
32 |
+
.sidebar.open { left: 0; }
|
33 |
.input-field {
|
34 |
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
35 |
background-color: #f1f5f9;
|
|
|
43 |
.btn:hover { transform: translateY(-1px); }
|
44 |
.btn:active { transform: translateY(0); }
|
45 |
.tab-button.active { border-color: #3b82f6; color: #3b82f6; }
|
46 |
+
@media (min-width: 768px) {
|
47 |
+
.sidebar {
|
48 |
+
position: static;
|
49 |
+
width: 25%;
|
50 |
+
max-width: none;
|
51 |
+
}
|
52 |
+
.main-content { margin-left: 25%; }
|
53 |
+
.code-block { height: calc(100vh - 8rem); }
|
54 |
+
}
|
55 |
</style>
|
56 |
</head>
|
57 |
+
<body class="bg-gray-100 font-sans min-h-screen">
|
58 |
<!-- Sidebar -->
|
59 |
+
<div id="sidebar" class="sidebar bg-white p-6 shadow-xl h-screen overflow-y-auto">
|
60 |
+
<div class="flex justify-between items-center mb-8">
|
61 |
+
<h1 class="text-3xl font-extrabold text-gray-900">GS Generator</h1>
|
62 |
+
<button id="closeSidebar" class="md:hidden btn bg-gray-200 p-2 rounded-lg hover:bg-gray-300" onclick="toggleSidebar()">
|
63 |
+
<svg class="w-6 h-6 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
|
64 |
+
</button>
|
65 |
+
</div>
|
66 |
<div id="columnInputs" class="space-y-5">
|
67 |
<div>
|
68 |
<label class="block text-sm font-medium text-gray-700 mb-2">Columns</label>
|
|
|
82 |
</div>
|
83 |
|
84 |
<!-- Main Content -->
|
85 |
+
<div class="main-content w-full md:w-3/4 p-4 md:p-8">
|
86 |
+
<!-- Mobile Menu Button -->
|
87 |
+
<button id="openSidebar" class="md:hidden fixed top-4 left-4 btn bg-blue-600 p-2 rounded-lg hover:bg-blue-700 z-50" onclick="toggleSidebar()">
|
88 |
+
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
|
89 |
+
</button>
|
90 |
+
|
91 |
+
<div class="flex flex-col sm:flex-row border-b-2 border-gray-300 mb-6 space-y-2 sm:space-y-0 sm:space-x-4">
|
92 |
+
<button class="tab-button px-4 py-2 sm:px-6 sm:py-3 font-semibold text-gray-700 border-b-2 border-transparent hover:border-blue-600 hover:text-blue-600 transition-colors duration-200" onclick="showTab('code')">Code Preview</button>
|
93 |
+
<button class="tab-button px-4 py-2 sm:px-6 sm:py-3 font-semibold text-gray-700 border-b-2 border-transparent hover:border-blue-600 hover:text-blue-600 transition-colors duration-200" onclick="showTab('howto')">How to Use</button>
|
94 |
</div>
|
95 |
|
96 |
<!-- Code Preview Tab -->
|
97 |
<div id="code" class="tab-content active">
|
98 |
+
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4 space-y-2 sm:space-y-0">
|
99 |
+
<h2 class="text-xl sm:text-2xl font-semibold text-gray-800">Generated Code</h2>
|
100 |
<button onclick="copyCode()" class="btn bg-gray-700 p-2 rounded-lg hover:bg-gray-600 transition-colors duration-200" title="Copy to clipboard">
|
101 |
<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>
|
102 |
</button>
|
|
|
106 |
|
107 |
<!-- How to Use Tab -->
|
108 |
<div id="howto" class="tab-content">
|
109 |
+
<h2 class="text-xl sm:text-2xl font-semibold text-gray-800 mb-4">How to Use (cURL Examples)</h2>
|
110 |
+
<div class="flex flex-wrap gap-2 mb-6 overflow-x-auto pb-2">
|
111 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('appendSingle')">Append Single</button>
|
112 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('appendMultiple')">Append Multiple</button>
|
113 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('fetchAll')">Fetch All</button>
|
114 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('fetchRange')">Fetch Range</button>
|
115 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('search')">Search</button>
|
116 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('update')">Update</button>
|
117 |
+
<button class="curl-button btn px-3 py-1 sm:px-4 sm:py-2 bg-gray-200 rounded-lg hover:bg-blue-600 hover:text-white text-sm font-medium transition-colors duration-200" onclick="showCurlExample('delete')">Delete</button>
|
118 |
</div>
|
119 |
<div id="curlExamples" class="code-block"></div>
|
120 |
</div>
|