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

View File

@ -113,8 +113,13 @@ class TextBrowser(QWidget, dataget):
self.webivewwidget.on_load.connect(self.__loadextra)
def __loadextra(self, _):
if os.path.exists("userconfig/extrahtml.html"):
with open("userconfig/extrahtml.html", "r", encoding="utf8") as ff:
for _ in [
"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())
def debugeval(self, js):