Compare commits

...

2 Commits

Author SHA1 Message Date
bbce8c6f86 Map page updates, overall footer 2020-11-14 19:06:57 -06:00
f7c0f7d001 Link to Autarch treasure generator 2020-11-13 10:20:56 -06:00
10 changed files with 162 additions and 70 deletions

View File

@ -153,7 +153,9 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% else %}
<div class="uk-grid-medium uk-grid-match uk-flex-center" uk-grid>
</div>
{% endif %} {% endif %}
<div id="spell-modal" uk-modal> <div id="spell-modal" uk-modal>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

BIN
acks/static/home_image.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 KiB

View File

@ -1,15 +1,16 @@
{% set navigation_bar = [ {% set navigation_bar = [
('/', 'index', 'Home'), ('/', 'index', 'Home'),
('/handbook', 'handbook', 'Handbook'), ('/handbook', 'handbook', 'Handbook'),
('/worldmap', 'worldmap', 'World Map'), ('/worldmap', 'worldmap', 'Maps'),
('', 'generate', 'Generate'), ('.header', 'generate', 'Generate'),
('.header', 'other', 'Other'),
('/npc/spells', 'spells', 'Spells'), ('/npc/spells', 'spells', 'Spells'),
('/api/schema', 'api', 'API'), ('/api/schema', 'api', 'API'),
] %} ] %}
{% set generation_bar = [ {% set generation_bar = [
('/npc/party', 'npcparty', 'NPC Party'), ('/npc/party', 'npcparty', 'NPC Party'),
('/npc/single', 'npcsingle', 'Single NPC'), ('/npc/single', 'npcsingle', 'Single NPC'),
('/treasure', 'treasure', 'Treasure'), ('http://autarch.co/treasure', 'treasure', 'Treasure'),
] %} ] %}
{% set active_page = active_page|default('index') %} {% set active_page = active_page|default('index') %}
@ -47,13 +48,19 @@
<div class="uk-navbar-dropdown"> <div class="uk-navbar-dropdown">
<ul class="uk-nav uk-navbar-dropdown-nav"> <ul class="uk-nav uk-navbar-dropdown-nav">
{% for ghref, gid, glabel in generation_bar %} {% for ghref, gid, glabel in generation_bar %}
<li><a href="{{ ghref | e }}">{{ glabel|e }}</a></li> <li>
<a href="{{ ghref | e }}" {% if gid == 'treasure' %}target="_blank"{% endif %}>
{{ glabel|e }}
</a>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% else %} {% else %}
{% if href != '.header' %}
<a href="{{ href|e }}">{{ label|e }}</a> <a href="{{ href|e }}">{{ label|e }}</a>
{% endif %} {% endif %}
{% endif %}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
@ -63,26 +70,34 @@
<div class="uk-offcanvas-bar uk-flex uk-flex-column"> <div class="uk-offcanvas-bar uk-flex uk-flex-column">
<ul class="uk-nav uk-nav-primary uk-nav-center uk-margin-auto-vertical"> <ul class="uk-nav uk-nav-primary uk-nav-center uk-margin-auto-vertical">
{% for href, id, label in navigation_bar %} {% for href, id, label in navigation_bar %}
<li {% if id == active_page %} class="uk-active" {% endif %}> {% if href == '.header' %}
<li class="uk-nav-header">{{ label|e }}</li>
{% if id == 'generate' %} {% if id == 'generate' %}
<a href="">{{ label |e }}</a>
<div class="uk-navbar-dropdown">
<ul class="uk-nav uk-navbar-dropdown-nav">
{% for ghref, gid, glabel in generation_bar %} {% for ghref, gid, glabel in generation_bar %}
<li><a href="{{ ghref | e }}">{{ glabel|e }}</a></li> <li {% if gid == active_page %} class="uk-active" {% endif %}>
{% endfor %} <a href="{{ ghref | e }}" {% if gid == 'treasure' %}target="_blank"{% endif %}>
</ul> {{ glabel|e }}
</div> </a>
{% else %}
<a href="{{ href|e }}">{{ label|e }}</a>
{% endif %}
</li> </li>
{% endfor %} {% endfor %}
{% endif %}
{% else %}
<li {% if id == active_page %} class="uk-active" {% endif %}>
<a href="{{ href|e }}">{{ label|e }}</a>
</li>
{% endif %}
{% endfor %}
</ul> </ul>
</div> </div>
</div> </div>
<div class="uk-container"> <div class="uk-container uk-margin-medium-top">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
<footer class="uk-flex uk-flex-top uk-flex-center uk-margin-small uk-margin-medium-top">
<div class="uk-text-center uk-text-small">
Made by <a href="https://binaryatrocity.name">binaryatrocity</a>.
ACKS &amp; related &copy; <a href="http://www.autarch.co/">Autarch</a>.
</div>
</footer>
</body> </body>
</html> </html>

