from base64 import b64decode import tkinter as tk from PIL import Image, ImageTk from socketio import SimpleClient, exceptions from threading import Thread from requests import get from datetime import datetime COLORS = [(0x33, 0x33, 0x66), (0x96, 0x96, 0xe0)] COLORS_UNPACKED = COLORS[0] + ((0, 0, 0) * 254) + COLORS[1] SCREENSHOTS_TMPL = "./screenshots/%Y%m%d_%H%M%S.png" class App(tk.Tk): def __init__(self, url: str = "https://onemillioncheckboxes.com") -> None: self.url = url super().__init__() self.title("1M pixels") self.sio = SimpleClient() self._canvas = tk.Canvas(self) self._canvas.config(width=1000, height=1000, borderwidth=0, highlightthickness=0) self._canvas.pack() self.config(width=1000, height=1000, borderwidth=0, highlightthickness=0) self._last_update = 0 self._running = False self._image = Image.new("RGB", (1000, 1000), COLORS[0]) self._canvas.bind("", self._on_mouse_move) self._canvas.bind("