From d6c72464b75a2bf9b94c93035b8282d467a72488 Mon Sep 17 00:00:00 2001 From: Werner Kramer Date: Tue, 20 Feb 2024 13:23:55 +0100 Subject: [PATCH 1/3] WIP --- docs/public/configuration/README.md | 77 +++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/docs/public/configuration/README.md b/docs/public/configuration/README.md index bb7f42ace..8918ed806 100644 --- a/docs/public/configuration/README.md +++ b/docs/public/configuration/README.md @@ -7,14 +7,83 @@ All configuration related to what content is being displayed in Web OC, is manag Key files in the FEWS Configuration to get started with Web OC are: -- WebOperatorClient.xml (SystemConfigFiles). Configure available Web OC components as well as general items like title and logo: https://publicwiki.deltares.nl/display/FEWSDOC/11+Web+Operator+Client -- WebServices.xml (PiServiceConfigFiles). Web OC highly depends on what data is made available through FewsWebServices, Use this configuration file to configure a filterId, permissions etc.: https://publicwiki.deltares.nl/pages/viewpage.action?pageId=220266993 +- `WebOperatorClient.xml` (SystemConfigFiles). Configure available Web OC components as well as general items like title and logo: https://publicwiki.deltares.nl/display/FEWSDOC/11+Web+Operator+Client +- `WebServices.xml` (PiServiceConfigFiles). Web OC highly depends on what data is made available through FewsWebServices, Use this configuration file to configure a filterId, permissions etc.: https://publicwiki.deltares.nl/pages/viewpage.action?pageId=220266993 Although Web OC will run without any further adjustments to the Delft-FEWS configuration, its strongly recommended to spend some time on your Topology configuration in relation to Web OC (see below). -### System time +> **_NOTE:_** Please note that Web OC will always use the system time of the Web OC users device as Web OC system time. This time setting can not be modified by Web OC configuration. + +## General Web OC configuration + +```xml + + + + Delft FEWS Web Operator Client + + deltares_logo.png + deltares_favicon.svg + + topologyDisplay + weboc-default-style.css + image.png + + https://example.com + terms-of-use + + + + + Topology Disiplay + + topololgy_node_id + + true + + + Terms of Use page + terms-of-use + public + terms-of-use.html + + + +``` + +^ **NOTE**: The FEWS PI webservices (2023.02) can be used to serve [static web resources](https://fewsdocs.deltares.nl/webservices/rest-api/v1/#get-/resources/static/-path-/-id-). +Relative urls in `WebOperatorClient.xml` are first resolved against the base url of the Web OC instance (e.g. `deltares_logo.png`), and then against the resources endpoint of the FewsWebServices instance. + +### Styling + +With the customStyleSheet option in the `WebOperatorClient.xml` , it is possible to load a custom stylesheet for Web OC. This stylesheet will be loaded after the default stylesheet and can be used to override default styles. The custom stylesheet should be placed in the same directory as the index.html file. + +```css +@import '../fonts/exo-2/fonts.css'; +@import './default-styles.css'; +@import './vuetifiy-overrule.css'; + +:root { + --font-family: 'Exo 2', sans-serif; + --theme-color: white; + --contrast-color: black; + --canvas-fill: rgb(223, 223, 223); + --weboc-app-bar-bg-color: #080c80; +} + +.dark { + --contrast-color: rgb(255, 255, 255); + --theme-color: black; + --canvas-fill: rgb(54, 54, 54); +} +``` + +**Fonts** + +**Icons** -Please note that Web OC will always use the system time of the Web OC users device as Web OC system time. This time setting can not be modified by Web OC configuration. ## Web OC navigation using Topology From 433884b64366b964ebdcbc37cc35bfb7b533dd91 Mon Sep 17 00:00:00 2001 From: Werner Kramer Date: Fri, 5 Apr 2024 14:18:45 +0200 Subject: [PATCH 2/3] Fix type in file name --- public/rwsos-style.css | 2 +- public/{vuetifiy-overrule.css => vuetify-overrule.css} | 0 public/weboc-default-style.css | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename public/{vuetifiy-overrule.css => vuetify-overrule.css} (100%) diff --git a/public/rwsos-style.css b/public/rwsos-style.css index e09afea53..80d28ffd3 100644 --- a/public/rwsos-style.css +++ b/public/rwsos-style.css @@ -1,6 +1,6 @@ @import 'fonts/RO/fonts.css'; @import './default-styles.css'; -@import './vuetifiy-overrule.css'; +@import './vuetify-overrule.css'; :root { --font-family: 'RO-Sans', sans-serif; diff --git a/public/vuetifiy-overrule.css b/public/vuetify-overrule.css similarity index 100% rename from public/vuetifiy-overrule.css rename to public/vuetify-overrule.css diff --git a/public/weboc-default-style.css b/public/weboc-default-style.css index dfa9d79ab..acfbf3201 100644 --- a/public/weboc-default-style.css +++ b/public/weboc-default-style.css @@ -1,6 +1,6 @@ @import '../fonts/exo-2/fonts.css'; @import './default-styles.css'; -@import './vuetifiy-overrule.css'; +@import './vuetify-overrule.css'; :root { --font-family: 'Exo 2', sans-serif; From f94cd8f9aa56511a70e5537f091912f49c8bf9ca Mon Sep 17 00:00:00 2001 From: Werner Kramer Date: Fri, 5 Apr 2024 14:19:31 +0200 Subject: [PATCH 3/3] Add documentation of changing colors and fonts --- docs/public/app_configuration/README.md | 73 ++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/docs/public/app_configuration/README.md b/docs/public/app_configuration/README.md index a6b192483..050d92d76 100644 --- a/docs/public/app_configuration/README.md +++ b/docs/public/app_configuration/README.md @@ -13,4 +13,75 @@ The following settings can be provided: | | If not configured the web oc can be accessed without authentication. | | `VITE_AUTH_METADATA_URL` | Url of the OIDC meta data, e.g. "https://login.microsoftonline.com/MYTENANTID/v2.0/.well-known/openid-configuration". | | `VITE_AUTH_SCOPE` | Scope, e.g. "openid profile email Offline_Access api://myclientid/Delft-FEWSWebServices". | -| `VITE_MAPBOX_TOKEN` | Mapbox token. Can be retrieved from: https://account.mapbox.com/access-tokens. | +| `VITE_MAPBOX_TOKEN` | Mapbox token. Can be retrieved from: https://account.mapbox.com/access-tokens. Optional since v1.1.0. | + +## Styling + +By default the Web OC loads the `weboc-default-style.css` which can be found in the root directory of a Web OC build. +Three more style sheets with font specification, chart styles and specific css overruling Vuetify component styles are imported by this file. +In the following section a number of css variables define a number of colors used by the Web OC in normal (light) and dark mode. + +```css +@import './fonts/exo-2/fonts.css'; +@import './default-styles.css'; +@import './vuetify-overrule.css'; + +:root { + --font-family: 'Exo 2', sans-serif; + --theme-color: white; + --contrast-color: black; + --canvas-fill: rgb(223, 223, 223); + --weboc-app-bar-bg-color: #080c80; +} + +.dark { + --contrast-color: rgb(255, 255, 255); + --theme-color: black; + --canvas-fill: rgb(54, 54, 54); +} +``` + +Create a copy of the `weboc-default-style.css` and change the line in the `WebOperatorClient.xml` file to point to the new file: +```xml +weboc-default-style.css +``` +See [Web OC Delft-FEWS configuration ](configuration/) for more information on the `WebOperatorClient.xml` file. + +### Changing the WebOC colors + +Change the following css variable to change the colors used in light or dark mode: + +| Variable | Description | +| --- | ---- | +| `--weboc-app-bar-bg-color` | Color of app top menu bar | +| `--theme-color` | Color of texts and chart axes | +| `--contrast-color` | Contrast color used in charts | +| `--canvas-fill` | Chart canvas background color | + +### Changing the WebOC fonts + +It is easy to host your own set of [web fonts](https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Web_fonts) or use a service like Google fonts https://fonts.google.com/. + +To use a font from the Google font service — check license conditions — replace the first import (`@import './fonts/exo-2/fonts.css';`) with the import statement for including the selected font. Take the import statement from the "Web @import" tab at https://fonts.google.com/selection/embed after selecting a font. + +As an example, the following import make the Dancing Script fonts available + +```css +@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&display=swap') +``` + +Then change the `--font-family` variable to read +```css +:root { + --font-family: 'Dancing Script', sans-serif; + ... +} +``` +The correct name of the font can also be found at https://fonts.google.com/selection/embed. + + + +> [!TIP] +> Using a font service might require changes to the `font-src` and `style-src` Content Security Policy in the webserver configuration. + +Self hosting of web fonts requires fonts in a `woff` or `woff2` format.