Skip to content

Commit 5c6def7

Browse files
committed
hide multievent elements on page load
1 parent 28ec20e commit 5c6def7

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

.changeset/thin-suits-agree.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@hyperbook/markdown": patch
3+
"hyperbook": patch
4+
---
5+
6+
Hide multieventy element on page load to not reveal the solutions.

packages/markdown/assets/directive-multievent/multievent.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,8 @@ var multievent = {
964964
}
965965

966966
SK[clNr].style.display = "block";
967+
SK[clNr].style.visibility = "visible";
968+
SK[clNr].style.opacity = "1";
967969

968970
// Add event listeners to save state on changes
969971
var allInputs = SK[clNr].getElementsByTagName("input");

packages/markdown/assets/directive-multievent/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}
99

1010
.directive-multievent {
11+
transition: opacity 0.2s ease-in;
1112

1213
.MECheckbox:not(first-child),
1314
.MERadio:not(first-child) {

packages/markdown/src/remarkDirectiveMultievent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default (ctx: HyperbookContext) => () => {
2626
data.hName = "div";
2727
data.hProperties = {
2828
class: "directive-multievent multievent",
29+
style: "visibility: hidden; opacity: 0;",
2930
};
3031
}
3132
});

website/en/book/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ Add shareable URL builder with sections filter
5454
- Floating action buttons (TOC, QR code) now use dynamic flexbox positioning
5555
- Both share and QR dialogs moved outside content area to remain visible when filtering
5656

57+
58+
:::
59+
60+
:::tab{title="Fixed :bug:" id="fixed"}
61+
62+
- Multievent is hidden on page load and gets shown when the javascript is loaded, thus not revealing the solutions.
63+
5764
:::
5865

5966
::::

0 commit comments

Comments
 (0)