From 8b173ff6cdd1563d81cce76a2621779c766313e4 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 2 Feb 2023 18:18:04 +0100 Subject: [PATCH] fixed broken nav menu & link replacement errors --- website/docs/gettingStarted.html | 225 +++++++++++++++++++++++-- website/docs/nav.html | 2 +- website/docs/plugins/autoplay.html | 43 +++++ website/docs/plugins/blackout.html | 27 +++ website/docs/plugins/form.html | 36 ++++ website/docs/plugins/fullscreen.html | 28 +++ website/docs/plugins/media.html | 49 ++++++ website/docs/plugins/navigation.html | 39 +++++ website/docs/plugins/resize.html | 27 +++ website/docs/plugins/touch.html | 27 +++ website/docs/reference/CSS.html | 2 +- website/docs/reference/JavaScript.html | 2 +- website/docs/src/build.js | 6 +- 13 files changed, 490 insertions(+), 23 deletions(-) create mode 100644 website/docs/plugins/autoplay.html create mode 100644 website/docs/plugins/blackout.html create mode 100644 website/docs/plugins/form.html create mode 100644 website/docs/plugins/fullscreen.html create mode 100644 website/docs/plugins/media.html create mode 100644 website/docs/plugins/navigation.html create mode 100644 website/docs/plugins/resize.html create mode 100644 website/docs/plugins/touch.html diff --git a/website/docs/gettingStarted.html b/website/docs/gettingStarted.html index 1debef2..b818309 100644 --- a/website/docs/gettingStarted.html +++ b/website/docs/gettingStarted.html @@ -1,25 +1,214 @@ - - - Getting Started - impress.js + + + /gettingStarted :: | DOCS - impress.js + + + - - -
- -
-
-
-

Getting Started with impress.js

-

impress.js is a JavaScript framework to create stunning presentations. Note: impress may not help you, if you have nothing interesting to say!

-

If you are new to impress and you want to learn to use it, we suggest you start here!

-
+ + +
+ +
+
+
+

Introduction

+

Welcome to impress.js! This presentation framework allows you to create stunning presentations with the power of CSS3 transformations. +NOTE: This Guide is not made for you, if you have never written HTML and/or CSS before. Knowing your way around in JavaScript certainly helps, but is not a necessity. You may still continue this tutorial and try to understand what we do as you go.

+

For more advanced and complete documentation, you might prefer the DOCUMENTATION.

+

Getting started with impress.js

+

Installation / acquiring the framework

+

First of all, you need to know, if you are going to have WiFi connection when you hold your presentation. If you are not sure, please use the method where you download the file instead of the cdn.

+

Including from cdn

+

Loading the script from the cdn is quite straight forward. If you copy the below example code, you need to do nothing else, impress will be loaded automatically.

+

Direct links to different versions of the impress.js file

+
    +
  • V2.0.0: https://cdn.jsdelivr.net/gh/impress/impress.js@2.0.0/js/impress.js
  • +
  • V1.1.0: https://cdn.jsdelivr.net/gh/impress/impress.js@1.1.0/js/impress.js
  • +
  • Source: https://cdn.jsdelivr.net/gh/impress/impress.js/js/impress.js
  • +
+

Download the file to your PC

+

Head to the releases tab and download the source code as zip or as a tarball. Go ahead and unzip / untar it. You need to copy the folder /js/ into the folder you are working in. Optionally, if you want to make your life a bit easier, you can copy also copy the folder /css/ in there.

+

Setting up the project

+

Open up your favorite text-editor / IDE, for example Visual Studio Code, Atom, Notepad ++, ... +Now, create a new file called index.html and create the basic HTML structure:

