diff --git a/CHANGELOG.md b/CHANGELOG.md index 759f0bb9..df181529 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Back to [Readme](README.md). +## [3.8.2] - 2024-10-30 + +### Added + +* Dark mode + ## [3.8.1] - 2024-09-12 ### Changed @@ -918,6 +924,8 @@ the core component is now the reporting engine that is the base for other forms Initial project version on GitHub and Maven Central. +[3.8.2]: https://github.com/trivago/cluecumber-report-plugin/tree/v3.8.2 + [3.8.1]: https://github.com/trivago/cluecumber-report-plugin/tree/v3.8.1 [3.8.0]: https://github.com/trivago/cluecumber-report-plugin/tree/v3.8.0 diff --git a/engine/src/main/resources/template/css/cluecumber.css b/engine/src/main/resources/template/css/cluecumber.css index e9b0284e..a489257b 100644 --- a/engine/src/main/resources/template/css/cluecumber.css +++ b/engine/src/main/resources/template/css/cluecumber.css @@ -297,4 +297,23 @@ tr.even td, tr.odd td { .multiRunChildren { margin-top: 1rem; -} \ No newline at end of file +} + +html.dark-mode { + filter: invert(100%) hue-rotate(180deg); +} + +html.dark-mode img, +html.dark-mode video, +html.dark-mode .color-passed, +html.dark-mode .color-failed, +html.dark-mode .color-skipped, +html.dark-mode .border-color-passed, +html.dark-mode .border-color-failed, +html.dark-mode .border-color-skipped{ + filter: invert(100%) hue-rotate(180deg); +} + +#dark-mode-toggle { + margin-right: 10px; +} diff --git a/engine/src/main/resources/template/macros/navigation.ftl b/engine/src/main/resources/template/macros/navigation.ftl index ae464a4d..2a8b2228 100644 --- a/engine/src/main/resources/template/macros/navigation.ftl +++ b/engine/src/main/resources/template/macros/navigation.ftl @@ -61,6 +61,7 @@ limitations under the License. + ${reportDetails.date} diff --git a/engine/src/main/resources/template/snippets/js.ftl b/engine/src/main/resources/template/snippets/js.ftl index 7b7c0d98..86a4accb 100644 --- a/engine/src/main/resources/template/snippets/js.ftl +++ b/engine/src/main/resources/template/snippets/js.ftl @@ -125,9 +125,29 @@ limitations under the License. if (${expandPreviousScenarioRuns?c}) { $("[data-cluecumber-item='multi-run-button']").click(); } + + const isDarkMode = localStorage.getItem('darkMode') === 'enabled'; + if (isDarkMode) { + document.documentElement.classList.add('dark-mode'); + } + updateToggleButton(isDarkMode); + + document.getElementById('dark-mode-toggle').addEventListener('click', toggleDarkMode); } ); + function toggleDarkMode() { + document.documentElement.classList.toggle('dark-mode'); + const isDarkMode = document.documentElement.classList.contains('dark-mode'); + localStorage.setItem('darkMode', isDarkMode ? 'enabled' : 'disabled'); + updateToggleButton(isDarkMode); + } + + function updateToggleButton(isDarkMode) { + const button = document.getElementById('dark-mode-toggle'); + button.textContent = isDarkMode ? 'Toggle Light Mode' : 'Toggle Dark Mode'; + } + function resizeIframe(iframe) { setInterval(function () { try { diff --git a/examples/maven-example/pom.xml b/examples/maven-example/pom.xml index f889deb5..bb1b7957 100644 --- a/examples/maven-example/pom.xml +++ b/examples/maven-example/pom.xml @@ -6,7 +6,7 @@ blog.softwaretester maven-example - 3.8.1 + 3.8.2 pom diff --git a/pom.xml b/pom.xml index 187349b7..b9baf920 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ - 3.8.1 + 3.8.2 11 11 11