Changes to apiscroll.pub1.scroll.pub

root
root
3 days ago
Initial commit
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://apiscroll.pub
+ metaTags
+ editButton /edit.html
+ title API Scroll | Test & Debug APIs
+ style.css
+
+ header
+ class hero
+ nav
+ div API Scroll
+ class logo
+ div
+ class nav-links
+ a Docs
+ href #docs
+ a Examples
+ href #examples
+ a Edit
+ href edit.html
+ div
+ class hero-content
+ h1 Test APIs with Elegance
+ p Send, receive, and debug API calls with this beautiful interface
+ a Try It Now
+ class primary-button
+ href #tester
+ main
+ section
+ id tester
+ class api-tester
+ h2 API Tester
+ div
+ class tester-container
+ div
+ class request-panel
+ div
+ class method-selector
+ select
+ id method
+ option GET
+ option POST
+ option PUT
+ option DELETE
+ option PATCH
+ input
+ id url
+ class url-input
+ placeholder https://api.example.com/endpoint
+ div
+ class headers-section
+ h3 Headers
+ div
+ class headers-container
+ id headers
+ button
+ class add-header
+ id addHeader
+ + Add Header
+ div
+ class body-section
+ h3 Body
+ textarea
+ id requestBody
+ placeholder {"key": "value"}
+ div
+ class response-panel
+ div
+ class status-bar
+ span Status:
+ span
+ id statusCode
+ class status-code
+ span
+ id statusText
+ div
+ class response-tabs
+ button
+ class tab-active
+ id responseTab
+ Response
+ button
+ class tab
+ id headersTab
+ Headers
+ pre
+ id responseContent
+ class response-content
+ button
+ class send-button
+ id sendRequest
+ Send Request
+ section
+ id docs
+ class docs
+ h2 Documentation
+ div
+ class docs-grid
+ div
+ class docs-card
+ h3 Getting Started
+ p Enter your API endpoint URL, select the HTTP method, add any required headers, and include a request body if needed.
+ div
+ class docs-card
+ h3 Headers
+ p Add custom headers by clicking the "+ Add Header" button. Each header consists of a key-value pair.
+ div
+ class docs-card
+ h3 Response
+ p View the API response in either the formatted response view or the raw headers view.
+ section
+ id examples
+ class examples
+ h2 Example APIs
+ div
+ class examples-grid
+ div
+ class example-card
+ h3 JSONPlaceholder
+ p GET https://jsonplaceholder.typicode.com/posts/1
+ button
+ class example-button
+ data-url https://jsonplaceholder.typicode.com/posts/1
+ data-method GET
+ Try It
+ div
+ class example-card
+ h3 OpenWeatherMap
+ p GET https://api.openweathermap.org/data/2.5/weather?q=London
+ button
+ class example-button
+ data-url https://api.openweathermap.org/data/2.5/weather?q=London
+ data-method GET
+ Try It
+ div
+ class example-card
+ h3 GitHub API
+ p GET https://api.github.com/users/octocat
+ button
+ class example-button
+ data-url https://api.github.com/users/octocat
+ data-method GET
+ Try It
+ footer
+ div
+ class footer-content
+ div
+ class footer-links
+ a Documentation
+ href #docs
+ a Examples
+ href #examples
+ a Edit
+ href edit.html
+ p A beautiful way to test APIs
+
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "7c8b7e45-a2e4-4c0e-8320-974f94247563",
+ "object": "chat.completion",
+ "created": 1744811950,
+ "model": "deepseek-chat",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Here's my suggestion for this API testing tool website:\n\n---domain---\napiscroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://apiscroll.pub\nmetaTags\neditButton /edit.html\ntitle API Scroll | Test & Debug APIs\nstyle.css\n\nheader\n class hero\n nav\n div API Scroll\n class logo\n div\n class nav-links\n a Docs\n href #docs\n a Examples\n href #examples\n a Edit\n href edit.html\n div\n class hero-content\n h1 Test APIs with Elegance\n p Send, receive, and debug API calls with this beautiful interface\n a Try It Now\n class primary-button\n href #tester\nmain\n section\n id tester\n class api-tester\n h2 API Tester\n div\n class tester-container\n div\n class request-panel\n div\n class method-selector\n select\n id method\n option GET\n option POST\n option PUT\n option DELETE\n option PATCH\n input\n id url\n class url-input\n placeholder https://api.example.com/endpoint\n div\n class headers-section\n h3 Headers\n div\n class headers-container\n id headers\n button\n class add-header\n id addHeader\n + Add Header\n div\n class body-section\n h3 Body\n textarea\n id requestBody\n placeholder {\"key\": \"value\"}\n div\n class response-panel\n div\n class status-bar\n span Status:\n span\n id statusCode\n class status-code\n span\n id statusText\n div\n class response-tabs\n button\n class tab-active\n id responseTab\n Response\n button\n class tab\n id headersTab\n Headers\n pre\n id responseContent\n class response-content\n button\n class send-button\n id sendRequest\n Send Request\n section\n id docs\n class docs\n h2 Documentation\n div\n class docs-grid\n div\n class docs-card\n h3 Getting Started\n p Enter your API endpoint URL, select the HTTP method, add any required headers, and include a request body if needed.\n div\n class docs-card\n h3 Headers\n p Add custom headers by clicking the \"+ Add Header\" button. Each header consists of a key-value pair.\n div\n class docs-card\n h3 Response\n p View the API response in either the formatted response view or the raw headers view.\n section\n id examples\n class examples\n h2 Example APIs\n div\n class examples-grid\n div\n class example-card\n h3 JSONPlaceholder\n p GET https://jsonplaceholder.typicode.com/posts/1\n button\n class example-button\n data-url https://jsonplaceholder.typicode.com/posts/1\n data-method GET\n Try It\n div\n class example-card\n h3 OpenWeatherMap\n p GET https://api.openweathermap.org/data/2.5/weather?q=London\n button\n class example-button\n data-url https://api.openweathermap.org/data/2.5/weather?q=London\n data-method GET\n Try It\n div\n class example-card\n h3 GitHub API\n p GET https://api.github.com/users/octocat\n button\n class example-button\n data-url https://api.github.com/users/octocat\n data-method GET\n Try It\nfooter\n div\n class footer-content\n div\n class footer-links\n a Documentation\n href #docs\n a Examples\n href #examples\n a Edit\n href edit.html\n p A beautiful way to test APIs\n\nscript.js\n---style.css---\n:root {\n --primary: #6366f1;\n --primary-dark: #4f46e5;\n --text: #1e293b;\n --text-light: #64748b;\n --bg: #f8fafc;\n --card-bg: #ffffff;\n --border: #e2e8f0;\n --success: #10b981;\n --error: #ef4444;\n --warning: #f59e0b;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n line-height: 1.6;\n color: var(--text);\n background-color: var(--bg);\n}\n\nheader.hero {\n background: linear-gradient(135deg, var(--primary), var(--primary-dark));\n color: white;\n padding: 2rem 1rem;\n}\n\nnav {\n display: flex;\n justify-content: space-between;\n align-items: center;\n max-width: 1200px;\n margin: 0 auto;\n padding: 0 1rem;\n}\n\n.logo {\n font-size: 1.5rem;\n font-weight: 700;\n}\n\n.nav-links {\n display: flex;\n gap: 1.5rem;\n}\n\n.nav-links a {\n color: white;\n text-decoration: none;\n font-weight: 500;\n}\n\n.hero-content {\n max-width: 1200px;\n margin: 4rem auto;\n padding: 0 1rem;\n text-align: center;\n}\n\n.hero-content h1 {\n font-size: 3rem;\n margin-bottom: 1rem;\n}\n\n.hero-content p {\n font-size: 1.25rem;\n margin-bottom: 2rem;\n opacity: 0.9;\n}\n\n.primary-button {\n background: white;\n color: var(--primary);\n padding: 0.75rem 1.5rem;\n border-radius: 0.5rem;\n text-decoration: none;\n font-weight: 600;\n display: inline-block;\n transition: transform 0.2s;\n}\n\n.primary-button:hover {\n transform: translateY(-2px);\n}\n\nmain {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem 1rem;\n}\n\nsection {\n margin-bottom: 4rem;\n}\n\nh2 {\n font-size: 2rem;\n margin-bottom: 2rem;\n color: var(--text);\n}\n\n.api-tester {\n background: var(--card-bg);\n border-radius: 1rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n}\n\n.tester-container {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n}\n\n.request-panel, .response-panel {\n padding: 1.5rem;\n}\n\n.method-selector {\n margin-bottom: 1rem;\n}\n\n.method-selector select {\n padding: 0.5rem;\n border-radius: 0.25rem;\n border: 1px solid var(--border);\n}\n\n.url-input {\n width: 100%;\n padding: 0.75rem;\n border: 1px solid var(--border);\n border-radius: 0.5rem;\n margin-bottom: 1rem;\n font-family: monospace;\n}\n\n.headers-section, .body-section {\n margin-bottom: 1.5rem;\n}\n\n.headers-container {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-bottom: 1rem;\n}\n\n.header-row {\n display: flex;\n gap: 0.5rem;\n}\n\n.header-row input {\n flex: 1;\n padding: 0.5rem;\n border: 1px solid var(--border);\n border-radius: 0.25rem;\n}\n\n.add-header {\n background: var(--primary);\n color: white;\n border: none;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n cursor: pointer;\n font-weight: 500;\n}\n\n.add-header:hover {\n background: var(--primary-dark);\n}\n\n#requestBody {\n width: 100%;\n min-height: 150px;\n padding: 0.75rem;\n border: 1px solid var(--border);\n border-radius: 0.5rem;\n font-family: monospace;\n resize: vertical;\n}\n\n.response-panel {\n border-left: 1px solid var(--border);\n}\n\n.status-bar {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin-bottom: 1rem;\n padding: 0.5rem;\n background: var(--bg);\n border-radius: 0.25rem;\n}\n\n.status-code {\n font-weight: 600;\n}\n\n.response-tabs {\n display: flex;\n gap: 0.5rem;\n margin-bottom: 1rem;\n}\n\n.tab, .tab-active {\n padding: 0.5rem 1rem;\n border: none;\n background: none;\n cursor: pointer;\n font-weight: 500;\n border-radius: 0.25rem;\n}\n\n.tab-active {\n background: var(--primary);\n color: white;\n}\n\n.response-content {\n background: var(--bg);\n padding: 1rem;\n border-radius: 0.5rem;\n min-height: 200px;\n overflow: auto;\n font-family: monospace;\n white-space: pre-wrap;\n}\n\n.send-button {\n background: var(--primary);\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: 0.5rem;\n font-weight: 600;\n cursor: pointer;\n width: 100%;\n margin-top: 1rem;\n transition: background 0.2s;\n}\n\n.send-button:hover {\n background: var(--primary-dark);\n}\n\n.docs-grid, .examples-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 1.5rem;\n}\n\n.docs-card, .example-card {\n background: var(--card-bg);\n padding: 1.5rem;\n border-radius: 0.5rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n.docs-card h3, .example-card h3 {\n margin-bottom: 0.5rem;\n color: var(--primary);\n}\n\n.docs-card p, .example-card p {\n margin-bottom: 1rem;\n color: var(--text-light);\n}\n\n.example-button {\n background: var(--primary);\n color: white;\n border: none;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n cursor: pointer;\n font-weight: 500;\n}\n\n.example-button:hover {\n background: var(--primary-dark);\n}\n\nfooter {\n background: var(--card-bg);\n padding: 2rem 1rem;\n text-align: center;\n}\n\n.footer-content {\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.footer-links {\n display: flex;\n justify-content: center;\n gap: 2rem;\n margin-bottom: 1rem;\n}\n\n.footer-links a {\n color: var(--text);\n text-decoration: none;\n font-weight: 500;\n}\n\n.footer-links a:hover {\n color: var(--primary);\n}\n\n@media (max-width: 768px) {\n .tester-container {\n grid-template-columns: 1fr;\n }\n \n .response-panel {\n border-left: none;\n border-top: 1px solid var(--border);\n }\n \n .hero-content h1 {\n font-size: 2rem;\n }\n \n .nav-links {\n gap: 1rem;\n }\n}\n---script.js---\ndocument.addEventListener('DOMContentLoaded', function() {\n // DOM Elements\n const sendButton = document.getElementById('sendRequest');\n const urlInput = document.getElementById('url');\n const methodSelect = document.getElementById('method');\n const requestBody = document.getElementById('requestBody');\n const headersContainer = document.getElementById('headers');\n const addHeaderButton = document.getElementById('addHeader');\n const responseContent = document.getElementById('responseContent');\n const statusCode = document.getElementById('statusCode');\n const statusText = document.getElementById('statusText');\n const responseTab = document.getElementById('responseTab');\n const headersTab = document.getElementById('headersTab');\n const exampleButtons = document.querySelectorAll('.example-button');\n\n // Add initial header row\n addHeaderRow();\n\n // Event Listeners\n sendButton.addEventListener('click', sendRequest);\n addHeaderButton.addEventListener('click', addHeaderRow);\n responseTab.addEventListener('click', () => switchTab('response'));\n headersTab.addEventListener('click', () => switchTab('headers'));\n \n // Example buttons\n exampleButtons.forEach(button => {\n button.addEventListener('click', function() {\n const url = this.getAttribute('data-url');\n const method = this.getAttribute('data-method');\n urlInput.value = url;\n methodSelect.value = method;\n });\n });\n\n // Functions\n function addHeaderRow() {\n const headerRow = document.createElement('div');\n headerRow.className = 'header-row';\n \n const keyInput = document.createElement('input');\n keyInput.type = 'text';\n keyInput.placeholder = 'Header key';\n \n const valueInput = document.createElement('input');\n valueInput.type = 'text';\n valueInput.placeholder = 'Header value';\n \n const removeButton = document.createElement('button');\n removeButton.textContent = '×';\n removeButton.className = 'remove-header';\n removeButton.addEventListener('click', function() {\n headersContainer.removeChild(headerRow);\n });\n \n headerRow.appendChild(keyInput);\n headerRow.appendChild(valueInput);\n headerRow.appendChild(removeButton);\n headersContainer.appendChild(headerRow);\n }\n\n function getHeaders() {\n const headers = {};\n const headerRows = headersContainer.querySelectorAll('.header-row');\n \n headerRows.forEach(row => {\n const inputs = row.querySelectorAll('input');\n const key = inputs[0].value.trim();\n const value = inputs[1].value.trim();\n \n if (key && value) {\n headers[key] = value;\n }\n });\n \n return headers;\n }\n\n async function sendRequest() {\n const url = urlInput.value.trim();\n const method = methodSelect.value;\n const body = requestBody.value.trim();\n const headers = getHeaders();\n \n if (!url) {\n alert('Please enter a URL');\n return;\n }\n \n try {\n sendButton.disabled = true;\n sendButton.textContent = 'Sending...';\n \n const options = {\n method,\n headers: {\n 'Content-Type': 'application/json',\n ...headers\n }\n };\n \n if (method !== 'GET' && body) {\n options.body = body;\n }\n \n const response = await fetch(url, options);\n \n // Update status\n statusCode.textContent = response.status;\n statusCode.className = 'status-code ' + \n (response.ok ? 'success' : 'error');\n statusText.textContent = response.statusText;\n \n // Get response data\n let responseData;\n try {\n responseData = await response.json();\n responseContent.textContent = JSON.stringify(responseData, null, 2);\n } catch (e) {\n responseData = await response.text();\n responseContent.textContent = responseData;\n }\n \n // Show response tab by default\n switchTab('response');\n \n } catch (error) {\n statusCode.textContent = 'Error';\n statusCode.className = 'status-code error';\n statusText.textContent = '';\n responseContent.textContent = error.message;\n } finally {\n sendButton.disabled = false;\n sendButton.textContent = 'Send Request';\n }\n }\n\n function switchTab(tab) {\n if (tab === 'response') {\n responseTab.classList.add('tab-active');\n headersTab.classList.remove('tab-active');\n // In a real app, you would show response content here\n } else {\n headersTab.classList.add('tab-active');\n responseTab.classList.remove('tab-active');\n // In a real app, you would show headers content here\n }\n }\n});\n---end---"
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 724,
+ "completion_tokens": 3652,
+ "total_tokens": 4376,
+ "prompt_tokens_details": {
+ "cached_tokens": 704
+ },
+ "prompt_cache_hit_tokens": 704,
+ "prompt_cache_miss_tokens": 20
+ },
+ "system_fingerprint": "fp_3d5141a69a_prod0225"
+ }
readme.scroll
Changed around line 1
+ # apiscroll.pub1.scroll.pub
+
+ Prompt: website
+ Agent: deepseek
+ Model: deepseek-chat
+
+ ## User prompt
+ A website to send and receive api calls
+
+ ## System prompt
+ You are an expert web developer. Create a website based on this request: "A website to send and receive api calls"
+
+ Requirements:
+ - Use only Scroll, CSS, and JavaScript (NO frameworks, NO external dependencies)
+ - Create clean, semantic HTML5
+ - Make it mobile-responsive
+ - Follow modern best practices and accessibility guidelines
+ - Keep it simple but professional
+ - Use only relative links and no external resources
+ - Do not put a copyright symbol or all rights reserved in the footer.
+ - Make it beautiful. Dazzling. Advanced used of CSS.
+
+ As a refresher, for doing the html body, Scroll is a whitespace based language that uses a single indented space to mark a line (aka particle) as a subparticle of a parent line.
+
+ For example:
+
+ header
+ class hero
+ nav
+ div Scroll
+ class logo
+ div
+ class nav-links
+ a Features
+ href #features
+ a Examples
+ href #examples
+ a Edit
+ href edit.html
+ a GitHub
+ class cta-button
+ href https://github.com/breck7/scroll
+ div
+ class hero-content
+ h1 Write Better with Scroll
+ p The extendible markup language that makes source beautiful and compiles to anything
+ a Get Started
+ class primary-button
+ href https://hub.scroll.pub/
+ main
+ section
+ id features
+ class features
+ h2 Why Scroll?
+ div
+ class feature-grid
+ div
+ class feature-card
+ div ⚡
+ class feature-icon
+ h3 Simple Syntax
+ p Like Markdown, but more powerful. No parentheses needed.
+ div
+ class feature-card
+ div 🧩
+ class feature-icon
+ h3 Extendible
+ p Build your own custom parsers.
+ div
+ class feature-card
+ div 🎨
+ class feature-icon
+ h3 Beautiful Output
+ p Create stunning documents with minimal effort.
+ div
+ class feature-card
+ div 🚀
+ class feature-icon
+ h3 Fast & Light
+ p Built on the efficient PPS Stack.
+ section
+ id examples
+ class code-demo
+ h2 See It In Action
+ div
+ class code-container
+ pre
+ class code-example
+ div
+ class code-output
+ footer
+ div
+ class footer-content
+ div
+ class footer-links
+ a Documentation
+ href https://scroll.pub/tutorial.html
+ a Community
+ href https://www.reddit.com/r/WorldWideScroll/
+ a Blog
+ href https://scroll.pub/blog
+ p Started by Breck Yunits. Evolved by a community.
+ https://twitter.com/breckyunits Breck Yunits
+ https://github.com/breck7/scroll/graphs/contributors community
+
+
+ First suggest a short, memorable domain name ending in scroll.pub that represents this website. Then provide the website files. Use this exact format:
+
+ ---domain---
+ (domainscroll.pub here)
+ ---index.scroll---
+ buildHtml
+ baseUrl https://(domainscroll.pub here)
+ metaTags
+ editButton /edit.html
+ title (Title here)
+ style.css
+
+ (body content here. no blank lines please.)
+
+ script.js
+ ---style.css---
+ (CSS content here)
+ ---script.js---
+ (JavaScript content here)
+ ---end---
script.js
Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ // DOM Elements
+ const sendButton = document.getElementById('sendRequest');
+ const urlInput = document.getElementById('url');
+ const methodSelect = document.getElementById('method');
+ const requestBody = document.getElementById('requestBody');
+ const headersContainer = document.getElementById('headers');
+ const addHeaderButton = document.getElementById('addHeader');
+ const responseContent = document.getElementById('responseContent');
+ const statusCode = document.getElementById('statusCode');
+ const statusText = document.getElementById('statusText');
+ const responseTab = document.getElementById('responseTab');
+ const headersTab = document.getElementById('headersTab');
+ const exampleButtons = document.querySelectorAll('.example-button');
+
+ // Add initial header row
+ addHeaderRow();
+
+ // Event Listeners
+ sendButton.addEventListener('click', sendRequest);
+ addHeaderButton.addEventListener('click', addHeaderRow);
+ responseTab.addEventListener('click', () => switchTab('response'));
+ headersTab.addEventListener('click', () => switchTab('headers'));
+
+ // Example buttons
+ exampleButtons.forEach(button => {
+ button.addEventListener('click', function() {
+ const url = this.getAttribute('data-url');
+ const method = this.getAttribute('data-method');
+ urlInput.value = url;
+ methodSelect.value = method;
+ });
+ });
+
+ // Functions
+ function addHeaderRow() {
+ const headerRow = document.createElement('div');
+ headerRow.className = 'header-row';
+
+ const keyInput = document.createElement('input');
+ keyInput.type = 'text';
+ keyInput.placeholder = 'Header key';
+
+ const valueInput = document.createElement('input');
+ valueInput.type = 'text';
+ valueInput.placeholder = 'Header value';
+
+ const removeButton = document.createElement('button');
+ removeButton.textContent = '×';
+ removeButton.className = 'remove-header';
+ removeButton.addEventListener('click', function() {
+ headersContainer.removeChild(headerRow);
+ });
+
+ headerRow.appendChild(keyInput);
+ headerRow.appendChild(valueInput);
+ headerRow.appendChild(removeButton);
+ headersContainer.appendChild(headerRow);
+ }
+
+ function getHeaders() {
+ const headers = {};
+ const headerRows = headersContainer.querySelectorAll('.header-row');
+
+ headerRows.forEach(row => {
+ const inputs = row.querySelectorAll('input');
+ const key = inputs[0].value.trim();
+ const value = inputs[1].value.trim();
+
+ if (key && value) {
+ headers[key] = value;
+ }
+ });
+
+ return headers;
+ }
+
+ async function sendRequest() {
+ const url = urlInput.value.trim();
+ const method = methodSelect.value;
+ const body = requestBody.value.trim();
+ const headers = getHeaders();
+
+ if (!url) {
+ alert('Please enter a URL');
+ return;
+ }
+
+ try {
+ sendButton.disabled = true;
+ sendButton.textContent = 'Sending...';
+
+ const options = {
+ method,
+ headers: {
+ 'Content-Type': 'application/json',
+ ...headers
+ }
+ };
+
+ if (method !== 'GET' && body) {
+ options.body = body;
+ }
+
+ const response = await fetch(url, options);
+
+ // Update status
+ statusCode.textContent = response.status;
+ statusCode.className = 'status-code ' +
+ (response.ok ? 'success' : 'error');
+ statusText.textContent = response.statusText;
+
+ // Get response data
+ let responseData;
+ try {
+ responseData = await response.json();
+ responseContent.textContent = JSON.stringify(responseData, null, 2);
+ } catch (e) {
+ responseData = await response.text();
+ responseContent.textContent = responseData;
+ }
+
+ // Show response tab by default
+ switchTab('response');
+
+ } catch (error) {
+ statusCode.textContent = 'Error';
+ statusCode.className = 'status-code error';
+ statusText.textContent = '';
+ responseContent.textContent = error.message;
+ } finally {
+ sendButton.disabled = false;
+ sendButton.textContent = 'Send Request';
+ }
+ }
+
+ function switchTab(tab) {
+ if (tab === 'response') {
+ responseTab.classList.add('tab-active');
+ headersTab.classList.remove('tab-active');
+ // In a real app, you would show response content here
+ } else {
+ headersTab.classList.add('tab-active');
+ responseTab.classList.remove('tab-active');
+ // In a real app, you would show headers content here
+ }
+ }
+ });
style.css
Changed around line 1
+ :root {
+ --primary: #6366f1;
+ --primary-dark: #4f46e5;
+ --text: #1e293b;
+ --text-light: #64748b;
+ --bg: #f8fafc;
+ --card-bg: #ffffff;
+ --border: #e2e8f0;
+ --success: #10b981;
+ --error: #ef4444;
+ --warning: #f59e0b;
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
+ line-height: 1.6;
+ color: var(--text);
+ background-color: var(--bg);
+ }
+
+ header.hero {
+ background: linear-gradient(135deg, var(--primary), var(--primary-dark));
+ color: white;
+ padding: 2rem 1rem;
+ }
+
+ nav {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 0 1rem;
+ }
+
+ .logo {
+ font-size: 1.5rem;
+ font-weight: 700;
+ }
+
+ .nav-links {
+ display: flex;
+ gap: 1.5rem;
+ }
+
+ .nav-links a {
+ color: white;
+ text-decoration: none;
+ font-weight: 500;
+ }
+
+ .hero-content {
+ max-width: 1200px;
+ margin: 4rem auto;
+ padding: 0 1rem;
+ text-align: center;
+ }
+
+ .hero-content h1 {
+ font-size: 3rem;
+ margin-bottom: 1rem;
+ }
+
+ .hero-content p {
+ font-size: 1.25rem;
+ margin-bottom: 2rem;
+ opacity: 0.9;
+ }
+
+ .primary-button {
+ background: white;
+ color: var(--primary);
+ padding: 0.75rem 1.5rem;
+ border-radius: 0.5rem;
+ text-decoration: none;
+ font-weight: 600;
+ display: inline-block;
+ transition: transform 0.2s;
+ }
+
+ .primary-button:hover {
+ transform: translateY(-2px);
+ }
+
+ main {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 2rem 1rem;
+ }
+
+ section {
+ margin-bottom: 4rem;
+ }
+
+ h2 {
+ font-size: 2rem;
+ margin-bottom: 2rem;
+ color: var(--text);
+ }
+
+ .api-tester {
+ background: var(--card-bg);
+ border-radius: 1rem;
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+ }
+
+ .tester-container {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 1rem;
+ }
+
+ .request-panel, .response-panel {
+ padding: 1.5rem;
+ }
+
+ .method-selector {
+ margin-bottom: 1rem;
+ }
+
+ .method-selector select {
+ padding: 0.5rem;
+ border-radius: 0.25rem;
+ border: 1px solid var(--border);
+ }
+
+ .url-input {
+ width: 100%;
+ padding: 0.75rem;
+ border: 1px solid var(--border);
+ border-radius: 0.5rem;
+ margin-bottom: 1rem;
+ font-family: monospace;
+ }
+
+ .headers-section, .body-section {
+ margin-bottom: 1.5rem;
+ }
+
+ .headers-container {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ margin-bottom: 1rem;
+ }
+
+ .header-row {
+ display: flex;
+ gap: 0.5rem;
+ }
+
+ .header-row input {
+ flex: 1;
+ padding: 0.5rem;
+ border: 1px solid var(--border);
+ border-radius: 0.25rem;
+ }
+
+ .add-header {
+ background: var(--primary);
+ color: white;
+ border: none;
+ padding: 0.5rem 1rem;
+ border-radius: 0.25rem;
+ cursor: pointer;
+ font-weight: 500;
+ }
+
+ .add-header:hover {
+ background: var(--primary-dark);
+ }
+
+ #requestBody {
+ width: 100%;
+ min-height: 150px;
+ padding: 0.75rem;
+ border: 1px solid var(--border);
+ border-radius: 0.5rem;
+ font-family: monospace;
+ resize: vertical;
+ }
+
+ .response-panel {
+ border-left: 1px solid var(--border);
+ }
+
+ .status-bar {
+ display: flex;
+ gap: 0.5rem;
+ align-items: center;
+ margin-bottom: 1rem;
+ padding: 0.5rem;
+ background: var(--bg);
+ border-radius: 0.25rem;
+ }
+
+ .status-code {
+ font-weight: 600;
+ }
+
+ .response-tabs {
+ display: flex;
+ gap: 0.5rem;
+ margin-bottom: 1rem;
+ }
+
+ .tab, .tab-active {
+ padding: 0.5rem 1rem;
+ border: none;
+ background: none;
+ cursor: pointer;
+ font-weight: 500;
+ border-radius: 0.25rem;
+ }
+
+ .tab-active {
+ background: var(--primary);
+ color: white;
+ }
+
+ .response-content {
+ background: var(--bg);
+ padding: 1rem;
+ border-radius: 0.5rem;
+ min-height: 200px;
+ overflow: auto;
+ font-family: monospace;
+ white-space: pre-wrap;
+ }
+
+ .send-button {
+ background: var(--primary);
+ color: white;
+ border: none;
+ padding: 0.75rem 1.5rem;
+ border-radius: 0.5rem;
+ font-weight: 600;
+ cursor: pointer;
+ width: 100%;
+ margin-top: 1rem;
+ transition: background 0.2s;
+ }
+
+ .send-button:hover {
+ background: var(--primary-dark);
+ }
+
+ .docs-grid, .examples-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
+ gap: 1.5rem;
+ }
+
+ .docs-card, .example-card {
+ background: var(--card-bg);
+ padding: 1.5rem;
+ border-radius: 0.5rem;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+ }
+
+ .docs-card h3, .example-card h3 {
+ margin-bottom: 0.5rem;
+ color: var(--primary);
+ }
+
+ .docs-card p, .example-card p {
+ margin-bottom: 1rem;
+ color: var(--text-light);
+ }
+
+ .example-button {
+ background: var(--primary);
+ color: white;
+ border: none;
+ padding: 0.5rem 1rem;
+ border-radius: 0.25rem;
+ cursor: pointer;
+ font-weight: 500;
+ }
+
+ .example-button:hover {
+ background: var(--primary-dark);
+ }
+
+ footer {
+ background: var(--card-bg);
+ padding: 2rem 1rem;
+ text-align: center;
+ }
+
+ .footer-content {
+ max-width: 1200px;
+ margin: 0 auto;
+ }
+
+ .footer-links {
+ display: flex;
+ justify-content: center;
+ gap: 2rem;
+ margin-bottom: 1rem;
+ }
+
+ .footer-links a {
+ color: var(--text);
+ text-decoration: none;
+ font-weight: 500;
+ }
+
+ .footer-links a:hover {
+ color: var(--primary);
+ }
+
+ @media (max-width: 768px) {
+ .tester-container {
+ grid-template-columns: 1fr;
+ }
+
+ .response-panel {
+ border-left: none;
+ border-top: 1px solid var(--border);
+ }
+
+ .hero-content h1 {
+ font-size: 2rem;
+ }
+
+ .nav-links {
+ gap: 1rem;
+ }
+ }