1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-12-22 16:58:54 +00:00

fix mobile view

- add viewport to header (otherwise smartphones will render the desktop version)
- set focus to the code editor after loading the page
- fix some android dark mode theme issues by settings clear default for the light theme as well
This commit is contained in:
Florian 2023-05-07 19:23:20 +02:00 committed by PlantUML
parent 5d7c4e1a03
commit f0d78a146b
3 changed files with 21 additions and 19 deletions

View File

@ -5,16 +5,20 @@
/************* variables *************/ /************* variables *************/
:root { :root {
color-scheme: light dark; color-scheme: light dark;
--font-color: black;
--bg-color: white;
--border-color: #ccc; --border-color: #ccc;
--bg-color: inherit; --footer-font-color: #666;
--font-color: inherit; --footer-bg-color: #eee;
--settings-bg-color: #fefefe; --settings-bg-color: #fefefe;
} }
[data-theme="dark"] { [data-theme="dark"] {
--border-color: #848484;
--bg-color: #212121;
--settings-bg-color: #424242;
--font-color: #ccc; --font-color: #ccc;
--bg-color: #212121;
--border-color: #848484;
--footer-font-color: #ccc;
--footer-bg-color: black;
--settings-bg-color: #424242;
} }
/************* default settings *************/ /************* default settings *************/
@ -39,6 +43,14 @@ body {
height: 100%; height: 100%;
} }
} }
input:not([type=image]) {
background-color: var(--bg-color);
color: var(--font-color);
}
select {
background-color: var(--bg-color);
color: var(--font-color);
}
/************* ruler *************/ /************* ruler *************/
.hr { .hr {
@ -114,8 +126,8 @@ body {
} }
} }
.footer p { .footer p {
background-color: #eee; background-color: var(--footer-bg-color);
color: #666; color: var(--footer-font-color);
font-size: 0.7em; font-size: 0.7em;
margin: 0; margin: 0;
padding: 0.5em; padding: 0.5em;
@ -382,14 +394,6 @@ body {
[data-theme="dark"] input[type=image] { [data-theme="dark"] input[type=image] {
filter: invert() contrast(30%); filter: invert() contrast(30%);
} }
[data-theme="dark"] input:not([type=image]) {
background-color: var(--bg-color);
color: var(--font-color);
}
[data-theme="dark"] .footer p {
background-color: black;
color: var(--font-color);
}
[data-theme="dark"] a { [data-theme="dark"] a {
color: white; color: white;
} }

View File

@ -503,6 +503,7 @@ async function initializeApp(view) {
hidePreview(); hidePreview();
} }
document.appConfig.autoRefreshState = "complete"; document.appConfig.autoRefreshState = "complete";
document.editor?.focus();
} }
function loadCodeEditor() { function loadCodeEditor() {

View File

@ -3,6 +3,7 @@
<meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" /> <meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=1" />
<meta name="color-scheme" content="light dark" /> <meta name="color-scheme" content="light dark" />
<link rel="icon" href="favicon.ico" type="image/x-icon"/> <link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
@ -10,7 +11,3 @@
<script src="webjars/monaco-editor/0.36.1/min/vs/loader.js"></script> <script src="webjars/monaco-editor/0.36.1/min/vs/loader.js"></script>
<script src="plantumllanguage.js"></script> <script src="plantumllanguage.js"></script>
<script src="plantuml.js"></script> <script src="plantuml.js"></script>
<script>
const VERSION = <%= net.sourceforge.plantuml.version.Version.version() %>;
const VERSION_STRING = "<%= net.sourceforge.plantuml.version.Version.versionString() %>";
</script>