PR1_Sonderuebungen/PR1/.obsidian/plugins/obsidian-advanced-slides/plugin/customcontrols
Gregory Hammond 262f3d8cde vault backup: 2024-05-21 13:28:51 2024-05-21 13:28:52 +02:00
..
README.md vault backup: 2024-05-21 13:28:51 2024-05-21 13:28:52 +02:00
plugin.js vault backup: 2024-05-21 13:28:51 2024-05-21 13:28:52 +02:00
style.css vault backup: 2024-05-21 13:28:51 2024-05-21 13:28:52 +02:00

README.md

Custom controls

This plugin allows to add responsive custom controls to reveal.js which allow arbitrary positioning, layout, and behaviour of the controls.

Check out the live demo

Installation

Copy the files plugin.js and style.css into the plugin folder of your reveal.js presentation, i.e. plugin/customcontrols and load the plugin as shown below.

<link rel="stylesheet" href="plugin/customcontrols/style.css">
<script src="plugin/customcontrols/plugin.js"></script>

<script>
    Reveal.initialize({
        // ...
        plugins: [ RevealCustomControls ],
        // ...
    });
</script>

Note, without configuration you need to add

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

between <head> and </head> of your HTML file because the defaults use Font Awesome.

Configuration

The plugin can be configured by adding custom controls and changing the layout of the slide number, e.g., by:

Reveal.initialize({
	// ...
  customcontrols: {
		controls: [
      {
			  id: 'toggle-overview',
			  title: 'Toggle overview (O)',
			  icon: '<i class="fa fa-th"></i>',
			  action: 'Reveal.toggleOverview();'
			},
			{ icon: '<i class="fa fa-pen-square"></i>',
			  title: 'Toggle chalkboard (B)',
			  action: 'RevealChalkboard.toggleChalkboard();'
			},
			{ icon: '<i class="fa fa-pen"></i>',
			  title: 'Toggle notes canvas (C)',
			  action: 'RevealChalkboard.toggleNotesCanvas();'
			}
		]
	},
	// ...

});

The id and title are optional. The configuration should be self explaining and any number of controls can be added. The style file can be altered to control the layout and responsiveness of the custom controls.

License

MIT licensed

Copyright (C) 2020 Asvin Goel