Fancier homepage and a bit of performance improvement through aggressive caching.
This commit is contained in:
+173
-162
@@ -1,77 +1,105 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>KJV API - Legacy Edition</title>
|
||||
<style>html,body{background-color:#1a1a1a}</style>
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
||||
<link rel="stylesheet" href="/styles/page.css">
|
||||
<script src="/js/collapsible.js" defer></script>
|
||||
<style>
|
||||
/* Modern KJV API Styling - Index Page */
|
||||
|
||||
:root {
|
||||
--color-bg-primary: #1a1a1a;
|
||||
--color-bg-secondary: #252525;
|
||||
--color-bg-tertiary: #2f2f2f;
|
||||
--color-text-primary: #e8e8e8;
|
||||
--color-text-secondary: #b8b8b8;
|
||||
--color-text-muted: #888888;
|
||||
--color-accent-primary: #6b9bd1;
|
||||
--color-accent-hover: #85aede;
|
||||
--color-link: #6b9bd1;
|
||||
--color-link-hover: #85aede;
|
||||
--color-border: #3a3a3a;
|
||||
--color-shadow: rgba(0, 0, 0, 0.3);
|
||||
|
||||
--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
--font-scripture: Georgia, "Crimson Text", "Times New Roman", serif;
|
||||
--font-mono: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
|
||||
|
||||
--space-xs: 0.25rem;
|
||||
--space-sm: 0.5rem;
|
||||
--space-md: 1rem;
|
||||
--space-lg: 1.5rem;
|
||||
--space-xl: 2rem;
|
||||
|
||||
--content-max-width: 820px;
|
||||
--border-radius: 8px;
|
||||
--border-radius-sm: 4px;
|
||||
--transition-fast: 150ms ease;
|
||||
/* Bible Book Styles */
|
||||
.book-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--color-bg-primary);
|
||||
.book-button {
|
||||
background-color: var(--color-bg-tertiary);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--border-radius-sm);
|
||||
padding: 0.75rem 1rem;
|
||||
text-align: left;
|
||||
color: var(--color-text-primary);
|
||||
margin: 0;
|
||||
padding: var(--space-xl);
|
||||
transition: all var(--transition-fast);
|
||||
cursor: pointer;
|
||||
font-family: var(--font-ui);
|
||||
line-height: 1.6;
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: var(--font-ui);
|
||||
font-size: 16px;
|
||||
.book-button:hover {
|
||||
background-color: var(--color-accent-primary);
|
||||
color: var(--color-bg-primary);
|
||||
border-color: var(--color-accent-primary);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: var(--content-max-width);
|
||||
margin: 0 auto;
|
||||
padding: var(--space-lg);
|
||||
.book-button.active {
|
||||
background-color: var(--color-accent-primary);
|
||||
color: var(--color-bg-primary);
|
||||
border-color: var(--color-accent-primary);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--color-text-primary);
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: var(--space-lg);
|
||||
font-weight: 700;
|
||||
.chapter-grid {
|
||||
display: none;
|
||||
grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
|
||||
gap: 0.4rem;
|
||||
padding: 1rem;
|
||||
background-color: var(--color-bg-secondary);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--border-radius-sm);
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.chapter-link {
|
||||
background-color: var(--color-bg-tertiary);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--border-radius-sm);
|
||||
padding: 0.5rem;
|
||||
text-align: center;
|
||||
color: var(--color-text-primary);
|
||||
font-size: 0.85rem;
|
||||
transition: all var(--transition-fast);
|
||||
display: block;
|
||||
}
|
||||
|
||||
form {
|
||||
.chapter-link:hover {
|
||||
background-color: var(--color-accent-primary);
|
||||
color: var(--color-bg-primary);
|
||||
text-decoration: none;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.quick-actions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin: 1.5rem 0;
|
||||
}
|
||||
|
||||
.quick-btn {
|
||||
background-color: var(--color-accent-primary);
|
||||
color: var(--color-bg-primary);
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: var(--border-radius-sm);
|
||||
font-weight: 600;
|
||||
transition: all var(--transition-fast);
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.quick-btn:hover {
|
||||
background-color: var(--color-accent-hover);
|
||||
transform: translateY(-1px);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.search-section {
|
||||
background-color: var(--color-bg-secondary);
|
||||
padding: var(--space-xl);
|
||||
border-radius: var(--border-radius);
|
||||
@@ -80,124 +108,105 @@ form {
|
||||
box-shadow: 0 2px 8px var(--color-shadow);
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: var(--space-sm);
|
||||
.testament-header {
|
||||
color: var(--color-accent-primary);
|
||||
font-size: 1.8rem;
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
font-weight: 700;
|
||||
border-bottom: 2px solid var(--color-accent-primary);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.category-header {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 1.1rem;
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--color-link-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
width: 100%;
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
margin: var(--space-sm) 0;
|
||||
font-size: 1rem;
|
||||
font-family: var(--font-ui);
|
||||
background-color: var(--color-bg-tertiary);
|
||||
color: var(--color-text-primary);
|
||||
border: 2px solid var(--color-border);
|
||||
border-radius: var(--border-radius-sm);
|
||||
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
input[type=text]:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-accent-primary);
|
||||
box-shadow: 0 0 0 3px rgba(107, 155, 209, 0.1);
|
||||
}
|
||||
|
||||
input[type=button],
|
||||
input[type=submit],
|
||||
input[type=reset] {
|
||||
font-family: var(--font-ui);
|
||||
font-weight: 600;
|
||||
background-color: var(--color-accent-primary);
|
||||
border: none;
|
||||
color: var(--color-bg-primary);
|
||||
padding: var(--space-sm) var(--space-lg);
|
||||
text-decoration: none;
|
||||
margin: var(--space-sm) 0;
|
||||
cursor: pointer;
|
||||
border-radius: var(--border-radius-sm);
|
||||
transition: background-color var(--transition-fast), transform var(--transition-fast);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
input[type=button]:hover,
|
||||
input[type=submit]:hover,
|
||||
input[type=reset]:hover {
|
||||
background-color: var(--color-accent-hover);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: var(--color-bg-tertiary);
|
||||
color: var(--color-text-primary);
|
||||
padding: 2px 6px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: var(--color-bg-secondary);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--border-radius);
|
||||
padding: var(--space-lg);
|
||||
overflow-x: auto;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
padding: var(--space-md);
|
||||
.book-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
.quick-actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
form {
|
||||
padding: var(--space-lg);
|
||||
.quick-btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>KJV API (Legacy edition)</h1>
|
||||
<div class="container">
|
||||
<h1>KJV API (Legacy edition)</h1>
|
||||
|
||||
<form action="/find">
|
||||
<label for='kw'>Keyword Search</label><br>
|
||||
<input type="text" name="kw"><br><br>
|
||||
<input type="hidden" name="view" value="rich"">
|
||||
<input type="submit">
|
||||
<form>
|
||||
<div class="search-section">
|
||||
<form action="/find">
|
||||
<label for='kw'>Search Scripture</label><br>
|
||||
<input type="text" name="kw" id="kw" placeholder="Enter verse reference or search keywords..."><br><br>
|
||||
<input type="hidden" name="view" value="rich">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
|
||||
<div class="quick-actions">
|
||||
<a href="/random?view=rich" class="quick-btn">Random Verse</a>
|
||||
<a href="/votd?view=rich" class="quick-btn">Verse of the Day</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
API ENDPOINT SPECIFICATION v 0.3
|
||||
<!-- OLD TESTAMENT -->
|
||||
<h2 class="testament-header">Old Testament</h2>
|
||||
{% for category, books in testament_data.OT.items() %}
|
||||
<h3 class="category-header">{{ category }}</h3>
|
||||
<div class="book-grid">
|
||||
{% for book in books %}
|
||||
<div>
|
||||
<button class="book-button collapsible" data-book="{{ book.title }}">
|
||||
{{ book.title }}
|
||||
</button>
|
||||
<div class="chapter-grid content">
|
||||
{% for chapter in range(1, book.chapters + 1) %}
|
||||
<a href="/show?kw={{ book.title }} {{ chapter }}&view=rich" class="chapter-link">{{ chapter }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<!-- NEW TESTAMENT -->
|
||||
<h2 class="testament-header">New Testament</h2>
|
||||
{% for category, books in testament_data.NT.items() %}
|
||||
<h3 class="category-header">{{ category }}</h3>
|
||||
<div class="book-grid">
|
||||
{% for book in books %}
|
||||
<div>
|
||||
<button class="book-button collapsible" data-book="{{ book.title }}">
|
||||
{{ book.title }}
|
||||
</button>
|
||||
<div class="chapter-grid content">
|
||||
{% for chapter in range(1, book.chapters + 1) %}
|
||||
<a href="/show?kw={{ book.title }} {{ chapter }}&view=rich" class="chapter-link">{{ chapter }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<!-- API DOCUMENTATION -->
|
||||
<button class="collapsible" style="margin-top: 2rem;">API Documentation</button>
|
||||
<div class="content">
|
||||
<pre><code>API ENDPOINT SPECIFICATION v 0.3
|
||||
================================
|
||||
|
||||
<a href="/find">
|
||||
/find</a> - Tries to show a verse, if it's not a verse
|
||||
<a href="/find">/find</a> - Tries to show a verse, if it's not a verse
|
||||
it will try to search your query. If it's a
|
||||
single query it will try to find a definition
|
||||
for the word as well. Only avaliable in "Rich"
|
||||
@@ -213,9 +222,9 @@ URL PARAMETERS
|
||||
==============
|
||||
view=
|
||||
- json - json-encoded response
|
||||
- plain - plaintext response
|
||||
- rich - pretty response with css
|
||||
default: json
|
||||
- plain - very simple html response
|
||||
- rich - pretty response with css and js
|
||||
Required parameter
|
||||
|
||||
kw=
|
||||
- Used with /search /show/ /define /find
|
||||
@@ -244,7 +253,7 @@ num=
|
||||
FEATURES
|
||||
========
|
||||
- King James Only. (No heretical commentaries or false Bibles)
|
||||
- High quality source documents
|
||||
- High quality source documents
|
||||
- Free
|
||||
- Developer hates the sodomites
|
||||
|
||||
@@ -257,7 +266,6 @@ radio selector for choosing your output format.
|
||||
- /define
|
||||
- /show
|
||||
|
||||
|
||||
EXAMPLES
|
||||
========
|
||||
api.tld/random
|
||||
@@ -266,7 +274,10 @@ api.tld/show?kw=john3:16,1john5:7&view=plain
|
||||
|
||||
BUGS
|
||||
====
|
||||
Suggestions, bug reports or improvements can be reported to <a href="https://1611.social/@tyler">@tyler@1611.social</a>
|
||||
</code>
|
||||
</pre>
|
||||
Suggestions, bug reports or improvements can be reported to <a href="https://nicecrew.digital/@tyler">@tyler@nicecrew.digital</a></code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user