Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,64 @@ footer {visibility: hidden}
|
|
55 |
.gr-box {border-radius: 10px; border: 1px solid #ddd}
|
56 |
"""
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
|
|
|
59 |
gr.HTML("<h1 class='title'>LOGO Generator AI</h1>")
|
60 |
|
61 |
with gr.Column(elem_id="container"):
|
|
|
55 |
.gr-box {border-radius: 10px; border: 1px solid #ddd}
|
56 |
"""
|
57 |
|
58 |
+
|
59 |
+
def create_snow_effect():
|
60 |
+
# CSS 스타일 정의
|
61 |
+
snow_css = """
|
62 |
+
@keyframes snowfall {
|
63 |
+
0% {
|
64 |
+
transform: translateY(-10vh) translateX(0);
|
65 |
+
opacity: 1;
|
66 |
+
}
|
67 |
+
100% {
|
68 |
+
transform: translateY(100vh) translateX(100px);
|
69 |
+
opacity: 0.3;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
.snowflake {
|
73 |
+
position: fixed;
|
74 |
+
color: white;
|
75 |
+
font-size: 1.5em;
|
76 |
+
user-select: none;
|
77 |
+
z-index: 1000;
|
78 |
+
pointer-events: none;
|
79 |
+
animation: snowfall linear infinite;
|
80 |
+
}
|
81 |
+
"""
|
82 |
+
|
83 |
+
# JavaScript 코드 정의
|
84 |
+
snow_js = """
|
85 |
+
function createSnowflake() {
|
86 |
+
const snowflake = document.createElement('div');
|
87 |
+
snowflake.innerHTML = '❄';
|
88 |
+
snowflake.className = 'snowflake';
|
89 |
+
snowflake.style.left = Math.random() * 100 + 'vw';
|
90 |
+
snowflake.style.animationDuration = Math.random() * 3 + 2 + 's';
|
91 |
+
snowflake.style.opacity = Math.random();
|
92 |
+
document.body.appendChild(snowflake);
|
93 |
+
|
94 |
+
setTimeout(() => {
|
95 |
+
snowflake.remove();
|
96 |
+
}, 5000);
|
97 |
+
}
|
98 |
+
setInterval(createSnowflake, 200);
|
99 |
+
"""
|
100 |
+
|
101 |
+
# CSS와 JavaScript를 결합한 HTML
|
102 |
+
snow_html = f"""
|
103 |
+
<style>
|
104 |
+
{snow_css}
|
105 |
+
</style>
|
106 |
+
<script>
|
107 |
+
{snow_js}
|
108 |
+
</script>
|
109 |
+
"""
|
110 |
+
|
111 |
+
return gr.HTML(snow_html)
|
112 |
+
|
113 |
+
|
114 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
|
115 |
+
create_snow_effect()
|
116 |
gr.HTML("<h1 class='title'>LOGO Generator AI</h1>")
|
117 |
|
118 |
with gr.Column(elem_id="container"):
|