import tkinter as tk
import random
root = tk.Tk()
root.title("The Dice Game")
root.geometry("500x500")
root.configure(bg="#FFFFE0")
purple_block1 = tk.Frame(root, bg="purple", width=450, height=450)
purple_block1.pack(pady=10)
purple_block1.pack_propagate(False)
inside_text = tk.Label(
purple_block1,
text="Please, enter your name \nto start the game (〃^ー^〃)",
font=("Arial", 15, "bold"),
fg="#FFFFE0",
bg="purple"
)
inside_text.pack(pady=10)
name_text = tk.Label(
purple_block1,
text="Enter Name :",
font=("Times New Roman", 30, "bold"),
fg="#FFFFE0",
bg="purple"
)
name_text.pack(pady=1)
entry = tk.Entry(purple_block1)
entry.pack()
purple_block2 = tk.Frame(root, bg="purple", width=450, height=450)
purple_block2.pack(pady=10)
purple_block2.pack_propagate(False)
def go_to_loading():
name = entry.get()
purple_block1.pack_forget()
purple_block1.pack(fill="both", expand=True)
fra2load = tk.Label(
purple_block2,
text="Loading {name}...",
font=("Arial", 15, "bold"),
fg="#FFFFE0",
bg="purple"
)
fra2load.pack(pady=10, expand=True)
purple_block2 = tk.Frame(root, bg="purple", width=450, height=450)
purple_block2.pack(pady=10)
purple_block2.pack_propagate(False)
text_label = tk.Label(
root,
text="⋆ ꩜ The Dice Game ꩜ ⋆",
font=("Times New Roman", 30, "bold"),
fg="purple",
bg="#FFFFE0"
)
text_label.pack(pady=3)
button = tk.Button(
purple_block1,
text="Submit",
command=go_to_loading
)
button.pack(pady=10)
root.mainloop()