284 lines
8.0 KiB
HTML
284 lines
8.0 KiB
HTML
<!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>
|
|
<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>
|
|
/* Bible Book Styles */
|
|
.book-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
gap: 0.5rem;
|
|
padding: 0.5rem 0;
|
|
}
|
|
|
|
.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);
|
|
transition: all var(--transition-fast);
|
|
cursor: pointer;
|
|
font-family: var(--font-ui);
|
|
font-weight: 600;
|
|
font-size: 0.95rem;
|
|
width: 100%;
|
|
}
|
|
|
|
.book-button:hover {
|
|
background-color: var(--color-accent-primary);
|
|
color: var(--color-bg-primary);
|
|
border-color: var(--color-accent-primary);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.book-button.active {
|
|
background-color: var(--color-accent-primary);
|
|
color: var(--color-bg-primary);
|
|
border-color: var(--color-accent-primary);
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.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);
|
|
border: 1px solid var(--color-border);
|
|
margin-bottom: var(--space-xl);
|
|
box-shadow: 0 2px 8px var(--color-shadow);
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.book-grid {
|
|
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
|
}
|
|
|
|
.quick-actions {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.quick-btn {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container">
|
|
<h1>KJV API (Legacy edition)</h1>
|
|
|
|
<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>
|
|
|
|
<!-- 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
|
|
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"
|
|
and meant for interactive use/browsing
|
|
<a href="/random">/random</a> - outputs a random verse
|
|
<a href="/votd">/votd</a> - returns verse of the day
|
|
<a href="/search">/search</a> - returns a keyword search result set
|
|
<a href="/show">/show</a> - returns a verse or set of verses by name/location
|
|
<a href="/define">/define</a> - 1828 Noah Webster dictionary search
|
|
<a href="/seq">/seq</a> - Incremental sequence of Bible verses (per request)
|
|
|
|
URL PARAMETERS
|
|
==============
|
|
view=
|
|
- json - json-encoded response
|
|
- plain - very simple html response
|
|
- rich - pretty response with css and js
|
|
Required parameter
|
|
|
|
kw=
|
|
- Used with /search /show/ /define /find
|
|
- The keyword(s) of your query, separated by commas
|
|
-- ex ?kw=1cor5:1-5,2Peter2:5
|
|
|
|
getuid=
|
|
- Used only with /seq
|
|
- Set this to "true" to recieve a new UID for use with /seq?uid=
|
|
|
|
start=
|
|
- Used only with /seq
|
|
- You can use a ref like "1Cor5:1" to start there
|
|
instead of Genesis 1:1 as is the default
|
|
- Only used when creating a new UID
|
|
- If you want to "start in a new place" - just create a new UID
|
|
|
|
uid=
|
|
- Used only with /seq
|
|
- Required parameter for normal use of /seq
|
|
|
|
num=
|
|
- Used only with /seq
|
|
- You can get the "next # verses" in your sequence
|
|
|
|
FEATURES
|
|
========
|
|
- King James Only. (No heretical commentaries or false Bibles)
|
|
- High quality source documents
|
|
- Free
|
|
- Developer hates the sodomites
|
|
|
|
INTERACTIVE ENDPOINTS
|
|
=====================
|
|
The following endpoints will present you with a query box and
|
|
radio selector for choosing your output format.
|
|
- / (same function as /find)
|
|
- /search
|
|
- /define
|
|
- /show
|
|
|
|
EXAMPLES
|
|
========
|
|
api.tld/random
|
|
api.tld/votd?view=rich
|
|
api.tld/show?kw=john3:16,1john5:7&view=plain
|
|
|
|
BUGS
|
|
====
|
|
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>
|