Spaces:
Runtime error
Runtime error
Commit
·
1b56997
1
Parent(s):
ea0e1c6
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
from random import choice
|
4 |
+
os.chdir("C:\\Users\\Ray Ochoa\\OneDrive\\Node x Mooed")
|
5 |
+
|
6 |
+
|
7 |
+
image_list = [f"images/Image {i}.png" for i in range(1, 19)]
|
8 |
+
def update_moodboard(btn_value):
|
9 |
+
return {moodboard_image: choice(image_list)}
|
10 |
+
|
11 |
+
with gr.Blocks() as app:
|
12 |
+
|
13 |
+
gr.Markdown("# Magazine Layouts")
|
14 |
+
|
15 |
+
with gr.Tab("The Minimalist Layout"):
|
16 |
+
with gr.Column():
|
17 |
+
gr.Markdown("## Minimalist")
|
18 |
+
gr.Image("images/Image 1.png")
|
19 |
+
gr.Textbox(lines=4, value="It was a stormy night, and the vintage car roared down the highway.")
|
20 |
+
|
21 |
+
with gr.Tab("The Grid Layout"):
|
22 |
+
with gr.Row():
|
23 |
+
with gr.Column(scale=1):
|
24 |
+
gr.Image("images/Image 2.png")
|
25 |
+
gr.Textbox(lines=4, value="The old leather seats had stories to tell.")
|
26 |
+
with gr.Column(scale=1):
|
27 |
+
gr.Image("images/Image 3.png")
|
28 |
+
gr.Textbox(lines=4, value="With every curve and turn, the car seemed to whisper.")
|
29 |
+
|
30 |
+
with gr.Tab("The Asymmetrical Layout"):
|
31 |
+
with gr.Row():
|
32 |
+
with gr.Column(scale=2):
|
33 |
+
gr.Markdown("## Artistic Layout")
|
34 |
+
gr.Image("images/Image 4.png")
|
35 |
+
with gr.Column(scale=1):
|
36 |
+
gr.Image("images/Image 5.png")
|
37 |
+
gr.Textbox(lines=3, value="As the dawn broke, the car finally stopped.")
|
38 |
+
|
39 |
+
with gr.Tab("The F-Layout"):
|
40 |
+
with gr.Row():
|
41 |
+
with gr.Column(scale=3):
|
42 |
+
gr.Image("images/Image 6.png")
|
43 |
+
with gr.Column(scale=1):
|
44 |
+
gr.Textbox(lines=4, value="It was a stormy night, and the vintage car roared down the highway.")
|
45 |
+
|
46 |
+
with gr.Tab("The Radial Layout"):
|
47 |
+
with gr.Row():
|
48 |
+
with gr.Column(scale=1):
|
49 |
+
gr.Image("images/Image 9.png")
|
50 |
+
with gr.Column(scale=1):
|
51 |
+
gr.Image("images/Image 10.png")
|
52 |
+
with gr.Row():
|
53 |
+
with gr.Column(scale=1):
|
54 |
+
gr.Image("images/Image 11.png")
|
55 |
+
with gr.Column(scale=1):
|
56 |
+
gr.Textbox(lines=4, value="As the dawn broke, the car finally stopped.")
|
57 |
+
with gr.Column(scale=1):
|
58 |
+
gr.Image("images/Image 12.png")
|
59 |
+
|
60 |
+
with gr.Tab("Trading Card Layout 1"):
|
61 |
+
with gr.Column():
|
62 |
+
gr.Image(choice(image_list))
|
63 |
+
gr.Textbox(lines=1, value="Car Model: Mustang")
|
64 |
+
gr.Textbox(lines=1, value="Year: 1965")
|
65 |
+
gr.Textbox(lines=2, value="Stats: Speed 200mph, Mileage 15mpg")
|
66 |
+
gr.Textbox(lines=3, value="The Mustang is a classic American muscle car.")
|
67 |
+
|
68 |
+
# Museum Art Gallery: Spotlight Layout
|
69 |
+
with gr.Tab("Spotlight Layout"):
|
70 |
+
gr.Image(choice(image_list))
|
71 |
+
with gr.Row():
|
72 |
+
gr.Textbox(lines=1, value="Art: Moonlit Sonata")
|
73 |
+
gr.Textbox(lines=1, value="Artist: L. Vinci")
|
74 |
+
gr.Textbox(lines=1, value="Year: 1911")
|
75 |
+
gr.Textbox(lines=3, value="A single spotlight shines on this masterpiece, illuminating its intricate details and vivid colors.")
|
76 |
+
|
77 |
+
# Museum Art Gallery: Interactive Kiosk Layout
|
78 |
+
with gr.Tab("Interactive Kiosk Layout"):
|
79 |
+
with gr.Row():
|
80 |
+
with gr.Column(scale=1):
|
81 |
+
gr.Image(choice(image_list))
|
82 |
+
with gr.Column(scale=1):
|
83 |
+
gr.Textbox(lines=1, value="Art: Pixelated Reality")
|
84 |
+
gr.Textbox(lines=1, value="Artist: G. O'Keeffe")
|
85 |
+
gr.Textbox(lines=1, value="Year: 2001")
|
86 |
+
gr.Textbox(lines=4, value="Step up to the interactive kiosk to dive deeper into the story and significance of the artwork.")
|
87 |
+
|
88 |
+
# Moodboard for a Designer
|
89 |
+
with gr.Tab("Moodboard for a Designer"):
|
90 |
+
with gr.Row():
|
91 |
+
gr.Image(choice(image_list))
|
92 |
+
gr.Textbox(lines=1, value="Color: #FF5733")
|
93 |
+
gr.Textbox(lines=1, value="Font: Arial")
|
94 |
+
with gr.Row():
|
95 |
+
gr.Textbox(lines=1, value="Quote: Design is intelligence made visible.")
|
96 |
+
gr.Image(choice(image_list))
|
97 |
+
gr.Textbox(lines=1, value="Project: Logo Design")
|
98 |
+
|
99 |
+
# Comic Book with Dynamic Content Loading
|
100 |
+
with gr.Tab("Comic Book"):
|
101 |
+
with gr.Row():
|
102 |
+
gr.Textbox(lines=1, value="Title: The Adventures of Grado")
|
103 |
+
gr.Image(choice(image_list))
|
104 |
+
with gr.Row():
|
105 |
+
gr.Textbox(lines=1, value="BOOM!")
|
106 |
+
gr.Image(choice(image_list))
|
107 |
+
gr.Textbox(lines=2, value="Character: Oh no!")
|
108 |
+
gr.Button("Next Page", label="Next Page")
|
109 |
+
gr.Textbox(lines=1, value="Caption: To be continued...")
|
110 |
+
|
111 |
+
# Design Proposal Board with Multi-layered Layouts
|
112 |
+
with gr.Tab("Design Proposal Board"):
|
113 |
+
with gr.Row():
|
114 |
+
gr.Textbox(lines=1, value="Project: Redesign UI")
|
115 |
+
gr.Dropdown(options=["Planning", "Execution", "Review"], label="Project Stage")
|
116 |
+
with gr.Row():
|
117 |
+
gr.Textbox(lines=1, value="Timeline: 3 months")
|
118 |
+
gr.Slider(minimum=0, maximum=100, label="Progress")
|
119 |
+
gr.Image(choice(image_list))
|
120 |
+
gr.Button("View Milestones", label="View Milestones")
|
121 |
+
gr.Textbox(lines=4, value="Goals: Improve user engagement by 20%")
|
122 |
+
|
123 |
+
app.launch()
|