mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
example
This commit is contained in:
parent
ac476d46f2
commit
da26dba8e5
@ -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>
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user