From eae4a36fc6fe225caaba2685ffee1566946564c3 Mon Sep 17 00:00:00 2001 From: scanash00 Date: Wed, 31 Dec 2025 14:29:51 -0900 Subject: [PATCH] Make footer and api docs page mobile friendly --- client/src/pages/ApiDocs.jsx | 321 +++++++++-------------------------- client/src/styles.css | 115 +++++++++++++ 2 files changed, 198 insertions(+), 238 deletions(-) diff --git a/client/src/pages/ApiDocs.jsx b/client/src/pages/ApiDocs.jsx index 3817859..943e962 100644 --- a/client/src/pages/ApiDocs.jsx +++ b/client/src/pages/ApiDocs.jsx @@ -121,25 +121,11 @@ export default function ApiDocs() { The boop.cat API allows you to manage sites and trigger deployments programmatically. This is useful for CI/CD pipelines, GitHub Actions, and custom deployment workflows. -
-
+
+
Base URL: {baseUrl}/api/v1
-
+
Rate Limit: 100 requests / 15 minutes
@@ -197,114 +183,41 @@ export default function ApiDocs() {
{endpoints.map((endpoint, i) => ( -
-
+
+
{endpoint.method} - {endpoint.path} + {endpoint.path}
-
+
{endpoint.description}
-
-
+
+
Example Request -
-
-                {endpoint.example}
-              
+
{endpoint.example}
-
+
Example Response -
-
-                {endpoint.response}
-              
+
{endpoint.response}
))} @@ -320,22 +233,16 @@ export default function ApiDocs() { Here's an example workflow to trigger a deployment on every push to main:
-
- -
+                  'github-actions'
+                )
+              }
+            >
+              {copiedIndex === 'github-actions' ?  : }
+            
+          
+
             {`name: Deploy to boop.cat
 
 on:
@@ -402,46 +299,28 @@ jobs:
           For GitLab CI/CD, add this to your .gitlab-ci.yml:
         
-
- -
+                  'gitlab-ci'
+                )
+              }
+            >
+              {copiedIndex === 'gitlab-ci' ?  : }
+            
+          
+
             {`deploy:
   stage: deploy
   image: curlimages/curl
@@ -470,22 +349,14 @@ jobs:
           A simple Node.js script to trigger deployments:
         
-
- -
+                  'node-script'
+                )
+              }
+            >
+              {copiedIndex === 'node-script' ?  : }
+            
+          
+
             {`const siteId = 'YOUR_SITE_ID';
 const apiKey = process.env.BOOP_CAT_API_KEY;
 
@@ -549,22 +410,16 @@ deploy().catch(console.error);`}
           For Tangled.org (Spindle), create only .tangled/workflows/deploy.yml:
         
-
- -
+                  'tangled-ci'
+                )
+              }
+            >
+              {copiedIndex === 'tangled-ci' ?  : }
+            
+          
+
             {`when:
   - event: ["push"]
     branch: ["main"]
diff --git a/client/src/styles.css b/client/src/styles.css
index e0a4b7d..09ee531 100644
--- a/client/src/styles.css
+++ b/client/src/styles.css
@@ -1251,6 +1251,20 @@ html[data-theme='dark'] .landing-page .cta-card {
   opacity: 0.6;
 }
 
+@media (max-width: 640px) {
+  .footer-inner {
+    flex-direction: column;
+    gap: 20px;
+    text-align: center;
+  }
+
+  .footer-links {
+    flex-wrap: wrap;
+    justify-content: center;
+    gap: 16px 24px;
+  }
+}
+
 .content-section {
   animation: fadeInUp 0.6s ease-out backwards;
 }
@@ -4281,3 +4295,104 @@ html[data-theme='dark'] .landing-page .cta-card {
     width: 100%;
   }
 }
+
+/* ApiDocs Responsive Styles */
+.api-stats-grid {
+  display: flex;
+  gap: 12px;
+  flex-wrap: wrap;
+}
+
+.api-stat-card {
+  padding: 8px 16px;
+  background: var(--bg-secondary);
+  border-radius: 8px;
+  font-size: 13px;
+}
+
+.api-endpoint-item {
+  border-bottom: 1px solid var(--border);
+  padding-bottom: 24px;
+  margin-bottom: 24px;
+}
+
+.api-endpoint-item:last-child {
+  border-bottom: none;
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
+.api-endpoint-header {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  margin-bottom: 8px;
+  flex-wrap: wrap;
+}
+
+.api-method-badge {
+  padding: 4px 10px;
+  border-radius: 6px;
+  font-size: 12px;
+  font-weight: 700;
+  font-family: monospace;
+}
+
+.api-path {
+  font-size: 14px;
+  font-weight: 500;
+  word-break: break-all;
+}
+
+.api-example-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 6px;
+}
+
+.api-code-block {
+  background: var(--bg-tertiary, #1e1e1e);
+  padding: 16px;
+  border-radius: 8px;
+  font-family: monospace;
+  font-size: 12px;
+  color: var(--code-text, #e0e0e0);
+  overflow-x: auto;
+  margin: 0;
+  white-space: pre-wrap;
+  word-break: break-word;
+}
+
+.api-copy-btn {
+  width: 28px;
+  height: 28px;
+  border-radius: 50%;
+  background: var(--bg-secondary);
+  border: none;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  cursor: pointer;
+  color: var(--card-text);
+  transition: background 0.2s;
+}
+
+.api-copy-btn:hover {
+  background: var(--sidebar-hover);
+}
+
+@media (max-width: 600px) {
+  .api-stats-grid {
+    flex-direction: column;
+    gap: 8px;
+  }
+
+  .api-stat-card {
+    width: 100%;
+  }
+
+  .api-example-header {
+    margin-bottom: 8px;
+  }
+}
-- 
2.51.2