commit 0b5ade6b6475b132d9fa27557d577ed2aae1fbd4 Author: Ozi-s Date: Sun May 17 00:59:35 2026 +0300 first commit diff --git a/main.py b/main.py new file mode 100644 index 0000000..e370a43 --- /dev/null +++ b/main.py @@ -0,0 +1,41 @@ +import tkinter as tk +import time + +width = 120 +height = 140 + +app = tk.Tk(className="focustimer") + +app.title("Focus-Timer") +app.configure(background="#17153B") +app.geometry(f"{width}x{height}") +app.minsize(width, height) +app.maxsize(width, height) +app.resizable(False, False) +app.update_idletasks() + +text_label = tk.Label(app, text="Wanna start?", fg="#C8ACD6", background="#17153B",font=("Helvetica", 14), anchor="center") +text_label.pack(side="top",pady="15") + +time_label = tk.Label(app, text="hh:mm:ss",fg="#C8ACD6",background="#17153B",font=("Helvetica", 25) , anchor="center") +time_label.pack(expand=True,fill="y") + +seconds = 1200 + +def start(): + global seconds + text_label.config(text="Time to focus!") + time_label.config(fg="#AE445A") + if seconds > 0: + mins, secs = divmod(seconds, 60) + time_label.config(text=f"{mins}:{secs}") + app.after(1000, start) + seconds -= 1 + + + + +start_button = tk.Button(app, text="start", command=start, fg="#C8ACD6", background="#17153B") +start_button.pack(side="bottom", pady="15") + +app.mainloop()