K00B404 commited on
Commit
b353a09
·
verified ·
1 Parent(s): a8ca61f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +145 -1
app.py CHANGED
@@ -14,7 +14,151 @@ background_html = """
14
  </p>
15
  <script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
16
  """
 
 
 
 
 
 
 
 
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  def respond(
19
  message,
20
  history: list[tuple[str, str]],
@@ -48,7 +192,7 @@ def respond(
48
  yield response
49
 
50
 
51
- with gr.Blocks() as demo:
52
  #gr.HTML(background_html) # Insert the background effect
53
  gr.ChatInterface(
54
  respond,
 
14
  </p>
15
  <script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
16
  """
17
+
18
+ title_html="""
19
+ <center>
20
+ <div id="title-container">
21
+ <h1 id="title-text">FLUX Capacitor</h1>
22
+ </div>
23
+ </center>
24
+ """
25
 
26
+ css = """
27
+ .gradio-container {
28
+ background: url(https://huggingface.co/spaces/K00B404/FLUX.1-Dev-Serverless-darn-enhanced-prompt/resolve/main/edge.png);
29
+ background-size: 900px 880px;
30
+ background-repeat: no-repeat;
31
+ background-position: center;
32
+ background-attachment: fixed;
33
+ color:#000;
34
+ }
35
+ .dark\:bg-gray-950:is(.dark *) {
36
+ --tw-bg-opacity: 1;
37
+ background-color: rgb(157, 17, 142);
38
+ }
39
+ .gradio-container-4-41-0 .prose :last-child {
40
+ margin-top: 8px !important;
41
+ }
42
+ .gradio-container-4-41-0 .prose :last-child {
43
+ margin-bottom: -7px !important;
44
+ }
45
+ .dark {
46
+ --button-primary-background-fill: #09e60d70;
47
+ --button-primary-background-fill-hover: #00000070;
48
+ --background-fill-primary: #000;
49
+ --background-fill-secondary: #000;
50
+ }
51
+ .hide-container {
52
+ margin-top;-2px;
53
+ }
54
+ #app-container3 {
55
+ background-color: rgba(255, 255, 255, 0.001); /* Corrected to make semi-transparent */
56
+ max-width: 600px;
57
+ margin-left: auto;
58
+ margin-right: auto;
59
+ margin-bottom: 10px;
60
+ border-radius: 125px;
61
+ box-shadow: 0 0 10px rgba(0,0,0,0.1); /* Adjusted shadow opacity */
62
+ }
63
+ #app-container {
64
+ background-color: rgba(255, 255, 255, 0.001); /* Semi-transparent background */
65
+ max-width: 600px;
66
+ margin: 0 auto; /* Center horizontally */
67
+ padding-bottom: 10px;
68
+ border-radius: 25px;
69
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Adjusted shadow opacity */
70
+ }
71
+ .panel-container {
72
+ background-image: url('your-neon-border-image.png');
73
+ background-size: 100% 100%; /* Adjust the size to cover the container */
74
+ background-repeat: no-repeat;
75
+ background-position: center;
76
+ }
77
+ #title-container {
78
+ display: flex;
79
+ align-items: center
80
+ margin-bottom:10px;
81
+ justify-content: center;
82
+ }
83
+ #title-icon {
84
+ width: 32px;
85
+ height: auto;
86
+ margin-right: 10px;
87
+ }
88
+ #title-text {
89
+ font-size: 30px;
90
+ font-weight: bold;
91
+ color: #000;
92
+ }
93
+ :root {
94
+ --panel-size: 300px;
95
+ --border-width: 4px;
96
+ --glow-blur: 15px;
97
+ }
98
+ body {
99
+ background-color: #000;
100
+ display: flex;
101
+ justify-content: center;
102
+ align-items: center;
103
+ min-height: 100vh;
104
+ margin: 0;
105
+ }
106
+ .neon-panel {
107
+ width: var(--panel-size);
108
+ height: var(--panel-size);
109
+ background-color: #000;
110
+ position: relative;
111
+ border-radius: 20px;
112
+ overflow: hidden;
113
+ }
114
+ .neon-panel::before,
115
+ .neon-panel::after {
116
+ content: '';
117
+ position: absolute;
118
+ left: -2px;
119
+ top: -2px;
120
+ background: linear-gradient(
121
+ 124deg,
122
+ #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840,
123
+ #1ddde8, #2b1de8, #dd00f3, #dd00f3
124
+ );
125
+ background-size: 300% 300%;
126
+ width: calc(100% + 4px);
127
+ height: calc(100% + 4px);
128
+ z-index: -1;
129
+ animation: moveGradient 10s ease infinite;
130
+ }
131
+ .neon-panel::after {
132
+ filter: blur(var(--glow-blur));
133
+ }
134
+ .neon-panel-content {
135
+ position: absolute;
136
+ top: var(--border-width);
137
+ left: var(--border-width);
138
+ right: var(--border-width);
139
+ bottom: var(--border-width);
140
+ background-color: #000;
141
+ border-radius: 16px;
142
+ z-index: 1;
143
+ }
144
+ @keyframes moveGradient {
145
+ 0% { background-position: 0% 50%; }
146
+ 50% { background-position: 100% 50%; }
147
+ 100% { background-position: 0% 50%; }
148
+ }
149
+ @media (max-width: 768px) {
150
+ :root {
151
+ --panel-size: 250px;
152
+ --glow-blur: 10px;
153
+ }
154
+ }
155
+ @media (prefers-reduced-motion: reduce) {
156
+ .neon-panel::before,
157
+ .neon-panel::after {
158
+ animation: none;
159
+ }
160
+ }
161
+ """
162
  def respond(
163
  message,
164
  history: list[tuple[str, str]],
 
192
  yield response
193
 
194
 
195
+ with gr.Blocks(css=css) as demo:
196
  #gr.HTML(background_html) # Insert the background effect
197
  gr.ChatInterface(
198
  respond,