From cc8792b3150f7b7f0a5a297dedd78295d4031c68 Mon Sep 17 00:00:00 2001 From: nasrlol Date: Mon, 18 Nov 2024 23:10:14 +0100 Subject: finished the webpage, and the main code is functioning correctly --- README.md | 5 +- bin/__pycache__/i2c.cpython-312.pyc | Bin 4218 -> 0 bytes bin/display.c | 5 +- bin/main.py | 10 +++- bin/test | Bin 16016 -> 0 bytes webGUI/index.html | 30 ++++++------ webGUI/main.mjs | 14 +++++- webGUI/pages/cpuinfo.html | 30 ++++++++++++ webGUI/pages/general.html | 30 ++++++++++++ webGUI/pages/main.js | 0 webGUI/pages/notes.html | 25 ++++++++++ webGUI/pages/recourses.html | 30 ++++++++++++ webGUI/pages/speech.html | 30 ++++++++++++ webGUI/pages/stats.html | 14 ------ webGUI/styles.css | 90 ++++++++++++++++++++++++++++++------ 15 files changed, 265 insertions(+), 48 deletions(-) delete mode 100644 bin/__pycache__/i2c.cpython-312.pyc delete mode 100755 bin/test create mode 100644 webGUI/pages/cpuinfo.html create mode 100644 webGUI/pages/general.html create mode 100644 webGUI/pages/main.js create mode 100644 webGUI/pages/notes.html create mode 100644 webGUI/pages/recourses.html create mode 100644 webGUI/pages/speech.html delete mode 100644 webGUI/pages/stats.html diff --git a/README.md b/README.md index 7746d4e..46c8b77 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # I2C + A application to control an I2C display on RPI. This application should represent a multi-use software with features ranging from a bus line analyser, bus delay analiser, an generative AI command line, weather reports, note's saving and much more. This is a starter project with the goal of expanded everything later on to let's say an e-ink display or small LCD. -18/11/2024 migrating to C for the main code \ No newline at end of file +18/11/2024 migrating to C for the main code + +The program is Multi-platform and even supports a web-console diff --git a/bin/__pycache__/i2c.cpython-312.pyc b/bin/__pycache__/i2c.cpython-312.pyc deleted file mode 100644 index a2ea22c..0000000 Binary files a/bin/__pycache__/i2c.cpython-312.pyc and /dev/null differ diff --git a/bin/display.c b/bin/display.c index 51a0873..b960ff1 100644 --- a/bin/display.c +++ b/bin/display.c @@ -1,4 +1,7 @@ #include +#include +#include + static void activate(GtkApplication *app, gpointer user_data) { // Create a new application window @@ -24,4 +27,4 @@ int main(int argc, char *argv[]) { g_object_unref(app); return status; -} \ No newline at end of file +} diff --git a/bin/main.py b/bin/main.py index 482fde0..17b506d 100644 --- a/bin/main.py +++ b/bin/main.py @@ -57,11 +57,17 @@ def recognize_speech(): def save_notes(): print("Type your notes (type 'stop' to exit):") + print("Type line=1 or line=2 to print something to a specific line") while True: - output = input() + line = 1 + output = input(":") if output.lower() in ["stop", "break", "quit", "exit"]: break - lcd_instance.text(output, 1) + if output == "line=1": + line = 1 + elif output == "line=2": + line = 2 + lcd_instance.text(output, line) time.sleep(2) diff --git a/bin/test b/bin/test deleted file mode 100755 index 180427d..0000000 Binary files a/bin/test and /dev/null differ diff --git a/webGUI/index.html b/webGUI/index.html index eb12eca..28665f8 100644 --- a/webGUI/index.html +++ b/webGUI/index.html @@ -6,26 +6,28 @@ CONSOLE - + - - +
+ CPU Information + Resources + Speech Transcriber + Display a Message + General Tools +
+ +
+

Created by nsrddyn. All rights reserved © + 2024.

+
-
- -
- \ No newline at end of file diff --git a/webGUI/main.mjs b/webGUI/main.mjs index c7464e5..7e48f65 100644 --- a/webGUI/main.mjs +++ b/webGUI/main.mjs @@ -1 +1,13 @@ -let modes = ["STATS", ""] \ No newline at end of file +document.addEventListener("DOMContentLoaded", () => { + const buttons = document.querySelectorAll(".controls a"); + + buttons.forEach((button) => { + button.addEventListener("mouseover", () => { + button.style.boxShadow = "0px 6px 12px rgba(255, 255, 255, 0.5)"; + }); + + button.addEventListener("mouseout", () => { + button.style.boxShadow = "0px 4px 8px rgba(0, 0, 0, 0.4)"; + }); + }); +}); diff --git a/webGUI/pages/cpuinfo.html b/webGUI/pages/cpuinfo.html new file mode 100644 index 0000000..99579cb --- /dev/null +++ b/webGUI/pages/cpuinfo.html @@ -0,0 +1,30 @@ + + + + + + + CPU Information + + + + + + + + +
+

CPU Information

+
+ +
+

Created by nsrddyn. All rights reserved © + 2024.

+
+ + + \ No newline at end of file diff --git a/webGUI/pages/general.html b/webGUI/pages/general.html new file mode 100644 index 0000000..087afbc --- /dev/null +++ b/webGUI/pages/general.html @@ -0,0 +1,30 @@ + + + + + + + General Tools + + + + + + + + +
+

General Tools

+
+ +
+

Created by nsrddyn. All rights reserved © + 2024.

+
+ + + \ No newline at end of file diff --git a/webGUI/pages/main.js b/webGUI/pages/main.js new file mode 100644 index 0000000..e69de29 diff --git a/webGUI/pages/notes.html b/webGUI/pages/notes.html new file mode 100644 index 0000000..ea870d7 --- /dev/null +++ b/webGUI/pages/notes.html @@ -0,0 +1,25 @@ + + + + + + + Display a Message + + + + + + + + +
+

Display a Message

+
+ +