+
<!DOCTYPE html>
+<html>
+    <head>
+        <title>My first presentation</title>
+        <link rel="stylesheet" href="./css/impress-common.css"><!--Leave out, if you don't use impress-common.css-->
+    </head>
+    <body class="impress-not-supported">
+        <div class="fallback-message">
+            <p>Your browser <b>doesn't support the features required</b> by impress.js, so you are presented with a simplified version of this presentation.</p>
+            <p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>
+        </div>
+
+        <div id="impress">
+            <div id="myFirstSlide" class="step">
+                <h1>My first Slide</h1>
+            </div>
+        </div>
+
+        <script src="js/impress.js"></script>
+        <script>window.impress || document.write('<script src="https://cdn.jsdelivr.net/gh/impress/impress.js@2.0.0/js/impress.js">\x3C/script>');</script>
+        <script>impress().init()</script>
+    </body>
+</html>
+
+

Now, head into a file-manager, navigate to the file you just created (index.html) and open it. You should end up in a browser where you should see "My first Slide" displayed. As this is not really exciting, we are not gonna change anything about that and are gonna look at what you just typed. What do these lines mean?

+

Well, first things first, you should probably give your presentation a title. You may do this in normal HTML fashion by changing the title HTML tag.

+

So now, we reached the HTML body. You can see that it already belongs to a class. This class just tells impress.js that this is the body where the "fallback-message" should be displayed when it detects, that your browser does not support CSS3 and therefore impress.js won't work. You can easily omit that class though, including the "fallback-message" div with its content, if you only intend to use the presentation for yourself and you know about the fact that some browsers might not work.

+

Now, probably the most important part of all is the div that belongs to the impress class. This div should contain all the HTML code you write, as everything outside that class will not be animated by impress.js.

+

Finally, we load the impress.js script from your local copy (if you have one) or from the cdn, if you do not have a local copy and execute

+
impress().init()
+
+

to initialize impress.js. Now, let's continue on to explore more and more features of this amazing tool!

+

Creating slides

+

Creating slides is fairly easy. You create a div that belongs to the class step and you are off to the races! Let me give you an example:

+
<div class="step">
+Hello World
+</div>
+
+

Now, if you reload the presentation, you start to see a *slight* problem. All your text is stacked... How do we work around that?

+

Obviously, impress.js has an answer to it. You can add the following additional attributes to your div, to make it work:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeExplanation
data-xPosition the element along the x-axis (from left to right)
data-yPosition the element along the y-axis (from top to bottom)
data-zPosition the element along the z-axis (3D-Effect, move the element behind another one)
data-rotateRotate the element (if not using data-z!)
data-rotate-xRotate the element along the x-axis
data-rotate-yRotate the element along the y-axis
data-rotate-zRotate the element along the z-axis
data-scaleScale the element.
+

These are the basic positioning options in impress.js. All of the attributes take Strings as arguments, so be aware of the fact, that you need to put quotation marks around the numbers! The data-rotate attributes take an angle in form of a String as argument.

+

Now, that you have created the slides, you might want to style them. This is where CSS comes into play. Add another file to your project called, e.g., style.css.

+

NOTE: Whatever you do, do not mess with positioning and rotation of the div that belongs to the class step, but add a div inside of it, if you really have to mess with these properties. See the example below. Always position steps with the data- attribute!

+
<div class="step yourClassNameHere" data-x="1000" data-y="1000" data-z="-1000" data-scale="2" data-rotate-z="90">
+    <div class="yourSubClassNameHere">
+        <h1>Powerful, yet still simple</h1>
+    </div>
+</div>
+
+

NOTE: You may also use negative numbers for all these properties!

+

More advanced features

+

You might want to change some default settings, like the transition speed, the width & height of the target screen, etc. This table is from the DOCUMENTATION and was slightly adapted.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDefaultExplanation
data-transition-duration1000 (ms)Speed of transition between steps.
data-width1920 (px)Width of target screen size. When presentation is viewed on a larger or smaller screen, impress.js will scale all content automatically.
data-height1080 (px)Height of target screen size.
data-max-scale3Maximum scale factor. (Note that the default 1 will not increase content size on larger screens!)
data-min-scale0Minimum scale factor.
data-perspective1000Perspective for 3D rendering. See https://developer.mozilla.org/en/CSS/perspective
+

