Rename to hkt.sh
This commit is contained in:
30
tmp/fix-nezha-css4.py
Normal file
30
tmp/fix-nezha-css4.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import re
|
||||
|
||||
with open("/tmp/nezha-config-raw.yaml") as f:
|
||||
content = f.read()
|
||||
|
||||
content = re.sub(r"custom_code:.*\n?", "", content)
|
||||
|
||||
css = (
|
||||
'<style>'
|
||||
'body{background:url(/static/bg.jpg) no-repeat center center fixed!important;background-size:cover!important}'
|
||||
'#root,.loaded,.bg-background,.flex.min-h-screen{background:transparent!important}'
|
||||
'main{background:transparent!important}'
|
||||
'main>div>div,section.flex{background:rgba(0,0,0,0.55)!important;'
|
||||
'backdrop-filter:blur(6px)!important;'
|
||||
'-webkit-backdrop-filter:blur(6px)!important;'
|
||||
'border:1px solid rgba(255,255,255,0.12)!important;'
|
||||
'border-radius:16px!important}'
|
||||
'header,nav,footer{background:transparent!important}'
|
||||
'.bg-card,.bg-muted,.bg-accent{background:rgba(0,0,0,0.45)!important}'
|
||||
'p,span,h1,h2,h3,h4,a,button,label,.text-card-foreground,.text-foreground{color:rgba(255,255,255,0.9)!important}'
|
||||
'.text-muted-foreground{color:rgba(255,255,255,0.6)!important}'
|
||||
'</style>'
|
||||
)
|
||||
|
||||
content = content.rstrip() + '\ncustom_code: "' + css + '"\n'
|
||||
|
||||
with open("/tmp/nezha-config-fixed.yaml", "w") as f:
|
||||
f.write(content)
|
||||
|
||||
print("done")
|
||||
Reference in New Issue
Block a user