diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/api.py | 27 | ||||
| -rw-r--r-- | templates/index.html | 37 | ||||
| -rw-r--r-- | templates/live_preview.py | 14 | ||||
| -rw-r--r-- | templates/page/notes.html | 24 | ||||
| -rw-r--r-- | templates/page/overview.html | 29 | ||||
| -rw-r--r-- | templates/page/recourses.html | 29 | ||||
| -rw-r--r-- | templates/page/speech.html | 29 | ||||
| -rw-r--r-- | templates/static/main.mjs | 13 | ||||
| -rw-r--r-- | templates/static/styles.css | 101 |
9 files changed, 303 insertions, 0 deletions
diff --git a/templates/api.py b/templates/api.py new file mode 100644 index 0000000..b04ef77 --- /dev/null +++ b/templates/api.py | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | from flask import Flask, request, jsonify, render_template | ||
| 2 | |||
| 3 | app = Flask(__name__) | ||
| 4 | |||
| 5 | |||
| 6 | @app.route("/") | ||
| 7 | def index(): | ||
| 8 | return render_template("index.html") | ||
| 9 | |||
| 10 | |||
| 11 | @app.route("/api/run-script", methods=["POST"]) | ||
| 12 | def run_script(): | ||
| 13 | data = request.json | ||
| 14 | if not data: | ||
| 15 | return jsonify({"error": "No data provided"}), 400 | ||
| 16 | |||
| 17 | script_result = my_script_logic(data.get("input")) | ||
| 18 | |||
| 19 | return jsonify({"result": script_result}) | ||
| 20 | |||
| 21 | |||
| 22 | def my_script_logic(input_value): | ||
| 23 | return f"Processed input: {input_value}" | ||
| 24 | |||
| 25 | |||
| 26 | if __name__ == "__main__": | ||
| 27 | app.run(host="0.0.0.0", port=5000, debug=True) | ||
diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..5436dbd --- /dev/null +++ b/templates/index.html | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="en"> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta charset="UTF-8"> | ||
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 7 | <title>CONSOLE</title> | ||
| 8 | <link rel="stylesheet" href="static/styles.css"> | ||
| 9 | <script src="static/main.mjs" defer></script> | ||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <nav class="navigation"> | ||
| 14 | <a href="index.html" class="home">HOME</a> | ||
| 15 | <h2>I2C MODES</h2> | ||
| 16 | <a href="https://www.github.com/nasrlol" target="_blank">GITHUB</a> | ||
| 17 | </nav> | ||
| 18 | |||
| 19 | <section class="controls"> | ||
| 20 | <a href="page/overview.html" class="resources">Resources</a> | ||
| 21 | <a href="page/notes.html" class="speech_trans">Speech Transcriber</a> | ||
| 22 | <a href="page/recourses.html" class="notes">Display a Message</a> | ||
| 23 | <a href="page/speech.html" class="general">General Tools</a> | ||
| 24 | </section> | ||
| 25 | <section> | ||
| 26 | <p>This is the main control center for the I2C deivce. You can find | ||
| 27 | the main code and information about the project under my <a href="https://github.com/nasrlol">GITHUB</a></p> | ||
| 28 | |||
| 29 | </section> | ||
| 30 | |||
| 31 | <footer> | ||
| 32 | <p>Created by <a href="https://www.github.com/nasrlol" target="_blank">nsrddyn</a>. All rights reserved © | ||
| 33 | 2024.</p> | ||
| 34 | </footer> | ||
| 35 | </body> | ||
| 36 | |||
| 37 | </html> | ||
diff --git a/templates/live_preview.py b/templates/live_preview.py new file mode 100644 index 0000000..e753fc6 --- /dev/null +++ b/templates/live_preview.py | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | from livereload import Server | ||
| 2 | |||
| 3 | server = Server() | ||
| 4 | # Watch HTML file | ||
| 5 | server.watch('index.html') | ||
| 6 | # Watch CSS files | ||
| 7 | server.watch('static/styles.css') | ||
| 8 | # Watch JavaScript files | ||
| 9 | server.watch('static/main.mjs') | ||
| 10 | # Watch other files if needed | ||
| 11 | server.watch('page/*') # Watch everything in the page folder | ||
| 12 | |||
| 13 | # Serve the current directory | ||
| 14 | server.serve(root='.') | ||
diff --git a/templates/page/notes.html b/templates/page/notes.html new file mode 100644 index 0000000..3f24816 --- /dev/null +++ b/templates/page/notes.html | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="en"> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta charset="UTF-8"> | ||
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 7 | <title>Display a Message</title> | ||
| 8 | <link rel="stylesheet" href="../static/styles.css"> | ||
| 9 | <script src="../static/main.mjs" defer></script> | ||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <nav class="navigation"> | ||
| 14 | <a href="../index.html" class="home">HOME</a> | ||
| 15 | <h2>Display a Message</h2> | ||
| 16 | <a href="https://www.github.com/nasrlol" target="_blank">GITHUB</a> | ||
| 17 | </nav> | ||
| 18 | |||
| 19 | <section class="content"> | ||
| 20 | <h1>Display a Message</h1> | ||
| 21 | </section> | ||
| 22 | |||
| 23 | <footer> | ||
| 24 | <p>Created by <a href="https://www.github.com/nasrlol" target="_blank">nsrddyn</a>. All \ No newline at end of file | ||
diff --git a/templates/page/overview.html b/templates/page/overview.html new file mode 100644 index 0000000..123bf39 --- /dev/null +++ b/templates/page/overview.html | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="en"> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta charset="UTF-8"> | ||
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 7 | <title>General Tools</title> | ||
| 8 | <link rel="stylesheet" href="../static/styles.css"> | ||
| 9 | <script src="../static/main.mjs" defer></script> | ||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <nav class="navigation"> | ||
| 14 | <a href="../index.html" class="home">HOME</a> | ||
| 15 | <h2>General Tools</h2> | ||
| 16 | <a href="https://www.github.com/nasrlol" target="_blank">GITHUB</a> | ||
| 17 | </nav> | ||
| 18 | |||
| 19 | <section class="content"> | ||
| 20 | <h1>General Tools</h1> | ||
| 21 | </section> | ||
| 22 | |||
| 23 | <footer> | ||
| 24 | <p>Created by <a href="https://www.github.com/nasrlol" target="_blank">nsrddyn</a>. All rights reserved © | ||
| 25 | 2024.</p> | ||
| 26 | </footer> | ||
| 27 | </body> | ||
| 28 | |||
| 29 | </html> \ No newline at end of file | ||
diff --git a/templates/page/recourses.html b/templates/page/recourses.html new file mode 100644 index 0000000..992e44e --- /dev/null +++ b/templates/page/recourses.html | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="en"> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta charset="UTF-8"> | ||
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 7 | <title>Resources</title> | ||
| 8 | <link rel="stylesheet" href="../static/styles.css"> | ||
| 9 | <script src="../static/main.mjs" defer></script> | ||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <nav class="navigation"> | ||
| 14 | <a href="../index.html" class="home">HOME</a> | ||
| 15 | <h2>Resources</h2> | ||
| 16 | <a href="https://www.github.com/nasrlol" target="_blank">GITHUB</a> | ||
| 17 | </nav> | ||
| 18 | |||
| 19 | <section class="content"> | ||
| 20 | <h1>Resources</h1> | ||
| 21 | </section> | ||
| 22 | |||
| 23 | <footer> | ||
| 24 | <p>Created by <a href="https://www.github.com/nasrlol" target="_blank">nsrddyn</a>. All rights reserved © | ||
| 25 | 2024.</p> | ||
| 26 | </footer> | ||
| 27 | </body> | ||
| 28 | |||
| 29 | </html> \ No newline at end of file | ||
diff --git a/templates/page/speech.html b/templates/page/speech.html new file mode 100644 index 0000000..1b345ba --- /dev/null +++ b/templates/page/speech.html | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="en"> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta charset="UTF-8"> | ||
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 7 | <title>Speech Transcriber</title> | ||
| 8 | <link rel="stylesheet" href="../static/styles.css"> | ||
| 9 | <script src="../static/main.mjs" defer></script> | ||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <nav class="navigation"> | ||
| 14 | <a href="../index.html" class="home">HOME</a> | ||
| 15 | <h2>Speech Transcriber</h2> | ||
| 16 | <a href="https://www.github.com/nasrlol" target="_blank">GITHUB</a> | ||
| 17 | </nav> | ||
| 18 | |||
| 19 | <section class="content"> | ||
| 20 | <h1>Speech Transcriber</h1> | ||
| 21 | </section> | ||
| 22 | |||
| 23 | <footer> | ||
| 24 | <p>Created by <a href="https://www.github.com/nasrlol" target="_blank">nsrddyn</a>. All rights reserved © | ||
| 25 | 2024.</p> | ||
| 26 | </footer> | ||
| 27 | </body> | ||
| 28 | |||
| 29 | </html> \ No newline at end of file | ||
diff --git a/templates/static/main.mjs b/templates/static/main.mjs new file mode 100644 index 0000000..7e48f65 --- /dev/null +++ b/templates/static/main.mjs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | document.addEventListener("DOMContentLoaded", () => { | ||
| 2 | const buttons = document.querySelectorAll(".controls a"); | ||
| 3 | |||
| 4 | buttons.forEach((button) => { | ||
| 5 | button.addEventListener("mouseover", () => { | ||
| 6 | button.style.boxShadow = "0px 6px 12px rgba(255, 255, 255, 0.5)"; | ||
| 7 | }); | ||
| 8 | |||
| 9 | button.addEventListener("mouseout", () => { | ||
| 10 | button.style.boxShadow = "0px 4px 8px rgba(0, 0, 0, 0.4)"; | ||
| 11 | }); | ||
| 12 | }); | ||
| 13 | }); | ||
diff --git a/templates/static/styles.css b/templates/static/styles.css new file mode 100644 index 0000000..d43f592 --- /dev/null +++ b/templates/static/styles.css | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | @import url("https://fonts.googleapis.com/css2?family=Host+Grotesk:ital,wght@0,300..800;1,300..800&display=swap"); | ||
| 2 | |||
| 3 | body { | ||
| 4 | background-color: rgb(40, 44, 52); | ||
| 5 | color: white; | ||
| 6 | font-family: "Host Grotesk", sans-serif; | ||
| 7 | font-weight: 500; | ||
| 8 | margin: 0; | ||
| 9 | padding: 0; | ||
| 10 | } | ||
| 11 | |||
| 12 | p { | ||
| 13 | text-align: center; | ||
| 14 | |||
| 15 | } | ||
| 16 | |||
| 17 | h1 { | ||
| 18 | text-align: center; | ||
| 19 | } | ||
| 20 | |||
| 21 | a { | ||
| 22 | text-decoration: none; | ||
| 23 | color: wheat; | ||
| 24 | transition: color 0.3s ease; | ||
| 25 | } | ||
| 26 | |||
| 27 | a:hover { | ||
| 28 | color: rgb(255, 215, 128); | ||
| 29 | } | ||
| 30 | |||
| 31 | .navigation { | ||
| 32 | display: flex; | ||
| 33 | justify-content: space-between; | ||
| 34 | align-items: center; | ||
| 35 | padding: 20px 10%; | ||
| 36 | background-color: rgba(0, 0, 0, 0.8); | ||
| 37 | border-bottom: 2px solid white; | ||
| 38 | box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3); | ||
| 39 | position: sticky; | ||
| 40 | top: 0; | ||
| 41 | z-index: 10; | ||
| 42 | } | ||
| 43 | |||
| 44 | .navigation a { | ||
| 45 | font-size: 1.2em; | ||
| 46 | font-weight: 600; | ||
| 47 | transition: transform 0.3s ease; | ||
| 48 | } | ||
| 49 | |||
| 50 | .navigation a:hover { | ||
| 51 | transform: scale(1.1); | ||
| 52 | } | ||
| 53 | |||
| 54 | .controls { | ||
| 55 | display: flex; | ||
| 56 | flex-direction: row; | ||
| 57 | justify-content: center; | ||
| 58 | gap: 20px; | ||
| 59 | padding: 20px 10%; | ||
| 60 | } | ||
| 61 | |||
| 62 | .controls a { | ||
| 63 | display: flex; | ||
| 64 | justify-content: center; | ||
| 65 | align-items: center; | ||
| 66 | background-color: rgba(255, 255, 255, 0.1); | ||
| 67 | border-radius: 10px; | ||
| 68 | padding: 15px; | ||
| 69 | min-width: 150px; | ||
| 70 | width: 200px; | ||
| 71 | text-align: center; | ||
| 72 | font-size: 1.2em; | ||
| 73 | font-weight: 600; | ||
| 74 | color: white; | ||
| 75 | box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4); | ||
| 76 | transition: background-color 0.3s ease, transform 0.3s ease; | ||
| 77 | } | ||
| 78 | |||
| 79 | .controls a:hover { | ||
| 80 | background-color: rgba(255, 255, 255, 0.2); | ||
| 81 | transform: translateY(-5px); | ||
| 82 | } | ||
| 83 | |||
| 84 | footer { | ||
| 85 | background-color: rgba(0, 0, 0, 0.8); | ||
| 86 | text-align: center; | ||
| 87 | padding: 10px; | ||
| 88 | font-size: 0.9em; | ||
| 89 | border-top: 1px solid rgba(255, 255, 255, 0.2); | ||
| 90 | margin-top: 20px; | ||
| 91 | } | ||
| 92 | |||
| 93 | footer a { | ||
| 94 | color: wheat; | ||
| 95 | font-weight: 600; | ||
| 96 | text-decoration: underline; | ||
| 97 | } | ||
| 98 | |||
| 99 | footer a:hover { | ||
| 100 | color: rgb(255, 215, 128); | ||
| 101 | } | ||