Renaming Steps

+

You can give each step an ID. The name of the ID will be displayed in the browsers navigation bar instead of the default step-x whereas x is replaced by the current step number. This can be especially helpful, when trying to jump between steps and go back to a previous one. If you want to know how to move to a specific slide, you should take a look at the README of the "Goto" plugin.

+

Using PLUGINS

+

Impress.js is limited to everything that we have discussed so far and some other details, we won't go over here. Check the DOCUMENTATION for that.

+

impress.js has accumulated a lot of very useful plugins. You may find all of them here!

+

Each Plugin has a README.md file which you may read to get an idea on how to use them. Some of the plugins run unnoticed in the background, like the resize plugin, which automatically resizes the presentation whenever the browser window changed in size. Here, I will give you an overview of some of the plugins that impress.js includes by default.

+

NOTE: As previously mentioned, if you'd like to get more info about how it works, take a look at the DOCUMENTATION or the README.md files of the plugins.

+

impressConsole

+

This plugin opens up and additional browser tab which contains a speaker console. There you can see the current slide, the past slide and your notes. You add notes to your presentation by adding a div that belongs to the class "notes" to your div that belongs to the class "step".

+

adding notes to your presentation

+

You may add notes to your presentation by adding a div of class notes into the div of class step, like so:

+
    <div class="step">
+        Some text that is being displayed on your slides
+        <div class="notes">
+            this won't be displayed in your presentation
+        </div>
+    </div>
+
+

Now that you have added the notes to your HTML, it is time to hide them. You need to add the following code to your CSS file (or in the style tag in the header):

+
    .notes {
+        display: none;
+    }
+
+

To enter it, press P.

+

Goto

+

This plugin allows you to directly go to a certain step, by either passing in a number or the id of the step you'd like to go to.

+

Progress

+

This plugin, as its name implies, displays the progress in your presentation.

+

Blackout

+

This plugin hides the screen, if you press B, which is handy in a lot of situations.

+

Other plugins

+

You may find the other plugins here. It certainly helps if you familiarise yourself with the plugins.

+

Thank you for reading this

+

If you want to know more, you can always ready the DOCUMENTATION or, even better, read the Source Code and try to understand how it works!

+
+
+
- -
- - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/nav.html b/website/docs/nav.html index 46f6af0..fa8df4d 100644 --- a/website/docs/nav.html +++ b/website/docs/nav.html @@ -13,7 +13,7 @@ Getting Started API reference + HomeCSSHTMLJavaScriptPlugins
Plugins diff --git a/website/docs/plugins/autoplay.html b/website/docs/plugins/autoplay.html new file mode 100644 index 0000000..18ae57e --- /dev/null +++ b/website/docs/plugins/autoplay.html @@ -0,0 +1,43 @@ + + + + autoplay :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Autoplay

+

The autoplay plugin automatically advances the presentation after a certain timeout expired.

+

USAGE

+

You first have to enable the plugin by setting a global data-autoplay value on the impress-div. Then you can change individual data-autoplay values on each step by adding data-autoplay to it. If this value is set to 0, there will be no more auto-advancing on this step. The value you enter is time in seconds to switch to the next slide.

+

EXAMPLE

+

Note: This only shows part of the HTML. If you want to know how to set up a presentation, I highly recommend you read our Getting Started Guide

+
<div id=impress data-autoplay="5">
+    <div class="step" data-autoplay="0">
+        This slide will not auto-advance
+    </div>
+     <div class="step">
+        This slide will auto-advance at the globally defined rate.
+    </div>
+     <div class="step" data-autoplay="10">
+        This slide will auto-advance after 10 seconds
+    </div>
+</div>
+
+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/blackout.html b/website/docs/plugins/blackout.html new file mode 100644 index 0000000..ff7d6f9 --- /dev/null +++ b/website/docs/plugins/blackout.html @@ -0,0 +1,27 @@ + + + + blackout :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Blackout

