develop ready to be stable enough #5
@@ -1,2 +1,5 @@
|
||||
logs/*.log
|
||||
*__pycache__*
|
||||
data/shortcodes.db
|
||||
data/seq.db
|
||||
data/sermons.db
|
||||
|
||||
@@ -134,6 +134,10 @@ def serve_shortcode_js():
|
||||
def serve_collapsible_js():
|
||||
return Response(cached.get("js_collapsible"), mimetype='application/javascript')
|
||||
|
||||
@app.get("/styles/page.css")
|
||||
def serve_page_css():
|
||||
return send_file("styles/page.css", mimetype='text/css')
|
||||
|
||||
def generate_short_id():
|
||||
remain = random.randrange(614_656, 17_210_367) # resolves to length of 5
|
||||
chars = "0123456789ACEFHJKLMNPRTUVWXY"
|
||||
@@ -604,7 +608,7 @@ def show(kw=None, get_start_verse_id=False, human_readable=False):
|
||||
if arg_view == "plain":
|
||||
response = "<br>".join(response_list)
|
||||
elif arg_view == "rich" or human_readable:
|
||||
response = "<br>".join(response_list)
|
||||
response = "".join(response_list)
|
||||
else:
|
||||
response = jsonify(response_list)
|
||||
return response
|
||||
@@ -670,8 +674,8 @@ def scripture_response(scriptures, human_readable=False):
|
||||
)
|
||||
|
||||
response.append(cached["css_navbar"])
|
||||
response.append("<div class='responses'")
|
||||
response.append(f"{len(scriptures)} Results")
|
||||
response.append("<div class='responses'>")
|
||||
response.append(f"<div class='results-count'>{len(scriptures)} Results</div>")
|
||||
for scripture in scriptures:
|
||||
response.append(response_rich(scripture))
|
||||
response.append("</div>")
|
||||
@@ -720,7 +724,7 @@ def random_verse():
|
||||
if arg_view == "plain":
|
||||
response = "<br>".join(response_list)
|
||||
elif arg_view == "rich":
|
||||
response = "<br>".join(response_list)
|
||||
response = "".join(response_list)
|
||||
else:
|
||||
response = jsonify(response_list)
|
||||
#logging.debug(f"Search Response: {response}")
|
||||
@@ -741,7 +745,7 @@ def verse_of_the_day():
|
||||
if arg_view == "plain":
|
||||
response = "<br>".join(response_list)
|
||||
elif arg_view == "rich":
|
||||
response = "<br>".join(response_list)
|
||||
response = "".join(response_list)
|
||||
else:
|
||||
response = jsonify(response_list)
|
||||
#logging.debug(f"Search Response: {response}")
|
||||
@@ -781,7 +785,7 @@ def search():
|
||||
if arg_view == "plain":
|
||||
response = "<br>".join(response_list)
|
||||
elif arg_view == "rich":
|
||||
response = "<br>".join(response_list)
|
||||
response = "".join(response_list)
|
||||
else:
|
||||
response = jsonify(response_list)
|
||||
#logging.debug(f"Search Response: {response}")
|
||||
@@ -935,8 +939,10 @@ def sequential_read(start=0, num=1, uid=None, getuid=False):
|
||||
# only look at a small set of the oldest unused entries.
|
||||
seq_conn.commit()
|
||||
arg_view = request.args.get("view", None)
|
||||
if arg_view == "plain" or arg_view == "rich":
|
||||
if arg_view == "plain":
|
||||
response = "<br>".join(response_list)
|
||||
elif arg_view == "rich":
|
||||
response = "".join(response_list)
|
||||
else:
|
||||
response = jsonify(response_list)
|
||||
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
+24
-21
@@ -1,24 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bible Dictionary - KJV API</title>
|
||||
<link rel="stylesheet" href="/styles/page.css">
|
||||
<style>body{background-color:#1a1a1a}</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="/">Home</a> | <a href="/define">Dictionary</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> | <a href="/votd?view=rich">Verse of the Day</a>
|
||||
</header>
|
||||
<h2>Bible Dictionary</h2>
|
||||
<form action="/define">
|
||||
<label for='kw'>Word lookup</label><br>
|
||||
<input type="text" name="kw"><br><br>
|
||||
|
||||
<label for='view'>View<label><br>
|
||||
<input type="radio" name="view" value="rich" checked="checked">Rich<br>
|
||||
<input type="radio" name="view" value="plain">Plain<br>
|
||||
<input type="radio" name="view" value="json">JSON<br>
|
||||
|
||||
<input type="submit">
|
||||
<form>
|
||||
<label for='kw'>Word lookup</label>
|
||||
<input type="text" name="kw" placeholder="Enter a word to define...">
|
||||
<label for='view'>View</label>
|
||||
<input type="radio" name="view" value="rich" checked="checked"> Rich
|
||||
<input type="radio" name="view" value="plain"> Plain
|
||||
<input type="radio" name="view" value="json"> JSON
|
||||
<input type="submit" value="Define">
|
||||
</form>
|
||||
<p>This tool uses an abridged 1828 Noah Webster dictionary.</p>
|
||||
|
||||
<style>
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 768px;
|
||||
}
|
||||
a {
|
||||
color: #547720
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+19
-19
@@ -1,24 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Quick Search - KJV API</title>
|
||||
<link rel="stylesheet" href="/styles/page.css">
|
||||
<style>body{background-color:#1a1a1a}</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="/">Home</a> | <a href="/find">Quick Search</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> |
|
||||
<a href="/votd?view=rich">Verse of the Day</a></header>
|
||||
<a href="/votd?view=rich">Verse of the Day</a>
|
||||
</header>
|
||||
<h2>Quick Search</h2>
|
||||
<form action="/find">
|
||||
<label for='kw'>Query</label><br>
|
||||
<input type="text" name="kw"><br><br>
|
||||
|
||||
<input type="hidden" name="view" value="rich"><br>
|
||||
|
||||
<input type="submit">
|
||||
<form>
|
||||
|
||||
<style>
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 768px;
|
||||
}
|
||||
a {
|
||||
color: #547720
|
||||
}
|
||||
</style>
|
||||
<label for='kw'>Query</label>
|
||||
<input type="text" name="kw" placeholder="Enter verse reference or keywords...">
|
||||
<input type="hidden" name="view" value="rich">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+158
-53
@@ -1,77 +1,182 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<style>
|
||||
/* Dark Theme */
|
||||
body {
|
||||
background-color: #222;
|
||||
color: #fff;
|
||||
/* 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;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--color-bg-primary);
|
||||
color: var(--color-text-primary);
|
||||
margin: 0;
|
||||
padding: var(--space-xl);
|
||||
font-family: var(--font-ui);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Style the header */
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
font-size: 14.5pt;
|
||||
width: 768px;
|
||||
padding: 1px;
|
||||
margin-top: 15px;
|
||||
color: #fff; /* Text color */
|
||||
font-family: var(--font-ui);
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: var(--content-max-width);
|
||||
margin: 0 auto;
|
||||
padding: var(--space-lg);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--color-text-primary);
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: var(--space-lg);
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
form {
|
||||
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);
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: var(--space-sm);
|
||||
font-weight: 600;
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff; /* Link color */
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
.header {
|
||||
font-family: sans-serif;
|
||||
padding: 10px 16px;
|
||||
background: #333; /* Dark background */
|
||||
color: #fff; /* Text color */
|
||||
position: fixed;
|
||||
top: 5px;
|
||||
width: 768px;
|
||||
a:hover {
|
||||
color: var(--color-link-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
width: 75%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
font-size: 14.5pt;
|
||||
background-color: #333; /* Dark background */
|
||||
color: #fff; /* Text color */
|
||||
border: 1px solid #555; /* Border color */
|
||||
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=button], input[type=submit], input[type=reset] {
|
||||
font-family: sans-serif;
|
||||
background-color: #555; /* Dark button background */
|
||||
border: none;
|
||||
color: #fff; /* Button text color */
|
||||
padding: 16px 32px;
|
||||
text-decoration: none;
|
||||
margin: 4px 2px;
|
||||
cursor: pointer;
|
||||
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: #222;
|
||||
color: #fff;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-family: monospace;
|
||||
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;
|
||||
}
|
||||
|
||||
.definition {
|
||||
padding: 8px;
|
||||
font-family: sans-serif;
|
||||
font-size: 14.5pt;
|
||||
width: 768px;
|
||||
padding: 1px;
|
||||
color: #fff; /* Text color */
|
||||
background-color: #222; /* Dark background */
|
||||
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);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
form {
|
||||
padding: var(--space-lg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
+4
-1
@@ -1 +1,4 @@
|
||||
<b><a href="/find?kw={chapter}&view=rich">{passage}</a></b><br>{text}<br>
|
||||
<div class="verse-container">
|
||||
<div class="verse-reference"><a href="/find?kw={chapter}&view=rich">{passage}</a></div>
|
||||
<div class="verse-text">{text}</div>
|
||||
</div>
|
||||
|
||||
+25
-23
@@ -1,28 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bible Search - KJV API</title>
|
||||
<link rel="stylesheet" href="/styles/page.css">
|
||||
<style>body{background-color:#1a1a1a}</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="/">Home</a> | <a href="/find">Quick Search</a> | <a href="/search">Bible Search</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> | <a href="/votd?view=rich">Verse of the Day</a>
|
||||
</header>
|
||||
<h2>Bible Search</h2>
|
||||
<form action="/search">
|
||||
<label for='kw'>Key Words</label><br>
|
||||
<input type="text" name="kw"><br><br>
|
||||
|
||||
<label for='view'>View<label><br>
|
||||
<input type="radio" name="view" value="rich" checked="checked">Rich<br>
|
||||
<input type="radio" name="view" value="plain">Plain<br>
|
||||
<input type="radio" name="view" value="json">JSON<br>
|
||||
|
||||
<input type="submit">
|
||||
<form>
|
||||
|
||||
<label for='kw'>Key Words</label>
|
||||
<input type="text" name="kw" placeholder="Enter search keywords...">
|
||||
<label for='view'>View</label>
|
||||
<input type="radio" name="view" value="rich" checked="checked"> Rich
|
||||
<input type="radio" name="view" value="plain"> Plain
|
||||
<input type="radio" name="view" value="json"> JSON
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
<hr>
|
||||
<p>You can use standard search operators such as <b>AND</b>, <b>OR</b>, and <b>NOT</b>.</p>
|
||||
<p>Such as: "reprobate <b>NOT</b> silver".</p>
|
||||
<p>Multiple word queries without operators will be assumed to be AND.<p>
|
||||
|
||||
<style>
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 768px;
|
||||
}
|
||||
a {
|
||||
color: #547720
|
||||
}
|
||||
</style>
|
||||
<p>Multiple word queries without operators will be assumed to be AND.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+20
-32
@@ -1,40 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sequential Bible Viewer - KJV API</title>
|
||||
<link rel="stylesheet" href="/styles/page.css">
|
||||
<style>body{background-color:#1a1a1a}</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="/">Home</a> | <a href="/find">Quick Search</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> |
|
||||
<a href="/votd?view=rich">Verse of the Day</a></header>
|
||||
|
||||
<a href="/">Home</a> | <a href="/find">Quick Search</a> | <a href="/seq">Sequential Viewer</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> | <a href="/votd?view=rich">Verse of the Day</a>
|
||||
</header>
|
||||
<h2>Sequential Bible Viewer</h2>
|
||||
<p>In order to use this, you first need a UID, which you
|
||||
can get by querying /seq?getuid=true and optionally include
|
||||
&start=BIBLEREF (where BIBLEREF is like 1Cor2:1) to set
|
||||
a start position other than Genesis 1:1.</p>
|
||||
|
||||
<p>After you have your UID, this will keep track of where you
|
||||
are at. Query /seq?uid=YOURUID and optionally include
|
||||
&num=# (where # is an integer of how many verses you want to
|
||||
include from your current position at a time)</p>
|
||||
|
||||
<p>The &view= argument works with this.<p>
|
||||
|
||||
<p>In order to use this, you first need a UID, which you can get by querying <code>/seq?getuid=true</code> and optionally include <code>&start=BIBLEREF</code> (where BIBLEREF is like 1Cor2:1) to set a start position other than Genesis 1:1.</p>
|
||||
<p>After you have your UID, this will keep track of where you are at. Query <code>/seq?uid=YOURUID</code> and optionally include <code>&num=#</code> (where # is an integer of how many verses you want to include from your current position at a time)</p>
|
||||
<p>The <code>&view=</code> argument works with this.</p>
|
||||
<h4>Example Pleroma Bot shell script</h4>
|
||||
<pre>
|
||||
<code>
|
||||
#!/bin/sh
|
||||
<pre><code>#!/bin/sh
|
||||
verse=$(curl -XGET https://api.1611.social/seq?uid=MYUID?view=plain);
|
||||
curl -XPOST -u biblebot:MYPASSWORD \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"status": "'"${verse}"'"}' \
|
||||
https://my.fediverse.tld/api/v1/statuses;
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<style>
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 768px;
|
||||
}
|
||||
a {
|
||||
color: #547720
|
||||
}
|
||||
</style>
|
||||
</code></pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+27
-14
@@ -1,18 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Show Verse - KJV API</title>
|
||||
<link rel="stylesheet" href="/styles/page.css">
|
||||
<style>body{background-color:#1a1a1a}</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="/">Home</a> | <a href="/find">Quick Search</a> | <a href="/show">Show Verse</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> | <a href="/votd?view=rich">Verse of the Day</a>
|
||||
</header>
|
||||
<h2>Show Verse</h2>
|
||||
<form action="/show">
|
||||
<label for='kw'>Verse References</label><br>
|
||||
<input type="text" name="kw"><br><br>
|
||||
|
||||
<label for='view'>View<label><br>
|
||||
<input type="radio" name="view" value="rich" checked="checked">Rich<br>
|
||||
<input type="radio" name="view" value="plain">Plain<br>
|
||||
<input type="radio" name="view" value="json">JSON<br>
|
||||
|
||||
<input type="submit">
|
||||
<form>
|
||||
|
||||
<label for='kw'>Verse References</label>
|
||||
<input type="text" name="kw" placeholder="e.g., 1 John 5:7 or John3:16,2Peter2:1">
|
||||
<label for='view'>View</label>
|
||||
<input type="radio" name="view" value="rich" checked="checked"> Rich
|
||||
<input type="radio" name="view" value="plain"> Plain
|
||||
<input type="radio" name="view" value="json"> JSON
|
||||
<input type="submit" value="Show">
|
||||
</form>
|
||||
<hr>
|
||||
<p>You can try to search a Bible reference in this box, such as "1 John 5:7".</p>
|
||||
<p>You can search a Bible reference in this box, such as "1 John 5:7".</p>
|
||||
<p>You can use abbreviations, but you may not get the result you are looking for.</p>
|
||||
<p>Use a dash for the verse to get the entire chapter, eg. "John 3:-"<p>
|
||||
<p>You may return multiple verse groups by using a comma, eg. "John3:16,2Peter2:1"</p>
|
||||
<p>Use a dash for the verse to get the entire chapter, e.g., "John 3:-"</p>
|
||||
<p>You may return multiple verse groups by using a comma, e.g., "John3:16,2Peter2:1"</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+41
-12
@@ -1,25 +1,54 @@
|
||||
/* Style the button that is used to open and close the collapsible content */
|
||||
/* Modern Collapsible Styling */
|
||||
|
||||
.collapsible {
|
||||
background-color: #eee;
|
||||
color: #444;
|
||||
background-color: #2f2f2f;
|
||||
color: #e8e8e8;
|
||||
cursor: pointer;
|
||||
padding: 18px;
|
||||
padding: 1rem 1.25rem;
|
||||
width: 100%;
|
||||
border: none;
|
||||
max-width: 820px;
|
||||
border: 2px solid #3a3a3a;
|
||||
border-radius: 4px;
|
||||
text-align: left;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
|
||||
margin: 0.5rem auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
|
||||
.active, .collapsible:hover {
|
||||
background-color: #ccc;
|
||||
.collapsible:hover {
|
||||
background-color: #3a3a3a;
|
||||
border-color: #6b9bd1;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Style the collapsible content. Note: hidden by default */
|
||||
.collapsible.active {
|
||||
background-color: #6b9bd1;
|
||||
color: #1a1a1a;
|
||||
border-color: #6b9bd1;
|
||||
}
|
||||
|
||||
.collapsible.active:hover {
|
||||
background-color: #85aede;
|
||||
border-color: #85aede;
|
||||
}
|
||||
|
||||
/* Collapsible content styling */
|
||||
.content {
|
||||
padding: 0 18px;
|
||||
padding: 0 1.25rem;
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
background-color: #f1f1f1;
|
||||
background-color: #252525;
|
||||
max-width: 820px;
|
||||
margin: 0 auto 0.5rem;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #3a3a3a;
|
||||
}
|
||||
|
||||
.content.show {
|
||||
display: block;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
+259
-54
@@ -1,70 +1,275 @@
|
||||
<style>
|
||||
/* Dark Theme */
|
||||
/* Modern KJV API Styling - Header & Layout */
|
||||
|
||||
:root {
|
||||
/* Color Palette */
|
||||
--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);
|
||||
|
||||
/* Typography */
|
||||
--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;
|
||||
|
||||
/* Spacing */
|
||||
--space-xs: 0.25rem;
|
||||
--space-sm: 0.5rem;
|
||||
--space-md: 1rem;
|
||||
--space-lg: 1.5rem;
|
||||
--space-xl: 2rem;
|
||||
--space-2xl: 3rem;
|
||||
|
||||
/* Layout */
|
||||
--content-max-width: 820px;
|
||||
--header-height: 160px;
|
||||
--border-radius: 8px;
|
||||
--border-radius-sm: 4px;
|
||||
|
||||
/* Transitions */
|
||||
--transition-fast: 150ms ease;
|
||||
--transition-normal: 250ms ease;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #222;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Style the header */
|
||||
.responses {
|
||||
font-family: sans-serif;
|
||||
font-size: 14.5pt;
|
||||
width: 768px;
|
||||
padding: 1px;
|
||||
margin-top: 100px;
|
||||
color: #fff; /* Text color */
|
||||
width: auto;
|
||||
max-width: 100%; /* Ensure it doesn't exceed the container width */
|
||||
white-space: pre-wrap; /* Allow word wrapping */
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff; /* Link color */
|
||||
background-color: var(--color-bg-primary);
|
||||
color: var(--color-text-primary);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: var(--font-ui);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Header Styling */
|
||||
.header {
|
||||
font-family: sans-serif;
|
||||
padding: 10px 16px;
|
||||
background: #333; /* Dark background */
|
||||
color: #fff; /* Text color */
|
||||
position: fixed;
|
||||
top: 5px;
|
||||
width: 98vw;
|
||||
max-width: 100%; /* Ensure it doesn't exceed the container width */
|
||||
min-height: 50px;
|
||||
font-family: var(--font-ui);
|
||||
padding: var(--space-lg);
|
||||
background: linear-gradient(to bottom, var(--color-bg-secondary), var(--color-bg-tertiary));
|
||||
color: var(--color-text-primary);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
box-shadow: 0 4px 12px var(--color-shadow);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.header a {
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
padding: var(--space-xs) var(--space-sm);
|
||||
transition: color var(--transition-fast);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.header a:hover {
|
||||
color: var(--color-link-hover);
|
||||
}
|
||||
|
||||
/* Response Container */
|
||||
.responses {
|
||||
font-family: var(--font-scripture);
|
||||
font-size: 1.125rem;
|
||||
line-height: 1.8;
|
||||
max-width: var(--content-max-width);
|
||||
margin: 0 auto;
|
||||
padding: var(--space-md);
|
||||
margin-top: var(--header-height);
|
||||
color: var(--color-text-primary);
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* Results Count */
|
||||
.results-count {
|
||||
font-family: var(--font-ui);
|
||||
font-size: 0.9rem;
|
||||
color: var(--color-text-muted);
|
||||
margin-bottom: var(--space-md);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
a {
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--color-link-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Form Inputs */
|
||||
input[type=text] {
|
||||
width: 75%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
font-size: 14.5pt;
|
||||
background-color: #333; /* Dark background */
|
||||
color: #fff; /* Text color */
|
||||
border: 1px solid #555; /* Border color */
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
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=button], input[type=submit], input[type=reset] {
|
||||
font-family: sans-serif;
|
||||
background-color: #555; /* Dark button background */
|
||||
border: none;
|
||||
color: #fff; /* Button text color */
|
||||
padding: 16px 32px;
|
||||
text-decoration: none;
|
||||
margin: 4px 2px;
|
||||
cursor: pointer;
|
||||
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=text]::placeholder {
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
input[type=button],
|
||||
input[type=submit],
|
||||
input[type=reset],
|
||||
button {
|
||||
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-xs) var(--space-sm);
|
||||
cursor: pointer;
|
||||
border-radius: var(--border-radius-sm);
|
||||
transition: background-color var(--transition-fast), transform var(--transition-fast);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
input[type=button]:hover,
|
||||
input[type=submit]:hover,
|
||||
input[type=reset]:hover,
|
||||
button:hover {
|
||||
background-color: var(--color-accent-hover);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
input[type=button]:active,
|
||||
input[type=submit]:active,
|
||||
input[type=reset]:active,
|
||||
button:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* Definition Styling */
|
||||
.definition {
|
||||
padding: 8px;
|
||||
font-family: sans-serif;
|
||||
font-size: 14.5pt;
|
||||
width: 768px;
|
||||
padding: 1px;
|
||||
color: #fff; /* Text color */
|
||||
background-color: #222; /* Dark background */
|
||||
padding: var(--space-lg);
|
||||
font-family: var(--font-scripture);
|
||||
font-size: 1.05rem;
|
||||
line-height: 1.7;
|
||||
max-width: var(--content-max-width);
|
||||
margin: var(--space-md) auto;
|
||||
color: var(--color-text-secondary);
|
||||
background-color: var(--color-bg-secondary);
|
||||
border-left: 4px solid var(--color-accent-primary);
|
||||
border-radius: var(--border-radius-sm);
|
||||
}
|
||||
|
||||
/* Verse Container Styling */
|
||||
.verse-container {
|
||||
background-color: var(--color-bg-secondary);
|
||||
border-left: 3px solid var(--color-accent-primary);
|
||||
border-radius: var(--border-radius-sm);
|
||||
padding: 0.75rem 1.25rem;
|
||||
margin: 0.5rem 0;
|
||||
transition: background-color var(--transition-fast), border-color var(--transition-fast);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.verse-container:hover {
|
||||
background-color: var(--color-bg-tertiary);
|
||||
border-left-color: var(--color-accent-hover);
|
||||
}
|
||||
|
||||
.verse-reference {
|
||||
font-family: var(--font-ui);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--color-text-secondary);
|
||||
line-height: 1.2;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.verse-reference a {
|
||||
color: var(--color-accent-primary);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
.verse-reference a:hover {
|
||||
color: var(--color-accent-hover);
|
||||
}
|
||||
|
||||
.verse-text {
|
||||
font-family: var(--font-scripture);
|
||||
font-size: 1.15rem;
|
||||
line-height: 1.8;
|
||||
color: var(--color-text-primary);
|
||||
text-indent: 0;
|
||||
margin: 0.35rem 0 0 0;
|
||||
padding: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
:root {
|
||||
--header-height: 180px;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: var(--space-md);
|
||||
}
|
||||
|
||||
.responses {
|
||||
font-size: 1rem;
|
||||
padding: var(--space-md);
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.header a {
|
||||
font-size: 0.9rem;
|
||||
padding: var(--space-xs);
|
||||
}
|
||||
|
||||
input[type=button],
|
||||
input[type=submit],
|
||||
input[type=reset],
|
||||
button {
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,10 +1,66 @@
|
||||
<style>
|
||||
.testhtml{
|
||||
font-family: sans-serif;
|
||||
font-size: 14.5pt;
|
||||
width: 768px;
|
||||
<style>
|
||||
/* Modern KJV API Styling - Human Readable */
|
||||
|
||||
:root {
|
||||
/* Color Palette */
|
||||
--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);
|
||||
|
||||
/* Typography */
|
||||
--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;
|
||||
|
||||
/* Spacing */
|
||||
--space-xs: 0.25rem;
|
||||
--space-sm: 0.5rem;
|
||||
--space-md: 1rem;
|
||||
--space-lg: 1.5rem;
|
||||
--space-xl: 2rem;
|
||||
--space-2xl: 3rem;
|
||||
|
||||
/* Layout */
|
||||
--content-max-width: 820px;
|
||||
--border-radius: 8px;
|
||||
--border-radius-sm: 4px;
|
||||
|
||||
/* Transitions */
|
||||
--transition-fast: 150ms ease;
|
||||
--transition-normal: 250ms ease;
|
||||
}
|
||||
|
||||
.testhtml {
|
||||
font-family: var(--font-scripture);
|
||||
font-size: 1.125rem;
|
||||
line-height: 1.75;
|
||||
max-width: var(--content-max-width);
|
||||
margin: 0 auto;
|
||||
padding: var(--space-md);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #547720
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--color-link-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: var(--color-accent-primary);
|
||||
}
|
||||
</style>
|
||||
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
/* Shared Page Styling for Simple Pages */
|
||||
|
||||
:root {
|
||||
--color-bg-primary: #1a1a1a;
|
||||
--color-bg-secondary: #252525;
|
||||
--color-text-primary: #e8e8e8;
|
||||
--color-text-secondary: #b8b8b8;
|
||||
--color-accent-primary: #6b9bd1;
|
||||
--color-accent-hover: #85aede;
|
||||
--color-link: #6b9bd1;
|
||||
--color-link-hover: #85aede;
|
||||
--color-border: #3a3a3a;
|
||||
--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
--border-radius-sm: 4px;
|
||||
--border-radius: 8px;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html, body {
|
||||
background-color: var(--color-bg-primary);
|
||||
color: var(--color-text-primary);
|
||||
margin: 0;
|
||||
padding: 1.5rem;
|
||||
font-family: var(--font-ui);
|
||||
line-height: 1.6;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
max-width: 820px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
color: var(--color-text-primary);
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
border-bottom: 2px solid var(--color-border);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
transition: color 150ms ease;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--color-link-hover);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
form {
|
||||
background-color: var(--color-bg-secondary);
|
||||
padding: 1.5rem;
|
||||
border-radius: var(--border-radius);
|
||||
border: 1px solid var(--color-border);
|
||||
margin: 1.5rem 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
margin: 0.5rem 0 1rem 0;
|
||||
font-size: 1rem;
|
||||
font-family: var(--font-ui);
|
||||
background-color: var(--color-bg-primary);
|
||||
color: var(--color-text-primary);
|
||||
border: 2px solid var(--color-border);
|
||||
border-radius: var(--border-radius-sm);
|
||||
transition: border-color 150ms ease;
|
||||
}
|
||||
|
||||
input[type=text]:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-accent-primary);
|
||||
}
|
||||
|
||||
input[type=radio] {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
input[type=submit], button {
|
||||
background-color: var(--color-accent-primary);
|
||||
color: var(--color-bg-primary);
|
||||
border: none;
|
||||
padding: 0.75rem 1.5rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
border-radius: var(--border-radius-sm);
|
||||
cursor: pointer;
|
||||
transition: background-color 150ms ease, transform 150ms ease;
|
||||
}
|
||||
|
||||
input[type=submit]:hover, button:hover {
|
||||
background-color: var(--color-accent-hover);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px solid var(--color-border);
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1rem 0;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
b, strong {
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
@@ -10,9 +10,13 @@ def check_sanity():
|
||||
|
||||
|
||||
def check_database_permissions():
|
||||
from os.path import exists
|
||||
dependancies = ['data/seq.db', "data/shortcodes.db"]
|
||||
current_uid = getuid()
|
||||
for dependancy in dependancies:
|
||||
# Skip check if file doesn't exist yet - SQLite will create it on first use
|
||||
if not exists(dependancy):
|
||||
continue
|
||||
if stat(dependancy).st_uid != current_uid:
|
||||
raise PermissionError(dependancy)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user