decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
60 stars 15 forks source link

Feature: "accessible handout mode" #55

Closed salbeira closed 1 year ago

salbeira commented 1 year ago

Adds a feature to the "a11y" plugin:

The user can click a button in the navigation menu to view the presentation as a single scrollable page instead of a slide deck. This is done so assistive technology can parse and navigate through the presentation as a single document.

In addition this allows us to sunset the handout feature of decker as all of our reveal.js plugins are not activated inside handouts, causing them to lack a lot of features and content conversions.

Also I heared some people like to scroll through presentations on their smartphone rather than swipe around.

The feature is implemented by "kidnapping" the slides into a fake reveal element. This is done so our css rules responsible for layouting are kept the same. The "kidnapping" is necessary because if the slides are kept inside the reveal container, reveal itself randomly re-establishes its layouting and resets all attribute changes that are necessary to enable the scrolling view.

Intersection Observers are used to load and unload iframes and videos that scroll in and out of view.

The feedback plugin is modified so it does not reload the "currentSlide" questions if the handout mode is enabled and instead takes the data from the currently "in view" slide while the handout mode is active.

mbotsch commented 1 year ago

Some more comments and bugs:

mbotsch commented 1 year ago

Look's good, thanks! I noticed two more things that do not work:

mbotsch commented 1 year ago

I fixed the background images and the touch scrolling issue. The keyboard navigation is still open.

monofon commented 1 year ago

Very nice!

So far, I found one thing that does not seem to work: background interactive iframes.

# ![](/apps/image-zoom.html){.frame .interactive}

Produces an empty slide. The iFrame is nowhere to be seen. The iframe app works as expected if not used on the slide background.

salbeira commented 1 year ago

The keyboard one is a bit of a doozy: The default keyboard behaviour can be restored by disabling reveal's keyboard configuration. None of our custom keyboard commands are available then though.

I am adding a custom keyboard event handler that scrolls the viewport if we are in handout mode.

@monofon Can you list what media elements are available as background elements? (Before you wrote this I thought images and videos are the height of technological advancements in background technology)

monofon commented 1 year ago

Standard Reveal feature: https://revealjs.com/backgrounds/

mbotsch commented 1 year ago

I implemented background videos for handout mode. I guess that background iframes should work in a similar fashion.

@monofon are you using background iframes for your slides? I didn't even know that those existed...

monofon commented 1 year ago

Yes, i do.

mbotsch commented 1 year ago

I just noticed that background videos and background iframes should use data-src instead of src and the intersection observer should then load the content when the slide becomes visible.

mbotsch commented 1 year ago

The ping-pong is getting inefficient. Let me give it a try...

mbotsch commented 1 year ago

@salbeira , @monofon What do you think about those?

monofon commented 1 year ago

Todschick.

My background iFrames work perfectly. Videos too.

Zoom is nice but:

Even my Javascript embeddings work.

Same for my embedded test quizzes.

As to your questions:

  1. No snapping to see here. Do I have to enable that somehow?
  2. Zoom is good. See above.
  3. Probably not.

Tested on 9edf1461c91f77.

mbotsch commented 1 year ago

I found some more quirks. Fixing them required that our UI anchors had to be move from the Reveal element to its parent (the reveal-viewport element). While this seem to be the more natural choice anyway, I had to make several CSS adjustments (presenter mode, (my) poll mode, whiteboard buttons).

Please test once more...