+

This plugin is automatically enabled and runs whenever you start your presentation. You can press B or . on your keyboard to blank / unblank the screen.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/form.html b/website/docs/plugins/form.html new file mode 100644 index 0000000..9b8230d --- /dev/null +++ b/website/docs/plugins/form.html @@ -0,0 +1,36 @@ + + + + form :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Form

+

Form support! Functionality to better support use of input, textarea, button... elements in a presentation.

+

This plugin does two things:

+

Set stopPropagation on any element that might take text input. This allows users to type, for example, the letter 'P' into a form field, without causing the presenter console to spring up.

+

On impress:stepleave, de-focus any potentially active element. This is to prevent the focus from being left in a form element that is no longer visible in the window, and user therefore typing garbage into the form.

+

THIS PLUGIN REQUIRES FURTHER DEVELOPMENT

+

TODO: Currently it is not possible to use TAB to navigate between form elements. Impress.js, and +in particular the navigation plugin, unfortunately must fully take control of the tab key, +otherwise a user could cause the browser to scroll to a link or button that's not on the current +step. However, it could be possible to allow tab navigation between form elements, as long as +they are on the active step. This is a topic for further study.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/fullscreen.html b/website/docs/plugins/fullscreen.html new file mode 100644 index 0000000..0024963 --- /dev/null +++ b/website/docs/plugins/fullscreen.html @@ -0,0 +1,28 @@ + + + + fullscreen :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Fullscreen

+

This plugin puts your presentation into fullscreen by pressing F5. You can leave fullscreen again by pressing Esc.

+

Note: impress.js works just fine with the normal fullscreen offered by your browser where you would (usually) press F11 to enter it. There are certain circumstances where you might want to use this plugin instead, as it should work with the impressConsole plugin as well.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/media.html b/website/docs/plugins/media.html new file mode 100644 index 0000000..20a5554 --- /dev/null +++ b/website/docs/plugins/media.html @@ -0,0 +1,49 @@ + + + + media :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Media

+

This plugin will do the following things:

+
    +
  • Add a special class when playing (body.impress-media-video-playing and body.impress-media-video-playing) and pausing media (body.impress-media-video-paused and body.impress-media-audio-paused) (removing them when ending). This can be useful for example for darkening the background or fading out other elements while a video is playing. Only media at the current step are taken into account. All classes are removed when leaving a step.
  • +
  • Introduce the following new data attributes: +
      +
    • data-media-autoplay="true": Autostart media when entering its step.
    • +
    • data-media-autostop="true": Stop media (= pause and reset to start), when leaving its step.
    • +
    • data-media-autopause="true": Pause media but keep current time when leaving its step.
    • +
    +
  • +
+

When these attributes are added to a step they are inherited by all media on this step. Of course this setting can be overwritten by adding different attributes to inidvidual media.

+

The same rule applies when this attributes is added to the root element. Settings can be overwritten for individual steps and media. +Examples:

+
    +
  • data-media-autoplay="true" data-media-autostop="true": start media on enter, stop on leave, restart from beginning when re-entering the step.
  • +
  • data-media-autoplay="true" data-media-autopause="true": start media on enter, pause on leave, resume on re-enter
  • +
  • data-media-autoplay="true" data-media-autostop="true" data-media-autopause="true": start media on enter, stop on leave (stop overwrites pause).
  • +
  • data-media-autoplay="true" data-media-autopause="false": let media start automatically when entering a step and let it play when leaving the step.
  • +
  • <div id="impress" data-media-autoplay="true"> ... <div class="step" data-media-autoplay="false"> +All media is startet automatically on all steps except the one that has the data-media-autoplay="false" attribute.
  • +
  • Pro tip: Use <audio onended="impress().next()"> or <video onended="impress().next()"> to proceed to the next step automatically, when the end of the media is reached.
  • +
