added a bunch of to-dos. tried to make the base_board update automatically on launch of routes.py, added a bunch of to-dos to make it into a cool product
This commit is contained in:
BIN
boards (MacBook Pro's conflicted copy 2017-11-14).db
Normal file
BIN
boards (MacBook Pro's conflicted copy 2017-11-14).db
Normal file
Binary file not shown.
BIN
boards (Zev’s MacBook Pro's conflicted copy 2017-12-16).db
Normal file
BIN
boards (Zev’s MacBook Pro's conflicted copy 2017-12-16).db
Normal file
Binary file not shown.
11
config.py
11
config.py
@@ -5,21 +5,24 @@ config = dict(num_squares=312)
|
||||
|
||||
colors = [
|
||||
'red',
|
||||
'blue',
|
||||
'#0000FF',
|
||||
'#CF5300',
|
||||
'#0000CC',
|
||||
'yellow',
|
||||
'green',
|
||||
'#2C2416',
|
||||
'black',
|
||||
'#1A1B29',
|
||||
'#333333',
|
||||
'#F98D8D',
|
||||
'orange',
|
||||
'#1A1B29',
|
||||
'#000080',
|
||||
'#333333',
|
||||
'#CF5300',
|
||||
'#8B0000',
|
||||
'#FFCE00',
|
||||
'#006400',
|
||||
'#CA278C',
|
||||
'#3B0160',
|
||||
'#9370DB',
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -83,6 +83,12 @@ def prep_colors_for_table(some_colors):
|
||||
return palette
|
||||
|
||||
|
||||
def update_base_table():
|
||||
base_board = get_board()
|
||||
base_board.palette = ''.join(colors)
|
||||
session.commit()
|
||||
|
||||
|
||||
base_board = get_board(name='') or create_board('', '00' * num_squares, colors)
|
||||
|
||||
# each number is represented by a two-digit integer string
|
||||
|
||||
19
routes.py
19
routes.py
@@ -5,13 +5,29 @@ from flask import Flask, render_template, request, jsonify, redirect, url_for
|
||||
|
||||
from config import config
|
||||
from models import session, get_color_num_dict, base_board, colors, color_num_dict, get_board, get_boards, \
|
||||
create_board
|
||||
create_board, update_base_table
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
num_squares = config['num_squares']
|
||||
|
||||
|
||||
# TODO: export an animtated gif of the progress of a piece
|
||||
# TODO: fix loading/saving
|
||||
# TODO: add undo/redo
|
||||
# TODO: add Eno-like soothing tones when you tap a box
|
||||
# TODO: make selected color slightly larger
|
||||
# TODO: dislpay filename
|
||||
# TODO: allow renaming
|
||||
# TODO: allow live view of progress via web/app
|
||||
|
||||
# not related to the app
|
||||
# TODO: make simon.averba.ch and put his art up there because he wants to "send it to everybody in the world"
|
||||
# TODO: make sylvia.averba.ch and put his art up there because he wants to "send it to everybody in the world"
|
||||
# TODO: make abi.averba.ch and put his art up there because he wants to "send it to everybody in the world"
|
||||
# TODO: use IFPS for the above
|
||||
|
||||
|
||||
|
||||
@app.route('/<board_name>')
|
||||
def main_board(board_name=None):
|
||||
@@ -21,6 +37,7 @@ def main_board(board_name=None):
|
||||
|
||||
@app.route('/')
|
||||
def main():
|
||||
update_base_table()
|
||||
return render_template('100_blocks.html',
|
||||
all_boards=get_boards(),
|
||||
board=base_board)
|
||||
|
||||
Reference in New Issue
Block a user