initial commit

This commit is contained in:
2025-12-19 18:27:11 +09:00
commit 1f8fd99d25
9 changed files with 286 additions and 0 deletions

30
main.py Normal file
View File

@@ -0,0 +1,30 @@
import datetime
import flask
from flask import render_template, request
from modules.clocks import crt
app = flask.Flask(__name__)
clock = crt.CRTClock(R=((1, 0, 0), (0, 1, 0), (0, 0, 1)))
@app.route("/")
def index():
return render_template("index.html")
@app.route("/color")
def get_color():
global clock
now = datetime.datetime.now()
color = clock.transform(now)
r = int(color[0] * 255)
g = int(color[1] * 255)
b = int(color[2] * 255)
return flask.jsonify({"color": f"rgb({r}, {g}, {b})"})
if __name__ == "__main__":
app.run(debug=True)