Spaces:
Sleeping
Sleeping
Onur Kansoy commited on
Fix: Selectively apply !important to title and fix indentation error
Browse files
app.py
CHANGED
|
@@ -253,7 +253,7 @@ def _run_script(script, start_scene=0, start_dial=0, delay_start=0):
|
|
| 253 |
# ββ CSS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 254 |
CSS = """
|
| 255 |
@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&display=swap');
|
| 256 |
-
*,*::before,*::after{box-sizing:border-box
|
| 257 |
body,.gradio-container{background:#210609!important;font-family:'IM Fell English',serif!important;color:#e8d4a8!important;margin:0!important;padding:0!important}
|
| 258 |
.gradio-container{max-width:100%!important;padding:0!important}
|
| 259 |
footer{display:none!important}
|
|
@@ -263,13 +263,13 @@ footer{display:none!important}
|
|
| 263 |
#main-tabs>.tabitem{border:none!important;padding:0!important;margin:0!important}
|
| 264 |
|
| 265 |
/* Select screen */
|
| 266 |
-
.sel-wrap{position:relative
|
| 267 |
.vid-container{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:0!important;padding:0!important;margin:0!important;border:none!important;background:transparent!important;pointer-events:none}
|
| 268 |
-
.sel-video{width:100%
|
| 269 |
-
.sel-content{z-index:1
|
| 270 |
-
.ttl{font-size:4em
|
| 271 |
-
.sub{font-style:italic
|
| 272 |
-
.pbtn-row{display:flex
|
| 273 |
#btn-comedy button,#btn-drama button,#btn-infidelity button{
|
| 274 |
background:linear-gradient(135deg,#140a0c,#2a1015)!important;border:1px solid #c9a22744!important;
|
| 275 |
color:#c9a227!important;font-family:'IM Fell English',serif!important;font-size:1.05em!important;
|
|
@@ -277,45 +277,45 @@ footer{display:none!important}
|
|
| 277 |
transition:border-color .3s,box-shadow .3s,transform .2s!important}
|
| 278 |
#btn-comedy button:hover,#btn-drama button:hover,#btn-infidelity button:hover{
|
| 279 |
border-color:#c9a227!important;box-shadow:0 0 28px rgba(201,162,39,.25)!important;transform:translateY(-2px)!important}
|
| 280 |
-
.div-txt{color:#7a6a4e
|
| 281 |
#custom-topic textarea{background:#120508!important;border:1px solid #c9a22733!important;color:#e8d4a8!important;
|
| 282 |
font-family:'IM Fell English',serif!important;font-size:1em!important;border-radius:6px!important;min-width:480px!important}
|
| 283 |
-
#status-box{color:#c9a227
|
| 284 |
|
| 285 |
/* Theater screen β curtain reveal animation on entry */
|
| 286 |
-
.th-wrap{position:relative
|
| 287 |
@keyframes curtain-open{
|
| 288 |
0%{clip-path:inset(0 50% 0 50%)}
|
| 289 |
100%{clip-path:inset(0 0% 0 0%)}
|
| 290 |
}
|
| 291 |
-
.scene-img-wrap{position:relative
|
| 292 |
-
.img-curtain{position:absolute
|
| 293 |
-
.img-curtain-left{left:0
|
| 294 |
-
.img-curtain-right{right:0
|
| 295 |
-
.scene-img{width:100%
|
| 296 |
-
.th-lower{padding:20px 32px 16px
|
| 297 |
-
.action-text{font-style:italic
|
| 298 |
-
.char-name{font-size:1rem
|
| 299 |
-
.dialogue-text{color:#e8d4a8
|
| 300 |
-
.dialogue-box{padding:12px 0
|
| 301 |
-
.ctrl-row{display:flex
|
| 302 |
#hist-btn button{background:transparent!important;border:1px solid #c9a22744!important;color:#c9a227!important;
|
| 303 |
font-size:1.1em!important;width:44px!important;height:44px!important;border-radius:50%!important;padding:0!important;min-width:44px!important}
|
| 304 |
-
#history-panel{position:fixed
|
| 305 |
-
background:rgba(10,5,8,.97)
|
| 306 |
-
#history-panel.open{right:0
|
| 307 |
-
.history-inner{display:flex
|
| 308 |
-
.hist-row{padding:8px 0
|
| 309 |
-
.hist-name{font-size:.85em
|
| 310 |
-
.hist-line{color:#9a8a6e
|
| 311 |
-
.mode-toggle{display:flex
|
| 312 |
-
.mode-btn{background:transparent
|
| 313 |
-
.mode-btn.active{background:#c9a22722
|
| 314 |
#interrupt-input textarea{background:#120508!important;border:1px solid #c9a22733!important;color:#e8d4a8!important;font-family:'IM Fell English',serif!important;border-radius:6px!important}
|
| 315 |
-
.ov-fullscreen{position:fixed
|
| 316 |
-
display:flex!important;align-items:center
|
| 317 |
-
.ov-txt{color:#c9a227
|
| 318 |
-
.ov-spin{width:40px
|
| 319 |
@keyframes spin{to{transform:rotate(360deg)}}
|
| 320 |
|
| 321 |
@keyframes nb-in { 0% { opacity:0; } 100% { opacity:1; } }
|
|
@@ -360,14 +360,12 @@ async () => {
|
|
| 360 |
if(old) old.remove();
|
| 361 |
const div = document.createElement("div");
|
| 362 |
div.id = "native-title-overlay";
|
| 363 |
-
|
| 364 |
-
div.style.cssText = `position:absolute;top:0;left:0;width:100%;height:${h}px;z-index:99999;pointer-events:none;overflow:hidden;`;
|
| 365 |
div.innerHTML = `
|
| 366 |
-
<div id="native-bg" style="position:absolute;
|
| 367 |
-
<h1 id="native-text" style="position:absolute;top:
|
| 368 |
`;
|
| 369 |
-
|
| 370 |
-
container.appendChild(div);
|
| 371 |
setTimeout(() => { div.remove(); }, 7500);
|
| 372 |
};
|
| 373 |
window.injectRewriting = (...args) => {
|
|
@@ -375,11 +373,9 @@ async () => {
|
|
| 375 |
if(old) old.remove();
|
| 376 |
const div = document.createElement("div");
|
| 377 |
div.id = "native-rewriting-overlay";
|
| 378 |
-
|
| 379 |
-
div.style.cssText = `position:absolute;top:0;left:0;width:100%;height:${h}px;z-index:99999;background:rgba(10,5,8,0.92);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;overflow:hidden;`;
|
| 380 |
div.innerHTML = `<div class="ov-spin" style="width:40px;height:40px;border:3px solid rgba(201,162,39,0.2);border-top-color:#c9a227;border-radius:50%;animation:spin 1s linear infinite;"></div><div style="color:#c9a227;font-size:1.4em;font-style:italic;">Rewritingβ¦</div>`;
|
| 381 |
-
|
| 382 |
-
container.appendChild(div);
|
| 383 |
return args;
|
| 384 |
};
|
| 385 |
window.removeRewriting = (...args) => {
|
|
|
|
| 253 |
# ββ CSS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 254 |
CSS = """
|
| 255 |
@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&display=swap');
|
| 256 |
+
*,*::before,*::after{box-sizing:border-box}
|
| 257 |
body,.gradio-container{background:#210609!important;font-family:'IM Fell English',serif!important;color:#e8d4a8!important;margin:0!important;padding:0!important}
|
| 258 |
.gradio-container{max-width:100%!important;padding:0!important}
|
| 259 |
footer{display:none!important}
|
|
|
|
| 263 |
#main-tabs>.tabitem{border:none!important;padding:0!important;margin:0!important}
|
| 264 |
|
| 265 |
/* Select screen */
|
| 266 |
+
.sel-wrap{position:relative;overflow:hidden;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#210609}
|
| 267 |
.vid-container{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:0!important;padding:0!important;margin:0!important;border:none!important;background:transparent!important;pointer-events:none}
|
| 268 |
+
.sel-video{width:100%;height:100%;object-fit:cover;transition:filter .8s ease;pointer-events:none;display:block;transform:scale(1.05)}
|
| 269 |
+
.sel-content{z-index:1;position:relative;transition:opacity .5s ease;display:flex;flex-direction:column;align-items:center;gap:32px;padding:60px 40px}
|
| 270 |
+
.ttl{font-size:4em;color:#c9a227!important;text-shadow:0 0 60px rgba(201,162,39,.4);margin:0;text-align:center;letter-spacing:.05em}
|
| 271 |
+
.sub{font-style:italic;color:#7a6a4e;font-size:1.1em;margin:-20px 0 0;text-align:center}
|
| 272 |
+
.pbtn-row{display:flex;gap:16px;flex-wrap:wrap;justify-content:center}
|
| 273 |
#btn-comedy button,#btn-drama button,#btn-infidelity button{
|
| 274 |
background:linear-gradient(135deg,#140a0c,#2a1015)!important;border:1px solid #c9a22744!important;
|
| 275 |
color:#c9a227!important;font-family:'IM Fell English',serif!important;font-size:1.05em!important;
|
|
|
|
| 277 |
transition:border-color .3s,box-shadow .3s,transform .2s!important}
|
| 278 |
#btn-comedy button:hover,#btn-drama button:hover,#btn-infidelity button:hover{
|
| 279 |
border-color:#c9a227!important;box-shadow:0 0 28px rgba(201,162,39,.25)!important;transform:translateY(-2px)!important}
|
| 280 |
+
.div-txt{color:#7a6a4e;font-style:italic;font-size:.9em}
|
| 281 |
#custom-topic textarea{background:#120508!important;border:1px solid #c9a22733!important;color:#e8d4a8!important;
|
| 282 |
font-family:'IM Fell English',serif!important;font-size:1em!important;border-radius:6px!important;min-width:480px!important}
|
| 283 |
+
#status-box{color:#c9a227;font-style:italic;font-size:.95em;min-height:24px;text-align:center}
|
| 284 |
|
| 285 |
/* Theater screen β curtain reveal animation on entry */
|
| 286 |
+
.th-wrap{position:relative;min-height:100vh;background:radial-gradient(circle at center top, #3a0d18 0%, #210609 80%);display:flex;flex-direction:column;animation:curtain-open 1.4s cubic-bezier(.77,0,.18,1) both}
|
| 287 |
@keyframes curtain-open{
|
| 288 |
0%{clip-path:inset(0 50% 0 50%)}
|
| 289 |
100%{clip-path:inset(0 0% 0 0%)}
|
| 290 |
}
|
| 291 |
+
.scene-img-wrap{position:relative;width:100%;max-height:340px;overflow:hidden;background:#000;border-bottom:1px solid #c9a22722}
|
| 292 |
+
.img-curtain{position:absolute;top:0;height:120%;width:15%;max-width:150px;z-index:10;pointer-events:none;object-fit:fill;filter:drop-shadow(0 0 15px rgba(0,0,0,0.9))}
|
| 293 |
+
.img-curtain-left{left:0}
|
| 294 |
+
.img-curtain-right{right:0;transform:scaleX(-1)}
|
| 295 |
+
.scene-img{width:100%;max-height:340px;object-fit:cover;display:block;transition:opacity .6s}
|
| 296 |
+
.th-lower{padding:20px 32px 16px;flex:1;display:flex;flex-direction:column;gap:16px}
|
| 297 |
+
.action-text{font-style:italic;color:#7a6a4e;font-size:.85rem;margin-bottom:4px}
|
| 298 |
+
.char-name{font-size:1rem;font-weight:bold;letter-spacing:.04em;margin-bottom:6px}
|
| 299 |
+
.dialogue-text{color:#e8d4a8;font-size:1.1rem;line-height:1.8;min-height:2em}
|
| 300 |
+
.dialogue-box{padding:12px 0}
|
| 301 |
+
.ctrl-row{display:flex;align-items:center;gap:12px;border-top:1px solid #c9a22722;padding-top:14px;flex-wrap:wrap}
|
| 302 |
#hist-btn button{background:transparent!important;border:1px solid #c9a22744!important;color:#c9a227!important;
|
| 303 |
font-size:1.1em!important;width:44px!important;height:44px!important;border-radius:50%!important;padding:0!important;min-width:44px!important}
|
| 304 |
+
#history-panel{position:fixed;top:0;right:-420px;height:100vh;width:400px;z-index:500;
|
| 305 |
+
background:rgba(10,5,8,.97);border-left:2px solid #c9a227;padding:24px 20px;overflow-y:auto;transition:right .3s}
|
| 306 |
+
#history-panel.open{right:0}
|
| 307 |
+
.history-inner{display:flex;flex-direction:column;gap:10px}
|
| 308 |
+
.hist-row{padding:8px 0;border-bottom:1px solid #c9a22722}
|
| 309 |
+
.hist-name{font-size:.85em;font-weight:bold;display:block;margin-bottom:2px}
|
| 310 |
+
.hist-line{color:#9a8a6e;font-style:italic;font-size:.95em}
|
| 311 |
+
.mode-toggle{display:flex;border:1px solid #c9a22744;border-radius:6px;overflow:hidden}
|
| 312 |
+
.mode-btn{background:transparent;border:none;color:#7a6a4e;padding:8px 18px;font-family:'IM Fell English',serif;font-size:.9em;cursor:pointer;transition:all .2s}
|
| 313 |
+
.mode-btn.active{background:#c9a22722;color:#c9a227}
|
| 314 |
#interrupt-input textarea{background:#120508!important;border:1px solid #c9a22733!important;color:#e8d4a8!important;font-family:'IM Fell English',serif!important;border-radius:6px!important}
|
| 315 |
+
.ov-fullscreen{position:fixed;inset:0;z-index:400;background:rgba(10,5,8,.92);
|
| 316 |
+
display:flex!important;align-items:center;justify-content:center;flex-direction:column;gap:16px}
|
| 317 |
+
.ov-txt{color:#c9a227;font-size:1.4em;font-style:italic}
|
| 318 |
+
.ov-spin{width:40px;height:40px;border:3px solid #c9a22733;border-top-color:#c9a227;border-radius:50%;animation:spin 1s linear infinite}
|
| 319 |
@keyframes spin{to{transform:rotate(360deg)}}
|
| 320 |
|
| 321 |
@keyframes nb-in { 0% { opacity:0; } 100% { opacity:1; } }
|
|
|
|
| 360 |
if(old) old.remove();
|
| 361 |
const div = document.createElement("div");
|
| 362 |
div.id = "native-title-overlay";
|
| 363 |
+
div.style.cssText = "position:fixed;inset:0;z-index:99999;pointer-events:none;overflow:hidden;";
|
|
|
|
| 364 |
div.innerHTML = `
|
| 365 |
+
<div id="native-bg" style="position:absolute;inset:0;background:#0a0508;opacity:0;animation: nb-in 0.8s ease forwards 2.4s, nb-out 0.8s ease forwards 6.5s; z-index:1;"></div>
|
| 366 |
+
<h1 id="native-text" style="position:absolute;top:180px;left:0;width:100%;z-index:10;color:#c9a227;font-size:4em;text-align:center;margin:0;padding:0;opacity:0;animation: nt-in 1.5s ease-out forwards 3.0s, nt-out 1.5s ease-in forwards 5.5s; text-shadow:0 0 40px rgba(201,162,39,0.5);font-family:'IM Fell English',serif;">${titleText}</h1>
|
| 367 |
`;
|
| 368 |
+
document.body.appendChild(div);
|
|
|
|
| 369 |
setTimeout(() => { div.remove(); }, 7500);
|
| 370 |
};
|
| 371 |
window.injectRewriting = (...args) => {
|
|
|
|
| 373 |
if(old) old.remove();
|
| 374 |
const div = document.createElement("div");
|
| 375 |
div.id = "native-rewriting-overlay";
|
| 376 |
+
div.style.cssText = "position:fixed;inset:0;z-index:99999;background:rgba(10,5,8,0.92);display:flex;align-items:center;justify-content:flex-start;padding-top:250px;flex-direction:column;gap:16px;overflow:hidden;";
|
|
|
|
| 377 |
div.innerHTML = `<div class="ov-spin" style="width:40px;height:40px;border:3px solid rgba(201,162,39,0.2);border-top-color:#c9a227;border-radius:50%;animation:spin 1s linear infinite;"></div><div style="color:#c9a227;font-size:1.4em;font-style:italic;">Rewritingβ¦</div>`;
|
| 378 |
+
document.body.appendChild(div);
|
|
|
|
| 379 |
return args;
|
| 380 |
};
|
| 381 |
window.removeRewriting = (...args) => {
|