# Day 14
#     ___                              ___ _     _           _
#    / __\__ _ _ ____   ____ _ ___    /___\ |__ (_) ___  ___| |_ ___
#   / /  / _` | '_ \ \ / / _` / __|  //  // '_ \| |/ _ \/ __| __/ __|
#  / /__| (_| | | | \ V / (_| \__ \ / \_//| |_) | |  __/ (__| |_\__ \
#  \____/\__,_|_| |_|\_/ \__,_|___/ \___/ |_.__// |\___|\___|\__|___/
#                                             |__/

'''
# we rectangle (x/y of top left, x/y of bottom right)
c3.create_rectangle( (100, 100), (300, 200), fill="blue")

# we line (x/y of starting point, x/y of ending point)
c3.create_line((250, 50), (350, 150), width=4, fill="green")

# we arc (same as line but with style)
c3.create_arc((240,240), (130,30), style=tk.CHORD, width=2, fill="yellow")

# we oval (same as rectangle)
c3.create_oval((20,300), (120,400), fill="purple")

# we poly (points in an order that python will make a shape out of)
c3.create_polygon((350,350), (421,116), (114,334), fill="red")

# we text (x/y of start point)
c3.create_text((100, 260), text="bool", fill="orange", font="Hack_Nerd_Font_Mono 35")
'''

from tkinter import *
import tkinter as tk
from tkinter.ttk import Notebook

# window
window =Tk()
window.resizable(True, True)
window.title("Vector Graphics")
window.geometry("500x400+200+200")

# notebook
notebook = Notebook(window) # for organizing
part1 = Frame(notebook)
part2 = Frame(notebook)
part3 = Frame(notebook)

notebook.add(part1, text = "part 1")
notebook.add(part2, text = "part 2")
notebook.add(part3, text = "part 3")
notebook.pack() #

# make a canvas to put graphics on
c1=Canvas(part1, width=400, height=400, bg="black")
c1.pack()
c2=Canvas(part2, width=400, height=400, bg="black")
c2.pack()
c3=Canvas(part3, width=400, height=400, bg="white")
c3.pack()

# Part 1
# _,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

# head
c1.create_oval((118,78), (282,242), fill="orange")
c1.create_oval((120,80), (280,240), fill="yellow")

# eyes
c1.create_oval((220,120), (230,150), fill="black")
c1.create_oval((180,120), (190,150), fill="black")

# mouth
c1.create_line((185,165), (205, 170), (225,165), width=4, fill="orange")

# Part 2
# _,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

# define variables
x1 = y1 = y2 = x4 = 0
x3 = y3 = x2 = y4 = 400

for i in range(1, 40):
    i += 1
    x1 += 5
    y1 += 7
    x2 -= 7
    y2 += 5
    x4 += 5
    y4 -= 3
    x3 -= 3
    y3 -= 5

    if i % 2 == 0:
        c2.create_polygon((x1, y1), (x2, y2), (x3, y3), (x4, y4), fill="black")
    else:
        c2.create_polygon((x1, y1), (x2, y2), (x3, y3), (x4, y4), fill="white")

# Part 3
# _,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_

# desk
c3.create_rectangle((0,300), (500,500), fill="sandybrown")

# stem
c3.create_line((200, 200), (190, 160), (160, 100), width=5, fill="limegreen")

# flower petals
c3.create_oval((135, 75), (160, 100), fill="red", outline="red")
c3.create_oval((148, 63), (172, 88), fill="red", outline="red")
c3.create_oval((160, 75), (185, 100), fill="red", outline="red")
c3.create_oval((135, 100), (160, 125), fill="red", outline="red")
c3.create_oval((172, 88), (197, 113), fill="red", outline="red")
c3.create_oval((148, 112), (172, 137), fill="red", outline="red")
c3.create_oval((160, 100), (185, 125), fill="red", outline="red")
c3.create_oval((122, 88), (148, 113), fill="red", outline="red")

# middle part of the flower (idk the term)
c3.create_oval((150, 90), (170, 110), fill="black")

# flower pot
c3.create_polygon((80, 300), (120, 300), (120, 360), fill="chocolate")
c3.create_polygon((80, 200), (320, 200), (280, 360), (120, 360), fill="brown")

# quote
c3.create_text((190, 260), text="'is jellyfish a erb?'", fill="orange", font="Helvetica 35")
c3.create_text((300,300), text="- XQc, 2021", fill="dodgerblue", font="Helvetica 17")

# signature
c3.create_text((380, 390), text="jason", font="Helvetica 9")

mainloop()