-
Notifications
You must be signed in to change notification settings - Fork 0
/
frontpage.py
117 lines (90 loc) · 4.7 KB
/
frontpage.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import tkinter as tk
from tkinter import ttk
import json
def save_file(contact: dict, filename: str):
with open(filename, "a") as f: #a means append. so makes it if it already exists, otherwise edits
json.dump(contact, f)
def signups(name, email):
# name = input("What is your contact name? ")
# email = input("What is your contact's email?")
#defining an object
contact = {
"name" : name,
"email" : email,
}
save_file(contact, "signups.json")
col1 = "#c8c8a9" #background of squares
col2 = "#ffcdad" #background
col3 = '#fe4365' #header
class Back():
def __init__(self):
#just the main empty background
self.root = tk.Tk()
self.root.geometry('1920x1080')
self.root.title('Protest Organizor Toolkit')
self.canvas = tk.Canvas(self.root, bg=col2)
self.canvas.pack(expand=tk.YES, fill=tk.BOTH)
def create_header():
banner = tk.Text(self.canvas, padx=10, pady=10, font = ("Oxygen", 30), bg=col3, relief="solid", borderwidth=2, wrap=tk.WORD, width=100, height=1)
banner.pack()
banner.insert(tk.END, "Title and Organizers: ")
def create_label(text1,x,y):
text = ttk.Label(self.canvas,text=text1, background=col1, font=("Oxygen", 20))
text.pack()
self.objBox = self.canvas.create_rectangle(10, 100, 635, 400, outline="black", width=2)
self.objTitle = tk.Label(self.canvas, text = "Objectives", font=('Oxygen', 18))
self.objTitle.place(x = 20, y = 120)
self.obj1 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.obj1.place(x = 20, y = 165)
self.obj2 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.obj2.place(x = 20, y = 250)
self.obj3 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.obj3.place(x = 20, y = 335)
self.contactBox = self.canvas.create_rectangle(10, 450, 635, 750, outline="black", width=2)
self.conTitle = tk.Label(self.canvas, text = "Contacts", font=('Oxygen', 18))
self.conTitle.place(x = 20, y = 470)
self.con1 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.con1.place(x = 20, y = 515)
self.con2 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.con2.place(x = 20, y = 600)
self.con3 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.con3.place(x = 20, y = 685)
self.locBox = self.canvas.create_rectangle(645, 100, 1270, 400, outline="black", width=2)
self.locTitle = tk.Label(self.canvas, text = "Location", font=('Oxygen', 18))
self.locTitle.place(x = 665, y = 120)
self.locText = tk.Text(self.canvas, font = ("Oxygen", 14))
self.locText.place(x = 665, y = 160, width = 580, height = 220)
self.dateBox = self.canvas.create_rectangle(645, 450, 1270, 750, outline="black", width=2)
self.dateTitle = tk.Label(self.canvas, text = "Key Dates", font=('Oxygen', 18))
self.dateTitle.place(x = 665, y = 470)
self.date1 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.date1.place(x = 665, y = 515)
self.date2 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.date2.place(x = 665, y = 600)
self.date3 = tk.Entry(self.canvas, font =("Oxygen", 14), width = 53)
self.date3.place(x = 665, y = 685)
#banner
self.banner = create_header()
#side panel
#self.canvas.create_rectangle(1000, 100, 1500, 900, outline="black", width=5)
#sign ups
# Create a button
self.signTitle = tk.Label(self.canvas, text = "Sign up!", font=('Oxygen', 18))
self.signTitle.place(x = 1300, y = 130)
name = ttk.Entry(self.root)
label = tk.Label(self.root, text="Name:")
label_window=self.canvas.create_window(1300,180, anchor=tk.NW, window=label)
input_window = self.canvas.create_window(1350,180, anchor=tk.NW, window=name)
# Place the button on the canvas at coordinates (50, 50)
# Create a label for displaying messages
email = ttk.Entry(self.root)
label_e = tk.Label(self.root, text="Email:")
label_window_e=self.canvas.create_window(1300,230, anchor=tk.NW, window=label_e)
input_window_e = self.canvas.create_window(1350,230, anchor=tk.NW, window=email)
button = tk.Button(self.canvas, text="Done!", command=signups(name.get(),email.get()))
button_window = self.canvas.create_window(1350, 300, anchor=tk.NW, window=button)
#david's bottom 2 square
self.root.mainloop()
return
if __name__ == '__main__':
Back()