fantaxy commited on
Commit
e385e87
1 Parent(s): eb54f7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -1
app.py CHANGED
@@ -128,9 +128,65 @@ def infer(
128
  return [true_input_image, image, seed]
129
 
130
 
131
- with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
 
134
  with gr.Row():
135
  run_button = gr.Button(value="Run")
136
 
 
128
  return [true_input_image, image, seed]
129
 
130
 
 
131
 
132
+ def create_snow_effect():
133
+ # CSS 스타일 정의
134
+ snow_css = """
135
+ @keyframes snowfall {
136
+ 0% {
137
+ transform: translateY(-10vh) translateX(0);
138
+ opacity: 1;
139
+ }
140
+ 100% {
141
+ transform: translateY(100vh) translateX(100px);
142
+ opacity: 0.3;
143
+ }
144
+ }
145
+ .snowflake {
146
+ position: fixed;
147
+ color: white;
148
+ font-size: 1.5em;
149
+ user-select: none;
150
+ z-index: 1000;
151
+ pointer-events: none;
152
+ animation: snowfall linear infinite;
153
+ }
154
+ """
155
+
156
+ # JavaScript 코드 정의
157
+ snow_js = """
158
+ function createSnowflake() {
159
+ const snowflake = document.createElement('div');
160
+ snowflake.innerHTML = '❄';
161
+ snowflake.className = 'snowflake';
162
+ snowflake.style.left = Math.random() * 100 + 'vw';
163
+ snowflake.style.animationDuration = Math.random() * 3 + 2 + 's';
164
+ snowflake.style.opacity = Math.random();
165
+ document.body.appendChild(snowflake);
166
+
167
+ setTimeout(() => {
168
+ snowflake.remove();
169
+ }, 5000);
170
+ }
171
+ setInterval(createSnowflake, 200);
172
+ """
173
+
174
+ # CSS와 JavaScript를 결합한 HTML
175
+ snow_html = f"""
176
+ <style>
177
+ {snow_css}
178
+ </style>
179
+ <script>
180
+ {snow_js}
181
+ </script>
182
+ """
183
+
184
+ return gr.HTML(snow_html)
185
+
186
+
187
+ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
188
 
189
+ create_snow_effect()
190
  with gr.Row():
191
  run_button = gr.Button(value="Run")
192