-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
87 lines (68 loc) · 2.45 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#imports
import tkinter as tk
from PIL import Image, ImageSequence, ImageTk
import base64
#initializing this shitty ass gui
root = tk.Tk()
root.title("Yecalapse")
#properties
root.geometry("700x400")
root.configure(bg="white")
#defining the gifs
gifPath = "goatgif.gif"
goatGif = Image.open(gifPath)
#making the frames thingy
frames = []
for frame in ImageSequence.Iterator(goatGif):
frame = frame.convert("RGBA")
white_bg = Image.new("RGBA", frame.size, "WHITE")
white_bg.paste(frame, (0, 0), frame)
frames.append(ImageTk.PhotoImage(white_bg))
#setting the left gif
goatedGifLeft = tk.Label(root)
goatedGifLeft.place(x=-100, y=-30)
#setting the right gif
goatedGifRight = tk.Label(root)
goatedGifRight.place(x=330, y=-30)
#defining the actual playback of the gif
def update_frameLeft(index):
frame = frames[index]
goatedGifLeft.configure(image=frame, bg="white")
root.after(500, update_frameLeft, (index + 1) % len(frames))
#defining the playback of the right gif
def update_frameRight(index):
frame = frames[index]
goatedGifRight.configure(image=frame, bg="white")
root.after(500, update_frameRight, (index + 1) % len(frames))
#these play the gif
update_frameLeft(0)
update_frameRight(0)
#defining the actual logo
Logo = tk.Label(root, width=8, height=1, text="Yecalapse", font=("Arial", 32), bg="white")
Logo.place(x=255, y=50)
#the text that tells you what to do
subText = tk.Label(root, text="User ID:", font=("Arial", 10), bg="white")
subText.place(x=300, y=110)
#making convert text function
def encode_text():
input_text = textBox.get("1.0", tk.END).strip()
encoded_text = base64.b64encode(input_text.encode()).decode().replace("=", "")
result_label.config(text=encoded_text)
#copy to clipboard function
def copy_to_clipboard():
root.clipboard_clear()
root.clipboard_append(result_label.cget("text"))
root.update()
#creating the text box
textBox = tk.Text(root, width=20, height=1, font=("Helvetica", 16))
textBox.place(x=250, y=150)
#creating the convert button
convert_button = tk.Button(root, text="Convert", command=encode_text)
convert_button.place(x=250, y=200)
#making the result text
result_label = tk.Label(root, text="", font=("Helvetica", 16), bg="white")
result_label.place(x=250, y=250)
#copy button
copy_button = tk.Button(root, text="Copy", command=copy_to_clipboard)
copy_button.place(x=250, y=300)
root.mainloop()