Last active
February 4, 2026 05:47
-
-
Save JoshuaGrams/2e5d3029dc48edf8770abb4a6b682ff2 to your computer and use it in GitHub Desktop.
Line-by-line text reveal: Twine/SugarCube.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This will show at the start. | |
| @@.hide;This will show after you click or press space/enter.@@ | |
| @@.hide;This will show after you advance again.@@ | |
| @@.hide;And again...@@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .hide { display: none; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function revealFirstHidden(ev) { | |
| if(ev.target.nodeName === 'A') return | |
| const hidden = $('.passage .hide') | |
| if(hidden.length > 0) { | |
| let show = hidden.first() | |
| show.removeClass('hide') | |
| if(show[0].scrollIntoView) | |
| show[0].scrollIntoView({behavior: 'smooth', block: 'nearest'}) | |
| } | |
| } | |
| const continueKeys = { " ": true, Enter: true } | |
| $(document).ready(function() { | |
| $('html').on('click', revealFirstHidden) | |
| $('html').on('keypress', function(ev) { | |
| if(continueKeys[ev.key] && !(ev.ctrlKey || ev.altKey || ev.shiftKey)) { | |
| revealFirstHidden(ev) | |
| } | |
| }) | |
| }) |
Author
Sorry, I'm not sure what you're saying. The continue marker doesn't go away when you reveal the last one?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello ! love this , but the continue marker still haunts me whenever i'm adding more than one reveal