Compare commits

..

No commits in common. "bbce8c6f86150c9f321865bdd842c08bfb3c87f7" and "d00d53f3042a6a9acc32fbf5e6aec20223574639" have entirely different histories.

10 changed files with 70 additions and 162 deletions

View File

@ -153,9 +153,7 @@
</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.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 KiB

View File

@ -1,16 +1,15 @@
{% set navigation_bar = [ {% set navigation_bar = [
('/', 'index', 'Home'), ('/', 'index', 'Home'),
('/handbook', 'handbook', 'Handbook'), ('/handbook', 'handbook', 'Handbook'),
('/worldmap', 'worldmap', 'Maps'), ('/worldmap', 'worldmap', 'World Map'),
('.header', 'generate', 'Generate'), ('', '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'),
('http://autarch.co/treasure', 'treasure', 'Treasure'), ('/treasure', 'treasure', 'Treasure'),
] %} ] %}
{% set active_page = active_page|default('index') %} {% set active_page = active_page|default('index') %}
@ -42,62 +41,48 @@
<div class="uk-navbar-center uk-visible@m"> <div class="uk-navbar-center uk-visible@m">
<ul class="uk-navbar-nav"> <ul class="uk-navbar-nav">
{% for href, id, label in navigation_bar %} {% for href, id, label in navigation_bar %}
<li {% if id == active_page %} class="uk-active" {% endif %}> <li {% if id == active_page %} class="uk-active" {% endif %}>
{% if id == 'generate' %} {% if id == 'generate' %}
<a href="">{{ label |e }}</a> <a href="">{{ label |e }}</a>
<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> <li><a href="{{ ghref | e }}">{{ glabel|e }}</a></li>
<a href="{{ ghref | e }}" {% if gid == 'treasure' %}target="_blank"{% endif %}> {% endfor %}
{{ glabel|e }} </ul>
</a> </div>
</li>
{% endfor %}
</ul>
</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>
</div> </div>
</nav> </nav>
<div id="offcanvas-nav" uk-offcanvas="overlay: true"> <div id="offcanvas-nav" uk-offcanvas="overlay: true">
<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 %}
{% if href == '.header' %}
<li class="uk-nav-header">{{ label|e }}</li>
{% if id == 'generate' %}
{% for ghref, gid, glabel in generation_bar %}
<li {% if gid == active_page %} class="uk-active" {% endif %}>
<a href="{{ ghref | e }}" {% if gid == 'treasure' %}target="_blank"{% endif %}>
{{ glabel|e }}
</a>
</li>
{% endfor %}
{% endif %}
{% else %}
<li {% if id == active_page %} class="uk-active" {% endif %}> <li {% if id == active_page %} class="uk-active" {% endif %}>
{% 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 %}
<li><a href="{{ ghref | e }}">{{ glabel|e }}</a></li>
{% endfor %}
</ul>
</div>
{% else %}
<a href="{{ href|e }}">{{ label|e }}</a> <a href="{{ href|e }}">{{ label|e }}</a>
</li>
{% endif %} {% endif %}
{% endfor %} </li>
</ul> {% endfor %}
</div> </ul>
</div> </div>
<div class="uk-container uk-margin-medium-top"> </div>
{% block content %}{% endblock %} <div class="uk-container">
{% 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,26 +6,6 @@
<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,10 +27,6 @@
<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>
@ -52,23 +48,10 @@
</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,23 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% set active_page = "worldmap" %} {% set active_page = "worldmap" %}
{% block title %}Maps{% endblock %} {% block title %}World Map{% 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>Maps</h1> <h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>World Map</h1>
</div> </div>
<br/> <br/>
<div class="uk-container uk-container-small"> <div>
<ul class="uk-subnav uk-subnav-pill uk-flex uk-flex-center" uk-switcher> <img id="worldmap-img" src="https://acks.atr0phy.net/static/WorldMap.png"/>
<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,3 +1,4 @@
import requests
from flask import current_app, Blueprint, render_template, url_for, redirect from flask import current_app, Blueprint, render_template, url_for, redirect
@ -5,7 +6,8 @@ default_views = Blueprint('default_views', __name__, url_prefix='/')
@default_views.route('/') @default_views.route('/')
def index(): def index():
return render_template('index.html') return redirect(url_for('npc_views.generate_npc_party'))
# return render_template('index.html')
@default_views.route('/handbook') @default_views.route('/handbook')
def handbook(): def handbook():
@ -15,29 +17,17 @@ 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: headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}
# First grab the page to pull a fresh form_build_id payload = {
treasure_page = s.get('http://autarch.co/treasure') "treasure_type": treasure_type,
dom_tree = html.fromstring(treasure_page.content) "form_id": "acks_treasure_form",
form_build_id = dom_tree.find('.//input[@name="form_build_id"]').attrib['value'] "form_build_id": "form-PqO-1VglfW4Q3x1fm7HMewhLFjst2oxY5AR_m6WOGBg"
}
# Use that form_build_id to make a request for generated treasure response = requests.request("POST", "http://autarch.co/system/ajax", data=payload, headers=headers)
headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'} generated_treasure = response.json()[1]["data"].replace('class="form-textarea"', 'class="uk-textarea"')
payload = { return render_template('treasure.html', generated_treasure=generated_treasure, treasure_type=treasure_type)
"form_id": "acks_treasure_form",
"form_build_id": form_build_id,
"treasure_type": treasure_type
}
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"')
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,37 +1,18 @@
alembic==1.3.1 ansi2html==1.5.2
aniso8601==8.0.0 cryptography==1.7.1
attrs==19.3.0 culour==0.1
blinker==1.4 enum34==1.1.6
certifi==2019.11.28 idna==2.2
chardet==3.0.4 ipaddress==1.0.17
Click==7.0 keyring==10.1
Flask==1.1.1 keyrings.alt==1.3
Flask-Admin==1.5.4 pudb==2018.1
Flask-Potion==0.16.0 pyasn1==0.1.9
Flask-SQLAlchemy==2.4.1 pycrypto==2.6.1
idna==2.8 Pygments==2.3.1
importlib-metadata==1.1.0 pygobject==3.22.0
itsdangerous==1.1.0 pyxdg==0.25
Jinja2==2.10.1 SecretStorage==2.3.1
jsonschema==3.2.0 six==1.12.0
lxml==4.6.1 urwid==2.0.1
Mako==1.1.0 virtualenv==16.6.1
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