View File

@ -6,6 +6,26 @@
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Home</h1> <h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Home</h1>
</div> </div>
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-medium uk-margin-large-bottom">
<div class="uk-container uk-container-small">
<p>
Welcome to the Adventurer Conqueror King toolkit for the Legends of Palisma campaign.
You've had a long journey... three months aboard a ship to reach the new continent,
many thousands of miles across the Immortal Sea from Branborne and any sense of familiarity.
</p>
<p>
What adventures await you in an age when empires totter on the brink of war, and terrible
monsters tear at the fragile borderlands of men; when decaying cities teem with chaos and
corruption, where nubile maidens are sacrificed to chthonic cults and nobles live in
decadent pleasure on the toil of slaves; when heroes, wizards, and rogues risk everything
in pursuit of glory, fortune, and power. These are days when adventurers can become
conquerors… and conquerors can become kings!
</p>
<hr class="uk-divider-icon uk-margin-large" />
<img src="{{ url_for('static', filename='home_image.jpg') }}" />
</div>
</div>
{% endblock %} {% endblock %}
{% block head %} {% block head %}

View File

@ -27,6 +27,10 @@
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Treasure Generator</h1> <h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Treasure Generator</h1>
</div> </div>
<div id="frame-container">
<iframe id="treasure-frame" src="http://autarch.co/treasure"/>
</div>
<!--
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom"> <div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
<div> <div>
<label for="treasure-type" class="uk-form-label">Select Treasure Type</label> <label for="treasure-type" class="uk-form-label">Select Treasure Type</label>
@ -48,10 +52,23 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
-->
{% endblock %} {% endblock %}
{% block head %} {% block head %}
<style> <style>
#frame-container {
display: flex;
width: 100%;
height: 85vh;
flex-direction: column:
}
#treasure-frame {
flex-grow: 1;
border: none;
margin: 0;
padding: 0;
}
h1 strong { h1 strong {
display: block; display: block;
font-size: 50%; font-size: 50%;

View File

@ -1,14 +1,23 @@
{% extends "base.html" %} {% extends "base.html" %}
{% set active_page = "worldmap" %} {% set active_page = "worldmap" %}
{% block title %}World Map{% endblock %} {% block title %}Maps{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>World Map</h1> <h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Maps</h1>
</div> </div>
<br/> <br/>
<div> <div class="uk-container uk-container-small">
<img id="worldmap-img" src="https://acks.atr0phy.net/static/WorldMap.png"/> <ul class="uk-subnav uk-subnav-pill uk-flex uk-flex-center" uk-switcher>
<li><a href="#">World Map</a></li>
<li><a href="#">Continent Overview</a></li>
<li><a href="#">Continent Full</a></li>
</ul>
<ul class="uk-switcher uk-margin" uk-lightbox>
<li><a href="{{ url_for('static', filename='WorldMap.png') }}"><img src="{{ url_for('static', filename='WorldMap.png') }}"/></a></li>
<li><a href="{{ url_for('static', filename='PalismaWorld.png') }}"><img src="{{ url_for('static', filename='PalismaWorld.png') }}"/></a></li>
<li><a href="{{ url_for('static', filename='PalismaContinent.png') }}"><img src="{{ url_for('static', filename='PalismaContinent.png') }}"/></a></li>
</ul>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,4 +1,3 @@
import requests
from flask import current_app, Blueprint, render_template, url_for, redirect from flask import current_app, Blueprint, render_template, url_for, redirect
@ -6,8 +5,7 @@ default_views = Blueprint('default_views', __name__, url_prefix='/')
@default_views.route('/') @default_views.route('/')
def index(): def index():
return redirect(url_for('npc_views.generate_npc_party')) return render_template('index.html')
# return render_template('index.html')
@default_views.route('/handbook') @default_views.route('/handbook')
def handbook(): def handbook():
@ -17,17 +15,29 @@ def handbook():
def worldmap(): def worldmap():
return render_template('worldmap.html') return render_template('worldmap.html')
@default_views.route('/treasure') #@default_views.route('/treasure')
@default_views.route('/treasure/<string:treasure_type>') #@default_views.route('/treasure/<string:treasure_type>')
def treasure(treasure_type=None): def treasure(treasure_type=None):
# import requests
# from lxml import html
# Unused, we can't tap into Autarch's generator, so just link to a new tab
# in navigation bar now
if treasure_type is not None: if treasure_type is not None:
with requests.Session() as s:
# First grab the page to pull a fresh form_build_id
treasure_page = s.get('http://autarch.co/treasure')
dom_tree = html.fromstring(treasure_page.content)
form_build_id = dom_tree.find('.//input[@name="form_build_id"]').attrib['value']
# Use that form_build_id to make a request for generated treasure
headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'} headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}
payload = { payload = {
"treasure_type": treasure_type,
"form_id": "acks_treasure_form", "form_id": "acks_treasure_form",
"form_build_id": "form-PqO-1VglfW4Q3x1fm7HMewhLFjst2oxY5AR_m6WOGBg" "form_build_id": form_build_id,
"treasure_type": treasure_type
} }
response = requests.request("POST", "http://autarch.co/system/ajax", data=payload, headers=headers) response = s.post("http://autarch.co/system/ajax", data=payload, headers=headers)
print("TG Response: {}, Payload: {}".format(response.text, payload))
generated_treasure = response.json()[1]["data"].replace('class="form-textarea"', 'class="uk-textarea"') generated_treasure = response.json()[1]["data"].replace('class="form-textarea"', 'class="uk-textarea"')
return render_template('treasure.html', generated_treasure=generated_treasure, treasure_type=treasure_type) return render_template('treasure.html', generated_treasure=generated_treasure, treasure_type=treasure_type)
return render_template('treasure.html') return render_template('treasure.html')

View File

@ -1,18 +1,37 @@
ansi2html==1.5.2 alembic==1.3.1
cryptography==1.7.1 aniso8601==8.0.0
culour==0.1 attrs==19.3.0
enum34==1.1.6 blinker==1.4
idna==2.2 certifi==2019.11.28
ipaddress==1.0.17 chardet==3.0.4
keyring==10.1 Click==7.0
keyrings.alt==1.3 Flask==1.1.1
pudb==2018.1 Flask-Admin==1.5.4
pyasn1==0.1.9 Flask-Potion==0.16.0
pycrypto==2.6.1 Flask-SQLAlchemy==2.4.1
Pygments==2.3.1 idna==2.8
pygobject==3.22.0 importlib-metadata==1.1.0
pyxdg==0.25 itsdangerous==1.1.0
SecretStorage==2.3.1 Jinja2==2.10.1
six==1.12.0 jsonschema==3.2.0
urwid==2.0.1 lxml==4.6.1
virtualenv==16.6.1 Mako==1.1.0
MarkupSafe==1.1.1
more-itertools==8.0.0
pkg-resources==0.0.0
pudb==2019.2
Pygments==2.5.2
pyrsistent==0.15.6
python-dateutil==2.8.1
python-editor==1.0.4
requests==2.22.0
rfc3987==1.3.8
six==1.13.0
SQLAlchemy==1.3.11
strict-rfc3339==0.7
urllib3==1.25.7
urwid==2.1.0
uWSGI==2.0.18
Werkzeug==0.16.0
WTForms==2.2.1
zipp==0.6.0