+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/navigation.html b/website/docs/plugins/navigation.html new file mode 100644 index 0000000..e13253b --- /dev/null +++ b/website/docs/plugins/navigation.html @@ -0,0 +1,39 @@ + + + + navigation :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Navigation

+

As you can see this part is separate from the impress.js core code. +It's because these navigation actions only need what impress.js provides with +its simple API. +This plugin is what we call an init plugin. It's a simple kind of +impress.js plugin. When loaded, it starts listening to the impress:init +event. That event listener initializes the plugin functionality - in this +case we listen to some keypress and mouse events. The only dependencies on +core impress.js functionality is the impress:init method, as well as using +the public api next(), prev(), etc when keys are pressed. +Copyright 2011-2012 Bartek Szopka (@bartaz) +Released under the MIT license.

+

Author:

+

Bartek Szopka

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/resize.html b/website/docs/plugins/resize.html new file mode 100644 index 0000000..cf3d29d --- /dev/null +++ b/website/docs/plugins/resize.html @@ -0,0 +1,27 @@ + + + + resize :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Resize

+

This plugin resizes the presentation after a window resize. It does not offer any programmatic way of interaction, as this is not needed. It runs automatically in the background.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/plugins/touch.html b/website/docs/plugins/touch.html new file mode 100644 index 0000000..164d7f0 --- /dev/null +++ b/website/docs/plugins/touch.html @@ -0,0 +1,27 @@ + + + + touch :: plugins | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

Touch

+

This plugin handles touch input. You can use swipe gestures to interact with your presentation, just note that the transitions might look slightly different from what you are used to on the PC.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/reference/CSS.html b/website/docs/reference/CSS.html index 56908a7..1669831 100644 --- a/website/docs/reference/CSS.html +++ b/website/docs/reference/CSS.html @@ -49,7 +49,7 @@ opacity: 1 } -

At the same time, the impress-on-* class is added to the body element, the class name represents the active Step Element id. This allows for custom global styling, since you can't match a CSS class backwards from the active Step Element id. This allows for custom global styling, since you can't match a CSS class backwards from the active Step Element to the body.

Example:

.impress-on-overview .step {
     opacity: 1;
diff --git a/website/docs/reference/JavaScript.html b/website/docs/reference/JavaScript.html
index 27b66d9..6b9e7de 100644
--- a/website/docs/reference/JavaScript.html
+++ b/website/docs/reference/JavaScript.html
@@ -104,7 +104,7 @@ rootElement.addEventListener( "impress:stepleave", function(event) {
 });
 

Improve The Docs

-

Did you find something that can be improved? Then create an issue so that we can discuss it!

diff --git a/website/docs/src/build.js b/website/docs/src/build.js index 6578fcf..238733f 100644 --- a/website/docs/src/build.js +++ b/website/docs/src/build.js @@ -44,7 +44,7 @@ if ( prompt( 'Do you want to regenerate the API reference? (y/n) ' ).toLowerCase if ( prompt( 'Do you want to regenerate the Getting Started Guide? (y/n) ' ).toLowerCase() == 'y' ) { console.log( 'Regenerating Getting Started Guide' ); - storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), '/gettingStarted.html', '' ); + storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), '/gettingStarted', '' ); } let docPages = fs.readdirSync( __dirname + '/../../../website/docs/reference' ); @@ -117,6 +117,8 @@ function checkLinks ( link, fpath ) { return ''; } else if ( link.slice( 0, 7 ) === 'http://' || link.slice( 0, 8 ) === 'https://' ) { return ''; + } else if ( link.slice( 0, 1 ) === '/' ) { + return ''; } else { throw Error( 'Invalid link found! Link is: "' + link + '" in file: ' + filepath + '/README.md' ); }; @@ -177,7 +179,7 @@ function generateNav () { Plugins