fix: darkmode extended to html webpage

fix #269
This commit is contained in:
Xiao YiFang 2022-12-24 08:56:52 +08:00
parent fd791d3d2f
commit 5fe3cc5028
3 changed files with 7591 additions and 0 deletions

View file

@ -148,6 +148,21 @@ std::string ArticleMaker::makeHtmlHeader( QString const & word,
"}"
"</script>";
result+= "<script type=\"text/javascript\" src=\"qrc:///scripts/gd-builtin.js\"></script>";
#ifdef Q_OS_WIN32
if( GlobalBroadcaster::instance()->getPreference()->darkMode )
{
result += "<script type=\"text/javascript\" src=\"qrc:///scripts/darkreader.js\"></script>";
result +=
"<script type=\"text/javascript\">"
"DarkReader.enable({"
" brightness: 100,"
" contrast: 90,"
" sepia: 10"
"});"
"</script>";
}
#endif
result += "</head><body>";
return result;

View file

@ -6,5 +6,6 @@
<file>scripts/gd-custom.js</file>
<file>scripts/jquery-3.6.0.slim.min.js</file>
<file>scripts/iframe-defer.js</file>
<file>scripts/darkreader.js</file>
</qresource>
</RCC>

7575
scripts/darkreader.js Normal file

File diff suppressed because it is too large Load diff