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