gaur3009 commited on
Commit
98d0fd4
·
verified ·
1 Parent(s): 5b0c443

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -2
app.py CHANGED
@@ -73,6 +73,29 @@ body::before {
73
  50% { background-position: 100% 50%; }
74
  100% { background-position: 0% 50%; }
75
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  """
77
 
78
  # JavaScript for text-to-speech and particles
@@ -105,17 +128,36 @@ document.addEventListener('DOMContentLoaded', function () {
105
  </script>
106
  """
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  # Gradio interface
109
  with gr.Blocks(css=custom_css) as interface:
110
  gr.HTML(custom_js)
111
  gr.Markdown("# **AI Phone Cover Designer**")
112
  gr.Markdown("Create custom phone covers with AI. Save your designs for future use.")
113
-
114
  # Navigation Tabs
115
  with gr.Tabs():
116
  with gr.Tab("Home"):
117
  gr.Markdown("Welcome to the **AI Phone Cover Designer**! Use the 'Design' tab to start creating custom designs.")
118
-
 
 
 
 
 
 
119
  with gr.Tab("Design"):
120
  with gr.Row():
121
  with gr.Column(scale=1):
 
73
  50% { background-position: 100% 50%; }
74
  100% { background-position: 0% 50%; }
75
  }
76
+ .carousel {
77
+ display: flex;
78
+ overflow-x: auto;
79
+ scroll-behavior: smooth;
80
+ }
81
+ .carousel .image-container {
82
+ display: inline-block;
83
+ text-align: center;
84
+ margin: 0 10px;
85
+ }
86
+ .carousel img {
87
+ max-height: 200px;
88
+ border-radius: 10px;
89
+ transition: transform 0.3s;
90
+ }
91
+ .carousel img:hover {
92
+ transform: scale(1.1);
93
+ }
94
+ .carousel .caption {
95
+ margin-top: 5px;
96
+ font-size: 14px;
97
+ color: #333;
98
+ }
99
  """
100
 
101
  # JavaScript for text-to-speech and particles
 
128
  </script>
129
  """
130
 
131
+ # Gallery Images with captions
132
+ gallery_images = [
133
+ ("https://gaur3009-phone-c.hf.space/gradio_api/file=/tmp/gradio/387f5407e32dd2e2d9e7017977f5ee98e4f40dcb8b1d2a9ef23612255a675163/image.webp
134
+ ", "Red Color, iPhone 14, Naruto Anime Theme"),
135
+ ("https://gaur3009-phone-c.hf.space/gradio_api/file=/tmp/gradio/3037d9cae7a86b29be5969cf3a361ae847915b54d97d6d5dffb6e019a2b9ddc9/image.webp
136
+ ", "Red Color, iPhone 14, Darth Vader Theme"),
137
+ ("https://gaur3009-phone-c.hf.space/gradio_api/file=/tmp/gradio/1958c8d60219357edbb2e1f69331152f1cd1109407b274c4511a810650dd574b/image.webp
138
+ ", "Black, iPhone 15, Thomas Shelby(Peaky Blinders) Theme"),
139
+ ("https://gaur3009-phone-c.hf.space/gradio_api/file=/tmp/gradio/183392add00a7fa3d53653f856bc88d4113bd74c0d37c43de7a9af414e9c1d84/image.webp", "Green color, iPhone, Green Goblin"),
140
+ ("https://gaur3009-phone-c.hf.space/gradio_api/file=/tmp/gradio/b7b0b2415f15f810f71658616a885b97c0466d09f1d852684a868ab9b5d18e6c/image.webp
141
+ ", "White and Cream Color, iPhone 15, Iron-Man"),
142
+ ]
143
+
144
  # Gradio interface
145
  with gr.Blocks(css=custom_css) as interface:
146
  gr.HTML(custom_js)
147
  gr.Markdown("# **AI Phone Cover Designer**")
148
  gr.Markdown("Create custom phone covers with AI. Save your designs for future use.")
149
+
150
  # Navigation Tabs
151
  with gr.Tabs():
152
  with gr.Tab("Home"):
153
  gr.Markdown("Welcome to the **AI Phone Cover Designer**! Use the 'Design' tab to start creating custom designs.")
154
+ gr.Markdown("### Gallery")
155
+ gallery_html = "<div class='carousel'>"
156
+ for img_url, caption in gallery_images:
157
+ gallery_html += f"<div class='image-container'><img src='{img_url}' alt='Design'><div class='caption'>{caption}</div></div>"
158
+ gallery_html += "</div>"
159
+ gr.HTML(gallery_html)
160
+
161
  with gr.Tab("Design"):
162
  with gr.Row():
163
  with gr.Column(scale=1):