This commit is contained in:
恍兮惚兮 2024-08-02 16:53:53 +08:00
parent ac476d46f2
commit da26dba8e5
2 changed files with 22 additions and 11 deletions

View File

@ -1,8 +1,14 @@
<div div="example_hello">Hello, welcome to use LunaTranslator</div>
<!-- <script>alert("welcome")</script> --> <script>
// alert("welcome")
clear_all = function () {
_clear_all()
document.getElementById('example_hello').innerText = ""
}
</script>
<style> <style>
body::before { body::before {
background-image: url("./luna.png"); background-image: url("https://image.lunatranslator.xyz/luna.jpg");
opacity: 0.6; opacity: 0.6;
background-size: 100% auto; background-size: 100% auto;
content: ''; content: '';
@ -13,15 +19,15 @@
bottom: 0; bottom: 0;
z-index: -1; z-index: -1;
} }
@media (prefers-color-scheme: dark)
{ @media (prefers-color-scheme: dark) {
:root { :root {
color-scheme: dark; color-scheme: dark;
} }
body
{ body {
background-color: rgb(44,44,44); background-color: rgb(44, 44, 44);
color: white; color: white;
} }
} }
</style> </style>

View File

@ -113,8 +113,13 @@ class TextBrowser(QWidget, dataget):
self.webivewwidget.on_load.connect(self.__loadextra) self.webivewwidget.on_load.connect(self.__loadextra)
def __loadextra(self, _): def __loadextra(self, _):
if os.path.exists("userconfig/extrahtml.html"): for _ in [
with open("userconfig/extrahtml.html", "r", encoding="utf8") as ff: "userconfig/extrahtml.html",
r"LunaTranslator\rendertext\exampleextrahtml.html",
]:
if not os.path.exists(_):
continue
with open(_, "r", encoding="utf8") as ff:
self.set_extra_html(ff.read()) self.set_extra_html(ff.read())
def debugeval(self, js): def debugeval(self, js):