Merge pull request #643 from impress/dev
1.0.0-beta1: Merge 2 years worth of work from dev to master! Highlights * New plugin based architecture allows adding more features without bloating core src/impress.js file * Source files are in src/ and compiled into js/impress.js with npm run build. End users should continue to use js/impress.js as before. * 19 new plugins * Integrates impressConsole.js by default (press 'P' to open speaker console) * Markdown support for those that are too much in a hurry to type HTML * 5 new demo presentations under examples/ show case the new features * Removes the code that prevented impress.js from running on mobile phones
30
.github/CONTRIBUTING.md
vendored
@@ -1,30 +0,0 @@
|
||||
Issues
|
||||
------
|
||||
|
||||
If you've found a bug or have a great idea for a new feature that will help **all users** of impress.js, let us know by [adding your suggestion]
|
||||
(https://github.com/bartaz/impress.js/issues/new) to the [issue tracker](https://github.com/bartaz/impress.js/issues).
|
||||
|
||||
Guidelines:
|
||||
|
||||
* If reporting a bug, please provide a [simplified example](https://sscce.org/) on [Pastebin](https://pastebin.com/) or [JsFiddle](https://jsfiddle.net/).
|
||||
|
||||
Pull Requests
|
||||
-------------
|
||||
|
||||
[Pull Requests](https://help.github.com/articles/using-pull-requests/) should be opened against the [master branch]
|
||||
(https://github.com/bartaz/impress.js/tree/master). But remember that the team will only accept code that fits the purpose of impress.js.
|
||||
|
||||
Guidelines:
|
||||
|
||||
* If proposing a feature, make sure to discuss that as an issue first.
|
||||
* Create a new [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches) for every separate change you make.
|
||||
* Execute `npm run lint && npm test` to make sure the tests pass and the code is consistent with the project standards.
|
||||
|
||||
Manual release steps
|
||||
--------------------
|
||||
|
||||
* Bump version in `package.json`
|
||||
* Bump version in `src/impress.js`
|
||||
* Create commit with the message "Release version x.x.x"
|
||||
* Create Github tag and release
|
||||
* Publish on npm: `git fetch && npm publish ./`
|
||||
5
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,5 +0,0 @@
|
||||
**Make sure these boxes are checked before submitting your issue, thank you!**
|
||||
|
||||
- [ ] I have read and complied with the [Issues Contributing Guidelines](https://github.com/impress/impress.js/blob/master/.github/CONTRIBUTING.md#issues).
|
||||
- [ ] If am reporting a bug, I have a [simplified example](http://www.sscce.org/) on [Pastebin](https://pastebin.com/) or [JsFiddle](https://jsfiddle.net/) that reproduces the issue.
|
||||
- [ ] I have used the [Search Tool](https://github.com/impress/impress.js/search) to make sure someone haven't already reported my issue or feature request.
|
||||
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,6 +0,0 @@
|
||||
**Make sure these boxes are checked before submitting your Pull Request, thank you!**
|
||||
|
||||
- [ ] I have read and complied with the [Pull Request Contributing Guidelines](https://github.com/impress/impress.js/blob/master/CONTRIBUTING.md#pull-requests).
|
||||
- [ ] I checked if an [an issue](https://github.com/impress/impress.js/issues) is necessary for my Pull Request and made sure it exists.
|
||||
- [ ] I have created a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches).
|
||||
- [ ] I have used the [Search Tool](https://github.com/impress/impress.js/search?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen&type=Issues) to make sure there are no open Pull Requests fixing the same thing.
|
||||
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/js/impress.min.js
|
||||
/node_modules
|
||||
/npm-debug.log
|
||||
|
||||
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "extras"]
|
||||
path = extras
|
||||
url = https://github.com/impress/impress-extras
|
||||
5
.jscsrc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"preset": "jquery",
|
||||
// Since we check quotemarks already in jshint, this can be turned off
|
||||
"validateQuoteMarks": false
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
"module": true
|
||||
},
|
||||
"boss": true,
|
||||
"browser": true,
|
||||
"curly": true,
|
||||
"esversion": 6,
|
||||
"eqeqeq": true,
|
||||
"eqnull": true,
|
||||
"expr": true,
|
||||
|
||||
@@ -82,6 +82,11 @@ Define the pixel based position in which the **center** of the [Step Element](#s
|
||||
</div>
|
||||
```
|
||||
|
||||
**Note:** The introduction of the [rel](src/plugins/rel/README.md) plugin includes a slight backward incompatible change.
|
||||
Previously the default value for `data-x`, `data-y` and `data-z` was zero. The `rel` plugin changes the default to inherit
|
||||
the value of the previous slide. This means, you need to explicitly set these values to zero, if they ever were non-zero.
|
||||
|
||||
|
||||
#### 3D Rotation (data-rotate-x, data-rotate-y, data-rotate-z)
|
||||
|
||||
You can not only position a [Step Element](#step-element) in 3D, but also rotate it around any axis.
|
||||
@@ -106,6 +111,13 @@ You can of course rotate it around Z axis with `data-rotate-z` - it has exactly
|
||||
</div>
|
||||
```
|
||||
|
||||
#### 3D Rotation Order (data-rotate-order)
|
||||
|
||||
The order in which the CSS `rotateX(), rotateY(), rotateZ()` transforms are applied matters. This is because each rotation is relative to the then current position of the element.
|
||||
|
||||
By default the rotation order is `data-rotate-order="xyz"`. For some advanced uses you may need to change it. The demo presentation [3D rotations](examples/3D-rotations/index.html) sets this attribute to rotate some steps into positions that are impossible to reach with the default order.
|
||||
|
||||
|
||||
## CSS
|
||||
|
||||
### 4D States (.past, .present and .future classes)
|
||||
@@ -189,6 +201,11 @@ It is recommended to add the class manually to the `body` element though, becaus
|
||||
}
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
Many new features are implemented as plugins. The [Plugins documentation](src/plugins/README.md) is the starting place to learn about those, as well as the README.md of [each plugin](src/plugins/).
|
||||
|
||||
|
||||
## JavaScript
|
||||
|
||||
### impress( [ id ] )
|
||||
@@ -229,6 +246,21 @@ rootElement.addEventListener( "impress:init", function() {
|
||||
impress().init();
|
||||
```
|
||||
|
||||
#### .tear()
|
||||
|
||||
Resets the DOM to its original state, as it was before `init()` was called.
|
||||
|
||||
This can be used to "unload" impress.js. A particular use case for this is, if you want to do
|
||||
dynamic changes to the presentation, you can do a teardown, apply changes, then call `init()`
|
||||
again. (In most cases, this will not cause flickering or other visible effects to the user,
|
||||
beyond the intended dynamic changes.)
|
||||
|
||||
**Example:**
|
||||
|
||||
```JavaScript
|
||||
impress().tear();
|
||||
```
|
||||
|
||||
#### .next()
|
||||
|
||||
Navigates to the next step of the presentation using the [`goto()` function](#impressgotostepindexstepelementidstepelement-duration).
|
||||
@@ -300,8 +332,8 @@ Triggers the `impress:stepenter` event in the [Root Element](#root-element) when
|
||||
|
||||
```JavaScript
|
||||
var rootElement = document.getElementById( "impress" );
|
||||
rootElement.addEventListener( "impress:stepenter", function() {
|
||||
var currentStep = document.querySelector( ".present" );
|
||||
rootElement.addEventListener( "impress:stepenter", function(event) {
|
||||
var currentStep = event.target;
|
||||
console.log( "Entered the Step Element '" + currentStep.id + "'" );
|
||||
});
|
||||
```
|
||||
@@ -312,8 +344,9 @@ Triggers the `impress:stepleave` event in the [Root Element](#root-element) when
|
||||
```JavaScript
|
||||
var rootElement = document.getElementById( "impress" );
|
||||
rootElement.addEventListener( "impress:stepleave", function(event) {
|
||||
var currentStep = event.target
|
||||
console.log( "Left the Step Element '" + currentStep.id + "'" );
|
||||
var currentStep = event.target;
|
||||
var nextStep = event.detail.next;
|
||||
console.log( "Left the Step Element '" + currentStep.id + "' and about to enter '" + nextStep.id );
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
66
README.md
@@ -14,15 +14,19 @@ impress.js may not help you if you have nothing interesting to say ;)
|
||||
HOW TO USE IT
|
||||
---------------
|
||||
|
||||
[Use the source](index.html), Luke ;)
|
||||
### Checking out and initializing the git repository
|
||||
|
||||
The [HTML source code](index.html) serves as a good example usage and contains comments explaning various features of impress.js. For more information about styling you can look into [CSS code](css/impress-demo.css) which shows how classes provided by impress.js can be used. Last but not least [JavaScript code of impress.js](js/impress.js) has some useful comments if you are interested in how everything works. Feel free to explore!
|
||||
git clone --recursive https://github.com/impress/impress.js.git
|
||||
cd impress.js
|
||||
|
||||
If you want more straightforward reference documentation of all impress.js features and API you can find it in [DOCUMENTATION.md](DOCUMENTATION.md).
|
||||
Note: For a minimal checkout, omit the `--recursive` option. This will leave out extra plugins.
|
||||
|
||||
### Documentation
|
||||
|
||||
|
||||
EXAMPLES AND OTHER LEARNING RESOURCES
|
||||
---------------------------------------
|
||||
Reference documentation of core impress.js features and API you can find it in [DOCUMENTATION.md](DOCUMENTATION.md).
|
||||
|
||||
The [HTML source code](index.html) of the official [impress.js demo](http://impress.github.io/impress.js/) serves as a good example usage and contains comments explaning various features of impress.js. For more information about styling you can look into [CSS code](css/impress-demo.css) which shows how classes provided by impress.js can be used. Last but not least [JavaScript code of impress.js](js/impress.js) has some useful comments if you are interested in how everything works. Feel free to explore!
|
||||
|
||||
### Official demo
|
||||
|
||||
@@ -30,6 +34,8 @@ EXAMPLES AND OTHER LEARNING RESOURCES
|
||||
|
||||
### Examples and demos
|
||||
|
||||
The [Classic Slides](http://impress.github.io/impress.js/examples/classic-slides/) demo is targeted towards beginners, or can be used as a template for presentations that look like the traditional PowerPoint slide deck. Over time, it also grew into the example presentation that uses most of the features and addons available.
|
||||
|
||||
More examples and demos can be found on [Examples and demos wiki page](http://github.com/impress/impress.js/wiki/Examples-and-demos).
|
||||
|
||||
Feel free to add your own example presentations (or websites) there.
|
||||
@@ -41,20 +47,48 @@ on the wiki, too.
|
||||
|
||||
There is also a book available about [Building impressive presentations with impress.js](http://www.packtpub.com/building-impressive-presentations-with-impressjs/book) by Rakhitha Nimesh Ratnayake.
|
||||
|
||||
You may want to check out the sibling project [Impressionist|https://github.com/henrikingo/impressionist]: a 3D GUI editor that can help you in creating impress.js presentations.
|
||||
|
||||
### Mailing list
|
||||
|
||||
You're welcome to ask impress.js related questions on the [impressionist-presentations](https://groups.google.com/forum/#!forum/impressionist-presentations) mailing list.
|
||||
|
||||
|
||||
REPOSITORY STRUCTURE
|
||||
--------------------
|
||||
|
||||
* [index.html](index.html): This is the official impress.js demo, showcasing all of the features of the original impress.js, as well as some new plugins as we add them.
|
||||
* As already mentioned, this file is well commented and acts as the official tutorial.
|
||||
* [examples/](examples/): Contains several demos showcasing additional features available.
|
||||
* [Classic Slides](examples/classic-slides/index.html) is a simple demo that that you can use as template if you want to create very simple, rectangular, PowerPoint-like presentations.
|
||||
* [src/](src/): The main file is [src/impress.js](src/impress.js). Additional functionality is implemented as plugins in [src/plugins/](src/plugins/).
|
||||
* See [src/plugins/README.md](src/plugins/README.md) for information about the plugin API and how to write plugins.
|
||||
* [test/](test/): Contains QUnit and Syn libraries that we use for writing tests, as well as some test coverage for core functionality. (Yes, more tests are much welcome.) Tests for plugins are in the directory of each plugin.
|
||||
* [js/](js/): Contains [js/impress.js](js/impress.js), which contains a concatenation of the core `src/impress.js` and all the plugins. Traditionally this is the file that you'll link to in a browser. In fact both the demo and test files do exactly that.
|
||||
* [css/](css/]: Contains a CSS file used by the demo. This file is **not required for using impress.js** in your own presentations. Impress.js creates the CSS it needs dynamically.
|
||||
* [extras/](extras/) contains plugins that for various reasons aren't enabled by default. You have to explicitly add them with their own `script` element to use them.
|
||||
* [build.js](build.js): Simple build file that creates `js/impress.js`. It also creates a minified version `impress.min.js`, but that one is not included in the github repository.
|
||||
* [package.json](build.js): An NPM package specification. This was mainly added so you can easily install [buildify](https://www.npmjs.com/package/buildify) and run `node build.js`. Other than the build process, which is really just doing roughly `cat src/impress.js src/plugins/*/*.js > js/impress.js`, and testing, `impress.js` itself doesn't depend on Node or any NPM modules.
|
||||
* [bower.json](bower.json): A Bower package file. We also don't depend on Bower, but provide this file if you want to use it.
|
||||
|
||||
WANT TO CONTRIBUTE?
|
||||
---------------------
|
||||
|
||||
Please, read the [contributing guidelines](.github/CONTRIBUTING.md) on how to create [Issues](.github/CONTRIBUTING.md#issues) and [Pull Requests](.github/CONTRIBUTING.md#pull-requests).
|
||||
For developers, once you've made changes to the code, you should run these commands for testing:
|
||||
|
||||
**Note:** The team has changed, so there will be many changes in the upcoming versions.
|
||||
If you need informations about versions, check the [changelog](CHANGELOG.md).
|
||||
npm run build
|
||||
npm run test
|
||||
npm run lint
|
||||
|
||||
Note that running `firefox qunit_test_runner.html` is usually more informative than running `karma` with `npm run test`. They both run the same tests.
|
||||
|
||||
More info about the [src/](src/) directory can be found in [src/plugins/README.md](src/plugins/README.md).
|
||||
|
||||
|
||||
ABOUT THE NAME
|
||||
----------------
|
||||
|
||||
impress.js name in [courtesy of @skuzniak](http://twitter.com/skuzniak/status/143627215165333504).
|
||||
impress.js name is [courtesy of @skuzniak](http://twitter.com/skuzniak/status/143627215165333504).
|
||||
|
||||
It's an (un)fortunate coincidence that a Open/LibreOffice presentation tool is called Impress ;)
|
||||
|
||||
@@ -66,11 +100,21 @@ See the [Reference API](DOCUMENTATION.md)
|
||||
BROWSER SUPPORT
|
||||
-----------------
|
||||
|
||||
This project supports only the major [evergreen](http://eisenbergeffect.bluespire.com/evergreen-browsers/) desktop browsers that have implemented:
|
||||
The design goal for impress.js has been to showcase awesome CSS3 features as found in modern browser versions. We also use some new DOM functionality, and specifically do not use jQuery or any other JavaScript libraries, nor our own functions, to support older browsers. In general, recent versions of Firefox and Chrome are known to work well. Reportedly IE now works too.
|
||||
|
||||
The typical use case for impress.js is to create presentations that you present from your own laptop, with a browser version you know works well. Some people also use impress.js successfully to embed animations or presentations in a web page, however, be aware that in this some of your visitors may not see the presentation correctly, or at all.
|
||||
|
||||
In particular, impress.js makes use of the following JS and CSS features:
|
||||
|
||||
* [DataSet API](http://caniuse.com/#search=dataset)
|
||||
* [ClassList API](http://caniuse.com/#search=classlist)
|
||||
* [CSS 3D Transforms](http://caniuse.com/#search=css%203d)
|
||||
* [CSS Transitions](http://caniuse.com/#search=css%20transition)
|
||||
|
||||
Copyright 2011-2016 Bartek Szopka - Released under the MIT [License](LICENSE)
|
||||
COPYRIGHT AND LICENSE
|
||||
---------------------
|
||||
|
||||
Copyright 2011-2016 Bartek Szopka
|
||||
Copyright 2015-2017 Henrik Ingo
|
||||
|
||||
Released under the MIT [License](LICENSE)
|
||||
|
||||
56
build.js
Normal file
@@ -0,0 +1,56 @@
|
||||
var buildify = require('buildify');
|
||||
|
||||
|
||||
buildify()
|
||||
.load('src/impress.js')
|
||||
// Libraries from src/lib
|
||||
.concat(['src/lib/gc.js'])
|
||||
.concat(['src/lib/util.js'])
|
||||
// Plugins from src/plugins
|
||||
.concat(['src/plugins/autoplay/autoplay.js',
|
||||
'src/plugins/blackout/blackout.js',
|
||||
'src/plugins/extras/extras.js',
|
||||
'src/plugins/form/form.js',
|
||||
'src/plugins/goto/goto.js',
|
||||
'src/plugins/help/help.js',
|
||||
'src/plugins/impressConsole/impressConsole.js',
|
||||
'src/plugins/mobile/mobile.js',
|
||||
'src/plugins/mouse-timeout/mouse-timeout.js',
|
||||
'src/plugins/navigation/navigation.js',
|
||||
'src/plugins/navigation-ui/navigation-ui.js',
|
||||
'src/plugins/progress/progress.js',
|
||||
'src/plugins/rel/rel.js',
|
||||
'src/plugins/resize/resize.js',
|
||||
'src/plugins/skip/skip.js',
|
||||
'src/plugins/stop/stop.js',
|
||||
'src/plugins/substep/substep.js',
|
||||
'src/plugins/touch/touch.js',
|
||||
'src/plugins/toolbar/toolbar.js'])
|
||||
.save('js/impress.js');
|
||||
/*
|
||||
* Disabled until uglify supports ES6: https://github.com/mishoo/UglifyJS2/issues/448
|
||||
.uglify()
|
||||
.save('js/impress.min.js');
|
||||
*/
|
||||
|
||||
|
||||
/* Auto generate an index.html that lists all the directories under examples/
|
||||
* This is useful for gh-pages, so you can link to http://impress.github.io/impress.js/examples
|
||||
*/
|
||||
var ls = require('ls');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var html_list = '<ul><br />\n'
|
||||
ls( 'examples/*', { type: 'dir' }).forEach(function(dir) {
|
||||
html_list += ' <li><a href="' + dir['file'] + '/">' + dir['name'] + '</a></li>\n';
|
||||
});
|
||||
html_list += '</ul>\n'
|
||||
|
||||
var html = '<html>\n<head>\n<title>Example presentations</title>\n</head>\n<body>'
|
||||
html += '<h1>Example presentations</h1>\n' + html_list
|
||||
html += '</body>\n</html>'
|
||||
|
||||
var filename = path.resolve(__dirname, 'examples', 'index.html');
|
||||
fs.writeFileSync(filename, html);
|
||||
console.log(filename);
|
||||
@@ -268,7 +268,7 @@ a:focus {
|
||||
}
|
||||
|
||||
#title h1 {
|
||||
font-size: 190px;
|
||||
font-size: 180px;
|
||||
|
||||
-webkit-transform: translateZ(50px);
|
||||
-moz-transform: translateZ(50px);
|
||||
@@ -294,6 +294,7 @@ a:focus {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#big strong,
|
||||
#big b {
|
||||
display: block;
|
||||
font-size: 250px;
|
||||
@@ -527,6 +528,35 @@ a:focus {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*
|
||||
This version of impress.js supports plugins, and in particular, a UI toolbar
|
||||
plugin that allows easy navigation between steps and autoplay.
|
||||
*/
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*
|
||||
With help from the mouse-timeout plugin, we can hide the toolbar and
|
||||
have it show only when you move/click/touch the mouse.
|
||||
*/
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
In fact, we can hide the mouse cursor itself too, when mouse isn't used.
|
||||
*/
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Now, when we have all the steps styled let's give users a hint how to navigate
|
||||
@@ -682,9 +712,9 @@ a:focus {
|
||||
|
||||
So use it wisely ... or don't use at all.
|
||||
*/
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
/*
|
||||
There is one funny thing I just realized.
|
||||
|
||||
|
||||
497
examples/2D-navigation/css/fonts.css
Normal file
@@ -0,0 +1,497 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQSYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQY4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBkbcKLIaa1LC45dFaAfauRA.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBmo_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBr6up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBiYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBo4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxmgpAmOCqD37_tyH_8Ri5MM.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxsPNMTLbnS9uQzHQlYieHUU.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxgyhumQnPMBCoGYhRaNxyyY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhUVAXEdVvYDDqrz3aeR0Yc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxlf4y_3s5bcYyyLIFUSWYUU.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxnywqdtBbUHn3VPgzuFrCy8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxl2umOyRU7PgRiv8DXcgJjk.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/JX7MlXqjSJNjQvI4heMMGvY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/vtwNVMP8y9C17vLvIBNZI_Y6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/9kaD4V2pNPMMeUVBHayd7vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/ATKpv8nLYAKUYexo8iqqrg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/kTYfCWJhlldPf5LnG4ZnHCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/g46X4VH_KHOWAAa-HpnGPiEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/hpORcvLZtemlH8gI-1S-7iEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/0XxGQsSc1g4rdRdjJKZrNPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/GpWpM_6S4VQLPNAQ3iWvVRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/7dSh6BcuqDLzS2qAASIeuhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/DVKQJxMmC9WF_oplMzlQqRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/PIPMHY90P7jtyjpXuZ2cLFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/5hX15RUpPERmeybVlLQEWBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/fU0HAfLiPHGlZhZpY6M7dBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/CPRt--GVMETgA6YEaoGitxTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/I-OtoJZa3TeyH6D9oli3ifesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpCYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpI4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/O_WhD9hODL16N4KLHLX7xSEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/3Nwg9VzlwLXPq3fNKwVRMCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/b31S45a_TNgaBApZhTgE6CEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9ede9INZm0R8ZMJUtfOsxrw.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9bpHcMS0zZe4mIYvDKG2oeM.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9RHJTnCUrjaAm2S9z52xC3Y.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9YWiMMZ7xLd792ULpGE4W_Y.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
|
||||
340
examples/2D-navigation/css/presentation.css
Normal file
@@ -0,0 +1,340 @@
|
||||
/*
|
||||
A common approach is to use googleapis.com to generate css for the webfonts you want to use.
|
||||
The downside of this approach is that you have to be online. So below I have simply saved
|
||||
the output of the googleapis url into a file. Then you of course also have to make sure
|
||||
the webfonts are locally installed to make offline usage work. For Ubuntu (or Debian) I
|
||||
successfully used the script from here to do that:
|
||||
http://www.webupd8.org/2011/01/automatically-install-all-google-web.html
|
||||
*/
|
||||
|
||||
/* @import url(http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic|Cutive+Mono); */
|
||||
@import url(fonts.css);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
We display a fallback message for users with browsers that don't support
|
||||
all the features required by it. All of the content will be still fully
|
||||
accessible for them, but some more advanced effects would be missing.
|
||||
When impress.js detects that browser supports all necessary CSS3 features,
|
||||
the fallback-message style is hidden.
|
||||
*/
|
||||
|
||||
.fallback-message {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.3;
|
||||
|
||||
width: 780px;
|
||||
padding: 10px 10px 0;
|
||||
margin: 20px auto;
|
||||
|
||||
border: 1px solid #E4C652;
|
||||
border-radius: 10px;
|
||||
background: #EEDC94;
|
||||
}
|
||||
|
||||
.fallback-message p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.impress-supported .fallback-message {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
The body background is the bacgkround of "everything". Many
|
||||
impress.js tools call it the "surface". It could also be a
|
||||
picture or pattern, but we leave it as light gray.
|
||||
*/
|
||||
|
||||
body {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
min-height: 740px;
|
||||
|
||||
background: #aaccbb;
|
||||
color: #ff4466;
|
||||
}
|
||||
|
||||
/*
|
||||
Now let's style the presentation steps.
|
||||
*/
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
display: block;
|
||||
|
||||
width: 900px;
|
||||
height: 700px;
|
||||
margin: 20px auto;
|
||||
padding: 40px 60px;
|
||||
|
||||
text-shadow: 0 2px 2px rgba(0, 10, 0, .5);
|
||||
|
||||
font-family: 'Open Sans', Arial, sans-serif;
|
||||
font-size: 30px;
|
||||
letter-spacing: -1px;
|
||||
|
||||
}
|
||||
/*
|
||||
Make inactive steps a little bit transparent.
|
||||
*/
|
||||
.impress-enabled .step {
|
||||
margin: 0;
|
||||
opacity: 0.3;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.impress-enabled .step.active { opacity: 1 }
|
||||
|
||||
/*
|
||||
Speaker notes allow you to write comments within the steps, that will not
|
||||
be displayed as part of the presentation. However, they will be picked up
|
||||
and displayed by impressConsole.js when integrated.
|
||||
*/
|
||||
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
margin: 0.7em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
/* Highlight.js used for coloring pre > code blocks. */
|
||||
pre > code {
|
||||
font-size: 14px;
|
||||
text-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Inline code, no Highlight.js */
|
||||
code {
|
||||
font-family: "Cutive mono","Courier New", monospace;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
padding: 0 0.1em;
|
||||
background: rgba(200,200,200,0.3);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.9);
|
||||
border-radius: 0.2em;
|
||||
border-bottom: 1px solid rgba(100,100,100,0.4);
|
||||
border-left: 1px solid rgba(100,100,100,0.4);
|
||||
|
||||
transition: 0.5s;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
background: rgba(200,200,200,1);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
em {
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strong {
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
q {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strike {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 300px
|
||||
}
|
||||
|
||||
/****************** Background images **********************************************/
|
||||
|
||||
|
||||
img.bg {
|
||||
position: fixed;
|
||||
z-index: -100;
|
||||
opacity: 0;
|
||||
height: 50%;
|
||||
width: auto;
|
||||
transition: opacity 2s;
|
||||
}
|
||||
|
||||
#applepie-image {
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
body.impress-on-applepie #applepie-image,
|
||||
body.impress-on-applepie-pro #applepie-image,
|
||||
body.impress-on-applepie-con #applepie-image,
|
||||
body.impress-on-conclusion #applepie-image,
|
||||
body.impress-on-overview #applepie-image {
|
||||
opacity: 0.7;
|
||||
transition: opacity 2s;
|
||||
}
|
||||
|
||||
#icecream-image {
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
body.impress-on-icecream #icecream-image,
|
||||
body.impress-on-icecream-pro #icecream-image,
|
||||
body.impress-on-icecream-con #icecream-image,
|
||||
body.impress-on-conclusion #icecream-image,
|
||||
body.impress-on-overview #icecream-image {
|
||||
opacity: 0.7;
|
||||
transition: opacity 2s;
|
||||
}
|
||||
|
||||
#crisps-image {
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
body.impress-on-crisps #crisps-image,
|
||||
body.impress-on-crisps-pro #crisps-image,
|
||||
body.impress-on-crisps-con #crisps-image,
|
||||
body.impress-on-conclusion #crisps-image,
|
||||
body.impress-on-overview #crisps-image {
|
||||
opacity: 0.7;
|
||||
transition: opacity 2s;
|
||||
}
|
||||
|
||||
|
||||
/*************** Slide specific things ****************************/
|
||||
|
||||
#image-credits {
|
||||
color: #779988;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/******************* PLUGINS *************************************************************/
|
||||
/*
|
||||
This version of impress.js supports plugins, and in particular, a UI toolbar
|
||||
plugin that allows easy navigation between steps and autoplay.
|
||||
*/
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
z-index: 10;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*
|
||||
With help from the mouse-timeout plugin, we can hide the toolbar and
|
||||
have it show only when you move/click/touch the mouse.
|
||||
*/
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
In fact, we can hide the mouse cursor itself too, when mouse isn't used.
|
||||
*/
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Progress bar */
|
||||
.impress-progressbar {
|
||||
position: absolute;
|
||||
right: 118px;
|
||||
bottom: 1px;
|
||||
left: 118px;
|
||||
border-radius: 7px;
|
||||
border: 2px solid rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
.impress-progressbar DIV {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
border-radius: 5px;
|
||||
background: rgba(75, 75, 75, 0.4);
|
||||
transition: width 1s linear;
|
||||
}
|
||||
.impress-progress {
|
||||
position: absolute;
|
||||
left: 59px;
|
||||
bottom: 1px;
|
||||
text-align: left;
|
||||
font-size: 10pt;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Help popup plugin */
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
/* Substep plugin */
|
||||
|
||||
#impress .step .substep {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#impress .step .substep.substep-visible {
|
||||
opacity: 1;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
BIN
examples/2D-navigation/images/35535918670_f1d12627ff_o.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
examples/2D-navigation/images/6296334551_b3d5c27823_b.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
examples/2D-navigation/images/6636957665_5e7c4a79de_o.png
Normal file
|
After Width: | Height: | Size: 646 KiB |
203
examples/2D-navigation/index.html
Normal file
@@ -0,0 +1,203 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Desserts (2D navigation demo)</title>
|
||||
<meta name="description" content="2D navigation demo" />
|
||||
<meta name="author" content="Henrik Ingo" />
|
||||
<link href="css/presentation.css" rel="stylesheet" />
|
||||
</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>
|
||||
|
||||
<!-- Some images that are fixed to background in the css -->
|
||||
<img id="applepie-image" class="bg" src="images/6296334551_b3d5c27823_b.png">
|
||||
<img id="icecream-image" class="bg" src="images/35535918670_f1d12627ff_o.png">
|
||||
<img id="crisps-image" class="bg" src="images/6636957665_5e7c4a79de_o.png">
|
||||
|
||||
|
||||
|
||||
<div id="impress" data-transition-duration="1000">
|
||||
|
||||
<div class="step" data-scale="2" data-x="-500" data-y="-500">
|
||||
<h1>2D navigation</h1>
|
||||
|
||||
<ul>
|
||||
<li>Impress.js allows you to layout your presentation in a 3D space</li>
|
||||
<li>Now <a href="https://github.com/impress/impress.js/tree/master/src/plugins/goto">the
|
||||
goto plugin</a> also allows you to specify
|
||||
non-linear navigation!</li>
|
||||
<li>This demo can be navigated by
|
||||
<ul>
|
||||
<li>continuously pressing Right Arrow</li>
|
||||
<li>continuously pressing Down Arrow</li>
|
||||
<li>(or freely, pressing Up, Down, Right, Left as you choose)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>It's up to you to decide which is the better structure</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="contents" class="step" data-rel-x="1500" data-rel-y="1500" data-scale="1">
|
||||
<h1>Choosing a treat</h1>
|
||||
|
||||
<ul>
|
||||
<li>You can choose your preferred treat from:
|
||||
<ul>
|
||||
<li>Ice cream</li>
|
||||
<li>Crisps</li>
|
||||
<li>Apple pie</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>We will make a structured pro's & con's analysis to arrive at a conclusion</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Ice cream slides (3) -->
|
||||
<div id="icecream" class="step" data-x="2000" data-y="2000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="contents icecream-pro contents crisps">
|
||||
<h1>Ice cream</h1>
|
||||
|
||||
<ul>
|
||||
<li>Cold</li>
|
||||
<li>Creamy</li>
|
||||
<li>Vanilla or flavored</li>
|
||||
<li>Caramel sauce, jams & other toppings</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="icecream-pro" class="step" data-rel-x="0" data-rel-y="1000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="icecream icecream-con applepie crisps-pro">
|
||||
<h1>Ice cream: Pro's</h1>
|
||||
|
||||
<ul>
|
||||
<li>Great for dessert or snack</li>
|
||||
<li>Great in the Summer</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="icecream-con" class="step" data-rel-x="0" data-rel-y="1000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="icecream-pro crisps applepie-pro crisps-con">
|
||||
<h1>Ice cream: Con's</h1>
|
||||
|
||||
<ul>
|
||||
<li>Not so great in the Winter</li>
|
||||
<li>If you're allergic to lactose/milk</li>
|
||||
<li>Diet alternatives are not real ice cream</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Crisps slides (3) -->
|
||||
<div id="crisps" class="step" data-x="3500" data-y="2000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="icecream-con crisps-pro icecream applepie">
|
||||
<h1>Crisps</h1>
|
||||
|
||||
<ul>
|
||||
<li>Potatoes fried in oil and salted</li>
|
||||
<li>Various flavors</li>
|
||||
<li>Dips</li>
|
||||
<li>Can be used as ingredient in subs (Cliff Huxtable style)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="crisps-pro" class="step" data-rel-x="0" data-rel-y="1000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="crisps crisps-con icecream-pro applepie-pro">
|
||||
<h1>Crisps: Pro's</h1>
|
||||
|
||||
<ul>
|
||||
<li>Simple yet tasty concept</li>
|
||||
<li>Great for snack</li>
|
||||
<li>Salty / spicy (not sweet)</li>
|
||||
<li>Finger food</li>
|
||||
<li>Diet alternatives are often ok</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="crisps-con" class="step" data-rel-x="0" data-rel-y="1000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="crisps-pro applepie icecream-con applepie-con">
|
||||
<h1>Crisps: Con's</h1>
|
||||
|
||||
<ul>
|
||||
<li>Commonly not used as dessert</li>
|
||||
<li>Not sweet</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Apple pie slides (3) -->
|
||||
<div id="applepie" class="step" data-x="5000" data-y="2000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="crisps-con applepie-pro crisps icecream-pro">
|
||||
<h1>Apple pie</h1>
|
||||
|
||||
<ul>
|
||||
<li>Apple's in a pie</li>
|
||||
<li>Many recipes exist. (Grandma's is the best.)</li>
|
||||
<li>Vanilla sauce or cream on top</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="applepie-pro" class="step" data-rel-x="0" data-rel-y="1000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="applepie applepie-con crisps-pro icecream-con">
|
||||
<h1>Apple pie: Pro's</h1>
|
||||
|
||||
<ul>
|
||||
<li>Great for dessert</li>
|
||||
<li>Or just with a cup of tea or glass of milk</li>
|
||||
<li>Best when warm</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="applepie-con" class="step" data-rel-x="0" data-rel-y="1000"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowLeft ArrowRight"
|
||||
data-goto-next-list="applepie-pro conclusion crisps-con conclusion">
|
||||
<h1>Apple pie: Con's</h1>
|
||||
|
||||
<ul>
|
||||
<li>I'm allergic to apple (but a small slice is worth it)</li>
|
||||
<li>Not finger food</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="conclusion" class="step" data-rel-x="1000" data-rel-y="1000">
|
||||
<h1>Conclusion</h1>
|
||||
|
||||
<p>Can I choose all three ;-)</p>
|
||||
|
||||
<p style="font-size: small; position: absolute; bottom: 30px; left: 300px;" id="image-credits"
|
||||
>Image credits: <a href="https://www.flickr.com/photos/reimagingerica/35535918670">reimagingerica@Flickr</a>,
|
||||
<a href="https://www.flickr.com/photos/mixedmolly/6636957665">mixedmolly@Flickr</a>,
|
||||
<a href="https://www.flickr.com/photos/stevepj2009/6296334551">stevepj2009@Flickr</a> </p>
|
||||
</div>
|
||||
|
||||
<div id="overview" class="step" data-x="3000" data-y="2000" data-scale="9" style="pointer-events: none;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="impress-toolbar"></div>
|
||||
|
||||
<div class="impress-progressbar"><div></div></div>
|
||||
<div class="impress-progress"></div>
|
||||
|
||||
<div id="impress-help"></div>
|
||||
|
||||
<script type="text/javascript" src="../../js/impress.js"></script>
|
||||
<script>impress().init();</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
279
examples/3D-rotations/css/3D-rotations.css
Normal file
@@ -0,0 +1,279 @@
|
||||
@import url(fonts.css);
|
||||
|
||||
|
||||
|
||||
/* Fallback message */
|
||||
|
||||
.fallback-message {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.3;
|
||||
|
||||
width: 780px;
|
||||
padding: 10px 10px 0;
|
||||
margin: 20px auto;
|
||||
|
||||
border: 1px solid #E4C652;
|
||||
border-radius: 10px;
|
||||
background: #EEDC94;
|
||||
}
|
||||
|
||||
.fallback-message p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.impress-supported .fallback-message {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* Body & steps */
|
||||
body {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
min-height: 740px;
|
||||
|
||||
background: #00000f;
|
||||
color: rgb(102, 102, 102);
|
||||
}
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
width: 700px;
|
||||
height: 700px;
|
||||
padding: 40px 60px;
|
||||
margin: 20px auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
line-height: 1.5;
|
||||
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
|
||||
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .1);
|
||||
|
||||
font-family: 'Open Sans', Arial, sans-serif;
|
||||
font-size: 40pt;
|
||||
letter-spacing: -1px;
|
||||
|
||||
}
|
||||
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Overview step has no background or border */
|
||||
|
||||
.overview {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
pointer-events: none;
|
||||
display: none;
|
||||
}
|
||||
.overview.active {
|
||||
display: block;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
Make inactive steps a little bit transparent.
|
||||
*/
|
||||
.impress-enabled .step {
|
||||
margin: 0;
|
||||
opacity: 0.1;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.impress-enabled .step.active { opacity: 1 }
|
||||
|
||||
|
||||
/* Content */
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.7em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
/* Highlight.js used for coloring pre > code blocks. */
|
||||
pre > code {
|
||||
font-size: 14px;
|
||||
text-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Inline code, no Highlight.js */
|
||||
code {
|
||||
font-family: "Cutive mono","Courier New", monospace;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
padding: 0 0.1em;
|
||||
background: rgba(200,200,200,0.2);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.9);
|
||||
border-radius: 0.2em;
|
||||
border-bottom: 1px solid rgba(100,100,100,0.2);
|
||||
border-left: 1px solid rgba(100,100,100,0.2);
|
||||
|
||||
transition: 0.5s;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
background: rgba(200,200,200,1);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
em {
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strong {
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
q {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strike {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
This version of impress.js supports plugins, and in particular, a UI toolbar
|
||||
plugin that allows easy navigation between steps and autoplay.
|
||||
*/
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
z-index: 10;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*
|
||||
With help from the mouse-timeout plugin, we can hide the toolbar and
|
||||
have it show only when you move/click/touch the mouse.
|
||||
*/
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
In fact, we can hide the mouse cursor itself too, when mouse isn't used.
|
||||
*/
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Progress bar */
|
||||
.impress-progressbar {
|
||||
position: absolute;
|
||||
right: 118px;
|
||||
bottom: 1px;
|
||||
left: 118px;
|
||||
border-radius: 7px;
|
||||
border: 2px solid rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
.impress-progressbar DIV {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
border-radius: 5px;
|
||||
background: rgba(75, 75, 75, 0.4);
|
||||
transition: width 1s linear;
|
||||
}
|
||||
.impress-progress {
|
||||
position: absolute;
|
||||
left: 59px;
|
||||
bottom: 1px;
|
||||
text-align: left;
|
||||
font-size: 10pt;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Help popup plugin */
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* Styles specific to each step */
|
||||
|
||||
#overview2 {
|
||||
font-size: 20pt;
|
||||
padding-left: 200px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
And as the last thing there is a workaround for quite strange bug.
|
||||
It happens a lot in Chrome. I don't remember if I've seen it in Firefox.
|
||||
|
||||
Sometimes the element positioned in 3D (especially when it's moved back
|
||||
along Z axis) is not clickable, because it falls 'behind' the <body>
|
||||
element.
|
||||
|
||||
To prevent this, I decided to make <body> non clickable by setting
|
||||
pointer-events property to `none` value.
|
||||
Value if this property is inherited, so to make everything else clickable
|
||||
I bring it back on the #impress element.
|
||||
|
||||
If you want to know more about `pointer-events` here are some docs:
|
||||
https://developer.mozilla.org/en/CSS/pointer-events
|
||||
|
||||
There is one very important thing to notice about this workaround - it makes
|
||||
everything 'unclickable' except what's in #impress element.
|
||||
|
||||
So use it wisely ... or don't use at all.
|
||||
*/
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
497
examples/3D-rotations/css/fonts.css
Normal file
@@ -0,0 +1,497 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQSYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQY4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBkbcKLIaa1LC45dFaAfauRA.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBmo_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBr6up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBiYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBo4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxmgpAmOCqD37_tyH_8Ri5MM.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxsPNMTLbnS9uQzHQlYieHUU.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxgyhumQnPMBCoGYhRaNxyyY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhUVAXEdVvYDDqrz3aeR0Yc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxlf4y_3s5bcYyyLIFUSWYUU.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxnywqdtBbUHn3VPgzuFrCy8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxl2umOyRU7PgRiv8DXcgJjk.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/JX7MlXqjSJNjQvI4heMMGvY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/vtwNVMP8y9C17vLvIBNZI_Y6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/9kaD4V2pNPMMeUVBHayd7vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/ATKpv8nLYAKUYexo8iqqrg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/kTYfCWJhlldPf5LnG4ZnHCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/g46X4VH_KHOWAAa-HpnGPiEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/hpORcvLZtemlH8gI-1S-7iEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/0XxGQsSc1g4rdRdjJKZrNPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/GpWpM_6S4VQLPNAQ3iWvVRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/7dSh6BcuqDLzS2qAASIeuhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/DVKQJxMmC9WF_oplMzlQqRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/PIPMHY90P7jtyjpXuZ2cLFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/5hX15RUpPERmeybVlLQEWBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/fU0HAfLiPHGlZhZpY6M7dBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/CPRt--GVMETgA6YEaoGitxTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/I-OtoJZa3TeyH6D9oli3ifesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpCYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpI4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/O_WhD9hODL16N4KLHLX7xSEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/3Nwg9VzlwLXPq3fNKwVRMCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/b31S45a_TNgaBApZhTgE6CEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9ede9INZm0R8ZMJUtfOsxrw.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9bpHcMS0zZe4mIYvDKG2oeM.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9RHJTnCUrjaAm2S9z52xC3Y.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9YWiMMZ7xLd792ULpGE4W_Y.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
|
||||
89
examples/3D-rotations/index.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<!doctype html>
|
||||
|
||||
<!--
|
||||
This is a simple example / template impress.js slide show. The goal is to be
|
||||
easier to read for a first timer than the official and very feature rich
|
||||
demo by bartaz (http://bartaz.github.io/impress.js/). It's also a very
|
||||
traditional presentation that looks like slides (square screens with bullet
|
||||
points...), again to make a first timer feel more at home. From this simple
|
||||
presentation you can then go on to more powerful impress.js presentations!
|
||||
|
||||
This example is hopefully helpful for people that want to create both
|
||||
simple and (eventually) awesome presentations in impress.js and comfortable
|
||||
doing that directly in HTML.
|
||||
|
||||
By: @henrikingo (Still based on the HTML from bartaz' demo.)
|
||||
|
||||
-->
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>A Study in 3D Rotations| by Henrik Ingo @henrikingo</title>
|
||||
<meta name="description" content="Explore impress.js in 3D" />
|
||||
<meta name="author" content="Henrik Ingo" />
|
||||
<link href="css/3D-rotations.css" rel="stylesheet" />
|
||||
</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" data-transition-duration="2000">
|
||||
|
||||
|
||||
<div id="overview" class="step overview" data-x="1350" data-y="100" data-z="100" data-scale="3" data-rotate-y="90">
|
||||
<h1>A Study in 3D Rotations</h1>
|
||||
</div>
|
||||
<div id="overview2" class="step overview" data-x="2018" data-y="106" data-z="3018" data-scale="2">
|
||||
<p>Unlike the <code>x/y/z</code> coordinates (aka translations), the <code>rotate-x/y/z</code> rotations are applied in a
|
||||
specific order, and order matters. This demo presentation exhibits the use of the new <code>data-rotate- order</code> attribute.
|
||||
Instead of the default "xyz" order, the steps use the reversed <em>"zyx"</em> order in applying rotations around each axis.
|
||||
Some of the steps (<a href="#step-3">3</a> & <a href="#step-7">7</a>), are in positions that are not possible with the default "xyz" order.</p>
|
||||
</div>
|
||||
|
||||
<div id="step-1" class="step" data-x="0" data-y="0" data-z="0"
|
||||
data-goto-prev="step-8">
|
||||
<p>Slide one</p>
|
||||
</div>
|
||||
|
||||
<div id="step-2" class="step" data-x="420" data-y="-70" data-z="-250" data-rotate-z="45" data-rotate-y="-45" data-rotate-order="zyx">
|
||||
<p>Slide two</p>
|
||||
</div>
|
||||
|
||||
<div id="step-3" class="step" data-x="700" data-y="350" data-z="-350" data-rotate-z="90" data-rotate-y="-90" data-rotate-order="zyx">
|
||||
<p>Slide three</p>
|
||||
</div>
|
||||
|
||||
<div id="step-4" class="step" data-x="422" data-y="780" data-z="-250" data-rotate-z="135" data-rotate-y="-135" data-rotate-order="zyx">
|
||||
<p>Slide four</p>
|
||||
</div>
|
||||
|
||||
<div id="step-5" class="step" data-x="0" data-y="702" data-z="0" data-rotate-z="180" data-rotate-y="-180" data-rotate-order="zyx">
|
||||
<p>Slide five</p>
|
||||
</div>
|
||||
|
||||
<div id="step-6" class="step" data-x="379" data-y="780" data-z="270" data-rotate-z="135" data-rotate-y="-225" data-rotate-order="zyx">
|
||||
<p>Slide six</p>
|
||||
</div>
|
||||
|
||||
<div id="step-7" class="step" data-x="700" data-y="350" data-z="350" data-rotate-z="90" data-rotate-y="-270" data-rotate-order="zyx">
|
||||
<p>Slide seven</p>
|
||||
</div>
|
||||
|
||||
<div id="step-8" class="step" data-x="379" data-y="-70" data-z="270" data-rotate-z="45" data-rotate-y="-315" data-rotate-order="zyx"
|
||||
data-goto-next="step-1">
|
||||
<p>Slide eight</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="impress-toolbar"></div>
|
||||
<div id="impress-help"></div>
|
||||
|
||||
<script type="text/javascript" src="../../js/impress.js"></script>
|
||||
<script>impress().init();</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
464
examples/classic-slides/css/classic-slides.css
Normal file
@@ -0,0 +1,464 @@
|
||||
/*
|
||||
A common approach is to use googleapis.com to generate css for the webfonts you want to use.
|
||||
The downside of this approach is that you have to be online. So below I have simply saved
|
||||
the output of the googleapis url into a file. Then you of course also have to make sure
|
||||
the webfonts are locally installed to make offline usage work. For Ubuntu (or Debian) I
|
||||
successfully used the script from here to do that:
|
||||
http://www.webupd8.org/2011/01/automatically-install-all-google-web.html
|
||||
*/
|
||||
|
||||
/* @import url(http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic|Cutive+Mono); */
|
||||
@import url(fonts.css);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
We display a fallback message for users with browsers that don't support
|
||||
all the features required by it. All of the content will be still fully
|
||||
accessible for them, but some more advanced effects would be missing.
|
||||
When impress.js detects that browser supports all necessary CSS3 features,
|
||||
the fallback-message style is hidden.
|
||||
*/
|
||||
|
||||
.fallback-message {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.3;
|
||||
|
||||
width: 780px;
|
||||
padding: 10px 10px 0;
|
||||
margin: 20px auto;
|
||||
|
||||
border: 1px solid #E4C652;
|
||||
border-radius: 10px;
|
||||
background: #EEDC94;
|
||||
}
|
||||
|
||||
.fallback-message p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.impress-supported .fallback-message {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
The body background is the bacgkround of "everything". Many
|
||||
impress.js tools call it the "surface". It could also be a
|
||||
picture or pattern, but we leave it as light gray.
|
||||
*/
|
||||
|
||||
body {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
min-height: 740px;
|
||||
|
||||
background: rgb(215, 215, 215);
|
||||
color: rgb(102, 102, 102);
|
||||
}
|
||||
|
||||
/*
|
||||
Now let's style the presentation steps.
|
||||
*/
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
width: 900px;
|
||||
padding: 40px;
|
||||
margin: 20px auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
font-family: 'PT Serif', georgia, serif;
|
||||
font-size: 48px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
/*
|
||||
Make inactive steps a little bit transparent.
|
||||
*/
|
||||
.impress-enabled .step {
|
||||
margin: 0;
|
||||
opacity: 0.3;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.impress-enabled .step.active { opacity: 1 }
|
||||
|
||||
/*
|
||||
Speaker notes allow you to write comments within the steps, that will not
|
||||
be displayed as part of the presentation. However, they will be picked up
|
||||
and displayed by impressConsole.js when integrated.
|
||||
*/
|
||||
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
These 'slide' step styles were heavily inspired by HTML5 Slides:
|
||||
http://html5slides.googlecode.com/svn/trunk/styles.css
|
||||
|
||||
Note that we also use a background image, again just to facilitate a common
|
||||
feature from PowerPoint and LibreOffice worlds. In this case the background
|
||||
image is just the impress.js favicon - as if it were a company logo or something.
|
||||
|
||||
*/
|
||||
.slide {
|
||||
display: block;
|
||||
|
||||
width: 900px;
|
||||
height: 700px;
|
||||
padding: 40px 60px;
|
||||
|
||||
background-image: url(../images/background.png);
|
||||
background-color: white;
|
||||
border: 1px solid rgba(0, 0, 0, .3);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
|
||||
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .1);
|
||||
|
||||
font-family: 'Open Sans', Arial, sans-serif;
|
||||
font-size: 30px;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
|
||||
.slide h1,
|
||||
.slide h2,
|
||||
.slide h3 {
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.slide p {
|
||||
text-align: center;
|
||||
margin: 0.7em;
|
||||
}
|
||||
|
||||
.slide li {
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
/* Highlight.js used for coloring pre > code blocks. */
|
||||
.slide pre > code {
|
||||
font-size: 14px;
|
||||
text-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Inline code, no Highlight.js */
|
||||
code {
|
||||
font-family: "Cutive mono","Courier New", monospace;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
padding: 0 0.1em;
|
||||
background: rgba(200,200,200,0.2);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.9);
|
||||
border-radius: 0.2em;
|
||||
border-bottom: 1px solid rgba(100,100,100,0.2);
|
||||
border-left: 1px solid rgba(100,100,100,0.2);
|
||||
|
||||
transition: 0.5s;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
background: rgba(200,200,200,1);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
em {
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strong {
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
q {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strike {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 300px
|
||||
}
|
||||
|
||||
.slide .right {
|
||||
float: right;
|
||||
margin-left: 40px;
|
||||
margin-right: 0px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.slide .left {
|
||||
float: left;
|
||||
margin-right: 40px;
|
||||
margin-left: 0px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.slide .top {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.slide .bottom {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/*
|
||||
Specific styles for: .title slides
|
||||
*/
|
||||
|
||||
.title {
|
||||
background-image: url(../images/background-title.png);
|
||||
}
|
||||
|
||||
.title h1,
|
||||
.title h2,
|
||||
.title h3 {
|
||||
position: absolute;
|
||||
left: 45px; /* slide width is 900px, so this is like a 5% margin on both sides */
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
}
|
||||
.title h1 { top: 50px; }
|
||||
.title h2 { top: 400px; }
|
||||
.title h3 { top: 500px; }
|
||||
|
||||
|
||||
|
||||
/* Styles for animating the contents of a slide, such as a img, p, li or span element. ********/
|
||||
|
||||
/*
|
||||
fly-in class starts from a position outside the slide, then flies into it's correct position.
|
||||
*/
|
||||
.future .fly-in {
|
||||
transform: translateY(-700px);
|
||||
opacity: 0.0; /* Make it invisible, just so it doesn't clutter some other slide that might be in the position where we moved it */
|
||||
}
|
||||
.present .fly-in {
|
||||
transform: translateY(0px);
|
||||
opacity: 1.0;
|
||||
transition: 2s;
|
||||
}
|
||||
.past .fly-out {
|
||||
transform: translateY(700px);
|
||||
opacity: 0.0;
|
||||
transition: 2s;
|
||||
}
|
||||
|
||||
/*
|
||||
Fade-in/out is a straightforward fade. Give it enough seconds that all browsers render it clearly.
|
||||
*/
|
||||
.future .fade-in {
|
||||
opacity: 0.0;
|
||||
}
|
||||
.present .fade-in {
|
||||
opacity: 1.0;
|
||||
transition: 3s;
|
||||
}
|
||||
.past .fade-out {
|
||||
opacity: 0.0;
|
||||
transition: 3s;
|
||||
}
|
||||
/*
|
||||
Zoom-in.
|
||||
*/
|
||||
.future .zoom-in {
|
||||
transform: scale(10);
|
||||
opacity: 0.0;
|
||||
}
|
||||
.present .zoom-in {
|
||||
transform: scale(1);
|
||||
opacity: 1.0;
|
||||
transition: 3s;
|
||||
}
|
||||
.past .zoom-out {
|
||||
transform: scale(10);
|
||||
opacity: 0.0;
|
||||
}
|
||||
|
||||
/*
|
||||
This version of impress.js supports plugins, and in particular, a UI toolbar
|
||||
plugin that allows easy navigation between steps and autoplay.
|
||||
*/
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
z-index: 10;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*
|
||||
With help from the mouse-timeout plugin, we can hide the toolbar and
|
||||
have it show only when you move/click/touch the mouse.
|
||||
*/
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
In fact, we can hide the mouse cursor itself too, when mouse isn't used.
|
||||
*/
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Progress bar */
|
||||
.impress-progressbar {
|
||||
position: absolute;
|
||||
right: 118px;
|
||||
bottom: 1px;
|
||||
left: 118px;
|
||||
border-radius: 7px;
|
||||
border: 2px solid rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
.impress-progressbar DIV {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
border-radius: 5px;
|
||||
background: rgba(75, 75, 75, 0.4);
|
||||
transition: width 1s linear;
|
||||
}
|
||||
.impress-progress {
|
||||
position: absolute;
|
||||
left: 59px;
|
||||
bottom: 1px;
|
||||
text-align: left;
|
||||
font-size: 10pt;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Help popup plugin */
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
/* Substep plugin */
|
||||
|
||||
#impress .step .substep {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#impress .step .substep.substep-visible {
|
||||
opacity: 1;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
/*
|
||||
Styles for specific slides.
|
||||
*/
|
||||
|
||||
/* The bar graph for Acme Inc profits */
|
||||
|
||||
#acme-graph-bottom {
|
||||
position: absolute;
|
||||
bottom: 100px;
|
||||
left: 440px;
|
||||
background-color: black;
|
||||
width: 410px;
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
/* height: is set from javascript */
|
||||
#acme-graph-q1,
|
||||
#acme-graph-q2,
|
||||
#acme-graph-q3,
|
||||
#acme-graph-q4 {
|
||||
border: solid 1px black;
|
||||
width: 70px;
|
||||
margin-left: 10px;
|
||||
position: absolute;
|
||||
bottom: 100px;
|
||||
}
|
||||
|
||||
#acme-graph-q1 {
|
||||
background-color: red;
|
||||
left: 450px;
|
||||
}
|
||||
|
||||
#acme-graph-q2 {
|
||||
background-color: blue;
|
||||
left: 550px;
|
||||
}
|
||||
|
||||
#acme-graph-q3 {
|
||||
background-color: green;
|
||||
left: 650px;
|
||||
}
|
||||
|
||||
#acme-graph-q4 {
|
||||
background-color: purple;
|
||||
left: 750px;
|
||||
}
|
||||
|
||||
/*
|
||||
And as the last thing there is a workaround for quite strange bug.
|
||||
It happens a lot in Chrome. I don't remember if I've seen it in Firefox.
|
||||
|
||||
Sometimes the element positioned in 3D (especially when it's moved back
|
||||
along Z axis) is not clickable, because it falls 'behind' the <body>
|
||||
element.
|
||||
|
||||
To prevent this, I decided to make <body> non clickable by setting
|
||||
pointer-events property to `none` value.
|
||||
Value if this property is inherited, so to make everything else clickable
|
||||
I bring it back on the #impress element.
|
||||
|
||||
If you want to know more about `pointer-events` here are some docs:
|
||||
https://developer.mozilla.org/en/CSS/pointer-events
|
||||
|
||||
There is one very important thing to notice about this workaround - it makes
|
||||
everything 'unclickable' except what's in #impress element.
|
||||
|
||||
So use it wisely ... or don't use at all.
|
||||
*/
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
497
examples/classic-slides/css/fonts.css
Normal file
@@ -0,0 +1,497 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQSYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQY4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBkbcKLIaa1LC45dFaAfauRA.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBmo_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBr6up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBiYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBo4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxmgpAmOCqD37_tyH_8Ri5MM.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxsPNMTLbnS9uQzHQlYieHUU.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxgyhumQnPMBCoGYhRaNxyyY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhUVAXEdVvYDDqrz3aeR0Yc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxlf4y_3s5bcYyyLIFUSWYUU.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxnywqdtBbUHn3VPgzuFrCy8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxl2umOyRU7PgRiv8DXcgJjk.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/JX7MlXqjSJNjQvI4heMMGvY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/vtwNVMP8y9C17vLvIBNZI_Y6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/9kaD4V2pNPMMeUVBHayd7vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/ATKpv8nLYAKUYexo8iqqrg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/kTYfCWJhlldPf5LnG4ZnHCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/g46X4VH_KHOWAAa-HpnGPiEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/hpORcvLZtemlH8gI-1S-7iEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/0XxGQsSc1g4rdRdjJKZrNPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/GpWpM_6S4VQLPNAQ3iWvVRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/7dSh6BcuqDLzS2qAASIeuhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/DVKQJxMmC9WF_oplMzlQqRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/PIPMHY90P7jtyjpXuZ2cLFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/5hX15RUpPERmeybVlLQEWBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/fU0HAfLiPHGlZhZpY6M7dBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/CPRt--GVMETgA6YEaoGitxTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/I-OtoJZa3TeyH6D9oli3ifesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpCYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpI4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/O_WhD9hODL16N4KLHLX7xSEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/3Nwg9VzlwLXPq3fNKwVRMCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/b31S45a_TNgaBApZhTgE6CEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9ede9INZm0R8ZMJUtfOsxrw.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9bpHcMS0zZe4mIYvDKG2oeM.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9RHJTnCUrjaAm2S9z52xC3Y.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9YWiMMZ7xLd792ULpGE4W_Y.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
|
||||
BIN
examples/classic-slides/images/3476636111_c551295ca4_b.jpg
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
examples/classic-slides/images/background-title.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
337
examples/classic-slides/images/background-title.svg
Normal file
@@ -0,0 +1,337 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="900"
|
||||
height="700"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="background-title.svg"
|
||||
inkscape:export-filename="/home/hingo/hacking/impress.js/examples/classic-slides/images/background-title.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient3972">
|
||||
<stop
|
||||
style="stop-color:#d7d7d7;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3974" />
|
||||
<stop
|
||||
id="stop4001"
|
||||
offset="0.5"
|
||||
style="stop-color:#e4e4eb;stop-opacity:0.49803922;" />
|
||||
<stop
|
||||
style="stop-color:#f2f2ff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3976" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="442.96588"
|
||||
inkscape:cy="486.34297"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="845"
|
||||
inkscape:window-x="-2"
|
||||
inkscape:window-y="-3"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-352.36218)">
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,1175.0086,227.72198)"
|
||||
inkscape:transform-center-x="-1.50147"
|
||||
inkscape:transform-center-y="-0.2514516" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#d7d7d7;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3197"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-478.57144"
|
||||
sodipodi:cy="288.57144"
|
||||
sodipodi:r1="47.573788"
|
||||
sodipodi:r2="38.488003"
|
||||
sodipodi:arg1="0.72165485"
|
||||
sodipodi:arg2="1.3499734"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -442.85716,320.00001 -54.56831,12.2497 -28.51269,-48.11219 36.94651,-41.98466 51.34688,22.16424 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,1183.5508,278.97519)"
|
||||
inkscape:transform-center-x="1.6045478"
|
||||
inkscape:transform-center-y="-0.68274238" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,1144.399,329.51655)"
|
||||
inkscape:transform-center-x="-1.409826"
|
||||
inkscape:transform-center-y="-0.48807819" />
|
||||
<image
|
||||
y="-881.14282"
|
||||
x="775.50507"
|
||||
id="image4083"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAABP9JREFU
|
||||
WIWdl11oW2UYx3/P+WiSpknHsi2MNgtkGNbVVryoisJkA+sYjG3MG2GwQdEhuxB2M4ThBGGCjLFR
|
||||
pkPZhYIwNrCom+iK9GJ4sVIdumnRdh/CbEu1o7ZZ6UdyHi+aU9+cnqyNLzyQc973/b//5/98vDmi
|
||||
qqx2qCqWZaGq7N69e6/neU/atj0bi8X6Ll269EOxWMRxHFpaWhgcHFw9aC0WiUQARkVEAQW0/Pua
|
||||
quJ53qod+l8EgJTjOCX/cN8cx5lQ1c2e59VEwqqNLiQSiQlV/Sf4Pp1OzwCzIoKIsOrQ1qqAqhKP
|
||||
x/8koABwwVyzWhWqKvA4D4rFYp/5LCKsWbPmNxGpeGdiGCEklUqFEzh69Cgi8oWIvCsilEqlUAJz
|
||||
c3PXzGfbtnEc57sw0g8fPkRVEZF3RKT3wIEDTExMVHq6sLBAX18fwK+AWpalwMcDAwMUi8VlIdiw
|
||||
YcOzdXV1pvyFsFBNTU35x5wrYypw58yZM5UEyszPlhd4BvC327Zts4PAzc3NOI4z5a9zXfePMAJN
|
||||
TU0AXxl4PvZrS2qpKsePH2+JRCLBpPLt1qZNm5pDyvGOv6axsfH74HwymQQYCMMUkZnW1tb/CADP
|
||||
mI0laNFodNp13af97FZVMpnMTcOj0+ac67o5y7LCKkX9EO/YsSNvEsgkk0kFljUYXzrbtueBTj8n
|
||||
gBOA2ratwKuGMu22bc8FQmnK70WjUW1ra0sD4HkepVKJ8fHxLNABfJpIJLzAJt+KwBuFQgFgSyKR
|
||||
+An4JplMxsuH7wXmw5yor69X4GsR2X7jxo2mU6dOVSah2UDi8TjATuBqeWOw77eqKvfv32d0dNT3
|
||||
/PmAgl557Y8i0gUwNDSEqnLs2DGWRlj2+rFUVbq6utqBN23b/jkajarrugth+4Cs4zh+jP+uq6vr
|
||||
FpG2mzdvpsNwXdetTiDM+vv7AdqAtjDC5aa1B9i5f//+FfF6enpYu3ZtbXfB+vXrN7a2ttZVm+/s
|
||||
7MQ8fHJysirW0l2xUggOHz6cAV4RkSupVEoty7rT1dW1bM+uXbsQkdvAiOu6Z4GO3t7eZf3DtHv3
|
||||
7oUTKI+XgE+CSVi2fMie9mDJWZY1ISIngC3VnDXjB/Ac8Hk0Gg3WrlmGRxYWFshms3XASeA00FTu
|
||||
bB9Wq/90Ol0E3gNyg4ODstRPyuw7yguDmysakYhsNzx+3Zg/qao8evQI4MgKWCWgcPDgwbSqLl3H
|
||||
cUDKFjbGI5HIU57n9fkhyuVye/zJVCr1AkB9fT2qeg542SAQHJbruvGRkZEGYDEE3d3d7SIyV4Vx
|
||||
/9atW5fFrqGh4bbvaSwWG1JV20zgWCz2BDBRBfOvJSUNSd83Yuaz/+z69esb5+fnwxL1gQE4GZZg
|
||||
uVyuCbgVzAfgxQoCpVKJu3fvbgR+Nxa/rbr4ZyUInM1mc47jLPV827a9TCazrOSKxSJjY2MAVw3c
|
||||
Hv/MCgVUlfPnzwN8CRwK9gOzR6xbt26nKalt25pOpw+FqTA7O4uqxoGPgAsA09PTVCiwUjMKkf+t
|
||||
YFwbGho+qLa+XHK28XtlAo+zfD7/gOVldkVVN6+0FyrPdKqUXehQXfw2dBevMrNktbGxsQNorAUP
|
||||
QIzWu6qRSCSYmZmZ8jwvUQEkMuV5Xs0Eav40KxQKeJ43FnyvqoOXL1+uFa42BVQV/+tn3759LcPD
|
||||
w3nXdcnn879cvHhx2PM8LKs2n/4Ful6n5lJtlzQAAAAASUVORK5CYII=
|
||||
"
|
||||
height="50.57143"
|
||||
width="50.57143"
|
||||
transform="matrix(0,1,-1,0,0,0)" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#d7d7d7;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3197-6"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-478.57144"
|
||||
sodipodi:cy="288.57144"
|
||||
sodipodi:r1="47.573788"
|
||||
sodipodi:r2="38.488003"
|
||||
sodipodi:arg1="0.72165485"
|
||||
sodipodi:arg2="1.3499734"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -442.85716,320.00001 -54.56831,12.2497 -28.51269,-48.11219 36.94651,-41.98466 51.34688,22.16424 z"
|
||||
transform="matrix(0.44159933,0.23084195,-0.23084195,0.44159933,89.555741,918.94346)"
|
||||
inkscape:transform-center-x="-1.8892484"
|
||||
inkscape:transform-center-y="-0.39033876" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195-8"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,38.474821,733.37841)"
|
||||
inkscape:transform-center-x="-1.50147"
|
||||
inkscape:transform-center-y="-0.2514516" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-9"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,30.121671,876.6823)"
|
||||
inkscape:transform-center-x="-1.409826"
|
||||
inkscape:transform-center-y="-0.48807819" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-3"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.34408672,0,0,0.34408672,-3.3081587,917.1069)"
|
||||
inkscape:transform-center-x="-0.97352805"
|
||||
inkscape:transform-center-y="-0.33703252" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-3-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.34408672,0,0,0.34408672,29.548981,922.96025)"
|
||||
inkscape:transform-center-x="-0.97352805"
|
||||
inkscape:transform-center-y="-0.33703252" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195-8-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(0.3204918,0,0,0.3204918,79.533061,832.48569)"
|
||||
inkscape:transform-center-x="-0.96571172"
|
||||
inkscape:transform-center-y="-0.16173851" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(-0.50808944,0,0,0.49826547,-279.52146,234.09512)"
|
||||
inkscape:transform-center-x="1.5309823"
|
||||
inkscape:transform-center-y="-0.25143993" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#d7d7d7;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3197-4"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-478.57144"
|
||||
sodipodi:cy="288.57144"
|
||||
sodipodi:r1="47.573788"
|
||||
sodipodi:r2="38.488003"
|
||||
sodipodi:arg1="0.72165485"
|
||||
sodipodi:arg2="1.3499734"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -442.85716,320.00001 -54.56831,12.2497 -28.51269,-48.11219 36.94651,-41.98466 51.34688,22.16424 z"
|
||||
transform="matrix(-0.50808944,0,0,0.49826547,-288.23156,285.34529)"
|
||||
inkscape:transform-center-x="-1.6360872"
|
||||
inkscape:transform-center-y="-0.68270036" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-90"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(-0.50808944,0,0,0.49826547,-248.3102,335.88365)"
|
||||
inkscape:transform-center-x="1.437537"
|
||||
inkscape:transform-center-y="-0.48804535" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
x="829.30469"
|
||||
y="-856.37756"
|
||||
id="text4226"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="matrix(0,1,-1,0,0,0)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4228"
|
||||
x="829.30469"
|
||||
y="-856.37756"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:PT Serif;-inkscape-font-specification:PT Serif">impress.js</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
BIN
examples/classic-slides/images/background.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
323
examples/classic-slides/images/background.svg
Normal file
@@ -0,0 +1,323 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="900"
|
||||
height="700"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="background.svg"
|
||||
inkscape:export-filename="/home/hingo/hacking/impress.js/examples/classic-slides/images/background-title.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient3972">
|
||||
<stop
|
||||
style="stop-color:#d7d7d7;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3974" />
|
||||
<stop
|
||||
id="stop4001"
|
||||
offset="0.5"
|
||||
style="stop-color:#e4e4eb;stop-opacity:0.49803922;" />
|
||||
<stop
|
||||
style="stop-color:#f2f2ff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3976" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="442.96588"
|
||||
inkscape:cy="486.34297"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="845"
|
||||
inkscape:window-x="-2"
|
||||
inkscape:window-y="-3"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-352.36218)">
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,1080.7229,232.00769)"
|
||||
inkscape:transform-center-x="-1.50147"
|
||||
inkscape:transform-center-y="-0.2514516" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#d7d7d7;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3197"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-478.57144"
|
||||
sodipodi:cy="288.57144"
|
||||
sodipodi:r1="47.573788"
|
||||
sodipodi:r2="38.488003"
|
||||
sodipodi:arg1="0.72165485"
|
||||
sodipodi:arg2="1.3499734"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -442.85716,320.00001 -54.56831,12.2497 -28.51269,-48.11219 36.94651,-41.98466 51.34688,22.16424 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,1089.2651,283.2609)"
|
||||
inkscape:transform-center-x="1.6045478"
|
||||
inkscape:transform-center-y="-0.68274238" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,1050.1133,333.80226)"
|
||||
inkscape:transform-center-x="-1.409826"
|
||||
inkscape:transform-center-y="-0.48807819" />
|
||||
<image
|
||||
y="999.21936"
|
||||
x="852.57141"
|
||||
id="image4083"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAABP9JREFU
|
||||
WIWdl11oW2UYx3/P+WiSpknHsi2MNgtkGNbVVryoisJkA+sYjG3MG2GwQdEhuxB2M4ThBGGCjLFR
|
||||
pkPZhYIwNrCom+iK9GJ4sVIdumnRdh/CbEu1o7ZZ6UdyHi+aU9+cnqyNLzyQc973/b//5/98vDmi
|
||||
qqx2qCqWZaGq7N69e6/neU/atj0bi8X6Ll269EOxWMRxHFpaWhgcHFw9aC0WiUQARkVEAQW0/Pua
|
||||
quJ53qod+l8EgJTjOCX/cN8cx5lQ1c2e59VEwqqNLiQSiQlV/Sf4Pp1OzwCzIoKIsOrQ1qqAqhKP
|
||||
x/8koABwwVyzWhWqKvA4D4rFYp/5LCKsWbPmNxGpeGdiGCEklUqFEzh69Cgi8oWIvCsilEqlUAJz
|
||||
c3PXzGfbtnEc57sw0g8fPkRVEZF3RKT3wIEDTExMVHq6sLBAX18fwK+AWpalwMcDAwMUi8VlIdiw
|
||||
YcOzdXV1pvyFsFBNTU35x5wrYypw58yZM5UEyszPlhd4BvC327Zts4PAzc3NOI4z5a9zXfePMAJN
|
||||
TU0AXxl4PvZrS2qpKsePH2+JRCLBpPLt1qZNm5pDyvGOv6axsfH74HwymQQYCMMUkZnW1tb/CADP
|
||||
mI0laNFodNp13af97FZVMpnMTcOj0+ac67o5y7LCKkX9EO/YsSNvEsgkk0kFljUYXzrbtueBTj8n
|
||||
gBOA2ratwKuGMu22bc8FQmnK70WjUW1ra0sD4HkepVKJ8fHxLNABfJpIJLzAJt+KwBuFQgFgSyKR
|
||||
+An4JplMxsuH7wXmw5yor69X4GsR2X7jxo2mU6dOVSah2UDi8TjATuBqeWOw77eqKvfv32d0dNT3
|
||||
/PmAgl557Y8i0gUwNDSEqnLs2DGWRlj2+rFUVbq6utqBN23b/jkajarrugth+4Cs4zh+jP+uq6vr
|
||||
FpG2mzdvpsNwXdetTiDM+vv7AdqAtjDC5aa1B9i5f//+FfF6enpYu3ZtbXfB+vXrN7a2ttZVm+/s
|
||||
7MQ8fHJysirW0l2xUggOHz6cAV4RkSupVEoty7rT1dW1bM+uXbsQkdvAiOu6Z4GO3t7eZf3DtHv3
|
||||
7oUTKI+XgE+CSVi2fMie9mDJWZY1ISIngC3VnDXjB/Ac8Hk0Gg3WrlmGRxYWFshms3XASeA00FTu
|
||||
bB9Wq/90Ol0E3gNyg4ODstRPyuw7yguDmysakYhsNzx+3Zg/qao8evQI4MgKWCWgcPDgwbSqLl3H
|
||||
cUDKFjbGI5HIU57n9fkhyuVye/zJVCr1AkB9fT2qeg542SAQHJbruvGRkZEGYDEE3d3d7SIyV4Vx
|
||||
/9atW5fFrqGh4bbvaSwWG1JV20zgWCz2BDBRBfOvJSUNSd83Yuaz/+z69esb5+fnwxL1gQE4GZZg
|
||||
uVyuCbgVzAfgxQoCpVKJu3fvbgR+Nxa/rbr4ZyUInM1mc47jLPV827a9TCazrOSKxSJjY2MAVw3c
|
||||
Hv/MCgVUlfPnzwN8CRwK9gOzR6xbt26nKalt25pOpw+FqTA7O4uqxoGPgAsA09PTVCiwUjMKkf+t
|
||||
YFwbGho+qLa+XHK28XtlAo+zfD7/gOVldkVVN6+0FyrPdKqUXehQXfw2dBevMrNktbGxsQNorAUP
|
||||
QIzWu6qRSCSYmZmZ8jwvUQEkMuV5Xs0Eav40KxQKeJ43FnyvqoOXL1+uFa42BVQV/+tn3759LcPD
|
||||
w3nXdcnn879cvHhx2PM8LKs2n/4Ful6n5lJtlzQAAAAASUVORK5CYII=
|
||||
"
|
||||
height="32"
|
||||
width="32" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#d7d7d7;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3197-6"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-478.57144"
|
||||
sodipodi:cy="288.57144"
|
||||
sodipodi:r1="47.573788"
|
||||
sodipodi:r2="38.488003"
|
||||
sodipodi:arg1="0.72165485"
|
||||
sodipodi:arg2="1.3499734"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -442.85716,320.00001 -54.56831,12.2497 -28.51269,-48.11219 36.94651,-41.98466 51.34688,22.16424 z"
|
||||
transform="matrix(0.44159933,0.23084195,-0.23084195,0.44159933,328.12717,970.37203)"
|
||||
inkscape:transform-center-x="-1.8892484"
|
||||
inkscape:transform-center-y="-0.39033876" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195-8"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,277.04625,784.80698)"
|
||||
inkscape:transform-center-x="-1.50147"
|
||||
inkscape:transform-center-y="-0.2514516" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-9"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.49829507,0,0,0.49829507,268.6931,928.11087)"
|
||||
inkscape:transform-center-x="-1.409826"
|
||||
inkscape:transform-center-y="-0.48807819" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-3"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.34408672,0,0,0.34408672,235.26327,968.53547)"
|
||||
inkscape:transform-center-x="-0.97352805"
|
||||
inkscape:transform-center-y="-0.33703252" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-3-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(0.34408672,0,0,0.34408672,268.12041,974.38882)"
|
||||
inkscape:transform-center-x="-0.97352805"
|
||||
inkscape:transform-center-y="-0.33703252" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195-8-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(0.3204918,0,0,0.3204918,318.10449,883.91426)"
|
||||
inkscape:transform-center-x="-0.96571172"
|
||||
inkscape:transform-center-y="-0.16173851" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f7f7f7;fill-opacity:1;stroke:#dccbcb;stroke-opacity:1"
|
||||
id="path3195-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-432.85715"
|
||||
sodipodi:cy="448.57144"
|
||||
sodipodi:r1="36.617161"
|
||||
sodipodi:r2="29.623903"
|
||||
sodipodi:arg1="1.2120257"
|
||||
sodipodi:arg2="1.8403442"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -420.00001,482.85716 -41.49172,-11.46298 -1.9197,-43.00323 40.30527,-15.11447 26.82974,33.66196 z"
|
||||
transform="matrix(-0.50808944,0,0,0.49826547,-180.95003,232.66655)"
|
||||
inkscape:transform-center-x="1.5309823"
|
||||
inkscape:transform-center-y="-0.25143993" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#d7d7d7;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3197-4"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-478.57144"
|
||||
sodipodi:cy="288.57144"
|
||||
sodipodi:r1="47.573788"
|
||||
sodipodi:r2="38.488003"
|
||||
sodipodi:arg1="0.72165485"
|
||||
sodipodi:arg2="1.3499734"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -442.85716,320.00001 -54.56831,12.2497 -28.51269,-48.11219 36.94651,-41.98466 51.34688,22.16424 z"
|
||||
transform="matrix(-0.50808944,0,0,0.49826547,-189.66013,283.91672)"
|
||||
inkscape:transform-center-x="-1.6360872"
|
||||
inkscape:transform-center-y="-0.68270036" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:#f2f2f2;fill-opacity:1;stroke:#c8b7b7"
|
||||
id="path3199-90"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="-358.57144"
|
||||
sodipodi:cy="152.85715"
|
||||
sodipodi:r1="39.512333"
|
||||
sodipodi:r2="31.966148"
|
||||
sodipodi:arg1="2.4329664"
|
||||
sodipodi:arg2="3.0612849"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m -388.57144,178.57143 -3.72625,-46.29983 42.88228,-17.8513 30.22896,35.26711 -24.19976,39.64758 z"
|
||||
transform="matrix(-0.50808944,0,0,0.49826547,-149.73877,334.45508)"
|
||||
inkscape:transform-center-x="1.437537"
|
||||
inkscape:transform-center-y="-0.48804535" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
463
examples/classic-slides/index.html
Normal file
@@ -0,0 +1,463 @@
|
||||
<!doctype html>
|
||||
|
||||
<!--
|
||||
This is a simple example / template impress.js slide show. The goal is to be
|
||||
easier to read for a first timer than the official and very feature rich
|
||||
demo by bartaz (http://bartaz.github.io/impress.js/). It's also a very
|
||||
traditional presentation that looks like slides (square screens with bullet
|
||||
points...), again to make a first timer feel more at home. From this simple
|
||||
presentation you can then go on to more powerful impress.js presentations!
|
||||
|
||||
This example is hopefully helpful for people that want to create both
|
||||
simple and (eventually) awesome presentations in impress.js and comfortable
|
||||
doing that directly in HTML.
|
||||
|
||||
By: @henrikingo (Still based on the HTML from bartaz' demo.)
|
||||
|
||||
-->
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Classic Slides with impress.js | Simple example impress.js slide show | by Henrik Ingo @henrikingo</title>
|
||||
|
||||
<meta name="description" content="Simple example impress.js slide show" />
|
||||
<meta name="author" content="Henrik Ingo" />
|
||||
<!--
|
||||
Impress.js doesn't depend on any external stylesheets. It adds all of the styles it needs for the
|
||||
presentation to work.
|
||||
|
||||
However, some of the `extras/` modules do come with their own CSS, and we load
|
||||
them here. You can read about each extras module separately in their directory.
|
||||
-->
|
||||
<link rel="stylesheet" href="../../extras/highlight/styles/github.css">
|
||||
<link rel="stylesheet" href="../../extras/mermaid/mermaid.forest.css">
|
||||
|
||||
|
||||
<!--
|
||||
This file contains styles specific for this example presentation.
|
||||
-->
|
||||
<link href="css/classic-slides.css" rel="stylesheet" />
|
||||
|
||||
</head>
|
||||
|
||||
<!--
|
||||
|
||||
Body element is used by impress.js to set some useful class names, that will allow you to detect
|
||||
the support and state of the presentation in CSS or other scripts.
|
||||
|
||||
First very useful class name is `impress-not-supported`. This class means, that browser doesn't
|
||||
support features required by impress.js, so you should apply some fallback styles in your CSS.
|
||||
It's not necessary to add it manually on this element. If the script detects that browser is not
|
||||
good enough it will add this class, but keeping it in HTML means that users without JavaScript
|
||||
will also get fallback styles.
|
||||
|
||||
When impress.js script detects that browser supports all required features, this class name will
|
||||
be removed.
|
||||
|
||||
Another class name on body element also depends on currently active presentation step.
|
||||
-->
|
||||
<body class="impress-not-supported">
|
||||
<!--
|
||||
This fallback message is only visible when there is `impress-not-supported` class on body.
|
||||
-->
|
||||
<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>
|
||||
|
||||
<!--
|
||||
This is the core element used by impress.js: the wrapper for your presentation steps.
|
||||
In this element all the impress.js magic happens.
|
||||
|
||||
data-transition-duration sets the time in microseconds that is used for the
|
||||
animation when transtitioning between slides.
|
||||
|
||||
data-autoplay can be used to set the time in seconds, after which presentation
|
||||
automatically moves to next slide. It can also be set individually for each
|
||||
slide, but here we just set a common duration for all slides.
|
||||
-->
|
||||
<div id="impress" data-transition-duration="1000" data-autoplay="10">
|
||||
|
||||
<!--
|
||||
Each step of the presentation should be an element inside the `#impress` with a class name
|
||||
of `step`. These step elements are positioned, rotated and scaled by impress.js, and
|
||||
the 'camera' shows them on each step of the presentation.
|
||||
|
||||
The `id` attribute of the step element is used to identify it in the URL, but it's optional.
|
||||
If it is not defined, it will get a default value of `step-N` where N is a number of slide.
|
||||
This step is auto-assigned the id "step-1". You can also use `#step-1` in a link, to
|
||||
point directly to this particular step.
|
||||
|
||||
Positioning information is passed through data-* attributes.
|
||||
|
||||
In the example below we only specify x and y position of the step element with `data-x="-1000"`
|
||||
and `data-y="-1500"` attributes. This means that **the center** of the element (yes, the center)
|
||||
will be positioned in point x = -1000px and y = -1500px of the presentation 'canvas'. It will not
|
||||
be rotated or scaled.
|
||||
|
||||
The "step" class is what *must* be used for every "slide". In this example we also use the "slide"
|
||||
class, which adds a rectangle with some background and makes this presentation look like a traditional
|
||||
powerpoint slide show. The "slide" class is entirely optional and indeed you wouldn't use it for
|
||||
your cooler impress.js presentations.
|
||||
-->
|
||||
<div class="step slide title" data-x="-1000" data-y="-1500">
|
||||
<h1>Example Presentation: <br />
|
||||
Classic Slides</h1>
|
||||
<h2>Henrik Ingo</h2>
|
||||
<h3>2015</h3>
|
||||
|
||||
<div class="notes">
|
||||
Any element with the class="notes" will not be displayed. This can
|
||||
be used for speaker notes. In fact, the impressConsole plugin will
|
||||
show it in the speaker console!
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide" data-rel-x="1000" data-rel-y="0">
|
||||
<h1>Table of Contents</h1>
|
||||
<ul>
|
||||
<li><a href="#step-1">A title slide</a></li>
|
||||
<li><a href="#step-2">Table of Contents</a></li>
|
||||
<li><a href="#step-3">Text slide</a></li>
|
||||
<li><a href="#step-4">Bullet points</a></li>
|
||||
<li><a href="#step-5">Blockquote & image</a></li>
|
||||
<li><a href="#step-6">More basic text styles</a></li>
|
||||
<li><a href="#step-7">Motion effects 101</a></li>
|
||||
<li><a href="#addons">Add-ons</a></li>
|
||||
<li><a href="#moreinfo">More info</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="notes">
|
||||
<p>Table of Contents, with links to other slides of this same presentation.</p>
|
||||
|
||||
<p>Note that instead of absolute positioning we use relative positioning,
|
||||
with the data-rel-x and data-rel-y attributes. This means the step is
|
||||
positioned relative to the foregoing step. In other words, this is
|
||||
equivalent to data-x="0" data-y="-1500".</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide">
|
||||
<h1>A slide with text</h1>
|
||||
<p>This slide has a few paragraphs <br />(p element) of normal text.</p>
|
||||
<p>Personally I like centered or even justified text, as it looks less boring. This can of course be set in <a href="css/classic-slides.css">the css file</a>.</p>
|
||||
<p>I really like the style on links in these presentations. I modified the border to be beveled, but it's mostly from <a href="http://impress.github.io/impress.js/">@bartaz' original demo</a>. <a href="https://twitter.com/bartaz">@bartaz</a> is the creator of impress.js.</p>
|
||||
|
||||
<div class="notes">
|
||||
In this slide, we don't even specify the relative position, rather
|
||||
that too is inherited. So this slide will again be 1000px to the
|
||||
right of the previous one.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide">
|
||||
<h1>Bullet points</h1>
|
||||
<ul>
|
||||
<li>A slide with bullet points. This is the first point.</li>
|
||||
<li>Second point</li>
|
||||
<li>Third point. Under this point we also have some sub-bullets:
|
||||
<ul>
|
||||
<li>Sub-bullet 1</li>
|
||||
<li>Sub-bullet 2</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="notes">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
This element introduces rotation.
|
||||
|
||||
Notation shouldn't be a surprise. We use `data-rotate="30"` attribute, meaning that this
|
||||
element should be rotated by 30 degrees clockwise.
|
||||
-->
|
||||
<div class="step slide" data-rel-x="1100" data-rel-y="300" data-rotate="30">
|
||||
<h1>A blockquote & image</h1>
|
||||
<img src="images/3476636111_c551295ca4_b.jpg"
|
||||
alt="Mother Teresa holding a newborn baby"
|
||||
class="right"/>
|
||||
<blockquote>
|
||||
Spread love everywhere you go. <br />Let no one ever come to you without leaving happier.
|
||||
<p style="text-align: right">Mother Teresa</p>
|
||||
<p class="left bottom"><small>Image credit: <a href="https://www.flickr.com/photos/peta-de-aztlan/3476636111/">Peta_de_Aztlan</a>@Flickr. CC-BY 2.0</small></p>
|
||||
</blockquote>
|
||||
|
||||
<div class="notes">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide" data-rel-x="800" data-rel-y="800" data-rotate="60">
|
||||
<h1>More text styles</h1>
|
||||
<p>As usual, use <em>em</em> to emphasize, <br />
|
||||
<strong>strong</strong> for strong, <u>u</u> for underline,<br />
|
||||
<strike>strike</strike> for strikethrough and <q>q for inline quotations</q>.</p>
|
||||
|
||||
<p>If you're a software engineer like me, you will often use the
|
||||
<code><code></code> tag for monospaced inline text.</p>
|
||||
|
||||
<div class="notes">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide" data-rel-x="300" data-rel-y="1100" data-rotate="90">
|
||||
<h1>Motion effects 101</h1>
|
||||
<p>Items on the slide can</p>
|
||||
<p class="fly-in fly-out">Fly in</p>
|
||||
<p class="fade-in fade-out" style="transition-delay: 2s">Fade in</p>
|
||||
<p class="zoom-in zoom-out" style="transition-delay: 4s">And zoom in</p>
|
||||
|
||||
<p class="left bottom"><small>...just like in PowerPoint. Yeah, I know I'm being lame, but it was fun to learn to do this in CSS3.</small></p>
|
||||
|
||||
<div class="notes">
|
||||
<p>This step here doesn't introduce anything new when it comes to data attributes, but you
|
||||
should notice in the demo that some words of this text are being animated.
|
||||
It's a very basic CSS transition that is applied to the elements when this step element is
|
||||
reached.
|
||||
</p><p>
|
||||
At the very beginning of the presentation all step elements are given the class of `future`.
|
||||
It means that they haven't been visited yet.
|
||||
</p><p>
|
||||
When the presentation moves to given step `future` is changed to `present` class name.
|
||||
That's how animation on this step works - text moves when the step has `present` class.
|
||||
</p><p>
|
||||
Finally when the step is left the `present` class is removed from the element and `past`
|
||||
class is added.
|
||||
</p><p>
|
||||
So basically every step element has one of three classes: `future`, `present` and `past`.
|
||||
Only one current step has the `present` class.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="addons" class="step slide title" data-rel-x="-300" data-rel-y="1100" data-rotate="120">
|
||||
<h2>Add-ons</h2>
|
||||
<div class="notes">
|
||||
<p>This version of impress.js includes several add-ons, striving to make this a
|
||||
full featured presentation app.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide" data-rel-x="-800" data-rel-y="800" data-rotate="150" data-autoplay="3">
|
||||
<h1>Impress.js plugins</h1>
|
||||
<ul>
|
||||
<li>A new <a href="https://github.com/impress/impress.js/blob/master/src/plugins/README.md">plugin framework</a> allows for rich extensibility,
|
||||
without bloating the core rendering library.
|
||||
<ul>
|
||||
<li class="substep">Press 'P' to open a presenter console.</li>
|
||||
<li class="substep">When you move the mouse, navigation controls are visible on your bottom left</li>
|
||||
<li class="substep">Autoplay makes the slides advance after a timeout</li>
|
||||
<li class="substep">Relative positioning plugin is often a more convenient way to position your slides when editing. (<a href="https://github.com/impress/impress.js/blob/master/examples/classic-slides/index.html">See html for this presentation.</a>)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="notes">
|
||||
<p>This presentation also uses speaker notes. They are not visible in the presentation, but shown in the impress console.</p>
|
||||
|
||||
<p>If you pressed P only now, this is the first time you see these notes. In fact, there has been notes on preceding slides as well.
|
||||
You can use the navigation controls at the bottom of the impress console to browse back to them.</p>
|
||||
|
||||
<p>And did you notice how those bullet points appear one by one as you press space/arrow? That's another plugin, called substeps.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide" data-rel-x="-1100" data-rel-y="300" data-rotate="180">
|
||||
<h1>Highlight.js</h1>
|
||||
<pre><code>
|
||||
// `init` API function that initializes (and runs) the presentation.
|
||||
var init = function () {
|
||||
if (initialized) { return; }
|
||||
execPreInitPlugins();
|
||||
|
||||
// First we set up the viewport for mobile devices.
|
||||
// For some reason iPad goes nuts when it is not done properly.
|
||||
var meta = $("meta[name='viewport']") || document.createElement("meta");
|
||||
meta.content = "width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no";
|
||||
if (meta.parentNode !== document.head) {
|
||||
meta.name = 'viewport';
|
||||
document.head.appendChild(meta);
|
||||
}
|
||||
</code></pre>
|
||||
<div class="notes">
|
||||
<p>The Highlight.js library provides really nice color coding of source code.
|
||||
It automatically applies to any code inside a <pre><code> element.</p>
|
||||
<p>Highlight.js is found under the <a href="https://github.com/impress/impress.js/tree/master/extras">extras/</a>
|
||||
directory, since it is an independent third party plugin, not really an impress.js plugin. You have
|
||||
to include it via it's own <link> and <script> tags.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step slide" data-rel-x="-1100" data-rel-y="-300" data-rotate="210">
|
||||
<h1>Mermaid.js</h1>
|
||||
<div class="mermaid">
|
||||
%% This is a comment in mermaid markup
|
||||
graph LR
|
||||
A(Support for<br />diagrams)
|
||||
B[Provided by<br />mermaid.js]
|
||||
C{Already<br />know<br />mermaid?}
|
||||
D(<a href="http://knsv.github.io/mermaid/index.html#usage">Tutorial</a>)
|
||||
E(Great, hope you enjoy!)
|
||||
A-->B
|
||||
B-->C
|
||||
C--No-->D
|
||||
C--Yes-->E
|
||||
classDef startEnd fill:#fcc,stroke:#353,stroke-width:2px;
|
||||
class A,D,E startEnd;
|
||||
</div>
|
||||
|
||||
<h1><a href="http://docs.mathjax.org/en/latest/start.html">MathJax.js</a></h1>
|
||||
<p>Use \(\LaTeX\), MathML or AsciiMath to properly show mathematical formula.</p>
|
||||
<div class="notes">
|
||||
Mermaid.js, likewise in a href="https://github.com/impress/impress.js/tree/master/extras">extras/</a>
|
||||
directory, draws SVG diagrams from a MarkDown-like syntax. To learn
|
||||
more about it <a href="http://knsv.github.io/mermaid/index.html#usage">read the fine manual</a>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="markdown" class="step slide markdown" data-rel-x="-800" data-rel-y="-800" data-rotate="240">
|
||||
# Markdown.js
|
||||
|
||||
* [Markdown.js](https://github.com/evilstreak/markdown-js) integration: for authors in a hurry!
|
||||
* ...or lazy ;-)
|
||||
* Jot down bullet points in *Markdown*
|
||||
* ...have it automatically converted to HTML
|
||||
* Markdown is converted into a presentation client side, in the browser. This is unlike
|
||||
existing tools like [Hovercraft](https://github.com/regebro/hovercraft) and
|
||||
[markdown-impress](http://binbinliao.com/markdown-impress/) where you generate a new
|
||||
html file on the command line.
|
||||
* [A more advanced Markdown presentation is here.](../markdown/)
|
||||
</div>
|
||||
|
||||
<div id="acme" class="step slide" data-rel-x="-300" data-rel-y="-1100" data-rotate="270">
|
||||
<ul>
|
||||
<li>Remember, in <em>impress.js</em> the full power of HTML5, CSS3 & JavaScript is always at your fingertips!</li>
|
||||
<li>For example, you can use tables, forms, or dynamic charts as you would on any web page:</li>
|
||||
</ul>
|
||||
<h2>Acme Inc Quarterly Profits</h2>
|
||||
|
||||
<!-- Improvised bar graph of divs, to avoid copying something like NVD3 into the repo. -->
|
||||
<div id="acme-graph">
|
||||
<div id="acme-graph-bars">
|
||||
<div id="acme-graph-q1"></div>
|
||||
<div id="acme-graph-q2"></div>
|
||||
<div id="acme-graph-q3"></div>
|
||||
<div id="acme-graph-q4"></div>
|
||||
</div>
|
||||
<div id="acme-graph-bottom"></div>
|
||||
</div>
|
||||
|
||||
<table border="1">
|
||||
<tr><td>Q1</td><td id="acme-q1">234€</td></tr>
|
||||
<tr><td>Q2</td><td id="acme-q2">255€</td></tr>
|
||||
<tr><td>Q3</td><td><input id="acme-q3" size="5" oninput="acmeDrawGraph();" />€ <small>(insert here)</small></td></tr>
|
||||
<tr><td>Q4</td><td><input id="acme-q4" size="5" oninput="acmeDrawGraph();" />€</td></tr>
|
||||
</table>
|
||||
<div class="notes">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var acmeDrawGraph = function() {
|
||||
var profits = {};
|
||||
|
||||
// Q1-Q2: get innerHTML, remove €
|
||||
var value = document.getElementById('acme-q1').innerHTML;
|
||||
if( value[value.length-1] == "€" ) value = value.substring(0, value.length-1);
|
||||
profits['q1'] = value;
|
||||
var value = document.getElementById('acme-q2').innerHTML;
|
||||
if( value[value.length-1] == "€" ) value = value.substring(0, value.length-1);
|
||||
profits['q2'] = value;
|
||||
|
||||
// Q3-Q4: get input.value
|
||||
profits['q3'] = document.getElementById('acme-q3').value;
|
||||
profits['q4'] = document.getElementById('acme-q4').value;
|
||||
|
||||
// Convert all to numeric value, and remember max value for scaling purposes.
|
||||
var max = profits['q1'];
|
||||
for ( var q in profits ) {
|
||||
profits[q] = isNaN(profits[q]) ? 0 : Number(profits[q]);
|
||||
if( profits[q] > max ) {
|
||||
max = profits[q];
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the bar graph
|
||||
for ( var q in profits ) {
|
||||
var h = 200 * profits[q] / max;
|
||||
var div = document.getElementById('acme-graph-'+q);
|
||||
div.style = 'height: ' + h + 'px';
|
||||
}
|
||||
};
|
||||
// This draws the first 2 bars during page load
|
||||
acmeDrawGraph();
|
||||
</script>
|
||||
|
||||
<!--
|
||||
This step also sets a custom data-transition-duration. All of the above steps used the value set
|
||||
in the root div#impress element, but it is also allowed to set it for each step. Since transitioning
|
||||
to this step will rotate twice around it's axis, we give the transition a bit more time here.
|
||||
-->
|
||||
<div id="moreinfo" class="step slide" data-x="2020" data-y="700" data-rotate="720" data-transition-duration="2000">
|
||||
<h1>More info</h1>
|
||||
<ul>
|
||||
<li><a href="https://github.com/impress/impress.js/blob/master/DOCUMENTATION.md">DOCUMENTATION.md</a> is the API reference.
|
||||
</li>
|
||||
<li><a href="https://github.com/impress/impress.js/blob/master/examples/classic-slides/index.html">Source of this presentation itself</a> is commented</li>
|
||||
<li><a href="http://impress.github.io/impress.js/">Advanced Impress.js demo</a> by <a href="http://twitter.com/bartaz">@bartaz</a>
|
||||
<ul>
|
||||
<li>Again, the <a href="http://github.com/impress/impress.js/blob/master/index.html">html</a>
|
||||
and <a href="https://github.com/impress/impress.js/blob/master/css/impress-demo.css">css</a> source is well commented.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>More examples and demos:
|
||||
<ul>
|
||||
<li><a href="https://github.com/impress/impress.js/tree/master/examples">examples/</a> in this repository</li>
|
||||
<li><a href="https://github.com/impress/impress.js/wiki/Examples-and-demos">on the impress.js wiki</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Check out <a href="https://github.com/impress/impressionist">Impressionist</a>: a 3D GUI to create impress.js presentations</li>
|
||||
</ul>
|
||||
|
||||
<div class="notes">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- This last, empty "slide" is set to be very large using the data-scale attribute,
|
||||
so that it covers all the other slides you just saw.
|
||||
It's a common way of zooming out at the end, to show the whole presentation.
|
||||
In CSS, we set pointer-events:none to make this slide non-clickable.
|
||||
It makes a difference at least for SVG content, such as the mermaid diagram. -->
|
||||
<div id="overview" class="step" data-x="3000" data-y="1500" data-scale="10" style="pointer-events: none;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
Add navigation-ui controls: back, forward and a select list.
|
||||
Add a progress indicator bar (current step / all steps)
|
||||
Add the help popup plugin
|
||||
-->
|
||||
<div id="impress-toolbar"></div>
|
||||
|
||||
<div class="impress-progressbar"><div></div></div>
|
||||
<div class="impress-progress"></div>
|
||||
|
||||
<div id="impress-help"></div>
|
||||
|
||||
<!-- Extra modules
|
||||
Load highlight.js, mermaid.js, markdown.js and MathJax.js from extras.
|
||||
If you're curious about details, these are initialized in src/plugins/extras/extras.js -->
|
||||
<script type="text/javascript" src="../../extras/highlight/highlight.pack.js"></script>
|
||||
<script type="text/javascript" src="../../extras/mermaid/mermaid.min.js"></script>
|
||||
<script type="text/javascript" src="../../extras/markdown/markdown.js"></script>
|
||||
<script type="text/javascript" src="../../extras/mathjax/MathJax.js?config=TeX-AMS_CHTML"></script>
|
||||
<!--
|
||||
To make all described above really work, you need to include impress.js in the page.
|
||||
You also need to call a `impress().init()` function to initialize impress.js presentation.
|
||||
And you should do it in the end of your document.
|
||||
-->
|
||||
<script type="text/javascript" src="../../js/impress.js"></script>
|
||||
<script>impress().init();</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
256
examples/cube/css/cube.css
Normal file
@@ -0,0 +1,256 @@
|
||||
@import url(fonts.css);
|
||||
|
||||
|
||||
|
||||
/* Fallback message */
|
||||
|
||||
.fallback-message {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.3;
|
||||
|
||||
width: 780px;
|
||||
padding: 10px 10px 0;
|
||||
margin: 20px auto;
|
||||
|
||||
border: 1px solid #E4C652;
|
||||
border-radius: 10px;
|
||||
background: #EEDC94;
|
||||
}
|
||||
|
||||
.fallback-message p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.impress-supported .fallback-message {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* Body & steps */
|
||||
body {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
min-height: 740px;
|
||||
|
||||
background: #00000f;
|
||||
color: rgb(102, 102, 102);
|
||||
}
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
width: 700px;
|
||||
height: 700px;
|
||||
padding: 40px 60px;
|
||||
margin: 20px auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
line-height: 1.5;
|
||||
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
|
||||
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .1);
|
||||
font-family: 'Open Sans', Arial, sans-serif;
|
||||
font-size: 30px;
|
||||
letter-spacing: -1px;
|
||||
|
||||
}
|
||||
|
||||
#overview {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
/*
|
||||
Make inactive steps a little bit transparent.
|
||||
*/
|
||||
.impress-enabled .step {
|
||||
margin: 0;
|
||||
opacity: 0.7;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
.impress-enabled .step.active { opacity: 1 }
|
||||
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.7em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
/* Highlight.js used for coloring pre > code blocks. */
|
||||
pre > code {
|
||||
font-size: 14px;
|
||||
text-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Inline code, no Highlight.js */
|
||||
code {
|
||||
font-family: "Cutive mono","Courier New", monospace;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
padding: 0 0.1em;
|
||||
background: rgba(200,200,200,0.2);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.9);
|
||||
border-radius: 0.2em;
|
||||
border-bottom: 1px solid rgba(100,100,100,0.2);
|
||||
border-left: 1px solid rgba(100,100,100,0.2);
|
||||
|
||||
transition: 0.5s;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
background: rgba(200,200,200,1);
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
em {
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strong {
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
q {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strike {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
This version of impress.js supports plugins, and in particular, a UI toolbar
|
||||
plugin that allows easy navigation between steps and autoplay.
|
||||
*/
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
z-index: 10;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*
|
||||
With help from the mouse-timeout plugin, we can hide the toolbar and
|
||||
have it show only when you move/click/touch the mouse.
|
||||
*/
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
In fact, we can hide the mouse cursor itself too, when mouse isn't used.
|
||||
*/
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Progress bar */
|
||||
.impress-progressbar {
|
||||
position: absolute;
|
||||
right: 118px;
|
||||
bottom: 1px;
|
||||
left: 118px;
|
||||
border-radius: 7px;
|
||||
border: 2px solid rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
.impress-progressbar DIV {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
border-radius: 5px;
|
||||
background: rgba(75, 75, 75, 0.4);
|
||||
transition: width 1s linear;
|
||||
}
|
||||
.impress-progress {
|
||||
position: absolute;
|
||||
left: 59px;
|
||||
bottom: 1px;
|
||||
text-align: left;
|
||||
font-size: 10pt;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Help popup plugin */
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
/*
|
||||
And as the last thing there is a workaround for quite strange bug.
|
||||
It happens a lot in Chrome. I don't remember if I've seen it in Firefox.
|
||||
|
||||
Sometimes the element positioned in 3D (especially when it's moved back
|
||||
along Z axis) is not clickable, because it falls 'behind' the <body>
|
||||
element.
|
||||
|
||||
To prevent this, I decided to make <body> non clickable by setting
|
||||
pointer-events property to `none` value.
|
||||
Value if this property is inherited, so to make everything else clickable
|
||||
I bring it back on the #impress element.
|
||||
|
||||
If you want to know more about `pointer-events` here are some docs:
|
||||
https://developer.mozilla.org/en/CSS/pointer-events
|
||||
|
||||
There is one very important thing to notice about this workaround - it makes
|
||||
everything 'unclickable' except what's in #impress element.
|
||||
|
||||
So use it wisely ... or don't use at all.
|
||||
*/
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
497
examples/cube/css/fonts.css
Normal file
@@ -0,0 +1,497 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQSYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQY4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBkbcKLIaa1LC45dFaAfauRA.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBmo_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBr6up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBiYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBo4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxmgpAmOCqD37_tyH_8Ri5MM.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxsPNMTLbnS9uQzHQlYieHUU.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxgyhumQnPMBCoGYhRaNxyyY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhUVAXEdVvYDDqrz3aeR0Yc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxlf4y_3s5bcYyyLIFUSWYUU.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxnywqdtBbUHn3VPgzuFrCy8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxl2umOyRU7PgRiv8DXcgJjk.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/JX7MlXqjSJNjQvI4heMMGvY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/vtwNVMP8y9C17vLvIBNZI_Y6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/9kaD4V2pNPMMeUVBHayd7vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/ATKpv8nLYAKUYexo8iqqrg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/kTYfCWJhlldPf5LnG4ZnHCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/g46X4VH_KHOWAAa-HpnGPiEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/hpORcvLZtemlH8gI-1S-7iEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/0XxGQsSc1g4rdRdjJKZrNPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/GpWpM_6S4VQLPNAQ3iWvVRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/7dSh6BcuqDLzS2qAASIeuhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/DVKQJxMmC9WF_oplMzlQqRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/PIPMHY90P7jtyjpXuZ2cLFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/5hX15RUpPERmeybVlLQEWBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/fU0HAfLiPHGlZhZpY6M7dBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/CPRt--GVMETgA6YEaoGitxTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/I-OtoJZa3TeyH6D9oli3ifesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpCYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpI4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/O_WhD9hODL16N4KLHLX7xSEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/3Nwg9VzlwLXPq3fNKwVRMCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/b31S45a_TNgaBApZhTgE6CEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9ede9INZm0R8ZMJUtfOsxrw.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9bpHcMS0zZe4mIYvDKG2oeM.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9RHJTnCUrjaAm2S9z52xC3Y.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9YWiMMZ7xLd792ULpGE4W_Y.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
|
||||
60
examples/cube/index.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Cube | Explore impress.js in 3D | by Henrik Ingo @henrikingo</title>
|
||||
<meta name="description" content="Explore impress.js in 3D" />
|
||||
<meta name="author" content="Henrik Ingo" />
|
||||
<link href="css/cube.css" rel="stylesheet" />
|
||||
</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" data-transition-duration="2000">
|
||||
|
||||
<div class="step" data-x="0" data-y="0" data-z="350"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft o" data-goto-next-list="step-4 step-3 step-2 step-5 overview">
|
||||
<p>Slide one</p>
|
||||
</div>
|
||||
|
||||
<div class="step" data-x="350" data-y="0" data-z="0" data-rotate-y="90"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft o" data-goto-next-list="step-4 step-3 step-6 step-1 overview">
|
||||
<p>Slide two</p>
|
||||
</div>
|
||||
|
||||
<div class="step" data-x="0" data-y="350" data-z="0" data-rotate-x="-90" data-rotate-z="90"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft o" data-goto-next-list="step-2 step-5 step-6 step-1 overview">
|
||||
<p>Slide three</p>
|
||||
</div>
|
||||
|
||||
<div class="step" data-x="0" data-y="-350" data-z="0" data-rotate-x="90" data-rotate-z="-90"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft o" data-goto-next-list="step-5 step-2 step-6 step-1 overview">
|
||||
<p>Slide four</p>
|
||||
</div>
|
||||
|
||||
<div class="step" data-x="-350" data-y="0" data-z="0" data-rotate-y="-90" data-rotate-z="-180"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft o" data-goto-next-list="step-3 step-4 step-6 step-1 overview">
|
||||
<p>Slide five</p>
|
||||
</div>
|
||||
|
||||
<div class="step" data-x="0" data-y="0" data-z="-350" data-rotate-y="-180" data-rotate-z="-180"
|
||||
data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft o" data-goto-next-list="step-3 step-4 step-2 step-5 overview">
|
||||
<p>Slide six</p>
|
||||
</div>
|
||||
|
||||
<div id="overview" class="step" data-x="700" data-y="-100" data-z="1000" data-scale="1" style="pointer-events: none;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="impress-toolbar"></div>
|
||||
<div id="impress-help"></div>
|
||||
|
||||
<script type="text/javascript" src="../../js/impress.js"></script>
|
||||
<script>impress().init();</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
14
examples/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example presentations</title>
|
||||
</head>
|
||||
<body><h1>Example presentations</h1>
|
||||
<ul><br />
|
||||
<li><a href="2D-navigation/">2D-navigation</a></li>
|
||||
<li><a href="3D-rotations/">3D-rotations</a></li>
|
||||
<li><a href="classic-slides/">classic-slides</a></li>
|
||||
<li><a href="cube/">cube</a></li>
|
||||
<li><a href="markdown/">markdown</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
47
examples/markdown/css/devopsy.css
Normal file
@@ -0,0 +1,47 @@
|
||||
/***** Menu where this style is selected *****/
|
||||
.devopsy .css-menu-devopsy {
|
||||
border: solid 1px #aaaaaa;
|
||||
}
|
||||
|
||||
|
||||
/***** Presentation *****/
|
||||
|
||||
body.devopsy {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.devopsy .step {
|
||||
color: #ffff00;
|
||||
}
|
||||
|
||||
/***** Styles *****/
|
||||
.devopsy h1,
|
||||
.devopsy h2,
|
||||
.devopsy h3 {
|
||||
color: #ff6600;
|
||||
}
|
||||
|
||||
.devopsy a {
|
||||
color: #00ffff;
|
||||
}
|
||||
|
||||
.devopsy blockquote {
|
||||
text-shadow: 3px 3px 3px rgba(255, 100, 0, .7);
|
||||
}
|
||||
|
||||
.devopsy em {
|
||||
text-shadow: 3px 3px 3px rgba(255, 100, 0, .7);
|
||||
}
|
||||
|
||||
.devopsy strong {
|
||||
text-shadow: 3px 3px 3px rgba(255, 100, 0, .7);
|
||||
}
|
||||
|
||||
.devopsy q {
|
||||
text-shadow: 3px 3px 3px rgba(255, 100, 0, .7);
|
||||
}
|
||||
|
||||
.devopsy strike {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
41
examples/markdown/css/effects.css
Normal file
@@ -0,0 +1,41 @@
|
||||
/***** Menu where this style is selected *****/
|
||||
.effects .css-menu-effects {
|
||||
border: solid 1px #aaaaaa;
|
||||
}
|
||||
|
||||
/***** Presentation *****/
|
||||
|
||||
body.effects {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
min-height: 740px;
|
||||
|
||||
background: #dde5dd;
|
||||
}
|
||||
|
||||
.effects .step {
|
||||
}
|
||||
|
||||
|
||||
/* Color effect. */
|
||||
.effects .past > *,
|
||||
.effects .future > * {
|
||||
color: inherit;
|
||||
transition: 3s;
|
||||
}
|
||||
.effects .present > * {
|
||||
color: rgb(200, 102, 102);
|
||||
transition: 3s;
|
||||
}
|
||||
|
||||
/* Fly right */
|
||||
|
||||
.effects .past h1,
|
||||
.effects .future h1 {
|
||||
transform: scale(3);
|
||||
transition: 1s;
|
||||
}
|
||||
.effects .present h1 {
|
||||
transform: scale(1);
|
||||
transition: 1s;
|
||||
}
|
||||
|
||||
497
examples/markdown/css/fonts.css
Normal file
@@ -0,0 +1,497 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQSYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cutive Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Cutive Mono'), local('CutiveMono-Regular'), url(http://fonts.gstatic.com/s/cutivemono/v4/N5odNRruTwjvCM8y77PhQY4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBjUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBkbcKLIaa1LC45dFaAfauRA.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBmo_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBr6up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBiYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v13/xjAJXh38I15wypJXxuGMBo4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxmgpAmOCqD37_tyH_8Ri5MM.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxsPNMTLbnS9uQzHQlYieHUU.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxgyhumQnPMBCoGYhRaNxyyY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxhUVAXEdVvYDDqrz3aeR0Yc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxlf4y_3s5bcYyyLIFUSWYUU.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxnywqdtBbUHn3VPgzuFrCy8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxl2umOyRU7PgRiv8DXcgJjk.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/JX7MlXqjSJNjQvI4heMMGvY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/vtwNVMP8y9C17vLvIBNZI_Y6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/9kaD4V2pNPMMeUVBHayd7vY6323mHUZFJMgTvxaG2iE.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans'), local('PTSans-Regular'), url(http://fonts.gstatic.com/s/ptsans/v8/ATKpv8nLYAKUYexo8iqqrg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/kTYfCWJhlldPf5LnG4ZnHCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/g46X4VH_KHOWAAa-HpnGPiEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/hpORcvLZtemlH8gI-1S-7iEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold'), local('PTSans-Bold'), url(http://fonts.gstatic.com/s/ptsans/v8/0XxGQsSc1g4rdRdjJKZrNPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/GpWpM_6S4VQLPNAQ3iWvVRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/7dSh6BcuqDLzS2qAASIeuhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/DVKQJxMmC9WF_oplMzlQqRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Sans Italic'), local('PTSans-Italic'), url(http://fonts.gstatic.com/s/ptsans/v8/PIPMHY90P7jtyjpXuZ2cLFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Sans';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url(http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/5hX15RUpPERmeybVlLQEWBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/fU0HAfLiPHGlZhZpY6M7dBTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/CPRt--GVMETgA6YEaoGitxTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(http://fonts.gstatic.com/s/ptserif/v8/I-OtoJZa3TeyH6D9oli3ifesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpDUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpCYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold'), local('PTSerif-Bold'), url(http://fonts.gstatic.com/s/ptserif/v8/QABk9IxT-LFTJ_dQzv7xpI4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/O_WhD9hODL16N4KLHLX7xSEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/3Nwg9VzlwLXPq3fNKwVRMCEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/b31S45a_TNgaBApZhTgE6CEAvth_LlrfE80CYdSH47w.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('PT Serif Italic'), local('PTSerif-Italic'), url(http://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9ede9INZm0R8ZMJUtfOsxrw.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9bpHcMS0zZe4mIYvDKG2oeM.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9RHJTnCUrjaAm2S9z52xC3Y.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('PT Serif Bold Italic'), local('PTSerif-BoldItalic'), url(http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9YWiMMZ7xLd792ULpGE4W_Y.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
|
||||
233
examples/markdown/css/markdown-slides.css
Normal file
@@ -0,0 +1,233 @@
|
||||
/***** Fonts *****/
|
||||
|
||||
/* @import url(http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic|Cutive+Mono); */
|
||||
@import url(fonts.css);
|
||||
|
||||
|
||||
/***** Fallback message *****/
|
||||
|
||||
.fallback-message {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.3;
|
||||
|
||||
width: 780px;
|
||||
padding: 10px 10px 0;
|
||||
margin: 20px auto;
|
||||
|
||||
border: 1px solid #E4C652;
|
||||
border-radius: 10px;
|
||||
background: #EEDC94;
|
||||
}
|
||||
|
||||
.fallback-message p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.impress-supported .fallback-message {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/***** Per slide hacks *****/
|
||||
|
||||
div#step-4 > p:last-child {
|
||||
margin-top: 150px;
|
||||
font-size: 0.5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div#tilted-slide {
|
||||
text-shadow: 20px 20px 10px rgba(0, 0, 0, .4);
|
||||
}
|
||||
div#tilted-slide h1 {
|
||||
margin-top: 200px;
|
||||
}
|
||||
|
||||
/***** Menu where this style is selected *****/
|
||||
.css-menu-bw {
|
||||
border: solid 1px rgb(102, 102, 102);
|
||||
}
|
||||
|
||||
.effects .css-menu-bw,
|
||||
.devopsy .css-menu-bw {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/***** Presentation *****/
|
||||
|
||||
body {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
min-height: 740px;
|
||||
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
width: 900px;
|
||||
height: 700px;
|
||||
padding: 40px 60px;
|
||||
margin: 20px auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
color: rgb(102, 102, 102);
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .1);
|
||||
font-family: 'Open Sans', Arial, sans-serif;
|
||||
font-size: 30px;
|
||||
letter-spacing: -1px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/*
|
||||
Make inactive steps a little bit transparent.
|
||||
*/
|
||||
.impress-enabled .step {
|
||||
margin: 0;
|
||||
opacity: 0.3;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
.impress-enabled .step.active { opacity: 1 }
|
||||
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.7em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
/* Highlight.js used for coloring pre > code blocks. */
|
||||
pre > code {
|
||||
font-size: 14px;
|
||||
text-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Inline code, no Highlight.js */
|
||||
code {
|
||||
font-family: "Cutive mono","Courier New", monospace;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
padding: 0 0.1em;
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.9);
|
||||
border-radius: 0.2em;
|
||||
|
||||
transition: 0.5s;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
em {
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strong {
|
||||
text-shadow: -1px 1px 2px rgba(100,100,100,0.5);
|
||||
}
|
||||
|
||||
q {
|
||||
font-family: 'PT Serif';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 2px 2px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
strike {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 300px;
|
||||
float: right;
|
||||
margin-left: 40px;
|
||||
margin-right: 0px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Specific styles for: .title steps
|
||||
*/
|
||||
|
||||
.title h1,
|
||||
.title h2,
|
||||
.title h3 {
|
||||
position: absolute;
|
||||
left: 45px; /* slide width is 900px, so this is like a 5% margin on both sides */
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
}
|
||||
.title h1 { top: 50px; }
|
||||
.title h2 { top: 400px; }
|
||||
.title h3 { top: 500px; }
|
||||
|
||||
|
||||
|
||||
/***** Plugins ******/
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
/* Help popup plugin */
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Disable mouse clicks / focus for body
|
||||
*/
|
||||
.impress-enabled { pointer-events: none }
|
||||
.impress-enabled #impress { pointer-events: auto }
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
BIN
examples/markdown/images/3476636111_c551295ca4_b.jpg
Normal file
|
After Width: | Height: | Size: 73 KiB |
188
examples/markdown/index.html
Normal file
@@ -0,0 +1,188 @@
|
||||
<!doctype html>
|
||||
|
||||
<!--
|
||||
A presentation done entirely in Markdown, as found in extras/markdown/.
|
||||
|
||||
By: @henrikingo
|
||||
-->
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Markdown in impress.js | by Henrik Ingo @henrikingo</title>
|
||||
|
||||
<meta name="description" content="Authoring impress.js presentations in Markdown" />
|
||||
<meta name="author" content="Henrik Ingo" />
|
||||
<link rel="stylesheet" href="../../extras/highlight/styles/github.css">
|
||||
|
||||
|
||||
<!--
|
||||
Styles specific for this example presentation.
|
||||
-->
|
||||
<link href="css/markdown-slides.css" rel="stylesheet" />
|
||||
<link href="css/devopsy.css" rel="stylesheet" />
|
||||
<link href="css/effects.css" rel="stylesheet" />
|
||||
|
||||
</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" data-transition-duration="1000">
|
||||
|
||||
<div id="markdown" class="step slide markdown" data-rel-x="0" data-rel-y="900">
|
||||
# Markdown
|
||||
## to author Impress.js presentations
|
||||
|
||||
* This presentation was written entirely in Markdown
|
||||
* Added by popular request
|
||||
* Easy way to make quick, simple yet aesthetic, presentations
|
||||
* Authoring without all the clutter of HTML
|
||||
|
||||
-----
|
||||
# Markdown.js
|
||||
|
||||
* Provided by [Markdown.js](https://github.com/evilstreak/markdown-js) in [extras/](https://github.com/impress/impress.js/tree/master/extras)
|
||||
* Jot down your bullet points in *Markdown* & have it automatically converted to HTML
|
||||
* Note: The Markdown is converted into a presentation client side, in the browser. This is unlike
|
||||
existing tools like [Hovercraft](https://github.com/regebro/hovercraft) and
|
||||
[markdown-impress](http://binbinliao.com/markdown-impress/) where you generate a new
|
||||
html file on the command line.
|
||||
* This combines the ease of typing Markdown with the full power of impress.js HTML5+CSS3+JavaScript!
|
||||
|
||||
-----
|
||||
# Styles
|
||||
|
||||
* You can use *italics* & **bold**
|
||||
* ...and `code`
|
||||
|
||||
|
||||
-----
|
||||
# A blockquote & image
|
||||
|
||||

|
||||
|
||||
> Spread love everywhere you go.
|
||||
> Let no one ever come to you without leaving happier.
|
||||
|
||||
*-- Mother Teresa*
|
||||
|
||||
Image credit: [Peta de Aztlan](https://www.flickr.com/photos/peta-de-aztlan/3476636111/)@Flickr. CC-BY 2.0
|
||||
|
||||
-----
|
||||
# Code
|
||||
|
||||
When also using [Highlight.js](https://highlightjs.org/) integration, code blocks in Markdown
|
||||
are converted to HTML first, then colored by Highlight.js:
|
||||
|
||||
// `init` API function that initializes (and runs) the presentation.
|
||||
var init = function () {
|
||||
if (initialized) { return; }
|
||||
execPreInitPlugins();
|
||||
|
||||
// First we set up the viewport for mobile devices.
|
||||
// For some reason iPad goes nuts when it is not done properly.
|
||||
var meta = $("meta[name='viewport']") || document.createElement("meta");
|
||||
meta.content = "width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no";
|
||||
if (meta.parentNode !== document.head) {
|
||||
meta.name = 'viewport';
|
||||
document.head.appendChild(meta);
|
||||
}
|
||||
|
||||
-----
|
||||
|
||||
# Slide separator
|
||||
|
||||
* 5 dashes are used to separate slides:
|
||||
|
||||
`-----`
|
||||
|
||||
* Attributes from `div.step` element are simply repeated.
|
||||
* Better use relative positioning, lest your slides will all be on top of each other.
|
||||
* If you need to set some attributes, just use HTML and create a div element, then write
|
||||
Markdown inside each div.
|
||||
</div>
|
||||
|
||||
<div id="title-slide" class="step slide title markdown" data-x="2000" data-y="5000">
|
||||
# Title slide
|
||||
## This slide has different CSS class than the previous ones
|
||||
</div>
|
||||
|
||||
|
||||
<div id="tilted-slide" class="step slide markdown" data-rotate="-85" data-x="2000" data-y="2000" data-z="1000" data-scale="4">
|
||||
# Simplicity of Markdown & Full power of Impress.js
|
||||
|
||||
* This slide sets its own `rotate`, `x`, `y`, and even `z` coordinates
|
||||
* Note that the Mother Teresa slide earlier was pimped with some custom CSS, all the while
|
||||
the content was written in simple Markdown.
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var enableBwCss = function(){
|
||||
disableDevopsCss();
|
||||
disableEffectsCss();
|
||||
};
|
||||
|
||||
var enableDevopsCss = function(){
|
||||
document.body.classList.add("devopsy");
|
||||
disableEffectsCss();
|
||||
};
|
||||
|
||||
var disableDevopsCss = function(){
|
||||
document.body.classList.remove("devopsy");
|
||||
};
|
||||
|
||||
var enableEffectsCss = function(){
|
||||
document.body.classList.add("effects");
|
||||
disableDevopsCss();
|
||||
};
|
||||
|
||||
var disableEffectsCss = function(){
|
||||
document.body.classList.remove("effects");
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<div id="js-slide" class="step slide" data-rotate="0" data-x="4000" data-y="5000">
|
||||
<h1>CSS & JavaScript magic</h1>
|
||||
|
||||
<p>Just to emphasize my point, this last slide allows you to use a JavaScript powered menu to
|
||||
toggle the CSS style:</p>
|
||||
|
||||
<p><a href="#" onclick="enableBwCss();" class="css-menu-bw">Black & white</a>,
|
||||
<a href="#" onclick="enableDevopsCss();" class="css-menu-devopsy">Devopsy</a>,
|
||||
<a href="#" onclick="enableEffectsCss();" class="css-menu-effects">Effects overload</a></p>
|
||||
|
||||
<p>Simplicity of Markdown married with full power of Impress.js!</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="overview" class="step" data-x="5000" data-y="4000" data-scale="10" style="pointer-events: none;" data-rotate="5">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="impress-toolbar"></div>
|
||||
<div id="impress-help"></div>
|
||||
|
||||
|
||||
<!-- Extra modules
|
||||
Load highlight.js, mermaid.js and markdown.js from extras.
|
||||
See also src/plugins/extras/extras.js -->
|
||||
<script type="text/javascript" src="../../extras/highlight/highlight.pack.js"></script>
|
||||
<script type="text/javascript" src="../../extras/mermaid/mermaid.min.js"></script>
|
||||
<script type="text/javascript" src="../../extras/markdown/markdown.js"></script>
|
||||
|
||||
<!--
|
||||
To make all described above really work, you need to include impress.js in the page.
|
||||
You also need to call a `impress().init()` function to initialize impress.js presentation.
|
||||
And you should do it in the end of your document.
|
||||
-->
|
||||
<script type="text/javascript" src="../../js/impress.js"></script>
|
||||
<script>impress().init();</script>
|
||||
</body>
|
||||
</html>
|
||||
1
extras
Submodule
33
index.html
@@ -143,8 +143,12 @@
|
||||
But as I said, you won't need it for now, so don't worry - there are some simple but interesting things
|
||||
right around the corner of this tag ;)
|
||||
|
||||
----------
|
||||
Plugins: We set the default time for autoplay plugin to 6 seconds. Autoplay will automatically advance
|
||||
to next slide after a timeout expires.
|
||||
|
||||
-->
|
||||
<div id="impress">
|
||||
<div id="impress" data-autoplay="7">
|
||||
|
||||
<!--
|
||||
|
||||
@@ -162,8 +166,11 @@
|
||||
|
||||
It will not be rotated or scaled.
|
||||
|
||||
--------
|
||||
Plugins: For first slide, set the autoplay time to a custom 10 seconds.
|
||||
|
||||
-->
|
||||
<div id="bored" class="step slide" data-x="-1000" data-y="-1500">
|
||||
<div id="bored" class="step slide" data-x="-1000" data-y="-1500" data-autoplay="10">
|
||||
<q>Aren’t you just <b>bored</b> with all those slides-based presentations?</q>
|
||||
</div>
|
||||
|
||||
@@ -256,8 +263,12 @@
|
||||
So basically every step element has one of three classes: `future`, `present` and `past`.
|
||||
Only one current step has the `present` class.
|
||||
|
||||
Note: data-x/y/z attributes, if not defined, by default will inherit the value of the
|
||||
previous step. So to get back to 0 on the z-axis, we must set it to 0.
|
||||
See src/plugins/rel/README.md for more information.
|
||||
|
||||
-->
|
||||
<div id="ing" class="step" data-x="3500" data-y="-850" data-rotate="270" data-scale="6">
|
||||
<div id="ing" class="step" data-x="3500" data-y="-850" data-z="0" data-rotate="270" data-scale="6">
|
||||
<p>by <b class="positioning">positioning</b>, <b class="rotating">rotating</b> and <b class="scaling">scaling</b> them on an infinite canvas</p>
|
||||
</div>
|
||||
|
||||
@@ -267,7 +278,7 @@
|
||||
|
||||
<div id="source" class="step" data-x="6300" data-y="2000" data-rotate="20" data-scale="4">
|
||||
<p>want to know more?</p>
|
||||
<q><a href="http://github.com/bartaz/impress.js">use the source</a>, Luke!</q>
|
||||
<q><a href="http://github.com/impress/impress.js">use the source</a>, Luke!</q>
|
||||
</div>
|
||||
|
||||
<div id="one-more-thing" class="step" data-x="6000" data-y="4000" data-scale="2">
|
||||
@@ -306,11 +317,18 @@
|
||||
CSS transfrom docs: https://developer.mozilla.org/en/CSS/transform
|
||||
|
||||
-->
|
||||
<div id="overview" class="step" data-x="3000" data-y="1500" data-scale="10">
|
||||
<div id="overview" class="step" data-x="3000" data-y="1500" data-z="0" data-scale="10">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
This is a UI plugin. You can read more about plugins in src/plugins/README.md.
|
||||
For now, I'll just tell you that this adds some graphical controls to navigate the
|
||||
presentation. In the CSS file you can style them as you want. We've put them bottom right.
|
||||
-->
|
||||
<div id="impress-toolbar"></div>
|
||||
|
||||
<!--
|
||||
|
||||
Hint is not related to impress.js in any way.
|
||||
@@ -336,11 +354,12 @@
|
||||
|
||||
-->
|
||||
<div class="hint">
|
||||
<p>Use a spacebar or arrow keys to navigate</p>
|
||||
<p>Use a spacebar or arrow keys to navigate. <br/>
|
||||
Press 'P' to launch speaker console.</p>
|
||||
</div>
|
||||
<script>
|
||||
if ("ontouchstart" in document.documentElement) {
|
||||
document.querySelector(".hint").innerHTML = "<p>Tap on the left or right to navigate</p>";
|
||||
document.querySelector(".hint").innerHTML = "<p>Swipe left or right to navigate</p>";
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
3444
js/impress.js
@@ -8,10 +8,13 @@ var sauceBrowsers = [
|
||||
[ "chrome", "52", "Windows 10" ],
|
||||
[ "firefox", "48", "Windows 10" ],
|
||||
[ "firefox", "47", "Windows 10" ],
|
||||
[ "microsoftedge", "13", "Windows 10" ],
|
||||
[ "internet explorer", "11", "Windows 10" ],
|
||||
[ "safari", "9", "OS X 10.11" ],
|
||||
[ "safari", "8", "OS X 10.10" ]
|
||||
[ "microsoftedge", "13", "Windows 10" ]
|
||||
// These browsers have issues with the iframe based test approach. impress.js itself should work
|
||||
// fine, it's just that the tests don't. We can figure out later whether there's some option that
|
||||
// allows to access the DOM inside the iframe with javascript.
|
||||
// [ "internet explorer", "11", "Windows 10" ],
|
||||
// [ "safari", "9", "OS X 10.11" ],
|
||||
// [ "safari", "8", "OS X 10.10" ]
|
||||
].reduce( function( object, platform ) {
|
||||
|
||||
// Convert "internet explorer" -> "ie".
|
||||
@@ -41,13 +44,27 @@ module.exports = function( config ) {
|
||||
frameworks: [ "qunit" ],
|
||||
singleRun: true,
|
||||
|
||||
// The list of files / patterns to load in the browser.
|
||||
proxies : {
|
||||
'/test/' : '/base/test/',
|
||||
'/js/' : '/base/js/',
|
||||
'/node_modules/syn/dist/' : '/base/node_modules/syn/dist/'
|
||||
},
|
||||
|
||||
// List of files / patterns to load in the browser
|
||||
files: [
|
||||
"test/bootstrap.js",
|
||||
"js/impress.js",
|
||||
"test/core_tests.js"
|
||||
// The QUnit tests
|
||||
"test/helpers.js",
|
||||
"test/core_tests.js",
|
||||
"src/plugins/navigation/navigation_tests.js",
|
||||
// Presentation files, for the iframe
|
||||
{pattern: "test/*.html", watched: true, served: true, included: false},
|
||||
{pattern: "test/plugins/*/*.html", watched: true, served: true, included: false},
|
||||
// JS files for iframe
|
||||
{pattern: "js/impress.js", watched: true, served: true, included: false},
|
||||
{pattern: "node_modules/syn/dist/global/syn.js", watched: false, served: true, included: false}
|
||||
],
|
||||
|
||||
|
||||
// The number of sauce tests to start in parallel.
|
||||
concurrency: 1,
|
||||
|
||||
@@ -61,7 +78,18 @@ module.exports = function( config ) {
|
||||
startConnect: true,
|
||||
tunnelIdentifier: process.env.CIRCLE_BUILD_NUM
|
||||
},
|
||||
captureTimeout: 120000,
|
||||
|
||||
client: {
|
||||
clearContext: false,
|
||||
qunit: {
|
||||
showUI: true,
|
||||
testTimeout: 120*1000
|
||||
}
|
||||
},
|
||||
|
||||
// If browser does not capture, or produce output, in given timeout [ms], kill it
|
||||
captureTimeout: 60*1000,
|
||||
browserNoActivityTimeout: 60*1000,
|
||||
customLaunchers: sauceBrowsers,
|
||||
|
||||
// Browsers to launch.
|
||||
|
||||
@@ -7,11 +7,24 @@ module.exports = function( config ) {
|
||||
// Frameworks to use
|
||||
frameworks: [ "qunit" ],
|
||||
|
||||
proxies : {
|
||||
'/test/' : '/base/test/',
|
||||
'/js/' : '/base/js/',
|
||||
'/node_modules/syn/dist/' : '/base/node_modules/syn/dist/'
|
||||
},
|
||||
|
||||
// List of files / patterns to load in the browser
|
||||
files: [
|
||||
"test/bootstrap.js",
|
||||
"js/impress.js",
|
||||
"test/core_tests.js"
|
||||
// The QUnit tests
|
||||
"test/helpers.js",
|
||||
"test/core_tests.js",
|
||||
"src/plugins/navigation/navigation_tests.js",
|
||||
// Presentation files, for the iframe
|
||||
{pattern: "test/*.html", watched: true, served: true, included: false},
|
||||
{pattern: "test/plugins/*/*.html", watched: true, served: true, included: false},
|
||||
// JS files for iframe
|
||||
{pattern: "js/impress.js", watched: true, served: true, included: false},
|
||||
{pattern: "node_modules/syn/dist/global/syn.js", watched: false, served: true, included: false}
|
||||
],
|
||||
|
||||
// List of files to exclude
|
||||
@@ -43,10 +56,21 @@ module.exports = function( config ) {
|
||||
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
|
||||
browsers: [ "Chrome" ],
|
||||
//browsers: [ "Chrome" ],
|
||||
//browsers: [ "Firefox" ],
|
||||
browsers: [ "Chrome", "Firefox" ],
|
||||
|
||||
// If browser does not capture in given timeout [ms], kill it
|
||||
captureTimeout: 60000,
|
||||
client: {
|
||||
clearContext: false,
|
||||
qunit: {
|
||||
showUI: true,
|
||||
testTimeout: 120*1000
|
||||
}
|
||||
},
|
||||
|
||||
// If browser does not capture, or produce output, in given timeout [ms], kill it
|
||||
captureTimeout: 60*1000,
|
||||
browserNoActivityTimeout: 60*1000,
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, it capture browsers, run tests and exit
|
||||
|
||||
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "impress.js",
|
||||
"version": "0.6.0",
|
||||
"version": "1.0.0-beta1",
|
||||
"description": "It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.",
|
||||
"main": "js/impress.js",
|
||||
"repository": {
|
||||
@@ -19,23 +19,29 @@
|
||||
"author": "Bartek Szopka",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bartaz/impress.js/issues"
|
||||
"url": "https://github.com/impress/impress.js/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "jshint js/impress.js *.js test/bootstrap.js && jscs js/impress.js *.js test/bootstrap.js --preset=jquery",
|
||||
"build": "node build.js",
|
||||
"lint": "jshint src test/*.js && jscs src test/*.js",
|
||||
"test": "karma start --single-run",
|
||||
"test:dev": "karma start",
|
||||
"test:sauce": "karma start karma.conf-sauce.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"buildify": "*",
|
||||
"chrome": "0.1.0",
|
||||
"firefox": "0.0.1",
|
||||
"jscs": "2.11.0",
|
||||
"jshint": "2.9.1",
|
||||
"karma": "0.13.22",
|
||||
"karma-chrome-launcher": "1.0.1",
|
||||
"karma-cli": "1.0.0",
|
||||
"karma-firefox-launcher": "~0.1",
|
||||
"karma-qunit": "1.0.0",
|
||||
"karma-sauce-launcher": "1.0.0",
|
||||
"qunitjs": "2.0.0-rc1"
|
||||
"ls": "0.2.1",
|
||||
"qunitjs": "2.0.0-rc1",
|
||||
"syn": "0.10.0"
|
||||
}
|
||||
}
|
||||
|
||||
26
qunit_test_runner.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license. See LICENSE file.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>QUnit tests for impress.js</title>
|
||||
<link rel="stylesheet" href="node_modules/qunitjs/qunit/qunit.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<script src="node_modules/qunitjs/qunit/qunit.js"></script>
|
||||
<!-- The QUnit tests. -->
|
||||
<script src="test/helpers.js"></script>
|
||||
<!-- Core tests -->
|
||||
<script src="test/core_tests.js"></script>
|
||||
<!-- Plugins -->
|
||||
<script src="src/plugins/navigation/navigation_tests.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
915
src/impress.js
Normal file
@@ -0,0 +1,915 @@
|
||||
/**
|
||||
* impress.js
|
||||
*
|
||||
* impress.js is a presentation tool based on the power of CSS3 transforms and transitions
|
||||
* in modern browsers and inspired by the idea behind prezi.com.
|
||||
*
|
||||
*
|
||||
* Copyright 2011-2012 Bartek Szopka (@bartaz)
|
||||
*
|
||||
* Released under the MIT and GPL Licenses.
|
||||
*
|
||||
* ------------------------------------------------
|
||||
* author: Bartek Szopka
|
||||
* version: 1.0.0-beta1
|
||||
* url: http://bartaz.github.com/impress.js/
|
||||
* source: http://github.com/bartaz/impress.js/
|
||||
*/
|
||||
|
||||
// You are one of those who like to know how things work inside?
|
||||
// Let me show you the cogs that make impress.js run...
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var lib;
|
||||
|
||||
// HELPER FUNCTIONS
|
||||
|
||||
// `pfx` is a function that takes a standard CSS property name as a parameter
|
||||
// and returns it's prefixed version valid for current browser it runs in.
|
||||
// The code is heavily inspired by Modernizr http://www.modernizr.com/
|
||||
var pfx = ( function() {
|
||||
|
||||
var style = document.createElement( "dummy" ).style,
|
||||
prefixes = "Webkit Moz O ms Khtml".split( " " ),
|
||||
memory = {};
|
||||
|
||||
return function( prop ) {
|
||||
if ( typeof memory[ prop ] === "undefined" ) {
|
||||
|
||||
var ucProp = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),
|
||||
props = ( prop + " " + prefixes.join( ucProp + " " ) + ucProp ).split( " " );
|
||||
|
||||
memory[ prop ] = null;
|
||||
for ( var i in props ) {
|
||||
if ( style[ props[ i ] ] !== undefined ) {
|
||||
memory[ prop ] = props[ i ];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return memory[ prop ];
|
||||
};
|
||||
|
||||
} )();
|
||||
|
||||
var validateOrder = function( order, fallback ) {
|
||||
var validChars = "xyz";
|
||||
var returnStr = "";
|
||||
if ( typeof order === "string" ) {
|
||||
for ( var i in order.split( "" ) ) {
|
||||
if ( validChars.indexOf( order[ i ] >= 0 ) ) {
|
||||
returnStr += order[ i ];
|
||||
|
||||
// Each of x,y,z can be used only once.
|
||||
validChars = validChars.split( order[ i ] ).join( "" );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( returnStr ) {
|
||||
return returnStr;
|
||||
} else if ( fallback !== undefined ) {
|
||||
return fallback;
|
||||
} else {
|
||||
return "xyz";
|
||||
}
|
||||
};
|
||||
|
||||
// `css` function applies the styles given in `props` object to the element
|
||||
// given as `el`. It runs all property names through `pfx` function to make
|
||||
// sure proper prefixed version of the property is used.
|
||||
var css = function( el, props ) {
|
||||
var key, pkey;
|
||||
for ( key in props ) {
|
||||
if ( props.hasOwnProperty( key ) ) {
|
||||
pkey = pfx( key );
|
||||
if ( pkey !== null ) {
|
||||
el.style[ pkey ] = props[ key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
return el;
|
||||
};
|
||||
|
||||
// `translate` builds a translate transform string for given data.
|
||||
var translate = function( t ) {
|
||||
return " translate3d(" + t.x + "px," + t.y + "px," + t.z + "px) ";
|
||||
};
|
||||
|
||||
// `rotate` builds a rotate transform string for given data.
|
||||
// By default the rotations are in X Y Z order that can be reverted by passing `true`
|
||||
// as second parameter.
|
||||
var rotate = function( r, revert ) {
|
||||
var order = r.order ? r.order : "xyz";
|
||||
var css = "";
|
||||
var axes = order.split( "" );
|
||||
if ( revert ) {
|
||||
axes = axes.reverse();
|
||||
}
|
||||
|
||||
for ( var i = 0; i < axes.length; i++ ) {
|
||||
css += " rotate" + axes[ i ].toUpperCase() + "(" + r[ axes[ i ] ] + "deg)";
|
||||
}
|
||||
return css;
|
||||
};
|
||||
|
||||
// `scale` builds a scale transform string for given data.
|
||||
var scale = function( s ) {
|
||||
return " scale(" + s + ") ";
|
||||
};
|
||||
|
||||
// `computeWindowScale` counts the scale factor between window size and size
|
||||
// defined for the presentation in the config.
|
||||
var computeWindowScale = function( config ) {
|
||||
var hScale = window.innerHeight / config.height,
|
||||
wScale = window.innerWidth / config.width,
|
||||
scale = hScale > wScale ? wScale : hScale;
|
||||
|
||||
if ( config.maxScale && scale > config.maxScale ) {
|
||||
scale = config.maxScale;
|
||||
}
|
||||
|
||||
if ( config.minScale && scale < config.minScale ) {
|
||||
scale = config.minScale;
|
||||
}
|
||||
|
||||
return scale;
|
||||
};
|
||||
|
||||
// CHECK SUPPORT
|
||||
var body = document.body;
|
||||
var impressSupported =
|
||||
|
||||
// Browser should support CSS 3D transtorms
|
||||
( pfx( "perspective" ) !== null ) &&
|
||||
|
||||
// And `classList` and `dataset` APIs
|
||||
( body.classList ) &&
|
||||
( body.dataset );
|
||||
|
||||
if ( !impressSupported ) {
|
||||
|
||||
// We can't be sure that `classList` is supported
|
||||
body.className += " impress-not-supported ";
|
||||
}
|
||||
|
||||
// GLOBALS AND DEFAULTS
|
||||
|
||||
// This is where the root elements of all impress.js instances will be kept.
|
||||
// Yes, this means you can have more than one instance on a page, but I'm not
|
||||
// sure if it makes any sense in practice ;)
|
||||
var roots = {};
|
||||
|
||||
var preInitPlugins = [];
|
||||
var preStepLeavePlugins = [];
|
||||
|
||||
// Some default config values.
|
||||
var defaults = {
|
||||
width: 1024,
|
||||
height: 768,
|
||||
maxScale: 1,
|
||||
minScale: 0,
|
||||
|
||||
perspective: 1000,
|
||||
|
||||
transitionDuration: 1000
|
||||
};
|
||||
|
||||
// It's just an empty function ... and a useless comment.
|
||||
var empty = function() { return false; };
|
||||
|
||||
// IMPRESS.JS API
|
||||
|
||||
// And that's where interesting things will start to happen.
|
||||
// It's the core `impress` function that returns the impress.js API
|
||||
// for a presentation based on the element with given id ("impress"
|
||||
// by default).
|
||||
var impress = window.impress = function( rootId ) {
|
||||
|
||||
// If impress.js is not supported by the browser return a dummy API
|
||||
// it may not be a perfect solution but we return early and avoid
|
||||
// running code that may use features not implemented in the browser.
|
||||
if ( !impressSupported ) {
|
||||
return {
|
||||
init: empty,
|
||||
goto: empty,
|
||||
prev: empty,
|
||||
next: empty,
|
||||
swipe: empty,
|
||||
tear: empty,
|
||||
lib: {}
|
||||
};
|
||||
}
|
||||
|
||||
rootId = rootId || "impress";
|
||||
|
||||
// If given root is already initialized just return the API
|
||||
if ( roots[ "impress-root-" + rootId ] ) {
|
||||
return roots[ "impress-root-" + rootId ];
|
||||
}
|
||||
|
||||
// The gc library depends on being initialized before we do any changes to DOM.
|
||||
lib = initLibraries( rootId );
|
||||
|
||||
body.classList.remove( "impress-not-supported" );
|
||||
body.classList.add( "impress-supported" );
|
||||
|
||||
// Data of all presentation steps
|
||||
var stepsData = {};
|
||||
|
||||
// Element of currently active step
|
||||
var activeStep = null;
|
||||
|
||||
// Current state (position, rotation and scale) of the presentation
|
||||
var currentState = null;
|
||||
|
||||
// Array of step elements
|
||||
var steps = null;
|
||||
|
||||
// Configuration options
|
||||
var config = null;
|
||||
|
||||
// Scale factor of the browser window
|
||||
var windowScale = null;
|
||||
|
||||
// Root presentation elements
|
||||
var root = lib.util.byId( rootId );
|
||||
var canvas = document.createElement( "div" );
|
||||
|
||||
var initialized = false;
|
||||
|
||||
// STEP EVENTS
|
||||
//
|
||||
// There are currently two step events triggered by impress.js
|
||||
// `impress:stepenter` is triggered when the step is shown on the
|
||||
// screen (the transition from the previous one is finished) and
|
||||
// `impress:stepleave` is triggered when the step is left (the
|
||||
// transition to next step just starts).
|
||||
|
||||
// Reference to last entered step
|
||||
var lastEntered = null;
|
||||
|
||||
// `onStepEnter` is called whenever the step element is entered
|
||||
// but the event is triggered only if the step is different than
|
||||
// last entered step.
|
||||
// We sometimes call `goto`, and therefore `onStepEnter`, just to redraw a step, such as
|
||||
// after screen resize. In this case - more precisely, in any case - we trigger a
|
||||
// `impress:steprefresh` event.
|
||||
var onStepEnter = function( step ) {
|
||||
if ( lastEntered !== step ) {
|
||||
lib.util.triggerEvent( step, "impress:stepenter" );
|
||||
lastEntered = step;
|
||||
}
|
||||
lib.util.triggerEvent( step, "impress:steprefresh" );
|
||||
};
|
||||
|
||||
// `onStepLeave` is called whenever the currentStep element is left
|
||||
// but the event is triggered only if the currentStep is the same as
|
||||
// lastEntered step.
|
||||
var onStepLeave = function( currentStep, nextStep ) {
|
||||
if ( lastEntered === currentStep ) {
|
||||
lib.util.triggerEvent( currentStep, "impress:stepleave", { next: nextStep } );
|
||||
lastEntered = null;
|
||||
}
|
||||
};
|
||||
|
||||
// `initStep` initializes given step element by reading data from its
|
||||
// data attributes and setting correct styles.
|
||||
var initStep = function( el, idx ) {
|
||||
var data = el.dataset,
|
||||
step = {
|
||||
translate: {
|
||||
x: lib.util.toNumber( data.x ),
|
||||
y: lib.util.toNumber( data.y ),
|
||||
z: lib.util.toNumber( data.z )
|
||||
},
|
||||
rotate: {
|
||||
x: lib.util.toNumber( data.rotateX ),
|
||||
y: lib.util.toNumber( data.rotateY ),
|
||||
z: lib.util.toNumber( data.rotateZ || data.rotate ),
|
||||
order: validateOrder( data.rotateOrder )
|
||||
},
|
||||
scale: lib.util.toNumber( data.scale, 1 ),
|
||||
transitionDuration: lib.util.toNumber(
|
||||
data.transitionDuration, config.transitionDuration
|
||||
),
|
||||
el: el
|
||||
};
|
||||
|
||||
if ( !el.id ) {
|
||||
el.id = "step-" + ( idx + 1 );
|
||||
}
|
||||
|
||||
stepsData[ "impress-" + el.id ] = step;
|
||||
|
||||
css( el, {
|
||||
position: "absolute",
|
||||
transform: "translate(-50%,-50%)" +
|
||||
translate( step.translate ) +
|
||||
rotate( step.rotate ) +
|
||||
scale( step.scale ),
|
||||
transformStyle: "preserve-3d"
|
||||
} );
|
||||
};
|
||||
|
||||
// Initialize all steps.
|
||||
// Read the data-* attributes, store in internal stepsData, and render with CSS.
|
||||
var initAllSteps = function() {
|
||||
steps = lib.util.$$( ".step", root );
|
||||
steps.forEach( initStep );
|
||||
};
|
||||
|
||||
// `init` API function that initializes (and runs) the presentation.
|
||||
var init = function() {
|
||||
if ( initialized ) { return; }
|
||||
execPreInitPlugins( root );
|
||||
|
||||
// First we set up the viewport for mobile devices.
|
||||
// For some reason iPad goes nuts when it is not done properly.
|
||||
var meta = lib.util.$( "meta[name='viewport']" ) || document.createElement( "meta" );
|
||||
meta.content = "width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no";
|
||||
if ( meta.parentNode !== document.head ) {
|
||||
meta.name = "viewport";
|
||||
document.head.appendChild( meta );
|
||||
}
|
||||
|
||||
// Initialize configuration object
|
||||
var rootData = root.dataset;
|
||||
config = {
|
||||
width: lib.util.toNumber( rootData.width, defaults.width ),
|
||||
height: lib.util.toNumber( rootData.height, defaults.height ),
|
||||
maxScale: lib.util.toNumber( rootData.maxScale, defaults.maxScale ),
|
||||
minScale: lib.util.toNumber( rootData.minScale, defaults.minScale ),
|
||||
perspective: lib.util.toNumber( rootData.perspective, defaults.perspective ),
|
||||
transitionDuration: lib.util.toNumber(
|
||||
rootData.transitionDuration, defaults.transitionDuration
|
||||
)
|
||||
};
|
||||
|
||||
windowScale = computeWindowScale( config );
|
||||
|
||||
// Wrap steps with "canvas" element
|
||||
lib.util.arrayify( root.childNodes ).forEach( function( el ) {
|
||||
canvas.appendChild( el );
|
||||
} );
|
||||
root.appendChild( canvas );
|
||||
|
||||
// Set initial styles
|
||||
document.documentElement.style.height = "100%";
|
||||
|
||||
css( body, {
|
||||
height: "100%",
|
||||
overflow: "hidden"
|
||||
} );
|
||||
|
||||
var rootStyles = {
|
||||
position: "absolute",
|
||||
transformOrigin: "top left",
|
||||
transition: "all 0s ease-in-out",
|
||||
transformStyle: "preserve-3d"
|
||||
};
|
||||
|
||||
css( root, rootStyles );
|
||||
css( root, {
|
||||
top: "50%",
|
||||
left: "50%",
|
||||
perspective: ( config.perspective / windowScale ) + "px",
|
||||
transform: scale( windowScale )
|
||||
} );
|
||||
css( canvas, rootStyles );
|
||||
|
||||
body.classList.remove( "impress-disabled" );
|
||||
body.classList.add( "impress-enabled" );
|
||||
|
||||
// Get and init steps
|
||||
initAllSteps();
|
||||
|
||||
// Set a default initial state of the canvas
|
||||
currentState = {
|
||||
translate: { x: 0, y: 0, z: 0 },
|
||||
rotate: { x: 0, y: 0, z: 0, order: "xyz" },
|
||||
scale: 1
|
||||
};
|
||||
|
||||
initialized = true;
|
||||
|
||||
lib.util.triggerEvent( root, "impress:init",
|
||||
{ api: roots[ "impress-root-" + rootId ] } );
|
||||
};
|
||||
|
||||
// `getStep` is a helper function that returns a step element defined by parameter.
|
||||
// If a number is given, step with index given by the number is returned, if a string
|
||||
// is given step element with such id is returned, if DOM element is given it is returned
|
||||
// if it is a correct step element.
|
||||
var getStep = function( step ) {
|
||||
if ( typeof step === "number" ) {
|
||||
step = step < 0 ? steps[ steps.length + step ] : steps[ step ];
|
||||
} else if ( typeof step === "string" ) {
|
||||
step = lib.util.byId( step );
|
||||
}
|
||||
return ( step && step.id && stepsData[ "impress-" + step.id ] ) ? step : null;
|
||||
};
|
||||
|
||||
// Used to reset timeout for `impress:stepenter` event
|
||||
var stepEnterTimeout = null;
|
||||
|
||||
// `goto` API function that moves to step given as `el` parameter (by index, id or element).
|
||||
// `duration` optionally given as second parameter, is the transition duration in css.
|
||||
// `reason` is the string "next", "prev" or "goto" (default) and will be made available to
|
||||
// preStepLeave plugins.
|
||||
// `origEvent` may contain event that caused the call to goto, such as a key press event
|
||||
var goto = function( el, duration, reason, origEvent ) {
|
||||
reason = reason || "goto";
|
||||
origEvent = origEvent || null;
|
||||
|
||||
if ( !initialized ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Re-execute initAllSteps for each transition. This allows to edit step attributes
|
||||
// dynamically, such as change their coordinates, or even remove or add steps, and have
|
||||
// that change apply when goto() is called.
|
||||
initAllSteps();
|
||||
|
||||
if ( !( el = getStep( el ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sometimes it's possible to trigger focus on first link with some keyboard action.
|
||||
// Browser in such a case tries to scroll the page to make this element visible
|
||||
// (even that body overflow is set to hidden) and it breaks our careful positioning.
|
||||
//
|
||||
// So, as a lousy (and lazy) workaround we will make the page scroll back to the top
|
||||
// whenever slide is selected
|
||||
//
|
||||
// If you are reading this and know any better way to handle it, I'll be glad to hear
|
||||
// about it!
|
||||
window.scrollTo( 0, 0 );
|
||||
|
||||
var step = stepsData[ "impress-" + el.id ];
|
||||
duration = ( duration !== undefined ? duration : step.transitionDuration );
|
||||
|
||||
// If we are in fact moving to another step, start with executing the registered
|
||||
// preStepLeave plugins.
|
||||
if ( activeStep && activeStep !== el ) {
|
||||
var event = { target: activeStep, detail: {} };
|
||||
event.detail.next = el;
|
||||
event.detail.transitionDuration = duration;
|
||||
event.detail.reason = reason;
|
||||
if ( origEvent ) {
|
||||
event.origEvent = origEvent;
|
||||
}
|
||||
|
||||
if ( execPreStepLeavePlugins( event ) === false ) {
|
||||
|
||||
// PreStepLeave plugins are allowed to abort the transition altogether, by
|
||||
// returning false.
|
||||
// see stop and substep plugins for an example of doing just that
|
||||
return false;
|
||||
}
|
||||
|
||||
// Plugins are allowed to change the detail values
|
||||
el = event.detail.next;
|
||||
step = stepsData[ "impress-" + el.id ];
|
||||
duration = event.detail.transitionDuration;
|
||||
}
|
||||
|
||||
if ( activeStep ) {
|
||||
activeStep.classList.remove( "active" );
|
||||
body.classList.remove( "impress-on-" + activeStep.id );
|
||||
}
|
||||
el.classList.add( "active" );
|
||||
|
||||
body.classList.add( "impress-on-" + el.id );
|
||||
|
||||
// Compute target state of the canvas based on given step
|
||||
var target = {
|
||||
rotate: {
|
||||
x: -step.rotate.x,
|
||||
y: -step.rotate.y,
|
||||
z: -step.rotate.z,
|
||||
order: step.rotate.order
|
||||
},
|
||||
translate: {
|
||||
x: -step.translate.x,
|
||||
y: -step.translate.y,
|
||||
z: -step.translate.z
|
||||
},
|
||||
scale: 1 / step.scale
|
||||
};
|
||||
|
||||
// Check if the transition is zooming in or not.
|
||||
//
|
||||
// This information is used to alter the transition style:
|
||||
// when we are zooming in - we start with move and rotate transition
|
||||
// and the scaling is delayed, but when we are zooming out we start
|
||||
// with scaling down and move and rotation are delayed.
|
||||
var zoomin = target.scale >= currentState.scale;
|
||||
|
||||
duration = lib.util.toNumber( duration, config.transitionDuration );
|
||||
var delay = ( duration / 2 );
|
||||
|
||||
// If the same step is re-selected, force computing window scaling,
|
||||
// because it is likely to be caused by window resize
|
||||
if ( el === activeStep ) {
|
||||
windowScale = computeWindowScale( config );
|
||||
}
|
||||
|
||||
var targetScale = target.scale * windowScale;
|
||||
|
||||
// Trigger leave of currently active element (if it's not the same step again)
|
||||
if ( activeStep && activeStep !== el ) {
|
||||
onStepLeave( activeStep, el );
|
||||
}
|
||||
|
||||
// Now we alter transforms of `root` and `canvas` to trigger transitions.
|
||||
//
|
||||
// And here is why there are two elements: `root` and `canvas` - they are
|
||||
// being animated separately:
|
||||
// `root` is used for scaling and `canvas` for translate and rotations.
|
||||
// Transitions on them are triggered with different delays (to make
|
||||
// visually nice and "natural" looking transitions), so we need to know
|
||||
// that both of them are finished.
|
||||
css( root, {
|
||||
|
||||
// To keep the perspective look similar for different scales
|
||||
// we need to "scale" the perspective, too
|
||||
// For IE 11 support we must specify perspective independent
|
||||
// of transform.
|
||||
perspective: ( config.perspective / targetScale ) + "px",
|
||||
transform: scale( targetScale ),
|
||||
transitionDuration: duration + "ms",
|
||||
transitionDelay: ( zoomin ? delay : 0 ) + "ms"
|
||||
} );
|
||||
|
||||
css( canvas, {
|
||||
transform: rotate( target.rotate, true ) + translate( target.translate ),
|
||||
transitionDuration: duration + "ms",
|
||||
transitionDelay: ( zoomin ? 0 : delay ) + "ms"
|
||||
} );
|
||||
|
||||
// Here is a tricky part...
|
||||
//
|
||||
// If there is no change in scale or no change in rotation and translation, it means
|
||||
// there was actually no delay - because there was no transition on `root` or `canvas`
|
||||
// elements. We want to trigger `impress:stepenter` event in the correct moment, so
|
||||
// here we compare the current and target values to check if delay should be taken into
|
||||
// account.
|
||||
//
|
||||
// I know that this `if` statement looks scary, but it's pretty simple when you know
|
||||
// what is going on - it's simply comparing all the values.
|
||||
if ( currentState.scale === target.scale ||
|
||||
( currentState.rotate.x === target.rotate.x &&
|
||||
currentState.rotate.y === target.rotate.y &&
|
||||
currentState.rotate.z === target.rotate.z &&
|
||||
currentState.translate.x === target.translate.x &&
|
||||
currentState.translate.y === target.translate.y &&
|
||||
currentState.translate.z === target.translate.z ) ) {
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
// Store current state
|
||||
currentState = target;
|
||||
activeStep = el;
|
||||
|
||||
// And here is where we trigger `impress:stepenter` event.
|
||||
// We simply set up a timeout to fire it taking transition duration (and possible delay)
|
||||
// into account.
|
||||
//
|
||||
// I really wanted to make it in more elegant way. The `transitionend` event seemed to
|
||||
// be the best way to do it, but the fact that I'm using transitions on two separate
|
||||
// elements and that the `transitionend` event is only triggered when there was a
|
||||
// transition (change in the values) caused some bugs and made the code really
|
||||
// complicated, cause I had to handle all the conditions separately. And it still
|
||||
// needed a `setTimeout` fallback for the situations when there is no transition at all.
|
||||
// So I decided that I'd rather make the code simpler than use shiny new
|
||||
// `transitionend`.
|
||||
//
|
||||
// If you want learn something interesting and see how it was done with `transitionend`
|
||||
// go back to version 0.5.2 of impress.js:
|
||||
// http://github.com/bartaz/impress.js/blob/0.5.2/js/impress.js
|
||||
window.clearTimeout( stepEnterTimeout );
|
||||
stepEnterTimeout = window.setTimeout( function() {
|
||||
onStepEnter( activeStep );
|
||||
}, duration + delay );
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
// `prev` API function goes to previous step (in document order)
|
||||
// `event` is optional, may contain the event that caused the need to call prev()
|
||||
var prev = function( origEvent ) {
|
||||
var prev = steps.indexOf( activeStep ) - 1;
|
||||
prev = prev >= 0 ? steps[ prev ] : steps[ steps.length - 1 ];
|
||||
|
||||
return goto( prev, undefined, "prev", origEvent );
|
||||
};
|
||||
|
||||
// `next` API function goes to next step (in document order)
|
||||
// `event` is optional, may contain the event that caused the need to call next()
|
||||
var next = function( origEvent ) {
|
||||
var next = steps.indexOf( activeStep ) + 1;
|
||||
next = next < steps.length ? steps[ next ] : steps[ 0 ];
|
||||
|
||||
return goto( next, undefined, "next", origEvent );
|
||||
};
|
||||
|
||||
// Swipe for touch devices by @and3rson.
|
||||
// Below we extend the api to control the animation between the currently
|
||||
// active step and a presumed next/prev step. See touch plugin for
|
||||
// an example of using this api.
|
||||
|
||||
// Helper function
|
||||
var interpolate = function( a, b, k ) {
|
||||
return a + ( b - a ) * k;
|
||||
};
|
||||
|
||||
// Animate a swipe.
|
||||
//
|
||||
// Pct is a value between -1.0 and +1.0, designating the current length
|
||||
// of the swipe.
|
||||
//
|
||||
// If pct is negative, swipe towards the next() step, if positive,
|
||||
// towards the prev() step.
|
||||
//
|
||||
// Note that pre-stepleave plugins such as goto can mess with what is a
|
||||
// next() and prev() step, so we need to trigger the pre-stepleave event
|
||||
// here, even if a swipe doesn't guarantee that the transition will
|
||||
// actually happen.
|
||||
//
|
||||
// Calling swipe(), with any value of pct, won't in itself cause a
|
||||
// transition to happen, this is just to animate the swipe. Once the
|
||||
// transition is committed - such as at a touchend event - caller is
|
||||
// responsible for also calling prev()/next() as appropriate.
|
||||
//
|
||||
// Note: For now, this function is made available to be used by the swipe plugin (which
|
||||
// is the UI counterpart to this). It is a semi-internal API and intentionally not
|
||||
// documented in DOCUMENTATION.md.
|
||||
var swipe = function( pct ) {
|
||||
if ( Math.abs( pct ) > 1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prepare & execute the preStepLeave event
|
||||
var event = { target: activeStep, detail: {} };
|
||||
event.detail.swipe = pct;
|
||||
|
||||
// Will be ignored within swipe animation, but just in case a plugin wants to read this,
|
||||
// humor them
|
||||
event.detail.transitionDuration = config.transitionDuration;
|
||||
var idx; // Needed by jshint
|
||||
if ( pct < 0 ) {
|
||||
idx = steps.indexOf( activeStep ) + 1;
|
||||
event.detail.next = idx < steps.length ? steps[ idx ] : steps[ 0 ];
|
||||
event.detail.reason = "next";
|
||||
} else if ( pct > 0 ) {
|
||||
idx = steps.indexOf( activeStep ) - 1;
|
||||
event.detail.next = idx >= 0 ? steps[ idx ] : steps[ steps.length - 1 ];
|
||||
event.detail.reason = "prev";
|
||||
} else {
|
||||
|
||||
// No move
|
||||
return;
|
||||
}
|
||||
if ( execPreStepLeavePlugins( event ) === false ) {
|
||||
|
||||
// If a preStepLeave plugin wants to abort the transition, don't animate a swipe
|
||||
// For stop, this is probably ok. For substep, the plugin it self might want to do
|
||||
// some animation, but that's not the current implementation.
|
||||
return false;
|
||||
}
|
||||
var nextElement = event.detail.next;
|
||||
|
||||
var nextStep = stepsData[ "impress-" + nextElement.id ];
|
||||
|
||||
// If the same step is re-selected, force computing window scaling,
|
||||
var nextScale = nextStep.scale * windowScale;
|
||||
var k = Math.abs( pct );
|
||||
|
||||
var interpolatedStep = {
|
||||
translate: {
|
||||
x: interpolate( currentState.translate.x, -nextStep.translate.x, k ),
|
||||
y: interpolate( currentState.translate.y, -nextStep.translate.y, k ),
|
||||
z: interpolate( currentState.translate.z, -nextStep.translate.z, k )
|
||||
},
|
||||
rotate: {
|
||||
x: interpolate( currentState.rotate.x, -nextStep.rotate.x, k ),
|
||||
y: interpolate( currentState.rotate.y, -nextStep.rotate.y, k ),
|
||||
z: interpolate( currentState.rotate.z, -nextStep.rotate.z, k ),
|
||||
|
||||
// Unfortunately there's a discontinuity if rotation order changes. Nothing I
|
||||
// can do about it?
|
||||
order: k < 0.7 ? currentState.rotate.order : nextStep.rotate.order
|
||||
},
|
||||
scale: interpolate( currentState.scale, nextScale, k )
|
||||
};
|
||||
|
||||
css( root, {
|
||||
|
||||
// To keep the perspective look similar for different scales
|
||||
// we need to 'scale' the perspective, too
|
||||
perspective: config.perspective / interpolatedStep.scale + "px",
|
||||
transform: scale( interpolatedStep.scale ),
|
||||
transitionDuration: "0ms",
|
||||
transitionDelay: "0ms"
|
||||
} );
|
||||
|
||||
css( canvas, {
|
||||
transform: rotate( interpolatedStep.rotate, true ) +
|
||||
translate( interpolatedStep.translate ),
|
||||
transitionDuration: "0ms",
|
||||
transitionDelay: "0ms"
|
||||
} );
|
||||
};
|
||||
|
||||
// Teardown impress
|
||||
// Resets the DOM to the state it was before impress().init() was called.
|
||||
// (If you called impress(rootId).init() for multiple different rootId's, then you must
|
||||
// also call tear() once for each of them.)
|
||||
var tear = function() {
|
||||
lib.gc.teardown();
|
||||
delete roots[ "impress-root-" + rootId ];
|
||||
};
|
||||
|
||||
// Adding some useful classes to step elements.
|
||||
//
|
||||
// All the steps that have not been shown yet are given `future` class.
|
||||
// When the step is entered the `future` class is removed and the `present`
|
||||
// class is given. When the step is left `present` class is replaced with
|
||||
// `past` class.
|
||||
//
|
||||
// So every step element is always in one of three possible states:
|
||||
// `future`, `present` and `past`.
|
||||
//
|
||||
// There classes can be used in CSS to style different types of steps.
|
||||
// For example the `present` class can be used to trigger some custom
|
||||
// animations when step is shown.
|
||||
lib.gc.addEventListener( root, "impress:init", function() {
|
||||
|
||||
// STEP CLASSES
|
||||
steps.forEach( function( step ) {
|
||||
step.classList.add( "future" );
|
||||
} );
|
||||
|
||||
lib.gc.addEventListener( root, "impress:stepenter", function( event ) {
|
||||
event.target.classList.remove( "past" );
|
||||
event.target.classList.remove( "future" );
|
||||
event.target.classList.add( "present" );
|
||||
}, false );
|
||||
|
||||
lib.gc.addEventListener( root, "impress:stepleave", function( event ) {
|
||||
event.target.classList.remove( "present" );
|
||||
event.target.classList.add( "past" );
|
||||
}, false );
|
||||
|
||||
}, false );
|
||||
|
||||
// Adding hash change support.
|
||||
lib.gc.addEventListener( root, "impress:init", function() {
|
||||
|
||||
// Last hash detected
|
||||
var lastHash = "";
|
||||
|
||||
// `#/step-id` is used instead of `#step-id` to prevent default browser
|
||||
// scrolling to element in hash.
|
||||
//
|
||||
// And it has to be set after animation finishes, because in Chrome it
|
||||
// makes transtion laggy.
|
||||
// BUG: http://code.google.com/p/chromium/issues/detail?id=62820
|
||||
lib.gc.addEventListener( root, "impress:stepenter", function( event ) {
|
||||
window.location.hash = lastHash = "#/" + event.target.id;
|
||||
}, false );
|
||||
|
||||
lib.gc.addEventListener( window, "hashchange", function() {
|
||||
|
||||
// When the step is entered hash in the location is updated
|
||||
// (just few lines above from here), so the hash change is
|
||||
// triggered and we would call `goto` again on the same element.
|
||||
//
|
||||
// To avoid this we store last entered hash and compare.
|
||||
if ( window.location.hash !== lastHash ) {
|
||||
goto( lib.util.getElementFromHash() );
|
||||
}
|
||||
}, false );
|
||||
|
||||
// START
|
||||
// by selecting step defined in url or first step of the presentation
|
||||
goto( lib.util.getElementFromHash() || steps[ 0 ], 0 );
|
||||
}, false );
|
||||
|
||||
body.classList.add( "impress-disabled" );
|
||||
|
||||
// Store and return API for given impress.js root element
|
||||
return ( roots[ "impress-root-" + rootId ] = {
|
||||
init: init,
|
||||
goto: goto,
|
||||
next: next,
|
||||
prev: prev,
|
||||
swipe: swipe,
|
||||
tear: tear,
|
||||
lib: lib
|
||||
} );
|
||||
|
||||
};
|
||||
|
||||
// Flag that can be used in JS to check if browser have passed the support test
|
||||
impress.supported = impressSupported;
|
||||
|
||||
// ADD and INIT LIBRARIES
|
||||
// Library factories are defined in src/lib/*.js, and register themselves by calling
|
||||
// impress.addLibraryFactory(libraryFactoryObject). They're stored here, and used to augment
|
||||
// the API with library functions when client calls impress(rootId).
|
||||
// See src/lib/README.md for clearer example.
|
||||
// (Advanced usage: For different values of rootId, a different instance of the libaries are
|
||||
// generated, in case they need to hold different state for different root elements.)
|
||||
var libraryFactories = {};
|
||||
impress.addLibraryFactory = function( obj ) {
|
||||
for ( var libname in obj ) {
|
||||
if ( obj.hasOwnProperty( libname ) ) {
|
||||
libraryFactories[ libname ] = obj[ libname ];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Call each library factory, and return the lib object that is added to the api.
|
||||
var initLibraries = function( rootId ) { //jshint ignore:line
|
||||
var lib = {};
|
||||
for ( var libname in libraryFactories ) {
|
||||
if ( libraryFactories.hasOwnProperty( libname ) ) {
|
||||
if ( lib[ libname ] !== undefined ) {
|
||||
throw "impress.js ERROR: Two libraries both tried to use libname: " + libname;
|
||||
}
|
||||
lib[ libname ] = libraryFactories[ libname ]( rootId );
|
||||
}
|
||||
}
|
||||
return lib;
|
||||
};
|
||||
|
||||
// `addPreInitPlugin` allows plugins to register a function that should
|
||||
// be run (synchronously) at the beginning of init, before
|
||||
// impress().init() itself executes.
|
||||
impress.addPreInitPlugin = function( plugin, weight ) {
|
||||
weight = parseInt( weight ) || 10;
|
||||
if ( weight <= 0 ) {
|
||||
throw "addPreInitPlugin: weight must be a positive integer";
|
||||
}
|
||||
|
||||
if ( preInitPlugins[ weight ] === undefined ) {
|
||||
preInitPlugins[ weight ] = [];
|
||||
}
|
||||
preInitPlugins[ weight ].push( plugin );
|
||||
};
|
||||
|
||||
// Called at beginning of init, to execute all pre-init plugins.
|
||||
var execPreInitPlugins = function( root ) { //jshint ignore:line
|
||||
for ( var i = 0; i < preInitPlugins.length; i++ ) {
|
||||
var thisLevel = preInitPlugins[ i ];
|
||||
if ( thisLevel !== undefined ) {
|
||||
for ( var j = 0; j < thisLevel.length; j++ ) {
|
||||
thisLevel[ j ]( root );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// `addPreStepLeavePlugin` allows plugins to register a function that should
|
||||
// be run (synchronously) at the beginning of goto()
|
||||
impress.addPreStepLeavePlugin = function( plugin, weight ) { //jshint ignore:line
|
||||
weight = parseInt( weight ) || 10;
|
||||
if ( weight <= 0 ) {
|
||||
throw "addPreStepLeavePlugin: weight must be a positive integer";
|
||||
}
|
||||
|
||||
if ( preStepLeavePlugins[ weight ] === undefined ) {
|
||||
preStepLeavePlugins[ weight ] = [];
|
||||
}
|
||||
preStepLeavePlugins[ weight ].push( plugin );
|
||||
};
|
||||
|
||||
// Called at beginning of goto(), to execute all preStepLeave plugins.
|
||||
var execPreStepLeavePlugins = function( event ) { //jshint ignore:line
|
||||
for ( var i = 0; i < preStepLeavePlugins.length; i++ ) {
|
||||
var thisLevel = preStepLeavePlugins[ i ];
|
||||
if ( thisLevel !== undefined ) {
|
||||
for ( var j = 0; j < thisLevel.length; j++ ) {
|
||||
if ( thisLevel[ j ]( event ) === false ) {
|
||||
|
||||
// If a plugin returns false, the stepleave event (and related transition)
|
||||
// is aborted
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} )( document, window );
|
||||
|
||||
// THAT'S ALL FOLKS!
|
||||
//
|
||||
// Thanks for reading it all.
|
||||
// Or thanks for scrolling down and reading the last part.
|
||||
//
|
||||
// I've learnt a lot when building impress.js and I hope this code and comments
|
||||
// will help somebody learn at least some part of it.
|
||||
105
src/lib/README.md
Normal file
@@ -0,0 +1,105 @@
|
||||
Impress.js Libraries
|
||||
====================
|
||||
|
||||
The `src/lib/*.js` files contain library functions. The main difference to plugins is that:
|
||||
|
||||
1. Libraries are closer to the impress.js core than plugins (arguably a subjective metric)
|
||||
2. Libraries are common utility functions used by many plugins
|
||||
3. Libraries are called synchronously, which is why the event based paradigm that plugins use to
|
||||
communicate isn't useful.
|
||||
|
||||
Plugins can access libraries via the API:
|
||||
|
||||
var api;
|
||||
document.addEventListener( "impress:init", function(event){
|
||||
api = event.detail.api;
|
||||
api().lib.<libraryName>.<libaryFunction>();
|
||||
});
|
||||
|
||||
...which is equivalent to:
|
||||
|
||||
impress().lib.<libraryName>.<libraryFunction>();
|
||||
|
||||
Implementing a library
|
||||
----------------------
|
||||
|
||||
1. Create a file under `src/lib/`.
|
||||
|
||||
2. Start with the standard boilerplate documentation, and the (function(document, window){})();
|
||||
wrapper.
|
||||
|
||||
3. The library should implement a factory function, and make its existence known to impress.js core:
|
||||
|
||||
window.impress.addLibraryFactory( { libName : libraryFactory} );
|
||||
|
||||
4. The library function should return a similar API object as core `impress()` function does:
|
||||
|
||||
var libraryFactory = function(rootId) {
|
||||
/* implement library functions ... */
|
||||
|
||||
var lib = {
|
||||
libFunction1: libFunction1,
|
||||
libFunction2: libFunction2
|
||||
}
|
||||
return lib;
|
||||
};
|
||||
|
||||
5. While rarely used, impress.js actually supports multiple presentation root div elements on a
|
||||
single html page. Each of these have their own API object, identified by the root element id
|
||||
attribute:
|
||||
|
||||
impress("other-root-id").init();
|
||||
|
||||
(The default rootId obviously is `"impress"`.)
|
||||
|
||||
Libraries MUST implement this support for multiple root elements as well.
|
||||
|
||||
- impress.js core will call the factory once for each separate root element being initialized via
|
||||
`impress.init(rootId)`.
|
||||
- Any state that a library might hold, MUST be stored *per `rootId`*.
|
||||
- Note that as we now support also `impress(rootId).tear()`, the same root element might be
|
||||
initialized more than once, and each of these MUST be treated as a new valid initialization.
|
||||
|
||||
Putting all of the above together, a skeleton library file will look like:
|
||||
|
||||
/**
|
||||
* Example library libName
|
||||
*
|
||||
* Henrik Ingo (c) 2016
|
||||
* MIT License
|
||||
*/
|
||||
(function ( document, window ) {
|
||||
'use strict';
|
||||
// Singleton library variables
|
||||
var roots = [];
|
||||
var singletonVar = {};
|
||||
|
||||
var libraryFactory = function(rootId) {
|
||||
if (roots["impress-root-" + rootId]) {
|
||||
return roots["impress-root-" + rootId];
|
||||
}
|
||||
|
||||
// Per root global variables (instance variables?)
|
||||
var instanceVar = {};
|
||||
|
||||
// LIBRARY FUNCTIONS
|
||||
var libraryFunction1 = function () {
|
||||
/* ... */
|
||||
};
|
||||
|
||||
var libraryFunction2 = function () {
|
||||
/* ... */
|
||||
};
|
||||
|
||||
var lib = {
|
||||
libFunction1: libFunction1,
|
||||
libFunction2: libFunction2
|
||||
}
|
||||
roots["impress-root-" + rootId] = lib;
|
||||
return lib;
|
||||
};
|
||||
|
||||
// Let impress core know about the existence of this library
|
||||
window.impress.addLibraryFactory( { libName : libraryFactory } );
|
||||
|
||||
})(document, window);
|
||||
238
src/lib/gc.js
Normal file
@@ -0,0 +1,238 @@
|
||||
/**
|
||||
* Garbage collection utility
|
||||
*
|
||||
* This library allows plugins to add elements and event listeners they add to the DOM. The user
|
||||
* can call `impress().lib.gc.teardown()` to cause all of them to be removed from DOM, so that
|
||||
* the document is in the state it was before calling `impress().init()`.
|
||||
*
|
||||
* In addition to just adding elements and event listeners to the garbage collector, plugins
|
||||
* can also register callback functions to do arbitrary cleanup upon teardown.
|
||||
*
|
||||
* Henrik Ingo (c) 2016
|
||||
* MIT License
|
||||
*/
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var roots = [];
|
||||
var rootsCount = 0;
|
||||
var startingState = { roots: [] };
|
||||
|
||||
var libraryFactory = function( rootId ) {
|
||||
if ( roots[ rootId ] ) {
|
||||
return roots[ rootId ];
|
||||
}
|
||||
|
||||
// Per root global variables (instance variables?)
|
||||
var elementList = [];
|
||||
var eventListenerList = [];
|
||||
var callbackList = [];
|
||||
|
||||
recordStartingState( rootId );
|
||||
|
||||
// LIBRARY FUNCTIONS
|
||||
// Definitions of the library functions we return as an object at the end
|
||||
|
||||
// `pushElement` adds a DOM element to the gc stack
|
||||
var pushElement = function( element ) {
|
||||
elementList.push( element );
|
||||
};
|
||||
|
||||
// `appendChild` is a convenience wrapper that combines DOM appendChild with gc.pushElement
|
||||
var appendChild = function( parent, element ) {
|
||||
parent.appendChild( element );
|
||||
pushElement( element );
|
||||
};
|
||||
|
||||
// `pushEventListener` adds an event listener to the gc stack
|
||||
var pushEventListener = function( target, type, listenerFunction ) {
|
||||
eventListenerList.push( { target:target, type:type, listener:listenerFunction } );
|
||||
};
|
||||
|
||||
// `addEventListener` combines DOM addEventListener with gc.pushEventListener
|
||||
var addEventListener = function( target, type, listenerFunction ) {
|
||||
target.addEventListener( type, listenerFunction );
|
||||
pushEventListener( target, type, listenerFunction );
|
||||
};
|
||||
|
||||
// `pushCallback` If the above utilities are not enough, plugins can add their own callback
|
||||
// function to do arbitrary things.
|
||||
var pushCallback = function( callback ) {
|
||||
callbackList.push( callback );
|
||||
};
|
||||
pushCallback( function( rootId ) { resetStartingState( rootId ); } );
|
||||
|
||||
// `teardown` will
|
||||
// - execute all callbacks in LIFO order
|
||||
// - call `removeChild` on all DOM elements in LIFO order
|
||||
// - call `removeEventListener` on all event listeners in LIFO order
|
||||
// The goal of a teardown is to return to the same state that the DOM was before
|
||||
// `impress().init()` was called.
|
||||
var teardown = function() {
|
||||
|
||||
// Execute the callbacks in LIFO order
|
||||
var i; // Needed by jshint
|
||||
for ( i = callbackList.length - 1; i >= 0; i-- ) {
|
||||
callbackList[ i ]( rootId );
|
||||
}
|
||||
callbackList = [];
|
||||
for ( i = 0; i < elementList.length; i++ ) {
|
||||
elementList[ i ].parentElement.removeChild( elementList[ i ] );
|
||||
}
|
||||
elementList = [];
|
||||
for ( i = 0; i < eventListenerList.length; i++ ) {
|
||||
var target = eventListenerList[ i ].target;
|
||||
var type = eventListenerList[ i ].type;
|
||||
var listener = eventListenerList[ i ].listener;
|
||||
target.removeEventListener( type, listener );
|
||||
}
|
||||
};
|
||||
|
||||
var lib = {
|
||||
pushElement: pushElement,
|
||||
appendChild: appendChild,
|
||||
pushEventListener: pushEventListener,
|
||||
addEventListener: addEventListener,
|
||||
pushCallback: pushCallback,
|
||||
teardown: teardown
|
||||
};
|
||||
roots[ rootId ] = lib;
|
||||
rootsCount++;
|
||||
return lib;
|
||||
};
|
||||
|
||||
// Let impress core know about the existence of this library
|
||||
window.impress.addLibraryFactory( { gc: libraryFactory } );
|
||||
|
||||
// CORE INIT
|
||||
// The library factory (gc(rootId)) is called at the beginning of impress(rootId).init()
|
||||
// For the purposes of teardown(), we can use this as an opportunity to save the state
|
||||
// of a few things in the DOM in their virgin state, before impress().init() did anything.
|
||||
// Note: These could also be recorded by the code in impress.js core as these values
|
||||
// are changed, but in an effort to not deviate too much from upstream, I'm adding
|
||||
// them here rather than the core itself.
|
||||
var recordStartingState = function( rootId ) {
|
||||
startingState.roots[ rootId ] = {};
|
||||
startingState.roots[ rootId ].steps = [];
|
||||
|
||||
// Record whether the steps have an id or not
|
||||
var steps = document.getElementById( rootId ).querySelectorAll( ".step" );
|
||||
for ( var i = 0; i < steps.length; i++ ) {
|
||||
var el = steps[ i ];
|
||||
startingState.roots[ rootId ].steps.push( {
|
||||
el: el,
|
||||
id: el.getAttribute( "id" )
|
||||
} );
|
||||
}
|
||||
|
||||
// In the rare case of multiple roots, the following is changed on first init() and
|
||||
// reset at last tear().
|
||||
if ( rootsCount === 0 ) {
|
||||
startingState.body = {};
|
||||
|
||||
// It is customary for authors to set body.class="impress-not-supported" as a starting
|
||||
// value, which can then be removed by impress().init(). But it is not required.
|
||||
// Remember whether it was there or not.
|
||||
if ( document.body.classList.contains( "impress-not-supported" ) ) {
|
||||
startingState.body.impressNotSupported = true;
|
||||
} else {
|
||||
startingState.body.impressNotSupported = false;
|
||||
}
|
||||
|
||||
// If there's a <meta name="viewport"> element, its contents will be overwritten by init
|
||||
var metas = document.head.querySelectorAll( "meta" );
|
||||
for ( i = 0; i < metas.length; i++ ) {
|
||||
var m = metas[ i ];
|
||||
if ( m.name === "viewport" ) {
|
||||
startingState.meta = m.content;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// CORE TEARDOWN
|
||||
var resetStartingState = function( rootId ) {
|
||||
|
||||
// Reset body element
|
||||
document.body.classList.remove( "impress-enabled" );
|
||||
document.body.classList.remove( "impress-disabled" );
|
||||
|
||||
var root = document.getElementById( rootId );
|
||||
var activeId = root.querySelector( ".active" ).id;
|
||||
document.body.classList.remove( "impress-on-" + activeId );
|
||||
|
||||
document.documentElement.style.height = "";
|
||||
document.body.style.height = "";
|
||||
document.body.style.overflow = "";
|
||||
|
||||
// Remove style values from the root and step elements
|
||||
// Note: We remove the ones set by impress.js core. Otoh, we didn't preserve any original
|
||||
// values. A more sophisticated implementation could keep track of original values and then
|
||||
// reset those.
|
||||
var steps = root.querySelectorAll( ".step" );
|
||||
for ( var i = 0; i < steps.length; i++ ) {
|
||||
steps[ i ].classList.remove( "future" );
|
||||
steps[ i ].classList.remove( "past" );
|
||||
steps[ i ].classList.remove( "present" );
|
||||
steps[ i ].classList.remove( "active" );
|
||||
steps[ i ].style.position = "";
|
||||
steps[ i ].style.transform = "";
|
||||
steps[ i ].style[ "transform-style" ] = "";
|
||||
}
|
||||
root.style.position = "";
|
||||
root.style[ "transform-origin" ] = "";
|
||||
root.style.transition = "";
|
||||
root.style[ "transform-style" ] = "";
|
||||
root.style.top = "";
|
||||
root.style.left = "";
|
||||
root.style.transform = "";
|
||||
|
||||
// Reset id of steps ("step-1" id's are auto generated)
|
||||
steps = startingState.roots[ rootId ].steps;
|
||||
var step;
|
||||
while ( step = steps.pop() ) {
|
||||
if ( step.id === null ) {
|
||||
step.el.removeAttribute( "id" );
|
||||
} else {
|
||||
step.el.setAttribute( "id", step.id );
|
||||
}
|
||||
}
|
||||
delete startingState.roots[ rootId ];
|
||||
|
||||
// Move step div elements away from canvas, then delete canvas
|
||||
// Note: There's an implicit assumption here that the canvas div is the only child element
|
||||
// of the root div. If there would be something else, it's gonna be lost.
|
||||
var canvas = root.firstChild;
|
||||
var canvasHTML = canvas.innerHTML;
|
||||
root.innerHTML = canvasHTML;
|
||||
|
||||
if ( roots[ rootId ] !== undefined ) {
|
||||
delete roots[ rootId ];
|
||||
rootsCount--;
|
||||
}
|
||||
if ( rootsCount === 0 ) {
|
||||
|
||||
// In the rare case that more than one impress root elements were initialized, these
|
||||
// are only reset when all are uninitialized.
|
||||
document.body.classList.remove( "impress-supported" );
|
||||
if ( startingState.body.impressNotSupported ) {
|
||||
document.body.classList.add( "impress-not-supported" );
|
||||
}
|
||||
|
||||
// We need to remove or reset the meta element inserted by impress.js
|
||||
var metas = document.head.querySelectorAll( "meta" );
|
||||
for ( i = 0; i < metas.length; i++ ) {
|
||||
var m = metas[ i ];
|
||||
if ( m.name === "viewport" ) {
|
||||
if ( startingState.meta !== undefined ) {
|
||||
m.content = startingState.meta;
|
||||
} else {
|
||||
m.parentElement.removeChild( m );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} )( document, window );
|
||||
97
src/lib/util.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* Common utility functions
|
||||
*
|
||||
* Copyright 2011-2012 Bartek Szopka (@bartaz)
|
||||
* Henrik Ingo (c) 2016
|
||||
* MIT License
|
||||
*/
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var roots = [];
|
||||
|
||||
var libraryFactory = function( rootId ) {
|
||||
if ( roots[ rootId ] ) {
|
||||
return roots[ rootId ];
|
||||
}
|
||||
|
||||
// `$` returns first element for given CSS `selector` in the `context` of
|
||||
// the given element or whole document.
|
||||
var $ = function( selector, context ) {
|
||||
context = context || document;
|
||||
return context.querySelector( selector );
|
||||
};
|
||||
|
||||
// `$$` return an array of elements for given CSS `selector` in the `context` of
|
||||
// the given element or whole document.
|
||||
var $$ = function( selector, context ) {
|
||||
context = context || document;
|
||||
return arrayify( context.querySelectorAll( selector ) );
|
||||
};
|
||||
|
||||
// `arrayify` takes an array-like object and turns it into real Array
|
||||
// to make all the Array.prototype goodness available.
|
||||
var arrayify = function( a ) {
|
||||
return [].slice.call( a );
|
||||
};
|
||||
|
||||
// `byId` returns element with given `id` - you probably have guessed that ;)
|
||||
var byId = function( id ) {
|
||||
return document.getElementById( id );
|
||||
};
|
||||
|
||||
// `getElementFromHash` returns an element located by id from hash part of
|
||||
// window location.
|
||||
var getElementFromHash = function() {
|
||||
|
||||
// Get id from url # by removing `#` or `#/` from the beginning,
|
||||
// so both "fallback" `#slide-id` and "enhanced" `#/slide-id` will work
|
||||
return byId( window.location.hash.replace( /^#\/?/, "" ) );
|
||||
};
|
||||
|
||||
// Throttling function calls, by Remy Sharp
|
||||
// http://remysharp.com/2010/07/21/throttling-function-calls/
|
||||
var throttle = function( fn, delay ) {
|
||||
var timer = null;
|
||||
return function() {
|
||||
var context = this, args = arguments;
|
||||
window.clearTimeout( timer );
|
||||
timer = window.setTimeout( function() {
|
||||
fn.apply( context, args );
|
||||
}, delay );
|
||||
};
|
||||
};
|
||||
|
||||
// `toNumber` takes a value given as `numeric` parameter and tries to turn
|
||||
// it into a number. If it is not possible it returns 0 (or other value
|
||||
// given as `fallback`).
|
||||
var toNumber = function( numeric, fallback ) {
|
||||
return isNaN( numeric ) ? ( fallback || 0 ) : Number( numeric );
|
||||
};
|
||||
|
||||
// `triggerEvent` builds a custom DOM event with given `eventName` and `detail` data
|
||||
// and triggers it on element given as `el`.
|
||||
var triggerEvent = function( el, eventName, detail ) {
|
||||
var event = document.createEvent( "CustomEvent" );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
el.dispatchEvent( event );
|
||||
};
|
||||
|
||||
var lib = {
|
||||
$: $,
|
||||
$$: $$,
|
||||
arrayify: arrayify,
|
||||
byId: byId,
|
||||
getElementFromHash: getElementFromHash,
|
||||
throttle: throttle,
|
||||
toNumber: toNumber,
|
||||
triggerEvent: triggerEvent
|
||||
};
|
||||
roots[ rootId ] = lib;
|
||||
return lib;
|
||||
};
|
||||
|
||||
// Let impress core know about the existence of this library
|
||||
window.impress.addLibraryFactory( { util: libraryFactory } );
|
||||
|
||||
} )( document, window );
|
||||
442
src/plugins/README.md
Normal file
@@ -0,0 +1,442 @@
|
||||
Impress.js Plugins documentation
|
||||
================================
|
||||
|
||||
The default set of plugins
|
||||
--------------------------
|
||||
|
||||
A lot of impress.js features are and will be implemented as plugins. Each plugin
|
||||
has user documentation in a README.md file in [its own directory](./).
|
||||
|
||||
The plugins in this directory are called default plugins, and - unsurprisingly -
|
||||
are enabled by default. However, most of them won't do anything by default,
|
||||
rather require the user to invoke them somehow. For example:
|
||||
|
||||
* The *navigation* plugin waits for the user to press some keys, arrows, page
|
||||
down, page up, space or tab.
|
||||
* The *autoplay* plugin looks for the HTML attribute `data-autoplay` to see
|
||||
whether it should do its thing.
|
||||
* The *toolbar* plugin looks for a `<div>` element to become visible.
|
||||
|
||||
Extra addons
|
||||
------------
|
||||
|
||||
Yet more features are available in presentations that enable
|
||||
[extra addons](../../extras/). Extra addons are 3rd party plugins integrated
|
||||
into impress.js to provide convenient and standardized access to them. However,
|
||||
they are not activated by default, rather must be included with a `<script>`
|
||||
tag.
|
||||
|
||||
Note: The enabled extra addons are automatically initialized by the *extras*
|
||||
plugin.
|
||||
|
||||
Example HTML and CSS
|
||||
--------------------
|
||||
|
||||
Generally plugins will do something sane, or nothing, by default. Hence, no
|
||||
particular HTML or CSS is required. The README file of each plugin documents the
|
||||
HTML and CSS that you can use with that plugin.
|
||||
|
||||
For your convenience, below is some sample HTML and CSS code covering all the
|
||||
plugins that you may want to use or adapt.
|
||||
|
||||
### Sample HTML to enable plugins and extra addons
|
||||
|
||||
<head>
|
||||
<!-- CSS files if using Highlight.js or Mermaid.js extras. -->
|
||||
<link rel="stylesheet" href="../../extras/highlight/styles/github.css">
|
||||
<link rel="stylesheet" href="../../extras/mermaid/mermaid.forest.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="impress" data-autoplay="10">
|
||||
<div class="step"
|
||||
data-autoplay="15"
|
||||
data-rel-x="1000"
|
||||
data-rel-y="1000">
|
||||
|
||||
<h1>Slide content</h1>
|
||||
|
||||
<ul>
|
||||
<li class="substep">Point 1</li>
|
||||
<li class="substep">Point 2</li>
|
||||
</ul>
|
||||
|
||||
<div class="notes">
|
||||
Speaker notes are shown in the impressConsole.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="impress-toolbar"></div>
|
||||
<div class="impress-progressbar"><div></div></div>
|
||||
<div class="impress-progress"></div>
|
||||
<div id="impress-help"></div>
|
||||
|
||||
<script type="text/javascript" src="../../extras/highlight/highlight.pack.js"></script>
|
||||
<script type="text/javascript" src="../../extras/mermaid/mermaid.min.js"></script>
|
||||
<script type="text/javascript" src="../../extras/markdown/markdown.js"></script>
|
||||
<script type="text/javascript" src="../../extras/mathjax/MathJax.js?config=TeX-AMS_CHTML"></script>
|
||||
</body>
|
||||
|
||||
### Sample CSS related to plugins and extra addons
|
||||
|
||||
/* Using the substep plugin, hide bullet points at first, then show them one by one. */
|
||||
#impress .step .substep {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#impress .step .substep.substep-visible {
|
||||
opacity: 1;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
/*
|
||||
Speaker notes allow you to write comments within the steps, that will not
|
||||
be displayed as part of the presentation. However, they will be picked up
|
||||
and displayed by impressConsole.js when you press P.
|
||||
*/
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Toolbar plugin */
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
z-index: 10;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar.impress-toolbar-show {
|
||||
display: block;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar.impress-toolbar-hide {
|
||||
display: none;
|
||||
}
|
||||
/* If you disable pointer-events (like in the impress.js official demo), you need to re-enable them for the toolbar. */
|
||||
.impress-enabled #impress-toolbar { pointer-events: auto }
|
||||
/* Progress bar */
|
||||
.impress-enabled .impress-progressbar {
|
||||
position: absolute;
|
||||
right: 318px;
|
||||
bottom: 1px;
|
||||
left: 118px;
|
||||
border-radius: 7px;
|
||||
border: 2px solid rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
.impress-enabled .impress-progressbar DIV {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
border-radius: 5px;
|
||||
background: rgba(75, 75, 75, 0.4);
|
||||
transition: width 1s linear;
|
||||
}
|
||||
.impress-enabled .impress-progress {
|
||||
position: absolute;
|
||||
left: 59px;
|
||||
bottom: 1px;
|
||||
text-align: left;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
For developers
|
||||
==============
|
||||
|
||||
The vision for impress.js is to provide a compact core library doing the
|
||||
actual presentations, with a collection of plugins that provide additional
|
||||
functionality. A default set of plugins are distributed together with the core
|
||||
impress.js, and are located in this directory. They are called *default plugins*
|
||||
because they are distributed and active when users use the [js/impress.js](../../js/impress.js)
|
||||
in their presentations.
|
||||
|
||||
Building js/impress.js
|
||||
-----------------------
|
||||
|
||||
The common way to use impress.js is to link to the file
|
||||
[js/impress.js](../../js/impress.js). This is a simple concatenation of the
|
||||
core impress.js and all plugins in this directory. If you edit or add code
|
||||
under [src/](../), you can run `node build.js` to recreate the distributable
|
||||
`js/impress.js` file. The build script also creates a minified file, but this
|
||||
is not included in the git repository.
|
||||
|
||||
### Tip: Build errors
|
||||
|
||||
If your code has parse errors, the `build.js` will print a rather unhelpful
|
||||
exception like
|
||||
|
||||
/home/hingo/hacking/impress.js/js/impress.js
|
||||
|
||||
/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:271
|
||||
throw new JS_Parse_Error(message, line, col, pos);
|
||||
^
|
||||
Error
|
||||
at new JS_Parse_Error (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:263:18)
|
||||
at js_error (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:271:11)
|
||||
at croak (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:733:9)
|
||||
at token_error (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:740:9)
|
||||
at unexpected (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:746:9)
|
||||
at Object.semicolon [as 1] (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:766:43)
|
||||
at prog1 (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:1314:21)
|
||||
at simple_statement (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:906:27)
|
||||
at /home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:814:19
|
||||
at block_ (/home/hingo/hacking/impress.js/node_modules/uglify-js/lib/parse-js.js:1003:20)
|
||||
|
||||
You will be pleased to know, that the concatenation of the unminified file
|
||||
[js/impress.js](../../js/impress.js) has already succeeded at this point. Just
|
||||
open a test in your browser, and the browser will show you the line and error.
|
||||
|
||||
|
||||
### Structure, naming and policy
|
||||
|
||||
Each plugin is contained within its own directory. The name of the directory
|
||||
is the name of the plugin. For example, imagine a plugin called *pluginA*:
|
||||
|
||||
src/plugins/plugina/
|
||||
|
||||
The main javascript file should use the directory name as its root name:
|
||||
|
||||
src/plugins/plugina/plugina.js
|
||||
|
||||
For most plugins, a single `.js` file is enough.
|
||||
|
||||
Note that the plugin name is also used as a namespace for various things. For
|
||||
example, the *autoplay* plugin can be configured by setting the `data-autoplay="5"`
|
||||
attribute on a `div`.
|
||||
|
||||
As a general rule ids, classes and attributes within the `div#impress` root
|
||||
element, may use the plugin name directly (e.g. `data-autoplay="5"`). However,
|
||||
outside of the root element, you should use `impress-pluginname` (e.g.
|
||||
`<div id="impress-toolbar">`. The latter (longer) form also applies to all
|
||||
events, they should be prefixed with `impress:pluginname`.
|
||||
|
||||
You should use crisp and descriptive names for your plugins. But
|
||||
sometimes you might optimize for a short namespace. Hence, the
|
||||
[Relative Positioning Plugin](rel/rel.js) is called `rel` to keep html attributes
|
||||
short. You should not overuse this idea!
|
||||
|
||||
Note that for default plugins, which is all plugins in this directory,
|
||||
**NO css, html or image files** are allowed.
|
||||
|
||||
Default plugins must not add any global variables.
|
||||
|
||||
### Testing
|
||||
|
||||
The plugin directory should also include tests, which should use the *QUnit* and
|
||||
*Syn* libraries under [test/](../../test). You can have as many tests as you like,
|
||||
but it is suggested your first and main test file is called `plugina_tests.html`
|
||||
and `plugina_tests.js` respectively. You need to add your test `.js` file into
|
||||
[/qunit_test_runner.html](../../qunit_test_runner.html), and the `.js` file
|
||||
should start by loading the test `.html` file into the
|
||||
`iframe#presentation-iframe`. See [navigation-ui](navigation-ui) plugin for an
|
||||
example.
|
||||
|
||||
You are allowed to test your plugin whatever way you like, but the general
|
||||
approach is for the test to load the [js/impress.js](../../js/impress.js) file
|
||||
produced by build.js. This way you are testing what users will actually be
|
||||
using, rather than the uncompiled source code.
|
||||
|
||||
HowTo write a plugin
|
||||
--------------------
|
||||
|
||||
### Encapsulation
|
||||
|
||||
To avoid polluting the global namespace, plugins must encapsulate them in the
|
||||
standard javascript anonymous function:
|
||||
|
||||
/**
|
||||
* Plugin A - An example plugin
|
||||
*
|
||||
* Description...
|
||||
*
|
||||
* Copyright 2016 Firstname Lastname, email or github handle
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
(function ( document, window ) {
|
||||
|
||||
// Plugin implementation...
|
||||
|
||||
})(document, window);
|
||||
|
||||
|
||||
### Init plugins
|
||||
|
||||
We categorize plugins into various categories, based on how and when they are
|
||||
called, and what they do.
|
||||
|
||||
An init plugin is the simplest kind of plugin. It simply listens for the
|
||||
`impress().init()` method to send the `impress:init` event, at which point
|
||||
the plugin can initialize itself and start doing whatever it does, for example
|
||||
by calling methods in the public api returned by `impress()`.
|
||||
|
||||
The `impress:init` event has the `div#impress` element as its `target` attribute,
|
||||
whereas `event.detail.api` contains the same object that is returned by calling
|
||||
`impress()`. It is customary to store the api object sent by the event rather than
|
||||
calling `impress()` from the global namespace.
|
||||
|
||||
Example:
|
||||
|
||||
/**
|
||||
* Plugin A - An example plugin
|
||||
*
|
||||
* Description...
|
||||
*
|
||||
* Copyright 2016 Firstname Lastname, email or github handle
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
(function ( document, window ) {
|
||||
var root;
|
||||
var api;
|
||||
var lib;
|
||||
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
root = event.target;
|
||||
api = event.detail.api;
|
||||
lib = api.lib;
|
||||
|
||||
// Element attributes starting with "data-", become available under
|
||||
// element.dataset. In addition hyphenized words become camelCased.
|
||||
var data = root.dataset;
|
||||
// Get value of `<div id="impress" data-plugina-foo="...">`
|
||||
var foo = data.pluginaFoo;
|
||||
// ...
|
||||
}
|
||||
})(document, window);
|
||||
|
||||
|
||||
Both [Navigation](navigation/navigation.js) and [Autoplay](autoplay/autoplay.js)
|
||||
are init plugins.
|
||||
|
||||
To provide end user configurability in your plugin, a good idea might be to
|
||||
read html attributes from the impress presentation. The
|
||||
[Autoplay](autoplay/autoplay.js) plugin does exactly this, you can provide
|
||||
a default value in the `div#impress` element, or in each `div.step`.
|
||||
|
||||
A plugin must only use html attributes in its designated namespace, which is
|
||||
|
||||
data-pluginName-*="value"
|
||||
|
||||
For example, if *pluginA* offers config options `foo` and `bar`, it would look
|
||||
like this:
|
||||
|
||||
<div id="impress" data-plugina-foo="5" data-plugina-bar="auto" >
|
||||
|
||||
|
||||
### Pre-init plugins
|
||||
|
||||
Some plugins need to run before even impress().init() does anything. These
|
||||
are typically *filters*: they want to modify the html via DOM calls, before
|
||||
impress.js core parses the presentation. We call these *pre-init plugins*.
|
||||
|
||||
A pre-init plugin must be called synchronously, before `impress().init()` is
|
||||
executed. Plugins can register themselves to be called in the pre-init phase
|
||||
by calling:
|
||||
|
||||
impress.addPreInitPlugin( plugin [, weight] );
|
||||
|
||||
The argument `plugin` must be a function. `weight` is optional and defaults to
|
||||
`10`. Plugins are ordered by weight when they are executed, with lower weight
|
||||
first.
|
||||
|
||||
The [Relative Positioning Plugin](rel/rel.js) is an example of a pre-init plugin.
|
||||
|
||||
### Pre-StepLeave plugins
|
||||
|
||||
A *pre-stepleave plugin* is called synchronously from impress.js core at the
|
||||
beginning of `impress().goto()`.
|
||||
|
||||
To register a plugin, call
|
||||
|
||||
impress.addPreStepLeavePlugin( plugin [, weight] );
|
||||
|
||||
When the plugin function is executed, it will be passed an argument
|
||||
that resembles the `event` object from DOM event handlers:
|
||||
|
||||
`event.target` contains the current step, which we are about to leave.
|
||||
|
||||
`event.detail.next` contains the element we are about to transition to.
|
||||
|
||||
`event.detail.reason` contains a string, one of "next", "prev" or "goto",
|
||||
which tells you which API function was called to initiate the transition.
|
||||
|
||||
`event.detail.transitionDuration` contains the transitionDuration for the
|
||||
upcoming transition.
|
||||
|
||||
A pre-stepleave plugin may alter the values in `event.detail` (except for
|
||||
`reason`), and this can change the behavior of the upcoming transition.
|
||||
For example, the `goto` plugin will set the `event.detail.next` to point to
|
||||
some other element, causing the presentation to jump to that step instead.
|
||||
|
||||
|
||||
### GUI plugins
|
||||
|
||||
A *GUI plugin* is actually just an init plugin, but is a special category that
|
||||
exposes visible widgets or effects in the presentation. For example, it might
|
||||
provide clickable buttons to go to the next and previous slide.
|
||||
|
||||
Note that all plugins shipped in the default set **must not** produce any visible
|
||||
html elements unless the user asks for it. A recommended best practice is to let
|
||||
the user add a div element, with an id equaling the plugin's namespace, in the
|
||||
place where he wants to see whatever visual UI elements the plugin is providing:
|
||||
|
||||
<div id="impress-plugina"></div>
|
||||
|
||||
Another way to show the elements of a UI plugin might be by allowing the user
|
||||
to explicitly press a key, like "H" for a help dialog.
|
||||
|
||||
[Toolbar plugin](toolbar/README.md) is an example of a GUI plugin. It presents
|
||||
a toolbar where other plugins can add their buttons in a centralized fashion.
|
||||
|
||||
Remember that for default plugins, even GUI plugins, no html files, css files
|
||||
or images are allowed. Everything must be generated from javascript. The idea
|
||||
is that users can theme widgets with their own CSS. (A plugin is of course welcome
|
||||
to provide example CSS that can be copypasted :-)
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
If *pluginB* depends on the existence of *pluginA*, and also *pluginA* must run
|
||||
before *pluginB*, then *pluginB* should not listen to the `impress:init` event,
|
||||
rather *pluginA* should send its own init event, which *pluginB* listens to.
|
||||
|
||||
Example:
|
||||
|
||||
// pluginA
|
||||
document.addEventListener("impress:init", function (event) {
|
||||
// plugin A does it's own initialization first...
|
||||
|
||||
// Signal other plugins that plugin A is now initialized
|
||||
var root = document.querySelector( "div#impress" );
|
||||
var event = document.createEvent("CustomEvent");
|
||||
event.initCustomEvent("impress:plugina:init', true, true, { "plugina" : "data..." });
|
||||
root.dispatchEvent(event);
|
||||
}, false);
|
||||
|
||||
// pluginB
|
||||
document.addEventListener("impress:init", function (event) {
|
||||
// plugin B implementation
|
||||
}, false);
|
||||
|
||||
A plugin should use the namespace `impress:pluginname:*` for any events it sends.
|
||||
|
||||
In theory all plugins could always send an `init` and other events, but in
|
||||
practice we're adding them on an as needed basis.
|
||||
159
src/plugins/autoplay/autoplay.js
Normal file
@@ -0,0 +1,159 @@
|
||||
/**
|
||||
* Autoplay plugin - Automatically advance slideshow after N seconds
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo, henrik.ingo@avoinelama.fi
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global clearTimeout, setTimeout, document */
|
||||
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
|
||||
var autoplayDefault = 0;
|
||||
var currentStepTimeout = 0;
|
||||
var api = null;
|
||||
var timeoutHandle = null;
|
||||
var root = null;
|
||||
var util;
|
||||
|
||||
// On impress:init, check whether there is a default setting, as well as
|
||||
// handle step-1.
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
util = event.detail.api.lib.util;
|
||||
|
||||
// Getting API from event data instead of global impress().init().
|
||||
// You don't even need to know what is the id of the root element
|
||||
// or anything. `impress:init` event data gives you everything you
|
||||
// need to control the presentation that was just initialized.
|
||||
api = event.detail.api;
|
||||
root = event.target;
|
||||
|
||||
// Element attributes starting with "data-", become available under
|
||||
// element.dataset. In addition hyphenized words become camelCased.
|
||||
var data = root.dataset;
|
||||
|
||||
if ( data.autoplay ) {
|
||||
autoplayDefault = util.toNumber( data.autoplay, 0 );
|
||||
}
|
||||
|
||||
var toolbar = document.querySelector( "#impress-toolbar" );
|
||||
if ( toolbar ) {
|
||||
addToolbarButton( toolbar );
|
||||
}
|
||||
|
||||
api.lib.gc.pushCallback( function() {
|
||||
clearTimeout( timeoutHandle );
|
||||
} );
|
||||
|
||||
// Note that right after impress:init event, also impress:stepenter is
|
||||
// triggered for the first slide, so that's where code flow continues.
|
||||
}, false );
|
||||
|
||||
// If default autoplay time was defined in the presentation root, or
|
||||
// in this step, set timeout.
|
||||
var reloadTimeout = function( event ) {
|
||||
var step = event.target;
|
||||
currentStepTimeout = util.toNumber( step.dataset.autoplay, autoplayDefault );
|
||||
if ( status === "paused" ) {
|
||||
setAutoplayTimeout( 0 );
|
||||
} else {
|
||||
setAutoplayTimeout( currentStepTimeout );
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener( "impress:stepenter", function( event ) {
|
||||
reloadTimeout( event );
|
||||
}, false );
|
||||
|
||||
document.addEventListener( "impress:substep:stepleaveaborted", function( event ) {
|
||||
reloadTimeout( event );
|
||||
}, false );
|
||||
|
||||
/**
|
||||
* Set timeout after which we move to next() step.
|
||||
*/
|
||||
var setAutoplayTimeout = function( timeout ) {
|
||||
if ( timeoutHandle ) {
|
||||
clearTimeout( timeoutHandle );
|
||||
}
|
||||
|
||||
if ( timeout > 0 ) {
|
||||
timeoutHandle = setTimeout( function() { api.next(); }, timeout * 1000 );
|
||||
}
|
||||
setButtonText();
|
||||
};
|
||||
|
||||
/*** Toolbar plugin integration *******************************************/
|
||||
var status = "not clicked";
|
||||
var toolbarButton = null;
|
||||
|
||||
// Copied from core impress.js. Good candidate for moving to a utilities collection.
|
||||
var triggerEvent = function( el, eventName, detail ) {
|
||||
var event = document.createEvent( "CustomEvent" );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
el.dispatchEvent( event );
|
||||
};
|
||||
|
||||
var makeDomElement = function( html ) {
|
||||
var tempDiv = document.createElement( "div" );
|
||||
tempDiv.innerHTML = html;
|
||||
return tempDiv.firstChild;
|
||||
};
|
||||
|
||||
var toggleStatus = function() {
|
||||
if ( currentStepTimeout > 0 && status !== "paused" ) {
|
||||
status = "paused";
|
||||
} else {
|
||||
status = "playing";
|
||||
}
|
||||
};
|
||||
|
||||
var getButtonText = function() {
|
||||
if ( currentStepTimeout > 0 && status !== "paused" ) {
|
||||
return "||"; // Pause
|
||||
} else {
|
||||
return "▶"; // Play
|
||||
}
|
||||
};
|
||||
|
||||
var setButtonText = function() {
|
||||
if ( toolbarButton ) {
|
||||
|
||||
// Keep button size the same even if label content is changing
|
||||
var buttonWidth = toolbarButton.offsetWidth;
|
||||
var buttonHeight = toolbarButton.offsetHeight;
|
||||
toolbarButton.innerHTML = getButtonText();
|
||||
if ( !toolbarButton.style.width ) {
|
||||
toolbarButton.style.width = buttonWidth + "px";
|
||||
}
|
||||
if ( !toolbarButton.style.height ) {
|
||||
toolbarButton.style.height = buttonHeight + "px";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var addToolbarButton = function( toolbar ) {
|
||||
var html = '<button id="impress-autoplay-playpause" ' + // jshint ignore:line
|
||||
'title="Autoplay" class="impress-autoplay">' + // jshint ignore:line
|
||||
getButtonText() + "</button>"; // jshint ignore:line
|
||||
toolbarButton = makeDomElement( html );
|
||||
toolbarButton.addEventListener( "click", function() {
|
||||
toggleStatus();
|
||||
if ( status === "playing" ) {
|
||||
if ( autoplayDefault === 0 ) {
|
||||
autoplayDefault = 7;
|
||||
}
|
||||
if ( currentStepTimeout === 0 ) {
|
||||
currentStepTimeout = autoplayDefault;
|
||||
}
|
||||
setAutoplayTimeout( currentStepTimeout );
|
||||
} else if ( status === "paused" ) {
|
||||
setAutoplayTimeout( 0 );
|
||||
}
|
||||
} );
|
||||
|
||||
triggerEvent( toolbar, "impress:toolbar:appendChild",
|
||||
{ group: 10, element: toolbarButton } );
|
||||
};
|
||||
|
||||
} )( document );
|
||||
114
src/plugins/blackout/blackout.js
Normal file
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Blackout plugin
|
||||
*
|
||||
* Press Ctrl+b to hide all slides, and Ctrl+b again to show them.
|
||||
* Also navigating to a different slide will show them again (impress:stepleave).
|
||||
*
|
||||
* Copyright 2014 @Strikeskids
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global document */
|
||||
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
|
||||
var canvas = null;
|
||||
var blackedOut = false;
|
||||
|
||||
// While waiting for a shared library of utilities, copying these 2 from main impress.js
|
||||
var css = function( el, props ) {
|
||||
var key, pkey;
|
||||
for ( key in props ) {
|
||||
if ( props.hasOwnProperty( key ) ) {
|
||||
pkey = pfx( key );
|
||||
if ( pkey !== null ) {
|
||||
el.style[ pkey ] = props[ key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
return el;
|
||||
};
|
||||
|
||||
var pfx = ( function() {
|
||||
|
||||
var style = document.createElement( "dummy" ).style,
|
||||
prefixes = "Webkit Moz O ms Khtml".split( " " ),
|
||||
memory = {};
|
||||
|
||||
return function( prop ) {
|
||||
if ( typeof memory[ prop ] === "undefined" ) {
|
||||
|
||||
var ucProp = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),
|
||||
props = ( prop + " " + prefixes.join( ucProp + " " ) + ucProp ).split( " " );
|
||||
|
||||
memory[ prop ] = null;
|
||||
for ( var i in props ) {
|
||||
if ( style[ props[ i ] ] !== undefined ) {
|
||||
memory[ prop ] = props[ i ];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return memory[ prop ];
|
||||
};
|
||||
|
||||
} )();
|
||||
|
||||
var removeBlackout = function() {
|
||||
if ( blackedOut ) {
|
||||
css( canvas, {
|
||||
display: "block"
|
||||
} );
|
||||
blackedOut = false;
|
||||
}
|
||||
};
|
||||
|
||||
var blackout = function() {
|
||||
if ( blackedOut ) {
|
||||
removeBlackout();
|
||||
} else {
|
||||
css( canvas, {
|
||||
display: ( blackedOut = !blackedOut ) ? "none" : "block"
|
||||
} );
|
||||
blackedOut = true;
|
||||
}
|
||||
};
|
||||
|
||||
// Wait for impress.js to be initialized
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
var api = event.detail.api;
|
||||
var root = event.target;
|
||||
canvas = root.firstElementChild;
|
||||
var gc = api.lib.gc;
|
||||
|
||||
gc.addEventListener( document, "keydown", function( event ) {
|
||||
if ( event.ctrlKey && event.keyCode === 66 ) {
|
||||
event.preventDefault();
|
||||
if ( !blackedOut ) {
|
||||
blackout();
|
||||
} else {
|
||||
|
||||
// Note: This doesn't work on Firefox. It will set display:block,
|
||||
// but slides only become visible again upon next transition, which
|
||||
// forces some kind of redraw. Works as intended on Chrome.
|
||||
removeBlackout();
|
||||
}
|
||||
}
|
||||
}, false );
|
||||
|
||||
gc.addEventListener( document, "keyup", function( event ) {
|
||||
if ( event.ctrlKey && event.keyCode === 66 ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
|
||||
}, false );
|
||||
|
||||
document.addEventListener( "impress:stepleave", function() {
|
||||
removeBlackout();
|
||||
}, false );
|
||||
|
||||
} )( document );
|
||||
|
||||
26
src/plugins/extras/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
Extras Plugin
|
||||
=============
|
||||
|
||||
The Extras plugin will initialize the optional addon plugins from
|
||||
[extras/](../../../extras/) directory, if they were loaded.
|
||||
|
||||
Generally, for an extras plugin to have been loaded, 2 things must have happened:
|
||||
|
||||
1. The extras plugins must be present in extras/ directory, for example after
|
||||
running `git submodule update`
|
||||
2. One or more extras plugins are added to the impress.js presentation (the HTML
|
||||
file) by the author using a regular `<script>` tag.
|
||||
|
||||
If one or more extras plugins were so added, this plugin will automatically
|
||||
discover them and perform initialization (such as calling
|
||||
`mermaid.initialize()`).
|
||||
|
||||
If no extras plugins are added to a presentation, this plugin does nothing.
|
||||
|
||||
Note that some extra plugins (like mathjax) initialize themselves immediately, and
|
||||
there's nothing to do here.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Henrik Ingo (@henrikingo), 2016
|
||||
69
src/plugins/extras/extras.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Extras Plugin
|
||||
*
|
||||
* This plugin performs initialization (like calling mermaid.initialize())
|
||||
* for the extras/ plugins if they are loaded into a presentation.
|
||||
*
|
||||
* See README.md for details.
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global markdown, hljs, mermaid, impress, document, window */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
|
||||
var preInit = function() {
|
||||
if ( window.markdown ) {
|
||||
|
||||
// Unlike the other extras, Markdown.js doesn't by default do anything in
|
||||
// particular. We do it ourselves here.
|
||||
// In addition, we use "-----" as a delimiter for new slide.
|
||||
|
||||
// Query all .markdown elements and translate to HTML
|
||||
var markdownDivs = document.querySelectorAll( ".markdown" );
|
||||
for ( var idx = 0; idx < markdownDivs.length; idx++ ) {
|
||||
var element = markdownDivs[ idx ];
|
||||
|
||||
var slides = element.textContent.split( /^-----$/m );
|
||||
var i = slides.length - 1;
|
||||
element.innerHTML = markdown.toHTML( slides[ i ] );
|
||||
|
||||
// If there's an id, unset it for last, and all other, elements,
|
||||
// and then set it for the first.
|
||||
var id = null;
|
||||
if ( element.id ) {
|
||||
id = element.id;
|
||||
element.id = "";
|
||||
}
|
||||
i--;
|
||||
while ( i >= 0 ) {
|
||||
var newElement = element.cloneNode( false );
|
||||
newElement.innerHTML = markdown.toHTML( slides[ i ] );
|
||||
element.parentNode.insertBefore( newElement, element );
|
||||
element = newElement;
|
||||
i--;
|
||||
}
|
||||
if ( id !== null ) {
|
||||
element.id = id;
|
||||
}
|
||||
}
|
||||
} // Markdown
|
||||
|
||||
if ( window.hljs ) {
|
||||
hljs.initHighlightingOnLoad();
|
||||
}
|
||||
|
||||
if ( window.mermaid ) {
|
||||
mermaid.initialize( { startOnLoad:true } );
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin to be called in pre-init phase
|
||||
// Note: Markdown.js should run early/first, because it creates new div elements.
|
||||
// So add this with a lower-than-default weight.
|
||||
impress.addPreInitPlugin( preInit, 1 );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
28
src/plugins/form/form.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Form support
|
||||
*
|
||||
* Functionality to better support use of input, textarea, button... elements in a presentation.
|
||||
*
|
||||
* Currently this does only one single thing: 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo
|
||||
* MIT License
|
||||
*/
|
||||
/* global document */
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
|
||||
document.addEventListener( "impress:stepleave", function() {
|
||||
document.activeElement.blur();
|
||||
}, false );
|
||||
|
||||
} )( document );
|
||||
|
||||
27
src/plugins/goto/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
Goto Plugin
|
||||
===========
|
||||
|
||||
The goto plugin is a pre-stepleave plugin. It is executed before
|
||||
`impress:stepleave` event, and will alter the destination where to transition next.
|
||||
|
||||
Example:
|
||||
|
||||
<!-- When leaving this step, go directly to "step-5" -->
|
||||
<div class="step" data-goto="step-5">
|
||||
|
||||
<!-- When leaving this step with next(), go directly to "step-5", instead of the next step.
|
||||
If moving backwards to previous step - e.g. prev() instead of next() - then go to "step-1". -->
|
||||
<div class="step" data-goto-next="step-5" data-goto-prev="step-1">
|
||||
|
||||
<!-- data-goto-key-list and data-goto-next-list allow you to build advanced non-linear navigation. -->
|
||||
<div class="step" data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft" data-goto-next-list="step-4 step-3 step-2 step-5">
|
||||
|
||||
See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values for a table
|
||||
of what strings to use for each key.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license.
|
||||
|
||||
178
src/plugins/goto/goto.js
Normal file
@@ -0,0 +1,178 @@
|
||||
/**
|
||||
* Goto Plugin
|
||||
*
|
||||
* The goto plugin is a pre-stepleave plugin. It is executed before impress:stepleave,
|
||||
* and will alter the destination where to transition next.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <!-- When leaving this step, go directly to "step-5" -->
|
||||
* <div class="step" data-goto="step-5">
|
||||
*
|
||||
* <!-- When leaving this step with next(), go directly to "step-5", instead of next step.
|
||||
* If moving backwards to previous step - e.g. prev() instead of next() -
|
||||
* then go to "step-1". -->
|
||||
* <div class="step" data-goto-next="step-5" data-goto-prev="step-1">
|
||||
*
|
||||
* <!-- data-goto-key-list and data-goto-next-list allow you to build advanced non-linear
|
||||
* navigation. -->
|
||||
* <div class="step"
|
||||
* data-goto-key-list="ArrowUp ArrowDown ArrowRight ArrowLeft"
|
||||
* data-goto-next-list="step-4 step-3 step-2 step-5">
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values for a table
|
||||
* of what strings to use for each key.
|
||||
*
|
||||
* Copyright 2016-2017 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global window, document, impress */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var lib;
|
||||
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
lib = event.detail.api.lib;
|
||||
}, false );
|
||||
|
||||
var isNumber = function( numeric ) {
|
||||
return !isNaN( numeric );
|
||||
};
|
||||
|
||||
var goto = function( event ) {
|
||||
if ( ( !event ) || ( !event.target ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = event.target.dataset;
|
||||
var steps = document.querySelectorAll( ".step" );
|
||||
|
||||
// Data-goto-key-list="" & data-goto-next-list="" //////////////////////////////////////////
|
||||
if ( data.gotoKeyList !== undefined &&
|
||||
data.gotoNextList !== undefined &&
|
||||
event.origEvent !== undefined &&
|
||||
event.origEvent.key !== undefined ) {
|
||||
var keylist = data.gotoKeyList.split( " " );
|
||||
var nextlist = data.gotoNextList.split( " " );
|
||||
|
||||
if ( keylist.length !== nextlist.length ) {
|
||||
window.console.log(
|
||||
"impress goto plugin: data-goto-key-list and data-goto-next-list don't match:"
|
||||
);
|
||||
window.console.log( keylist );
|
||||
window.console.log( nextlist );
|
||||
|
||||
// Don't return, allow the other categories to work despite this error
|
||||
} else {
|
||||
var index = keylist.indexOf( event.origEvent.key );
|
||||
if ( index >= 0 ) {
|
||||
var next = nextlist[ index ];
|
||||
if ( isNumber( next ) ) {
|
||||
event.detail.next = steps[ next ];
|
||||
|
||||
// If the new next element has its own transitionDuration, we're responsible
|
||||
// for setting that on the event as well
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration,
|
||||
event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
var newTarget = document.getElementById( next );
|
||||
if ( newTarget && newTarget.classList.contains( "step" ) ) {
|
||||
event.detail.next = newTarget;
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration,
|
||||
event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
window.console.log( "impress goto plugin: " + next +
|
||||
" is not a step in this impress presentation." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Data-goto-next="" & data-goto-prev="" ///////////////////////////////////////////////////
|
||||
|
||||
// Handle event.target data-goto-next attribute
|
||||
if ( isNumber( data.gotoNext ) && event.detail.reason === "next" ) {
|
||||
event.detail.next = steps[ data.gotoNext ];
|
||||
|
||||
// If the new next element has its own transitionDuration, we're responsible for setting
|
||||
// that on the event as well
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration, event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
}
|
||||
if ( data.gotoNext && event.detail.reason === "next" ) {
|
||||
var newTarget = document.getElementById( data.gotoNext ); // jshint ignore:line
|
||||
if ( newTarget && newTarget.classList.contains( "step" ) ) {
|
||||
event.detail.next = newTarget;
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration,
|
||||
event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
window.console.log( "impress goto plugin: " + data.gotoNext +
|
||||
" is not a step in this impress presentation." );
|
||||
}
|
||||
}
|
||||
|
||||
// Handle event.target data-goto-prev attribute
|
||||
if ( isNumber( data.gotoPrev ) && event.detail.reason === "prev" ) {
|
||||
event.detail.next = steps[ data.gotoPrev ];
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration, event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
}
|
||||
if ( data.gotoPrev && event.detail.reason === "prev" ) {
|
||||
var newTarget = document.getElementById( data.gotoPrev ); // jshint ignore:line
|
||||
if ( newTarget && newTarget.classList.contains( "step" ) ) {
|
||||
event.detail.next = newTarget;
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration, event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
window.console.log( "impress goto plugin: " + data.gotoPrev +
|
||||
" is not a step in this impress presentation." );
|
||||
}
|
||||
}
|
||||
|
||||
// Data-goto="" ///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Handle event.target data-goto attribute
|
||||
if ( isNumber( data.goto ) ) {
|
||||
event.detail.next = steps[ data.goto ];
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration, event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
}
|
||||
if ( data.goto ) {
|
||||
var newTarget = document.getElementById( data.goto ); // jshint ignore:line
|
||||
if ( newTarget && newTarget.classList.contains( "step" ) ) {
|
||||
event.detail.next = newTarget;
|
||||
event.detail.transitionDuration = lib.util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration, event.detail.transitionDuration
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
window.console.log( "impress goto plugin: " + data.goto +
|
||||
" is not a step in this impress presentation." );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin to be called in pre-stepleave phase
|
||||
impress.addPreStepLeavePlugin( goto );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
37
src/plugins/help/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
Help screen plugin
|
||||
===================
|
||||
|
||||
Shows a help popup when a presentation is loaded, as well as when 'H' is pressed.
|
||||
|
||||
To enable the help popup, add following div to your presentation:
|
||||
|
||||
<div id="impress-help"></div>
|
||||
|
||||
Example CSS:
|
||||
|
||||
.impress-enabled #impress-help {
|
||||
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
|
||||
color: #EEEEEE;
|
||||
font-size: 80%;
|
||||
position: fixed;
|
||||
left: 2em;
|
||||
bottom: 2em;
|
||||
width: 24em;
|
||||
border-radius: 1em;
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
z-index: 100;
|
||||
font-family: Verdana, Arial, Sans;
|
||||
}
|
||||
.impress-enabled #impress-help td {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Copyright Henrik Ingo (@henrikingo), 2016
|
||||
MIT License
|
||||
122
src/plugins/help/help.js
Normal file
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* Help popup plugin
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <!-- Show a help popup at start, or if user presses "H" -->
|
||||
* <div id="impress-help"></div>
|
||||
*
|
||||
* For developers:
|
||||
*
|
||||
* Typical use for this plugin, is for plugins that support some keypress, to add a line
|
||||
* to the help popup produced by this plugin. For example "P: Presenter console".
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global window, document */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var rows = [];
|
||||
var timeoutHandle;
|
||||
|
||||
var triggerEvent = function( el, eventName, detail ) {
|
||||
var event = document.createEvent( "CustomEvent" );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
el.dispatchEvent( event );
|
||||
};
|
||||
|
||||
var renderHelpDiv = function() {
|
||||
var helpDiv = document.getElementById( "impress-help" );
|
||||
if ( helpDiv ) {
|
||||
var html = [];
|
||||
for ( var row in rows ) {
|
||||
for ( var arrayItem in row ) {
|
||||
html.push( rows[ row ][ arrayItem ] );
|
||||
}
|
||||
}
|
||||
if ( html ) {
|
||||
helpDiv.innerHTML = "<table>\n" + html.join( "\n" ) + "</table>\n";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var toggleHelp = function() {
|
||||
var helpDiv = document.getElementById( "impress-help" );
|
||||
if ( !helpDiv ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( helpDiv.style.display === "block" ) {
|
||||
helpDiv.style.display = "none";
|
||||
} else {
|
||||
helpDiv.style.display = "block";
|
||||
window.clearTimeout( timeoutHandle );
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener( "keyup", function( event ) {
|
||||
|
||||
// Check that event target is html or body element.
|
||||
if ( event.target.nodeName === "BODY" || event.target.nodeName === "HTML" ) {
|
||||
if ( event.keyCode === 72 ) { // "h"
|
||||
event.preventDefault();
|
||||
toggleHelp();
|
||||
}
|
||||
}
|
||||
}, false );
|
||||
|
||||
// API
|
||||
// Other plugins can add help texts, typically if they support an action on a keypress.
|
||||
/**
|
||||
* Add a help text to the help popup.
|
||||
*
|
||||
* :param: e.detail.command Example: "H"
|
||||
* :param: e.detail.text Example: "Show this help."
|
||||
* :param: e.detail.row Row index from 0 to 9 where to place this help text. Example: 0
|
||||
*/
|
||||
document.addEventListener( "impress:help:add", function( e ) {
|
||||
|
||||
// The idea is for the sender of the event to supply a unique row index, used for sorting.
|
||||
// But just in case two plugins would ever use the same row index, we wrap each row into
|
||||
// its own array. If there are more than one entry for the same index, they are shown in
|
||||
// first come, first serve ordering.
|
||||
var rowIndex = e.detail.row;
|
||||
if ( typeof rows[ rowIndex ] !== "object" || !rows[ rowIndex ].isArray ) {
|
||||
rows[ rowIndex ] = [];
|
||||
}
|
||||
rows[ e.detail.row ].push( "<tr><td><strong>" + e.detail.command + "</strong></td><td>" +
|
||||
e.detail.text + "</td></tr>" );
|
||||
renderHelpDiv();
|
||||
} );
|
||||
|
||||
document.addEventListener( "impress:init", function( e ) {
|
||||
renderHelpDiv();
|
||||
|
||||
// At start, show the help for 7 seconds.
|
||||
var helpDiv = document.getElementById( "impress-help" );
|
||||
if ( helpDiv ) {
|
||||
helpDiv.style.display = "block";
|
||||
timeoutHandle = window.setTimeout( function() {
|
||||
var helpDiv = document.getElementById( "impress-help" );
|
||||
helpDiv.style.display = "none";
|
||||
}, 7000 );
|
||||
|
||||
// Regster callback to empty the help div on teardown
|
||||
var api = e.detail.api;
|
||||
api.lib.gc.pushCallback( function() {
|
||||
window.clearTimeout( timeoutHandle );
|
||||
helpDiv.style.display = "";
|
||||
helpDiv.innerHTML = "";
|
||||
rows = [];
|
||||
} );
|
||||
}
|
||||
|
||||
// Use our own API to register the help text for "h"
|
||||
triggerEvent( document, "impress:help:add",
|
||||
{ command: "H", text: "Show this help", row: 0 } );
|
||||
} );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
33
src/plugins/impressConsole/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
Impress Console Plugin
|
||||
======================
|
||||
|
||||
Press 'P' to show a speaker console window.
|
||||
|
||||
* View of current slide
|
||||
* Preview of next slide
|
||||
* Speaker notes (contents of a <div class="notes"> element on current slide)
|
||||
* Navigation
|
||||
|
||||
For speaker notes, add the following anywhere inside a step
|
||||
|
||||
<div class="notes">Speaker notes text...</div>
|
||||
|
||||
Example CSS:
|
||||
|
||||
/* Hide notes from the actual presentation. This will not affect the visibility of notes in the impress console window. */
|
||||
|
||||
.notes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Credits
|
||||
-------
|
||||
|
||||
* Henrik Ingo, henrik.ingo@avoinelama.fi, impress.js (plugin) integration
|
||||
* Heiko Richler, Aico.Richler@gmx.net, major changes in rev. 1.3
|
||||
* Lennart Regebro, regebro@gmail.com, main author of impressConsole
|
||||
* David Souther, davidsouther@gmail.com, author of the original notes.js
|
||||
|
||||
MIT License
|
||||
747
src/plugins/impressConsole/impressConsole.js
Normal file
@@ -0,0 +1,747 @@
|
||||
/**
|
||||
* Adds a presenter console to impress.js
|
||||
*
|
||||
* MIT Licensed, see license.txt.
|
||||
*
|
||||
* Copyright 2012, 2013, 2015 impress-console contributors (see README.txt)
|
||||
*
|
||||
* version: 1.3-dev
|
||||
*
|
||||
*/
|
||||
|
||||
// This file contains so much HTML, that we will just respectfully disagree about js
|
||||
/* jshint quotmark:single */
|
||||
/* global navigator, top, setInterval, clearInterval, document, window */
|
||||
|
||||
( function( document, window ) {
|
||||
'use strict';
|
||||
|
||||
// TODO: Move this to src/lib/util.js
|
||||
var triggerEvent = function( el, eventName, detail ) {
|
||||
var event = document.createEvent( 'CustomEvent' );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
el.dispatchEvent( event );
|
||||
};
|
||||
|
||||
// Create Language object depending on browsers language setting
|
||||
var lang;
|
||||
switch ( navigator.language ) {
|
||||
case 'de':
|
||||
lang = {
|
||||
'noNotes': '<div class="noNotes">Keine Notizen hierzu</div>',
|
||||
'restart': 'Neustart',
|
||||
'clickToOpen': 'Klicken um Sprecherkonsole zu öffnen',
|
||||
'prev': 'zurück',
|
||||
'next': 'weiter',
|
||||
'loading': 'initalisiere',
|
||||
'ready': 'Bereit',
|
||||
'moving': 'in Bewegung',
|
||||
'useAMPM': false
|
||||
};
|
||||
break;
|
||||
case 'en': // jshint ignore:line
|
||||
default : // jshint ignore:line
|
||||
lang = {
|
||||
'noNotes': '<div class="noNotes">No notes for this step</div>',
|
||||
'restart': 'Restart',
|
||||
'clickToOpen': 'Click to open speaker console',
|
||||
'prev': 'Prev',
|
||||
'next': 'Next',
|
||||
'loading': 'Loading',
|
||||
'ready': 'Ready',
|
||||
'moving': 'Moving',
|
||||
'useAMPM': false
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
// Settings to set iframe in speaker console
|
||||
const preViewDefaultFactor = 0.7;
|
||||
const preViewMinimumFactor = 0.5;
|
||||
const preViewGap = 4;
|
||||
|
||||
// This is the default template for the speaker console window
|
||||
const consoleTemplate = '<!DOCTYPE html>' +
|
||||
'<html id="impressconsole"><head>' +
|
||||
|
||||
// Order is important: If user provides a cssFile, those will win, because they're later
|
||||
'{{cssStyle}}' +
|
||||
'{{cssLink}}' +
|
||||
'</head><body>' +
|
||||
'<div id="console">' +
|
||||
'<div id="views">' +
|
||||
'<iframe id="slideView" scrolling="no"></iframe>' +
|
||||
'<iframe id="preView" scrolling="no"></iframe>' +
|
||||
'<div id="blocker"></div>' +
|
||||
'</div>' +
|
||||
'<div id="notes"></div>' +
|
||||
'</div>' +
|
||||
'<div id="controls"> ' +
|
||||
'<div id="prev"><a href="#" onclick="impress().prev(); return false;" />' +
|
||||
'{{prev}}</a></div>' +
|
||||
'<div id="next"><a href="#" onclick="impress().next(); return false;" />' +
|
||||
'{{next}}</a></div>' +
|
||||
'<div id="clock">--:--</div>' +
|
||||
'<div id="timer" onclick="timerReset()">00m 00s</div>' +
|
||||
'<div id="status">{{loading}}</div>' +
|
||||
'</div>' +
|
||||
'</body></html>';
|
||||
|
||||
// Default css location
|
||||
var cssFileOldDefault = 'css/impressConsole.css';
|
||||
var cssFile = undefined; // jshint ignore:line
|
||||
|
||||
// Css for styling iframs on the console
|
||||
var cssFileIframeOldDefault = 'css/iframe.css';
|
||||
var cssFileIframe = undefined; // jshint ignore:line
|
||||
|
||||
// All console windows, so that you can call impressConsole() repeatedly.
|
||||
var allConsoles = {};
|
||||
|
||||
// Zero padding helper function:
|
||||
var zeroPad = function( i ) {
|
||||
return ( i < 10 ? '0' : '' ) + i;
|
||||
};
|
||||
|
||||
// The console object
|
||||
var impressConsole = window.impressConsole = function( rootId ) {
|
||||
|
||||
rootId = rootId || 'impress';
|
||||
|
||||
if ( allConsoles[ rootId ] ) {
|
||||
return allConsoles[ rootId ];
|
||||
}
|
||||
|
||||
// Root presentation elements
|
||||
var root = document.getElementById( rootId );
|
||||
|
||||
var consoleWindow = null;
|
||||
|
||||
var nextStep = function() {
|
||||
var classes = '';
|
||||
var nextElement = document.querySelector( '.active' );
|
||||
|
||||
// Return to parents as long as there is no next sibling
|
||||
while ( !nextElement.nextElementSibling && nextElement.parentNode ) {
|
||||
nextElement = nextElement.parentNode;
|
||||
}
|
||||
nextElement = nextElement.nextElementSibling;
|
||||
while ( nextElement ) {
|
||||
classes = nextElement.attributes[ 'class' ];
|
||||
if ( classes && classes.value.indexOf( 'step' ) !== -1 ) {
|
||||
consoleWindow.document.getElementById( 'blocker' ).innerHTML = lang.next;
|
||||
return nextElement;
|
||||
}
|
||||
|
||||
if ( nextElement.firstElementChild ) { // First go into deep
|
||||
nextElement = nextElement.firstElementChild;
|
||||
} else {
|
||||
|
||||
// Go to next sibling or through parents until there is a next sibling
|
||||
while ( !nextElement.nextElementSibling && nextElement.parentNode ) {
|
||||
nextElement = nextElement.parentNode;
|
||||
}
|
||||
nextElement = nextElement.nextElementSibling;
|
||||
}
|
||||
}
|
||||
|
||||
// No next element. Pick the first
|
||||
consoleWindow.document.getElementById( 'blocker' ).innerHTML = lang.restart;
|
||||
return document.querySelector( '.step' );
|
||||
};
|
||||
|
||||
// Sync the notes to the step
|
||||
var onStepLeave = function() {
|
||||
if ( consoleWindow ) {
|
||||
|
||||
// Set notes to next steps notes.
|
||||
var newNotes = document.querySelector( '.active' ).querySelector( '.notes' );
|
||||
if ( newNotes ) {
|
||||
newNotes = newNotes.innerHTML;
|
||||
} else {
|
||||
newNotes = lang.noNotes;
|
||||
}
|
||||
consoleWindow.document.getElementById( 'notes' ).innerHTML = newNotes;
|
||||
|
||||
// Set the views
|
||||
var baseURL = document.URL.substring( 0, document.URL.search( '#/' ) );
|
||||
var slideSrc = baseURL + '#' + document.querySelector( '.active' ).id;
|
||||
var preSrc = baseURL + '#' + nextStep().id;
|
||||
var slideView = consoleWindow.document.getElementById( 'slideView' );
|
||||
|
||||
// Setting them when they are already set causes glithes in Firefox, so check first:
|
||||
if ( slideView.src !== slideSrc ) {
|
||||
slideView.src = slideSrc;
|
||||
}
|
||||
var preView = consoleWindow.document.getElementById( 'preView' );
|
||||
if ( preView.src !== preSrc ) {
|
||||
preView.src = preSrc;
|
||||
}
|
||||
|
||||
consoleWindow.document.getElementById( 'status' ).innerHTML =
|
||||
'<span class="moving">' + lang.moving + '</span>';
|
||||
}
|
||||
};
|
||||
|
||||
// Sync the previews to the step
|
||||
var onStepEnter = function() {
|
||||
if ( consoleWindow ) {
|
||||
|
||||
// We do everything here again, because if you stopped the previos step to
|
||||
// early, the onstepleave trigger is not called for that step, so
|
||||
// we need this to sync things.
|
||||
var newNotes = document.querySelector( '.active' ).querySelector( '.notes' );
|
||||
if ( newNotes ) {
|
||||
newNotes = newNotes.innerHTML;
|
||||
} else {
|
||||
newNotes = lang.noNotes;
|
||||
}
|
||||
var notes = consoleWindow.document.getElementById( 'notes' );
|
||||
notes.innerHTML = newNotes;
|
||||
notes.scrollTop = 0;
|
||||
|
||||
// Set the views
|
||||
var baseURL = document.URL.substring( 0, document.URL.search( '#/' ) );
|
||||
var slideSrc = baseURL + '#' + document.querySelector( '.active' ).id;
|
||||
var preSrc = baseURL + '#' + nextStep().id;
|
||||
var slideView = consoleWindow.document.getElementById( 'slideView' );
|
||||
|
||||
// Setting them when they are already set causes glithes in Firefox, so check first:
|
||||
if ( slideView.src !== slideSrc ) {
|
||||
slideView.src = slideSrc;
|
||||
}
|
||||
var preView = consoleWindow.document.getElementById( 'preView' );
|
||||
if ( preView.src !== preSrc ) {
|
||||
preView.src = preSrc;
|
||||
}
|
||||
|
||||
consoleWindow.document.getElementById( 'status' ).innerHTML =
|
||||
'<span class="ready">' + lang.ready + '</span>';
|
||||
}
|
||||
};
|
||||
|
||||
// Sync substeps
|
||||
var onSubstep = function( event ) {
|
||||
if ( consoleWindow ) {
|
||||
if ( event.detail.reason === 'next' ) {
|
||||
onSubstepShow();
|
||||
}
|
||||
if ( event.detail.reason === 'prev' ) {
|
||||
onSubstepHide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var onSubstepShow = function() {
|
||||
var slideView = consoleWindow.document.getElementById( 'slideView' );
|
||||
triggerEventInView( slideView, 'impress:substep:show' );
|
||||
};
|
||||
|
||||
var onSubstepHide = function() {
|
||||
var slideView = consoleWindow.document.getElementById( 'slideView' );
|
||||
triggerEventInView( slideView, 'impress:substep:hide' );
|
||||
};
|
||||
|
||||
var triggerEventInView = function( frame, eventName, detail ) {
|
||||
|
||||
// Note: Unfortunately Chrome does not allow createEvent on file:// URLs, so this won't
|
||||
// work. This does work on Firefox, and should work if viewing the presentation on a
|
||||
// http:// URL on Chrome.
|
||||
var event = frame.contentDocument.createEvent( 'CustomEvent' );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
frame.contentDocument.dispatchEvent( event );
|
||||
};
|
||||
|
||||
var spaceHandler = function() {
|
||||
var notes = consoleWindow.document.getElementById( 'notes' );
|
||||
if ( notes.scrollTopMax - notes.scrollTop > 20 ) {
|
||||
notes.scrollTop = notes.scrollTop + notes.clientHeight * 0.8;
|
||||
} else {
|
||||
window.impress().next();
|
||||
}
|
||||
};
|
||||
|
||||
var timerReset = function() {
|
||||
consoleWindow.timerStart = new Date();
|
||||
};
|
||||
|
||||
// Show a clock
|
||||
var clockTick = function() {
|
||||
var now = new Date();
|
||||
var hours = now.getHours();
|
||||
var minutes = now.getMinutes();
|
||||
var seconds = now.getSeconds();
|
||||
var ampm = '';
|
||||
|
||||
if ( lang.useAMPM ) {
|
||||
ampm = ( hours < 12 ) ? 'AM' : 'PM';
|
||||
hours = ( hours > 12 ) ? hours - 12 : hours;
|
||||
hours = ( hours === 0 ) ? 12 : hours;
|
||||
}
|
||||
|
||||
// Clock
|
||||
var clockStr = zeroPad( hours ) + ':' + zeroPad( minutes ) + ':' + zeroPad( seconds ) +
|
||||
' ' + ampm;
|
||||
consoleWindow.document.getElementById( 'clock' ).firstChild.nodeValue = clockStr;
|
||||
|
||||
// Timer
|
||||
seconds = Math.floor( ( now - consoleWindow.timerStart ) / 1000 );
|
||||
minutes = Math.floor( seconds / 60 );
|
||||
seconds = Math.floor( seconds % 60 );
|
||||
consoleWindow.document.getElementById( 'timer' ).firstChild.nodeValue =
|
||||
zeroPad( minutes ) + 'm ' + zeroPad( seconds ) + 's';
|
||||
|
||||
if ( !consoleWindow.initialized ) {
|
||||
|
||||
// Nudge the slide windows after load, or they will scrolled wrong on Firefox.
|
||||
consoleWindow.document.getElementById( 'slideView' ).contentWindow.scrollTo( 0, 0 );
|
||||
consoleWindow.document.getElementById( 'preView' ).contentWindow.scrollTo( 0, 0 );
|
||||
consoleWindow.initialized = true;
|
||||
}
|
||||
};
|
||||
|
||||
var registerKeyEvent = function( keyCodes, handler, window ) {
|
||||
if ( window === undefined ) {
|
||||
window = consoleWindow;
|
||||
}
|
||||
|
||||
// Prevent default keydown action when one of supported key is pressed
|
||||
window.document.addEventListener( 'keydown', function( event ) {
|
||||
if ( !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey &&
|
||||
keyCodes.indexOf( event.keyCode ) !== -1 ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Trigger impress action on keyup
|
||||
window.document.addEventListener( 'keyup', function( event ) {
|
||||
if ( !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey &&
|
||||
keyCodes.indexOf( event.keyCode ) !== -1 ) {
|
||||
handler();
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
};
|
||||
|
||||
var consoleOnLoad = function() {
|
||||
var slideView = consoleWindow.document.getElementById( 'slideView' );
|
||||
var preView = consoleWindow.document.getElementById( 'preView' );
|
||||
|
||||
// Firefox:
|
||||
slideView.contentDocument.body.classList.add( 'impress-console' );
|
||||
preView.contentDocument.body.classList.add( 'impress-console' );
|
||||
if ( cssFileIframe !== undefined ) {
|
||||
slideView.contentDocument.head.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<link rel="stylesheet" type="text/css" href="' + cssFileIframe + '">'
|
||||
);
|
||||
preView.contentDocument.head.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<link rel="stylesheet" type="text/css" href="' + cssFileIframe + '">'
|
||||
);
|
||||
}
|
||||
|
||||
// Chrome:
|
||||
slideView.addEventListener( 'load', function() {
|
||||
slideView.contentDocument.body.classList.add( 'impress-console' );
|
||||
if ( cssFileIframe !== undefined ) {
|
||||
slideView.contentDocument.head.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<link rel="stylesheet" type="text/css" href="' +
|
||||
cssFileIframe + '">'
|
||||
);
|
||||
}
|
||||
} );
|
||||
preView.addEventListener( 'load', function() {
|
||||
preView.contentDocument.body.classList.add( 'impress-console' );
|
||||
if ( cssFileIframe !== undefined ) {
|
||||
preView.contentDocument.head.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<link rel="stylesheet" type="text/css" href="' +
|
||||
cssFileIframe + '">' );
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
var open = function() {
|
||||
if ( top.isconsoleWindow ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( consoleWindow && !consoleWindow.closed ) {
|
||||
consoleWindow.focus();
|
||||
} else {
|
||||
consoleWindow = window.open( '', 'impressConsole' );
|
||||
|
||||
// If opening failes this may be because the browser prevents this from
|
||||
// not (or less) interactive JavaScript...
|
||||
if ( consoleWindow == null ) {
|
||||
|
||||
// ... so I add a button to klick.
|
||||
// workaround on firefox
|
||||
var message = document.createElement( 'div' );
|
||||
message.id = 'consoleWindowError';
|
||||
message.style.position = 'fixed';
|
||||
message.style.left = 0;
|
||||
message.style.top = 0;
|
||||
message.style.right = 0;
|
||||
message.style.bottom = 0;
|
||||
message.style.backgroundColor = 'rgba(255, 255, 255, 0.9)';
|
||||
var onClickStr = 'var x = document.getElementById(\'consoleWindowError\');' +
|
||||
'x.parentNode.removeChild(x);impressConsole().open();';
|
||||
message.innerHTML = '<button style="margin: 25vh 25vw;width:50vw;height:50vh;' +
|
||||
'onclick="' + onClickStr + '">' +
|
||||
lang.clickToOpen +
|
||||
'</button>';
|
||||
document.body.appendChild( message );
|
||||
return;
|
||||
}
|
||||
|
||||
var cssLink = '';
|
||||
if ( cssFile !== undefined ) {
|
||||
cssLink = '<link rel="stylesheet" type="text/css" media="screen" href="' +
|
||||
cssFile + '">';
|
||||
}
|
||||
|
||||
// This sets the window location to the main window location, so css can be loaded:
|
||||
consoleWindow.document.open();
|
||||
|
||||
// Write the template:
|
||||
consoleWindow.document.write(
|
||||
|
||||
// CssStyleStr is lots of inline <style></style> defined at the end of this file
|
||||
consoleTemplate.replace( '{{cssStyle}}', cssStyleStr() )
|
||||
.replace( '{{cssLink}}', cssLink )
|
||||
.replace( /{{.*?}}/gi, function( x ) {
|
||||
return lang[ x.substring( 2, x.length - 2 ) ]; }
|
||||
)
|
||||
);
|
||||
consoleWindow.document.title = 'Speaker Console (' + document.title + ')';
|
||||
consoleWindow.impress = window.impress;
|
||||
|
||||
// We set this flag so we can detect it later, to prevent infinite popups.
|
||||
consoleWindow.isconsoleWindow = true;
|
||||
|
||||
// Set the onload function:
|
||||
consoleWindow.onload = consoleOnLoad;
|
||||
|
||||
// Add clock tick
|
||||
consoleWindow.timerStart = new Date();
|
||||
consoleWindow.timerReset = timerReset;
|
||||
consoleWindow.clockInterval = setInterval( allConsoles[ rootId ].clockTick, 1000 );
|
||||
|
||||
// Keyboard navigation handlers
|
||||
// 33: pg up, 37: left, 38: up
|
||||
registerKeyEvent( [ 33, 37, 38 ], window.impress().prev );
|
||||
|
||||
// 34: pg down, 39: right, 40: down
|
||||
registerKeyEvent( [ 34, 39, 40 ], window.impress().next );
|
||||
|
||||
// 32: space
|
||||
registerKeyEvent( [ 32 ], spaceHandler );
|
||||
|
||||
// 82: R
|
||||
registerKeyEvent( [ 82 ], timerReset );
|
||||
|
||||
// Cleanup
|
||||
consoleWindow.onbeforeunload = function() {
|
||||
|
||||
// I don't know why onunload doesn't work here.
|
||||
clearInterval( consoleWindow.clockInterval );
|
||||
};
|
||||
|
||||
// It will need a little nudge on Firefox, but only after loading:
|
||||
onStepEnter();
|
||||
consoleWindow.initialized = false;
|
||||
consoleWindow.document.close();
|
||||
|
||||
//Catch any window resize to pass size on
|
||||
window.onresize = resize;
|
||||
consoleWindow.onresize = resize;
|
||||
|
||||
return consoleWindow;
|
||||
}
|
||||
};
|
||||
|
||||
var resize = function() {
|
||||
var slideView = consoleWindow.document.getElementById( 'slideView' );
|
||||
var preView = consoleWindow.document.getElementById( 'preView' );
|
||||
|
||||
// Get ratio of presentation
|
||||
var ratio = window.innerHeight / window.innerWidth;
|
||||
|
||||
// Get size available for views
|
||||
var views = consoleWindow.document.getElementById( 'views' );
|
||||
|
||||
// SlideView may have a border or some padding:
|
||||
// asuming same border width on both direktions
|
||||
var delta = slideView.offsetWidth - slideView.clientWidth;
|
||||
|
||||
// Set views
|
||||
var slideViewWidth = ( views.clientWidth - delta );
|
||||
var slideViewHeight = Math.floor( slideViewWidth * ratio );
|
||||
|
||||
var preViewTop = slideViewHeight + preViewGap;
|
||||
|
||||
var preViewWidth = Math.floor( slideViewWidth * preViewDefaultFactor );
|
||||
var preViewHeight = Math.floor( slideViewHeight * preViewDefaultFactor );
|
||||
|
||||
// Shrink preview to fit into space available
|
||||
if ( views.clientHeight - delta < preViewTop + preViewHeight ) {
|
||||
preViewHeight = views.clientHeight - delta - preViewTop;
|
||||
preViewWidth = Math.floor( preViewHeight / ratio );
|
||||
}
|
||||
|
||||
// If preview is not high enough forget ratios!
|
||||
if ( preViewWidth <= Math.floor( slideViewWidth * preViewMinimumFactor ) ) {
|
||||
slideViewWidth = ( views.clientWidth - delta );
|
||||
slideViewHeight = Math.floor( ( views.clientHeight - delta - preViewGap ) /
|
||||
( 1 + preViewMinimumFactor ) );
|
||||
|
||||
preViewTop = slideViewHeight + preViewGap;
|
||||
|
||||
preViewWidth = Math.floor( slideViewWidth * preViewMinimumFactor );
|
||||
preViewHeight = views.clientHeight - delta - preViewTop;
|
||||
}
|
||||
|
||||
// Set the calculated into styles
|
||||
slideView.style.width = slideViewWidth + 'px';
|
||||
slideView.style.height = slideViewHeight + 'px';
|
||||
|
||||
preView.style.top = preViewTop + 'px';
|
||||
|
||||
preView.style.width = preViewWidth + 'px';
|
||||
preView.style.height = preViewHeight + 'px';
|
||||
};
|
||||
|
||||
var _init = function( cssConsole, cssIframe ) {
|
||||
if ( cssConsole !== undefined ) {
|
||||
cssFile = cssConsole;
|
||||
}
|
||||
|
||||
// You can also specify the css in the presentation root div:
|
||||
// <div id="impress" data-console-css=..." data-console-css-iframe="...">
|
||||
else if ( root.dataset.consoleCss !== undefined ) {
|
||||
cssFile = root.dataset.consoleCss;
|
||||
}
|
||||
|
||||
if ( cssIframe !== undefined ) {
|
||||
cssFileIframe = cssIframe;
|
||||
} else if ( root.dataset.consoleCssIframe !== undefined ) {
|
||||
cssFileIframe = root.dataset.consoleCssIframe;
|
||||
}
|
||||
|
||||
// Register the event
|
||||
root.addEventListener( 'impress:stepleave', onStepLeave );
|
||||
root.addEventListener( 'impress:stepenter', onStepEnter );
|
||||
root.addEventListener( 'impress:substep:stepleaveaborted', onSubstep );
|
||||
root.addEventListener( 'impress:substep:show', onSubstepShow );
|
||||
root.addEventListener( 'impress:substep:hide', onSubstepHide );
|
||||
|
||||
//When the window closes, clean up after ourselves.
|
||||
window.onunload = function() {
|
||||
if ( consoleWindow && !consoleWindow.closed ) {
|
||||
consoleWindow.close();
|
||||
}
|
||||
};
|
||||
|
||||
//Open speaker console when they press 'p'
|
||||
registerKeyEvent( [ 80 ], open, window );
|
||||
|
||||
//Btw, you can also launch console automatically:
|
||||
//<div id="impress" data-console-autolaunch="true">
|
||||
if ( root.dataset.consoleAutolaunch === 'true' ) {
|
||||
window.open();
|
||||
}
|
||||
};
|
||||
|
||||
var init = function( cssConsole, cssIframe ) {
|
||||
if ( ( cssConsole === undefined || cssConsole === cssFileOldDefault ) &&
|
||||
( cssIframe === undefined || cssIframe === cssFileIframeOldDefault ) ) {
|
||||
window.console.log( 'impressConsole.init() is deprecated. ' +
|
||||
'impressConsole is now initialized automatically when you ' +
|
||||
'call impress().init().' );
|
||||
}
|
||||
_init( cssConsole, cssIframe );
|
||||
};
|
||||
|
||||
document.addEventListener( 'impress:init', function() {
|
||||
_init();
|
||||
|
||||
// Add 'P' to the help popup
|
||||
triggerEvent( document, 'impress:help:add',
|
||||
{ command: 'P', text: 'Presenter console', row: 10 } );
|
||||
} );
|
||||
|
||||
// New API for impress.js plugins is based on using events
|
||||
root.addEventListener( 'impress:console:open', function() {
|
||||
window.open();
|
||||
} );
|
||||
|
||||
/**
|
||||
* Register a key code to an event handler
|
||||
*
|
||||
* :param: event.detail.keyCodes List of key codes
|
||||
* :param: event.detail.handler A function registered as the event handler
|
||||
* :param: event.detail.window The console window to register the keycode in
|
||||
*/
|
||||
root.addEventListener( 'impress:console:registerKeyEvent', function( event ) {
|
||||
registerKeyEvent( event.detail.keyCodes, event.detail.handler, event.detail.window );
|
||||
} );
|
||||
|
||||
// Return the object
|
||||
allConsoles[ rootId ] = { init: init, open: open, clockTick: clockTick,
|
||||
registerKeyEvent: registerKeyEvent };
|
||||
return allConsoles[ rootId ];
|
||||
|
||||
};
|
||||
|
||||
// Returns a string to be used inline as a css <style> element in the console window.
|
||||
// Apologies for length, but hiding it here at the end to keep it away from rest of the code.
|
||||
var cssStyleStr = function() {
|
||||
return `<style>
|
||||
#impressconsole body {
|
||||
background-color: rgb(255, 255, 255);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: verdana, arial, sans-serif;
|
||||
font-size: 2vw;
|
||||
}
|
||||
|
||||
#impressconsole div#console {
|
||||
position: absolute;
|
||||
top: 0.5vw;
|
||||
left: 0.5vw;
|
||||
right: 0.5vw;
|
||||
bottom: 3vw;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#impressconsole div#views, #impressconsole div#notes {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#impressconsole div#views {
|
||||
left: 0;
|
||||
right: 50vw;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#impressconsole div#blocker {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#impressconsole div#notes {
|
||||
left: 50vw;
|
||||
right: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
padding: 0.3ex;
|
||||
background-color: rgb(255, 255, 255);
|
||||
border: solid 1px rgb(120, 120, 120);
|
||||
}
|
||||
|
||||
#impressconsole div#notes .noNotes {
|
||||
color: rgb(200, 200, 200);
|
||||
}
|
||||
|
||||
#impressconsole div#notes p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#impressconsole iframe {
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
left: 0;
|
||||
border: solid 1px rgb(120, 120, 120);
|
||||
}
|
||||
|
||||
#impressconsole iframe#slideView {
|
||||
top: 0;
|
||||
width: 49vw;
|
||||
height: 49vh;
|
||||
}
|
||||
|
||||
#impressconsole iframe#preView {
|
||||
opacity: 0.7;
|
||||
top: 50vh;
|
||||
width: 30vw;
|
||||
height: 30vh;
|
||||
}
|
||||
|
||||
#impressconsole div#controls {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
bottom: 0.25vw;
|
||||
left: 0.5vw;
|
||||
right: 0.5vw;
|
||||
height: 2.5vw;
|
||||
background-color: rgb(255, 255, 255);
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
#impressconsole div#prev, div#next {
|
||||
}
|
||||
|
||||
#impressconsole div#prev a, #impressconsole div#next a {
|
||||
display: block;
|
||||
border: solid 1px rgb(70, 70, 70);
|
||||
border-radius: 0.5vw;
|
||||
font-size: 1.5vw;
|
||||
padding: 0.25vw;
|
||||
text-decoration: none;
|
||||
background-color: rgb(220, 220, 220);
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
#impressconsole div#prev a:hover, #impressconsole div#next a:hover {
|
||||
background-color: rgb(245, 245, 245);
|
||||
}
|
||||
|
||||
#impressconsole div#prev {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#impressconsole div#next {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#impressconsole div#status {
|
||||
margin-left: 2em;
|
||||
margin-right: 2em;
|
||||
text-align: center;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#impressconsole div#clock {
|
||||
margin-left: 2em;
|
||||
margin-right: 2em;
|
||||
text-align: center;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#impressconsole div#timer {
|
||||
margin-left: 2em;
|
||||
margin-right: 2em;
|
||||
text-align: center;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#impressconsole span.moving {
|
||||
color: rgb(255, 0, 0);
|
||||
}
|
||||
|
||||
#impressconsole span.ready {
|
||||
color: rgb(0, 128, 0);
|
||||
}
|
||||
</style>`;
|
||||
};
|
||||
|
||||
impressConsole();
|
||||
|
||||
} )( document, window );
|
||||
38
src/plugins/mobile/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
Mobile devices support
|
||||
======================
|
||||
|
||||
Presentations with a lot of 3D effects and graphics can consume a lot of resources, especially on mobile devices.
|
||||
This plugin provides some CSS classes that can be used to hide most of the slides, only showing the current, previous
|
||||
and next slide.
|
||||
|
||||
In particular, this plugin adds:
|
||||
|
||||
`body.impress-mobile` class, if it detects running on a mobile OS.
|
||||
|
||||
`div.prev` and `div.prev` to the adjacent steps to the current one. Note that the current slide is already identified
|
||||
by `present` and `active` CSS classes.
|
||||
|
||||
Example CSS
|
||||
-----------
|
||||
|
||||
body.impress-mobile .step {
|
||||
display:none;
|
||||
}
|
||||
body.impress-mobile .step.active,
|
||||
body.impress-mobile .step.present,
|
||||
body.impress-mobile .step.next,
|
||||
body.impress-mobile .step.prev {
|
||||
display:block;
|
||||
}
|
||||
|
||||
Note
|
||||
----
|
||||
|
||||
This plugin does not take into account redirects that could happen with skip, goto and other plugins. The active
|
||||
step will of course always be correct, but "non-linear" transitions to anything else than the actual previous and next
|
||||
steps will probably not look correct.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Kurt Zenisek (@KZeni)
|
||||
89
src/plugins/mobile/mobile.js
Normal file
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* Mobile devices support
|
||||
*
|
||||
* Allow presentation creators to hide all but 3 slides, to save resources, particularly on mobile
|
||||
* devices, using classes body.impress-mobile, .step.prev, .step.active and .step.next.
|
||||
*
|
||||
* Note: This plugin does not take into account possible redirections done with skip, goto etc
|
||||
* plugins. Basically it wouldn't work as intended in such cases, but the active step will at least
|
||||
* be correct.
|
||||
*
|
||||
* Adapted to a plugin from a submission by @Kzeni:
|
||||
* https://github.com/impress/impress.js/issues/333
|
||||
*/
|
||||
/* global document, navigator */
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
|
||||
var getNextStep = function( el ) {
|
||||
var steps = document.querySelectorAll( ".step" );
|
||||
for ( var i = 0; i < steps.length; i++ ) {
|
||||
if ( steps[ i ] === el ) {
|
||||
if ( i + 1 < steps.length ) {
|
||||
return steps[ i + 1 ];
|
||||
} else {
|
||||
return steps[ 0 ];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var getPrevStep = function( el ) {
|
||||
var steps = document.querySelectorAll( ".step" );
|
||||
for ( var i = steps.length - 1; i >= 0; i-- ) {
|
||||
if ( steps[ i ] === el ) {
|
||||
if ( i - 1 >= 0 ) {
|
||||
return steps[ i - 1 ];
|
||||
} else {
|
||||
return steps[ steps.length - 1 ];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Detect mobile browsers & add CSS class as appropriate.
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
var body = document.body;
|
||||
if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||
navigator.userAgent
|
||||
) ) {
|
||||
body.classList.add( "impress-mobile" );
|
||||
}
|
||||
|
||||
// Unset all this on teardown
|
||||
var api = event.detail.api;
|
||||
api.lib.gc.pushCallback( function() {
|
||||
document.body.classList.remove( "impress-mobile" );
|
||||
var prev = document.getElementsByClassName( "prev" )[ 0 ];
|
||||
var next = document.getElementsByClassName( "next" )[ 0 ];
|
||||
if ( typeof prev !== "undefined" ) {
|
||||
prev.classList.remove( "prev" );
|
||||
}
|
||||
if ( typeof next !== "undefined" ) {
|
||||
next.classList.remove( "next" );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
// Add prev and next classes to the siblings of the newly entered active step element
|
||||
// Remove prev and next classes from their current step elements
|
||||
// Note: As an exception we break namespacing rules, as these are useful general purpose
|
||||
// classes. (Naming rules would require us to use css classes mobile-next and mobile-prev,
|
||||
// based on plugin name.)
|
||||
document.addEventListener( "impress:stepenter", function( event ) {
|
||||
var oldprev = document.getElementsByClassName( "prev" )[ 0 ];
|
||||
var oldnext = document.getElementsByClassName( "next" )[ 0 ];
|
||||
|
||||
var prev = getPrevStep( event.target );
|
||||
prev.classList.add( "prev" );
|
||||
var next = getNextStep( event.target );
|
||||
next.classList.add( "next" );
|
||||
|
||||
if ( typeof oldprev !== "undefined" ) {
|
||||
oldprev.classList.remove( "prev" );
|
||||
}
|
||||
if ( typeof oldnext !== "undefined" ) {
|
||||
oldnext.classList.remove( "next" );
|
||||
}
|
||||
} );
|
||||
} )( document );
|
||||
|
||||
25
src/plugins/mouse-timeout/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
Mouse timeout plugin
|
||||
====================
|
||||
|
||||
After 3 seconds of mouse inactivity, add the css class
|
||||
`body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the
|
||||
class.
|
||||
|
||||
The use case for this plugin is to use CSS to hide elements from the screen
|
||||
and only make them visible when the mouse is moved. Examples where this
|
||||
might be used are: the toolbar from the toolbar plugin, and the mouse cursor
|
||||
itself.
|
||||
|
||||
Example CSS
|
||||
------------
|
||||
|
||||
body.impress-mouse-timeout {
|
||||
cursor: none;
|
||||
}
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license.
|
||||
67
src/plugins/mouse-timeout/mouse-timeout.js
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Mouse timeout plugin
|
||||
*
|
||||
* After 3 seconds of mouse inactivity, add the css class
|
||||
* `body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the
|
||||
* class.
|
||||
*
|
||||
* The use case for this plugin is to use CSS to hide elements from the screen
|
||||
* and only make them visible when the mouse is moved. Examples where this
|
||||
* might be used are: the toolbar from the toolbar plugin, and the mouse cursor
|
||||
* itself.
|
||||
*
|
||||
* Example CSS:
|
||||
*
|
||||
* body.impress-mouse-timeout {
|
||||
* cursor: none;
|
||||
* }
|
||||
* body.impress-mouse-timeout div#impress-toolbar {
|
||||
* display: none;
|
||||
* }
|
||||
*
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global window, document */
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var timeout = 3;
|
||||
var timeoutHandle;
|
||||
|
||||
var hide = function() {
|
||||
|
||||
// Mouse is now inactive
|
||||
document.body.classList.add( "impress-mouse-timeout" );
|
||||
};
|
||||
|
||||
var show = function() {
|
||||
if ( timeoutHandle ) {
|
||||
window.clearTimeout( timeoutHandle );
|
||||
}
|
||||
|
||||
// Mouse is now active
|
||||
document.body.classList.remove( "impress-mouse-timeout" );
|
||||
|
||||
// Then set new timeout after which it is considered inactive again
|
||||
timeoutHandle = window.setTimeout( hide, timeout * 1000 );
|
||||
};
|
||||
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
var api = event.detail.api;
|
||||
var gc = api.lib.gc;
|
||||
gc.addEventListener( document, "mousemove", show );
|
||||
gc.addEventListener( document, "click", show );
|
||||
gc.addEventListener( document, "touch", show );
|
||||
|
||||
// Set first timeout
|
||||
show();
|
||||
|
||||
// Unset all this on teardown
|
||||
gc.pushCallback( function() {
|
||||
window.clearTimeout( timeoutHandle );
|
||||
document.body.classList.remove( "impress-mouse-timeout" );
|
||||
} );
|
||||
}, false );
|
||||
|
||||
} )( document, window );
|
||||
13
src/plugins/navigation-ui/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
Navigation UI plugin
|
||||
====================
|
||||
|
||||
This plugin provides UI elements "back", "forward" and a list to select
|
||||
a specific slide number.
|
||||
|
||||
The navigation controls are visible if the toolbar plugin is enabled. To add the toolbar to your
|
||||
presentations, [see toolbar plugin README](../toolbar/README.md).
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Henrik Ingo (@henrikingo), 2016
|
||||
123
src/plugins/navigation-ui/navigation-ui.js
Normal file
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* Navigation UI plugin
|
||||
*
|
||||
* This plugin provides UI elements "back", "forward" and a list to select
|
||||
* a specific slide number.
|
||||
*
|
||||
* The navigation controls are added to the toolbar plugin via DOM events. User must enable the
|
||||
* toolbar in a presentation to have them visible.
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
|
||||
// This file contains so much HTML, that we will just respectfully disagree about js
|
||||
/* jshint quotmark:single */
|
||||
/* global document */
|
||||
|
||||
( function( document ) {
|
||||
'use strict';
|
||||
var toolbar;
|
||||
var api;
|
||||
var root;
|
||||
var steps;
|
||||
var hideSteps = [];
|
||||
var prev;
|
||||
var select;
|
||||
var next;
|
||||
|
||||
var triggerEvent = function( el, eventName, detail ) {
|
||||
var event = document.createEvent( 'CustomEvent' );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
el.dispatchEvent( event );
|
||||
};
|
||||
|
||||
var makeDomElement = function( html ) {
|
||||
var tempDiv = document.createElement( 'div' );
|
||||
tempDiv.innerHTML = html;
|
||||
return tempDiv.firstChild;
|
||||
};
|
||||
|
||||
var selectOptionsHtml = function() {
|
||||
var options = '';
|
||||
for ( var i = 0; i < steps.length; i++ ) {
|
||||
|
||||
// Omit steps that are listed as hidden from select widget
|
||||
if ( hideSteps.indexOf( steps[ i ] ) < 0 ) {
|
||||
options = options + '<option value="' + steps[ i ].id + '">' + // jshint ignore:line
|
||||
steps[ i ].id + '</option>' + '\n'; // jshint ignore:line
|
||||
}
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
var addNavigationControls = function( event ) {
|
||||
api = event.detail.api;
|
||||
var gc = api.lib.gc;
|
||||
root = event.target;
|
||||
steps = root.querySelectorAll( '.step' );
|
||||
|
||||
var prevHtml = '<button id="impress-navigation-ui-prev" title="Previous" ' +
|
||||
'class="impress-navigation-ui"><</button>';
|
||||
var selectHtml = '<select id="impress-navigation-ui-select" title="Go to" ' +
|
||||
'class="impress-navigation-ui">' + '\n' +
|
||||
selectOptionsHtml() +
|
||||
'</select>';
|
||||
var nextHtml = '<button id="impress-navigation-ui-next" title="Next" ' +
|
||||
'class="impress-navigation-ui">></button>';
|
||||
|
||||
prev = makeDomElement( prevHtml );
|
||||
prev.addEventListener( 'click',
|
||||
function() {
|
||||
api.prev();
|
||||
} );
|
||||
select = makeDomElement( selectHtml );
|
||||
select.addEventListener( 'change',
|
||||
function( event ) {
|
||||
api.goto( event.target.value );
|
||||
} );
|
||||
gc.addEventListener( root, 'impress:steprefresh', function( event ) {
|
||||
|
||||
// As impress.js core now allows to dynamically edit the steps, including adding,
|
||||
// removing, and reordering steps, we need to requery and redraw the select list on
|
||||
// every stepenter event.
|
||||
steps = root.querySelectorAll( '.step' );
|
||||
select.innerHTML = '\n' + selectOptionsHtml();
|
||||
|
||||
// Make sure the list always shows the step we're actually on, even if it wasn't
|
||||
// selected from the list
|
||||
select.value = event.target.id;
|
||||
} );
|
||||
next = makeDomElement( nextHtml );
|
||||
next.addEventListener( 'click',
|
||||
function() {
|
||||
api.next();
|
||||
} );
|
||||
|
||||
triggerEvent( toolbar, 'impress:toolbar:appendChild', { group: 0, element: prev } );
|
||||
triggerEvent( toolbar, 'impress:toolbar:appendChild', { group: 0, element: select } );
|
||||
triggerEvent( toolbar, 'impress:toolbar:appendChild', { group: 0, element: next } );
|
||||
|
||||
};
|
||||
|
||||
// API for not listing given step in the select widget.
|
||||
// For example, if you set class="skip" on some element, you may not want it to show up in the
|
||||
// list either. Otoh we cannot assume that, or anything else, so steps that user wants omitted
|
||||
// must be specifically added with this API call.
|
||||
document.addEventListener( 'impress:navigation-ui:hideStep', function( event ) {
|
||||
hideSteps.push( event.target );
|
||||
if ( select ) {
|
||||
select.innerHTML = selectOptionsHtml();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Wait for impress.js to be initialized
|
||||
document.addEventListener( 'impress:init', function( event ) {
|
||||
toolbar = document.querySelector( '#impress-toolbar' );
|
||||
if ( toolbar ) {
|
||||
addNavigationControls( event );
|
||||
}
|
||||
}, false );
|
||||
|
||||
} )( document );
|
||||
|
||||
171
src/plugins/navigation/navigation.js
Normal file
@@ -0,0 +1,171 @@
|
||||
/**
|
||||
* Navigation events plugin
|
||||
*
|
||||
* 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
|
||||
* version: 0.5.3
|
||||
* url: http://bartaz.github.com/impress.js/
|
||||
* source: http://github.com/bartaz/impress.js/
|
||||
*
|
||||
*/
|
||||
/* global document */
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
|
||||
// Wait for impress.js to be initialized
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
|
||||
// Getting API from event data.
|
||||
// So you don't event need to know what is the id of the root element
|
||||
// or anything. `impress:init` event data gives you everything you
|
||||
// need to control the presentation that was just initialized.
|
||||
var api = event.detail.api;
|
||||
var gc = api.lib.gc;
|
||||
var util = api.lib.util;
|
||||
|
||||
// Supported keys are:
|
||||
// [space] - quite common in presentation software to move forward
|
||||
// [up] [right] / [down] [left] - again common and natural addition,
|
||||
// [pgdown] / [pgup] - often triggered by remote controllers,
|
||||
// [tab] - this one is quite controversial, but the reason it ended up on
|
||||
// this list is quite an interesting story... Remember that strange part
|
||||
// in the impress.js code where window is scrolled to 0,0 on every presentation
|
||||
// step, because sometimes browser scrolls viewport because of the focused element?
|
||||
// Well, the [tab] key by default navigates around focusable elements, so clicking
|
||||
// it very often caused scrolling to focused element and breaking impress.js
|
||||
// positioning. I didn't want to just prevent this default action, so I used [tab]
|
||||
// as another way to moving to next step... And yes, I know that for the sake of
|
||||
// consistency I should add [shift+tab] as opposite action...
|
||||
var isNavigationEvent = function( event ) {
|
||||
|
||||
// Don't trigger navigation for example when user returns to browser window with ALT+TAB
|
||||
if ( event.altKey || event.ctrlKey || event.metaKey ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the case of TAB, we force step navigation always, overriding the browser
|
||||
// navigation between input elements, buttons and links.
|
||||
if ( event.keyCode === 9 ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// With the sole exception of TAB, we also ignore keys pressed if shift is down.
|
||||
if ( event.shiftKey ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// For arrows, etc, check that event target is html or body element. This is to allow
|
||||
// presentations to have, for example, forms with input elements where user can type
|
||||
// text, including space, and not move to next step.
|
||||
if ( event.target.nodeName !== "BODY" && event.target.nodeName !== "HTML" ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ( event.keyCode >= 32 && event.keyCode <= 34 ) ||
|
||||
( event.keyCode >= 37 && event.keyCode <= 40 ) ) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// KEYBOARD NAVIGATION HANDLERS
|
||||
|
||||
// Prevent default keydown action when one of supported key is pressed.
|
||||
gc.addEventListener( document, "keydown", function( event ) {
|
||||
if ( isNavigationEvent( event ) ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Trigger impress action (next or prev) on keyup.
|
||||
gc.addEventListener( document, "keyup", function( event ) {
|
||||
if ( isNavigationEvent( event ) ) {
|
||||
if ( event.shiftKey ) {
|
||||
switch ( event.keyCode ) {
|
||||
case 9: // Shift+tab
|
||||
api.prev();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch ( event.keyCode ) {
|
||||
case 33: // Pg up
|
||||
case 37: // Left
|
||||
case 38: // Up
|
||||
api.prev( event );
|
||||
break;
|
||||
case 9: // Tab
|
||||
case 32: // Space
|
||||
case 34: // Pg down
|
||||
case 39: // Right
|
||||
case 40: // Down
|
||||
api.next( event );
|
||||
break;
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Delegated handler for clicking on the links to presentation steps
|
||||
gc.addEventListener( document, "click", function( event ) {
|
||||
|
||||
// Event delegation with "bubbling"
|
||||
// check if event target (or any of its parents is a link)
|
||||
var target = event.target;
|
||||
while ( ( target.tagName !== "A" ) &&
|
||||
( target !== document.documentElement ) ) {
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
if ( target.tagName === "A" ) {
|
||||
var href = target.getAttribute( "href" );
|
||||
|
||||
// If it's a link to presentation step, target this step
|
||||
if ( href && href[ 0 ] === "#" ) {
|
||||
target = document.getElementById( href.slice( 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( api.goto( target ) ) {
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Delegated handler for clicking on step elements
|
||||
gc.addEventListener( document, "click", function( event ) {
|
||||
var target = event.target;
|
||||
|
||||
// Find closest step element that is not active
|
||||
while ( !( target.classList.contains( "step" ) &&
|
||||
!target.classList.contains( "active" ) ) &&
|
||||
( target !== document.documentElement ) ) {
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
if ( api.goto( target ) ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Add a line to the help popup
|
||||
util.triggerEvent( document, "impress:help:add", { command: "Left & Right",
|
||||
text: "Previous & Next step",
|
||||
row: 1 } );
|
||||
|
||||
}, false );
|
||||
|
||||
} )( document );
|
||||
|
||||
169
src/plugins/navigation/navigation_tests.js
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
*
|
||||
* Released under the MIT license. See LICENSE file.
|
||||
*/
|
||||
/* global QUnit, loadIframe, initPresentation, document, window */
|
||||
|
||||
QUnit.module( "Navigation plugin" );
|
||||
|
||||
QUnit.test( "Navigation Plugin", function( assert ) {
|
||||
window.console.log( "Begin navigation plugin" );
|
||||
var done = assert.async();
|
||||
|
||||
loadIframe( "test/core_tests_presentation.html", assert, function() {
|
||||
initPresentation( assert, function() {
|
||||
var iframe = document.getElementById( "presentation-iframe" );
|
||||
var iframeDoc = iframe.contentDocument;
|
||||
var iframeWin = iframe.contentWindow;
|
||||
|
||||
var wait = 5; // Milliseconds
|
||||
|
||||
var step1 = iframeDoc.querySelector( "div#step-1" );
|
||||
var step2 = iframeDoc.querySelector( "div#step-2" );
|
||||
var step3 = iframeDoc.querySelector( "div#step-3" );
|
||||
var step4 = iframeDoc.querySelector( "div#fourth" );
|
||||
var root = iframeDoc.querySelector( "div#impress" );
|
||||
|
||||
var i = 0;
|
||||
var sequence = [ { left: step1,
|
||||
entered: step2,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", " " ); },
|
||||
text: "space (2->3)" },
|
||||
{ left: step2,
|
||||
entered: step3,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "[right]" ); },
|
||||
text: "[right] (3->4)" },
|
||||
{ left: step3,
|
||||
entered: step4,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "\t" ); },
|
||||
text: "tab (4->1)" },
|
||||
{ left: step4,
|
||||
entered: step1,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "[down]" ); },
|
||||
text: "[down] (1->2)" },
|
||||
{ left: step1,
|
||||
entered: step2,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "[page-down]" ); },
|
||||
text: "[page-down] (2->3)" },
|
||||
{ left: step2,
|
||||
entered: step3,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "[page-up]" ); },
|
||||
text: "[page-up] (3->2)" },
|
||||
{ left: step3,
|
||||
entered: step2,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "[left]" ); },
|
||||
text: "[left] (2->1)" },
|
||||
{ left: step2,
|
||||
entered: step1,
|
||||
next: function() { return iframeWin.syn.type( "bodyid", "[up]" ); },
|
||||
text: "[up] (1->4)" },
|
||||
{ left: step1,
|
||||
entered: step4,
|
||||
next: function() { return iframeWin.syn.click( "step-2", {} ); },
|
||||
text: "click on 2 (4->2)" },
|
||||
{ left: step4,
|
||||
entered: step2,
|
||||
next: function() { return iframeWin.syn.click( "linktofourth", {} ); },
|
||||
text: "click on link with href to id=fourth (2->4)" },
|
||||
{ left: step2,
|
||||
entered: step4,
|
||||
next: function() { return iframeWin.impress().goto( 0 ); },
|
||||
text: "Return to first step with goto(0)." },
|
||||
{ left: step4,
|
||||
entered: step1,
|
||||
next: false }
|
||||
];
|
||||
|
||||
var readyCount = 0;
|
||||
var readyForNext = function() {
|
||||
readyCount++;
|
||||
if ( readyCount % 2 === 0 ) {
|
||||
if ( sequence[ i ].next ) {
|
||||
assert.ok( sequence[ i ].next(), sequence[ i ].text );
|
||||
i++;
|
||||
} else {
|
||||
window.console.log( "End navigation plugin" );
|
||||
done();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Things to check on impress:stepenter event -----------------------------//
|
||||
var assertStepEnter = function( event ) {
|
||||
assert.equal( event.target, sequence[ i ].entered,
|
||||
event.target.id + " triggered impress:stepenter event." );
|
||||
readyForNext();
|
||||
};
|
||||
|
||||
var assertStepEnterWrapper = function( event ) {
|
||||
window.setTimeout( function() { assertStepEnter( event ); }, wait );
|
||||
};
|
||||
root.addEventListener( "impress:stepenter", assertStepEnterWrapper );
|
||||
|
||||
// Things to check on impress:stepleave event -----------------------------//
|
||||
var assertStepLeave = function( event ) {
|
||||
assert.equal( event.target, sequence[ i ].left,
|
||||
event.target.id + " triggered impress:stepleave event." );
|
||||
readyForNext();
|
||||
};
|
||||
|
||||
var assertStepLeaveWrapper = function( event ) {
|
||||
window.setTimeout( function() { assertStepLeave( event ); }, wait );
|
||||
};
|
||||
root.addEventListener( "impress:stepleave", assertStepLeaveWrapper );
|
||||
|
||||
assert.ok( iframeWin.impress().next(), "next() called and returns ok (1->2)" );
|
||||
} ); // InitPresentation()
|
||||
} ); // LoadIframe()
|
||||
} );
|
||||
|
||||
QUnit.test( "Navigation Plugin - No-op tests", function( assert ) {
|
||||
window.console.log( "Begin navigation no-op" );
|
||||
var done = assert.async();
|
||||
|
||||
loadIframe( "test/core_tests_presentation.html", assert, function() {
|
||||
initPresentation( assert, function() {
|
||||
var iframe = document.getElementById( "presentation-iframe" );
|
||||
var iframeDoc = iframe.contentDocument;
|
||||
var iframeWin = iframe.contentWindow;
|
||||
|
||||
var wait = 5; // Milliseconds
|
||||
|
||||
var root = iframeDoc.querySelector( "div#impress" );
|
||||
|
||||
// This should never happen -----------------------------//
|
||||
var assertStepEnter = function( event ) {
|
||||
assert.ok( false,
|
||||
event.target.id + " triggered impress:stepenter event." );
|
||||
};
|
||||
|
||||
var assertStepEnterWrapper = function( event ) {
|
||||
window.setTimeout( function() { assertStepEnter( event ); }, wait );
|
||||
};
|
||||
root.addEventListener( "impress:stepenter", assertStepEnterWrapper );
|
||||
|
||||
// This should never happen -----------------------------//
|
||||
var assertStepLeave = function( event ) {
|
||||
assert.ok( false,
|
||||
event.target.id + " triggered impress:stepleave event." );
|
||||
};
|
||||
|
||||
var assertStepLeaveWrapper = function( event ) {
|
||||
window.setTimeout( function() { assertStepLeave( event ); }, wait );
|
||||
};
|
||||
root.addEventListener( "impress:stepleave", assertStepLeaveWrapper );
|
||||
|
||||
// These are no-op actions, we're already in step-1 -----------------------//
|
||||
assert.ok( iframeWin.syn.click( "step-1", {} ),
|
||||
"Click on step that is currently active, should do nothing." );
|
||||
assert.ok( iframeWin.syn.click( "linktofirst", {} ),
|
||||
"Click on link pointing to step that is currently active, should do nothing." );
|
||||
|
||||
// After delay, if no event triggers are called. We're done.
|
||||
window.setTimeout( function() {
|
||||
window.console.log( "End navigation no-op" ); done();
|
||||
}, 3000 );
|
||||
} ); // InitPresentation()
|
||||
} ); // LoadIframe()
|
||||
} );
|
||||
46
src/plugins/progress/README.md
Normal file
@@ -0,0 +1,46 @@
|
||||
Progress plugin
|
||||
===============
|
||||
|
||||
Progressbar and pagexounter for impress.js presentations
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Add a div for progressbar and/or progress as you can see it here:
|
||||
|
||||
### HTML
|
||||
|
||||
<div class="impress-progressbar"><div></div></div>
|
||||
<div class="impress-progress"></div>
|
||||
|
||||
### Sample CSS
|
||||
|
||||
.impress-progressbar {
|
||||
position: absolute;
|
||||
right: 318px;
|
||||
bottom: 1px;
|
||||
left: 118px;
|
||||
border-radius: 7px;
|
||||
border: 2px solid rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
.impress-progressbar DIV {
|
||||
width: 0;
|
||||
height: 2px;
|
||||
border-radius: 5px;
|
||||
background: rgba(75, 75, 75, 0.4);
|
||||
transition: width 1s linear;
|
||||
}
|
||||
.impress-progress {
|
||||
position: absolute;
|
||||
left: 59px;
|
||||
bottom: 1px;
|
||||
text-align: left;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
Feel free to change the style of your progressbar as you like by editing the CSS file.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Copyright 2014: Matthias Bilger (@m42e)
|
||||
58
src/plugins/progress/progress.js
Normal file
@@ -0,0 +1,58 @@
|
||||
/* global document */
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
var root;
|
||||
var stepids = [];
|
||||
|
||||
// Get stepids from the steps under impress root
|
||||
var getSteps = function() {
|
||||
stepids = [];
|
||||
var steps = root.querySelectorAll( ".step" );
|
||||
for ( var i = 0; i < steps.length; i++ )
|
||||
{
|
||||
stepids[ i + 1 ] = steps[ i ].id;
|
||||
}
|
||||
};
|
||||
|
||||
// Wait for impress.js to be initialized
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
root = event.target;
|
||||
getSteps();
|
||||
var gc = event.detail.api.lib.gc;
|
||||
gc.pushCallback( function() {
|
||||
stepids = [];
|
||||
if ( progressbar ) {
|
||||
progressbar.style.width = "";
|
||||
}
|
||||
if ( progress ) {
|
||||
progress.innerHTML = "";
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
var progressbar = document.querySelector( "div.impress-progressbar div" );
|
||||
var progress = document.querySelector( "div.impress-progress" );
|
||||
|
||||
if ( null !== progressbar || null !== progress ) {
|
||||
document.addEventListener( "impress:stepleave", function( event ) {
|
||||
updateProgressbar( event.detail.next.id );
|
||||
} );
|
||||
|
||||
document.addEventListener( "impress:steprefresh", function( event ) {
|
||||
getSteps();
|
||||
updateProgressbar( event.target.id );
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
function updateProgressbar( slideId ) {
|
||||
var slideNumber = stepids.indexOf( slideId );
|
||||
if ( null !== progressbar ) {
|
||||
var width = 100 / ( stepids.length - 1 ) * ( slideNumber );
|
||||
progressbar.style.width = width.toFixed( 2 ) + "%";
|
||||
}
|
||||
if ( null !== progress ) {
|
||||
progress.innerHTML = slideNumber + "/" + ( stepids.length - 1 );
|
||||
}
|
||||
}
|
||||
} )( document );
|
||||
89
src/plugins/rel/README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
Relative Positioning Plugin
|
||||
===========================
|
||||
|
||||
This plugin provides support for defining the coordinates of a step relative
|
||||
to the previous step. This is often more convenient when creating presentations,
|
||||
since as you add, remove or move steps, you may not need to edit the positions
|
||||
as much as is the case with the absolute coordinates supported by impress.js
|
||||
core.
|
||||
|
||||
Example:
|
||||
|
||||
<!-- Position step 1000 px to the right and 500 px up from the previous step. -->
|
||||
<div class="step" data-rel-x="1000" data-rel-y="500">
|
||||
|
||||
Following html attributes are supported for step elements:
|
||||
|
||||
data-rel-x
|
||||
data-rel-y
|
||||
data-rel-z
|
||||
|
||||
Non-zero values are also inherited from the previous step. This makes it easy to
|
||||
create a boring presentation where each slide shifts for example 1000px down
|
||||
from the previous.
|
||||
|
||||
The above relative values are ignored, or set to zero, if the corresponding
|
||||
absolute value (`data-x` etc...) is set. Note that this also has the effect of
|
||||
resetting the inheritance functionality.
|
||||
|
||||
In addition to plain numbers, which are pixel values, it is also possible to
|
||||
define relative positions as a multiple of screen height and width, using
|
||||
a unit of "h" and "w", respectively, appended to the number.
|
||||
|
||||
Example:
|
||||
|
||||
<div class="step" data-rel-x="1.5w" data-rel-y="1.5h">
|
||||
|
||||
|
||||
IMPORTANT: Incompatible change
|
||||
------------------------------
|
||||
|
||||
Enabling / adding this plugin has a small incompatible side effect on default values.
|
||||
|
||||
Prior to this plugin, a missing data-x/y/z attribute would be assigned the default value of 0.
|
||||
But when using a version of impress.js with this plugin enabled, a missing data-x/y/z attribute
|
||||
will inherit the value from the previous step. (The first step will inherit the default value of 0.)
|
||||
|
||||
For example, if you have an old presentation with the following 3 steps, they would be positioned
|
||||
differently when using a version of impress.js that includes this plugin:
|
||||
|
||||
<div class="step" data-x="100" data-y="100" data-z="100"></div>
|
||||
<div class="step" data-x="100" data-y="100"></div>
|
||||
<div class="step" data-x="100" data-y="100"></div>
|
||||
|
||||
To get the same rendering now, you need to add an explicit `data-z="0"` to the second step:
|
||||
|
||||
<div class="step" data-x="100" data-y="100" data-z="100"></div>
|
||||
<div class="step" data-x="100" data-y="100" data-z="0"></div>
|
||||
<div class="step" data-x="100" data-y="100"></div>
|
||||
|
||||
Note that the latter code will render correctly also in old versions of impress.js.
|
||||
|
||||
If you have an old presentation that doesn't use relative positioning, and for some reason you
|
||||
cannot or don't want to add the explicit 0 values where needed, your last resort is to simply
|
||||
remove the `rel.js` plugin completely. You can either:
|
||||
|
||||
* Remove `rel.js` from [/build.js](../../../build.js) and recompile `impress.js` with: `npm build`
|
||||
* Just open [/js/impress.js] in an editor and delete the `rel.js` code.
|
||||
* Or, just uncomment the following single line, which is the last line of the plugin:
|
||||
|
||||
impress.addPreInitPlugin( rel );
|
||||
|
||||
|
||||
About Pre-Init Plugins
|
||||
----------------------
|
||||
|
||||
This plugin is a *pre-init plugin*. It is called synchronously from impress.js
|
||||
core at the beginning of `impress().init()`. This allows it to process its own
|
||||
data attributes first, and possibly alter the data-x, data-y and data-z attributes
|
||||
that will then be processed by `impress().init()`.
|
||||
|
||||
(Another name for this kind of plugin might be called a *filter plugin*, but
|
||||
*pre-init plugin* is more generic, as a plugin might do whatever it wants in
|
||||
the pre-init stage.)
|
||||
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Henrik Ingo (@henrikingo), 2016
|
||||
173
src/plugins/rel/rel.js
Normal file
@@ -0,0 +1,173 @@
|
||||
/**
|
||||
* Relative Positioning Plugin
|
||||
*
|
||||
* This plugin provides support for defining the coordinates of a step relative
|
||||
* to the previous step. This is often more convenient when creating presentations,
|
||||
* since as you add, remove or move steps, you may not need to edit the positions
|
||||
* as much as is the case with the absolute coordinates supported by impress.js
|
||||
* core.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <!-- Position step 1000 px to the right and 500 px up from the previous step. -->
|
||||
* <div class="step" data-rel-x="1000" data-rel-y="500">
|
||||
*
|
||||
* Following html attributes are supported for step elements:
|
||||
*
|
||||
* data-rel-x
|
||||
* data-rel-y
|
||||
* data-rel-z
|
||||
*
|
||||
* These values are also inherited from the previous step. This makes it easy to
|
||||
* create a boring presentation where each slide shifts for example 1000px down
|
||||
* from the previous.
|
||||
*
|
||||
* In addition to plain numbers, which are pixel values, it is also possible to
|
||||
* define relative positions as a multiple of screen height and width, using
|
||||
* a unit of "h" and "w", respectively, appended to the number.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <div class="step" data-rel-x="1.5w" data-rel-y="1.5h">
|
||||
*
|
||||
* This plugin is a *pre-init plugin*. It is called synchronously from impress.js
|
||||
* core at the beginning of `impress().init()`. This allows it to process its own
|
||||
* data attributes first, and possibly alter the data-x, data-y and data-z attributes
|
||||
* that will then be processed by `impress().init()`.
|
||||
*
|
||||
* (Another name for this kind of plugin might be called a *filter plugin*, but
|
||||
* *pre-init plugin* is more generic, as a plugin might do whatever it wants in
|
||||
* the pre-init stage.)
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
|
||||
/* global document, window */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
|
||||
var startingState = {};
|
||||
|
||||
/**
|
||||
* Copied from core impress.js. We currently lack a library mechanism to
|
||||
* to share utility functions like this.
|
||||
*/
|
||||
var toNumber = function( numeric, fallback ) {
|
||||
return isNaN( numeric ) ? ( fallback || 0 ) : Number( numeric );
|
||||
};
|
||||
|
||||
/**
|
||||
* Extends toNumber() to correctly compute also relative-to-screen-size values 5w and 5h.
|
||||
*
|
||||
* Returns the computed value in pixels with w/h postfix removed.
|
||||
*/
|
||||
var toNumberAdvanced = function( numeric, fallback ) {
|
||||
if ( typeof numeric !== "string" ) {
|
||||
return toNumber( numeric, fallback );
|
||||
}
|
||||
var ratio = numeric.match( /^([+-]*[\d\.]+)([wh])$/ );
|
||||
if ( ratio == null ) {
|
||||
return toNumber( numeric, fallback );
|
||||
} else {
|
||||
var value = parseFloat( ratio[ 1 ] );
|
||||
var multiplier = ratio[ 2 ] === "w" ? window.innerWidth : window.innerHeight;
|
||||
return value * multiplier;
|
||||
}
|
||||
};
|
||||
|
||||
var computeRelativePositions = function( el, prev ) {
|
||||
var data = el.dataset;
|
||||
|
||||
if ( !prev ) {
|
||||
|
||||
// For the first step, inherit these defaults
|
||||
prev = { x:0, y:0, z:0, relative: { x:0, y:0, z:0 } };
|
||||
}
|
||||
|
||||
var step = {
|
||||
x: toNumber( data.x, prev.x ),
|
||||
y: toNumber( data.y, prev.y ),
|
||||
z: toNumber( data.z, prev.z ),
|
||||
relative: {
|
||||
x: toNumberAdvanced( data.relX, prev.relative.x ),
|
||||
y: toNumberAdvanced( data.relY, prev.relative.y ),
|
||||
z: toNumberAdvanced( data.relZ, prev.relative.z )
|
||||
}
|
||||
};
|
||||
|
||||
// Relative position is ignored/zero if absolute is given.
|
||||
// Note that this also has the effect of resetting any inherited relative values.
|
||||
if ( data.x !== undefined ) {
|
||||
step.relative.x = 0;
|
||||
}
|
||||
if ( data.y !== undefined ) {
|
||||
step.relative.y = 0;
|
||||
}
|
||||
if ( data.z !== undefined ) {
|
||||
step.relative.z = 0;
|
||||
}
|
||||
|
||||
// Apply relative position to absolute position, if non-zero
|
||||
// Note that at this point, the relative values contain a number value of pixels.
|
||||
step.x = step.x + step.relative.x;
|
||||
step.y = step.y + step.relative.y;
|
||||
step.z = step.z + step.relative.z;
|
||||
|
||||
return step;
|
||||
};
|
||||
|
||||
var rel = function( root ) {
|
||||
var steps = root.querySelectorAll( ".step" );
|
||||
var prev;
|
||||
startingState[ root.id ] = [];
|
||||
for ( var i = 0; i < steps.length; i++ ) {
|
||||
var el = steps[ i ];
|
||||
startingState[ root.id ].push( {
|
||||
el: el,
|
||||
x: el.getAttribute( "data-x" ),
|
||||
y: el.getAttribute( "data-y" ),
|
||||
z: el.getAttribute( "data-z" )
|
||||
} );
|
||||
var step = computeRelativePositions( el, prev );
|
||||
|
||||
// Apply relative position (if non-zero)
|
||||
el.setAttribute( "data-x", step.x );
|
||||
el.setAttribute( "data-y", step.y );
|
||||
el.setAttribute( "data-z", step.z );
|
||||
prev = step;
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin to be called in pre-init phase
|
||||
window.impress.addPreInitPlugin( rel );
|
||||
|
||||
// Register teardown callback to reset the data.x, .y, .z values.
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
var root = event.target;
|
||||
event.detail.api.lib.gc.pushCallback( function() {
|
||||
var steps = startingState[ root.id ];
|
||||
var step;
|
||||
while ( step = steps.pop() ) {
|
||||
if ( step.x === null ) {
|
||||
step.el.removeAttribute( "data-x" );
|
||||
} else {
|
||||
step.el.setAttribute( "data-x", step.x );
|
||||
}
|
||||
if ( step.y === null ) {
|
||||
step.el.removeAttribute( "data-y" );
|
||||
} else {
|
||||
step.el.setAttribute( "data-y", step.y );
|
||||
}
|
||||
if ( step.z === null ) {
|
||||
step.el.removeAttribute( "data-z" );
|
||||
} else {
|
||||
step.el.setAttribute( "data-z", step.z );
|
||||
}
|
||||
}
|
||||
delete startingState[ root.id ];
|
||||
} );
|
||||
}, false );
|
||||
} )( document, window );
|
||||
|
||||
34
src/plugins/resize/resize.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Resize plugin
|
||||
*
|
||||
* Rescale the presentation after a window resize.
|
||||
*
|
||||
* Copyright 2011-2012 Bartek Szopka (@bartaz)
|
||||
* Released under the MIT license.
|
||||
* ------------------------------------------------
|
||||
* author: Bartek Szopka
|
||||
* version: 0.5.3
|
||||
* url: http://bartaz.github.com/impress.js/
|
||||
* source: http://github.com/bartaz/impress.js/
|
||||
*
|
||||
*/
|
||||
|
||||
/* global document, window */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
|
||||
// Wait for impress.js to be initialized
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
var api = event.detail.api;
|
||||
|
||||
// Rescale presentation when window is resized
|
||||
api.lib.gc.addEventListener( window, "resize", api.lib.util.throttle( function() {
|
||||
|
||||
// Force going to active step again, to trigger rescaling
|
||||
api.goto( document.querySelector( ".step.active" ), 500 );
|
||||
}, 250 ), false );
|
||||
}, false );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
20
src/plugins/skip/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
Skip Plugin
|
||||
===========
|
||||
|
||||
Example:
|
||||
|
||||
<!-- This slide is disabled in presentations, when moving with next()
|
||||
and prev() commands, but you can still move directly to it, for
|
||||
example with a url (anything using goto()). -->
|
||||
<div class="step skip">
|
||||
|
||||
The skip plugin is a pre-stepleave plugin. It is executed before
|
||||
`impress:stepleave` event. If the next step also has `class="skip"`
|
||||
set, it will set the next step to the one after that.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license.
|
||||
|
||||
84
src/plugins/skip/skip.js
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Skip Plugin
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <!-- This slide is disabled in presentations, when moving with next()
|
||||
* and prev() commands, but you can still move directly to it, for
|
||||
* example with a url (anything using goto()). -->
|
||||
* <div class="step skip">
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
|
||||
/* global document, window */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
var util;
|
||||
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
util = event.detail.api.lib.util;
|
||||
}, false );
|
||||
|
||||
var getNextStep = function( el ) {
|
||||
var steps = document.querySelectorAll( ".step" );
|
||||
for ( var i = 0; i < steps.length; i++ ) {
|
||||
if ( steps[ i ] === el ) {
|
||||
if ( i + 1 < steps.length ) {
|
||||
return steps[ i + 1 ];
|
||||
} else {
|
||||
return steps[ 0 ];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var getPrevStep = function( el ) {
|
||||
var steps = document.querySelectorAll( ".step" );
|
||||
for ( var i = steps.length - 1; i >= 0; i-- ) {
|
||||
if ( steps[ i ] === el ) {
|
||||
if ( i - 1 >= 0 ) {
|
||||
return steps[ i - 1 ];
|
||||
} else {
|
||||
return steps[ steps.length - 1 ];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var skip = function( event ) {
|
||||
if ( ( !event ) || ( !event.target ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( event.detail.next.classList.contains( "skip" ) ) {
|
||||
if ( event.detail.reason === "next" ) {
|
||||
|
||||
// Go to the next next step instead
|
||||
event.detail.next = getNextStep( event.detail.next );
|
||||
|
||||
// Recursively call this plugin again, until there's a step not to skip
|
||||
skip( event );
|
||||
} else if ( event.detail.reason === "prev" ) {
|
||||
|
||||
// Go to the previous previous step instead
|
||||
event.detail.next = getPrevStep( event.detail.next );
|
||||
skip( event );
|
||||
}
|
||||
|
||||
// If the new next element has its own transitionDuration, we're responsible for setting
|
||||
// that on the event as well
|
||||
event.detail.transitionDuration = util.toNumber(
|
||||
event.detail.next.dataset.transitionDuration, event.detail.transitionDuration
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin to be called in pre-stepleave phase
|
||||
// The weight makes this plugin run early. This is a good thing, because this plugin calls
|
||||
// itself recursively.
|
||||
window.impress.addPreStepLeavePlugin( skip, 1 );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
21
src/plugins/stop/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
Stop Plugin
|
||||
===========
|
||||
|
||||
Example:
|
||||
|
||||
<!-- Stop at this slide.
|
||||
(For example, when used on the last slide, this prevents the
|
||||
presentation from wrapping back to the beginning.) -->
|
||||
<div class="step stop">
|
||||
|
||||
The stop plugin is a pre-stepleave plugin. It is executed before
|
||||
`impress:stepleave` event. If the current slide has `class="stop"`
|
||||
set, it will disable the next() command by setting the next slide to the current
|
||||
slide.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license.
|
||||
|
||||
35
src/plugins/stop/stop.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Stop Plugin
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <!-- Stop at this slide.
|
||||
* (For example, when used on the last slide, this prevents the
|
||||
* presentation from wrapping back to the beginning.) -->
|
||||
* <div class="step stop">
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
/* global document, window */
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
|
||||
var stop = function( event ) {
|
||||
if ( ( !event ) || ( !event.target ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( event.target.classList.contains( "stop" ) ) {
|
||||
if ( event.detail.reason === "next" ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin to be called in pre-stepleave phase
|
||||
// The weight makes this plugin run fairly early.
|
||||
window.impress.addPreStepLeavePlugin( stop, 2 );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
37
src/plugins/substep/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
Substep Plugin
|
||||
===============
|
||||
|
||||
Reveal each substep (such as a bullet point) of the step separately. Just like in PowerPoint!
|
||||
|
||||
If the current step contains html elements with `class="substep"` then this plugin will prevent a
|
||||
`prev()` / `next()` call to leave the slide, and instead reveal the next substep (for `next()`) or
|
||||
alternatively hide one (for `prev()`). Only once all substeps are shown, will a call to `next()`
|
||||
actually move to the next step, and only when all are hidden will a call to `prev()` move to the
|
||||
previous one.
|
||||
|
||||
Calls to `goto()` will be ignored by this plugin, i.e. `goto()` will transition to whichever step is
|
||||
the target.
|
||||
|
||||
In practice what happens is that when each substep is stepped through via `next()` calls, a
|
||||
`class="substep-visible"` class is added to the element. It is up to the presentation author to
|
||||
use the appropriate CSS to make the substeps hidden and visible.
|
||||
|
||||
Example:
|
||||
|
||||
<style type="text/css">
|
||||
.substep { opacity: 0; }
|
||||
.substep.substep-visible { opacity: 1; transition: opacity 1s; }
|
||||
</style>
|
||||
|
||||
<div class="step">
|
||||
<h1>Fruits</h1>
|
||||
<p class="substep">Orange</p>
|
||||
<p class="substep">Apple</p>
|
||||
</div>
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Copyright 2017 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license.
|
||||
|
||||
111
src/plugins/substep/substep.js
Normal file
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Substep Plugin
|
||||
*
|
||||
* Copyright 2017 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
|
||||
/* global document, window */
|
||||
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
|
||||
// Copied from core impress.js. Good candidate for moving to src/lib/util.js.
|
||||
var triggerEvent = function( el, eventName, detail ) {
|
||||
var event = document.createEvent( "CustomEvent" );
|
||||
event.initCustomEvent( eventName, true, true, detail );
|
||||
el.dispatchEvent( event );
|
||||
};
|
||||
|
||||
var activeStep = null;
|
||||
document.addEventListener( "impress:stepenter", function( event ) {
|
||||
activeStep = event.target;
|
||||
}, false );
|
||||
|
||||
var substep = function( event ) {
|
||||
if ( ( !event ) || ( !event.target ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var step = event.target;
|
||||
var el; // Needed by jshint
|
||||
if ( event.detail.reason === "next" ) {
|
||||
el = showSubstepIfAny( step );
|
||||
if ( el ) {
|
||||
|
||||
// Send a message to others, that we aborted a stepleave event.
|
||||
// Autoplay will reload itself from this, as there won't be a stepenter event now.
|
||||
triggerEvent( step, "impress:substep:stepleaveaborted",
|
||||
{ reason: "next", substep: el } );
|
||||
|
||||
// Returning false aborts the stepleave event
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ( event.detail.reason === "prev" ) {
|
||||
el = hideSubstepIfAny( step );
|
||||
if ( el ) {
|
||||
triggerEvent( step, "impress:substep:stepleaveaborted",
|
||||
{ reason: "prev", substep: el } );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var showSubstepIfAny = function( step ) {
|
||||
var substeps = step.querySelectorAll( ".substep" );
|
||||
var visible = step.querySelectorAll( ".substep-visible" );
|
||||
if ( substeps.length > 0 ) {
|
||||
return showSubstep( substeps, visible );
|
||||
}
|
||||
};
|
||||
|
||||
var showSubstep = function( substeps, visible ) {
|
||||
if ( visible.length < substeps.length ) {
|
||||
var el = substeps[ visible.length ];
|
||||
el.classList.add( "substep-visible" );
|
||||
return el;
|
||||
}
|
||||
};
|
||||
|
||||
var hideSubstepIfAny = function( step ) {
|
||||
var substeps = step.querySelectorAll( ".substep" );
|
||||
var visible = step.querySelectorAll( ".substep-visible" );
|
||||
if ( substeps.length > 0 ) {
|
||||
return hideSubstep( visible );
|
||||
}
|
||||
};
|
||||
|
||||
var hideSubstep = function( visible ) {
|
||||
if ( visible.length > 0 ) {
|
||||
var el = visible[ visible.length - 1 ];
|
||||
el.classList.remove( "substep-visible" );
|
||||
return el;
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin to be called in pre-stepleave phase.
|
||||
// The weight makes this plugin run before other preStepLeave plugins.
|
||||
window.impress.addPreStepLeavePlugin( substep, 1 );
|
||||
|
||||
// When entering a step, in particular when re-entering, make sure that all substeps are hidden
|
||||
// at first
|
||||
document.addEventListener( "impress:stepenter", function( event ) {
|
||||
var step = event.target;
|
||||
var visible = step.querySelectorAll( ".substep-visible" );
|
||||
for ( var i = 0; i < visible.length; i++ ) {
|
||||
visible[ i ].classList.remove( "substep-visible" );
|
||||
}
|
||||
}, false );
|
||||
|
||||
// API for others to reveal/hide next substep ////////////////////////////////////////////////
|
||||
document.addEventListener( "impress:substep:show", function() {
|
||||
showSubstepIfAny( activeStep );
|
||||
}, false );
|
||||
|
||||
document.addEventListener( "impress:substep:hide", function() {
|
||||
hideSubstepIfAny( activeStep );
|
||||
}, false );
|
||||
|
||||
} )( document, window );
|
||||
|
||||
41
src/plugins/toolbar/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
Toolbar plugin
|
||||
====================
|
||||
|
||||
This plugin provides a generic graphical toolbar. Other plugins that
|
||||
want to expose a button or other widget, can add those to this toolbar.
|
||||
|
||||
Using a single consolidated toolbar for all GUI widgets makes it easier
|
||||
to position and style the toolbar rather than having to do that for lots
|
||||
of different divs.
|
||||
|
||||
To add/activate the toolbar in your presentation, add this div:
|
||||
|
||||
<div id="impress-toolbar"></div>
|
||||
|
||||
Styling the toolbar is left to presentation author. Here's an example CSS:
|
||||
|
||||
.impress-enabled div#impress-toolbar {
|
||||
position: fixed;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.impress-enabled div#impress-toolbar > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
The [mouse-timeout](../mouse-timeout/README.md) plugin can be leveraged to hide
|
||||
the toolbar from sight, and only make it visible when mouse is moved.
|
||||
|
||||
body.impress-mouse-timeout div#impress-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
If you're writing a plugin and would like to add a widget to the toolbar, see
|
||||
[the top of the source file for further instructions](toolbar.js).
|
||||
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Henrik Ingo (@henrikingo), 2016
|
||||
157
src/plugins/toolbar/toolbar.js
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* Toolbar plugin
|
||||
*
|
||||
* This plugin provides a generic graphical toolbar. Other plugins that
|
||||
* want to expose a button or other widget, can add those to this toolbar.
|
||||
*
|
||||
* Using a single consolidated toolbar for all GUI widgets makes it easier
|
||||
* to position and style the toolbar rather than having to do that for lots
|
||||
* of different divs.
|
||||
*
|
||||
*
|
||||
* *** For presentation authors: *****************************************
|
||||
*
|
||||
* To add/activate the toolbar in your presentation, add this div:
|
||||
*
|
||||
* <div id="impress-toolbar"></div>
|
||||
*
|
||||
* Styling the toolbar is left to presentation author. Here's an example CSS:
|
||||
*
|
||||
* .impress-enabled div#impress-toolbar {
|
||||
* position: fixed;
|
||||
* right: 1px;
|
||||
* bottom: 1px;
|
||||
* opacity: 0.6;
|
||||
* }
|
||||
* .impress-enabled div#impress-toolbar > span {
|
||||
* margin-right: 10px;
|
||||
* }
|
||||
*
|
||||
* The [mouse-timeout](../mouse-timeout/README.md) plugin can be leveraged to hide
|
||||
* the toolbar from sight, and only make it visible when mouse is moved.
|
||||
*
|
||||
* body.impress-mouse-timeout div#impress-toolbar {
|
||||
* display: none;
|
||||
* }
|
||||
*
|
||||
*
|
||||
* *** For plugin authors **********************************************
|
||||
*
|
||||
* To add a button to the toolbar, trigger the `impress:toolbar:appendChild`
|
||||
* or `impress:toolbar:insertBefore` events as appropriate. The detail object
|
||||
* should contain following parameters:
|
||||
*
|
||||
* { group : 1, // integer. Widgets with the same group are grouped inside
|
||||
* // the same <span> element.
|
||||
* html : "<button>Click</button>", // The html to add.
|
||||
* callback : "mycallback", // Toolbar plugin will trigger event
|
||||
* // `impress:toolbar:added:mycallback` when done.
|
||||
* before: element } // The reference element for an insertBefore() call.
|
||||
*
|
||||
* You should also listen to the `impress:toolbar:added:mycallback` event. At
|
||||
* this point you can find the new widget in the DOM, and for example add an
|
||||
* event listener to it.
|
||||
*
|
||||
* You are free to use any integer for the group. It's ok to leave gaps. It's
|
||||
* ok to co-locate with widgets for another plugin, if you think they belong
|
||||
* together.
|
||||
*
|
||||
* See navigation-ui for an example.
|
||||
*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
* Released under the MIT license.
|
||||
*/
|
||||
|
||||
/* global document */
|
||||
|
||||
( function( document ) {
|
||||
"use strict";
|
||||
var toolbar = document.getElementById( "impress-toolbar" );
|
||||
var groups = [];
|
||||
|
||||
/**
|
||||
* Get the span element that is a child of toolbar, identified by index.
|
||||
*
|
||||
* If span element doesn't exist yet, it is created.
|
||||
*
|
||||
* Note: Because of Run-to-completion, this is not a race condition.
|
||||
* https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop#Run-to-completion
|
||||
*
|
||||
* :param: index Method will return the element <span id="impress-toolbar-group-{index}">
|
||||
*/
|
||||
var getGroupElement = function( index ) {
|
||||
var id = "impress-toolbar-group-" + index;
|
||||
if ( !groups[ index ] ) {
|
||||
groups[ index ] = document.createElement( "span" );
|
||||
groups[ index ].id = id;
|
||||
var nextIndex = getNextGroupIndex( index );
|
||||
if ( nextIndex === undefined ) {
|
||||
toolbar.appendChild( groups[ index ] );
|
||||
} else {
|
||||
toolbar.insertBefore( groups[ index ], groups[ nextIndex ] );
|
||||
}
|
||||
}
|
||||
return groups[ index ];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the span element from groups[] that is immediately after given index.
|
||||
*
|
||||
* This can be used to find the reference node for an insertBefore() call.
|
||||
* If no element exists at a larger index, returns undefined. (In this case,
|
||||
* you'd use appendChild() instead.)
|
||||
*
|
||||
* Note that index needn't itself exist in groups[].
|
||||
*/
|
||||
var getNextGroupIndex = function( index ) {
|
||||
var i = index + 1;
|
||||
while ( !groups[ i ] && i < groups.length ) {
|
||||
i++;
|
||||
}
|
||||
if ( i < groups.length ) {
|
||||
return i;
|
||||
}
|
||||
};
|
||||
|
||||
// API
|
||||
// Other plugins can add and remove buttons by sending them as events.
|
||||
// In return, toolbar plugin will trigger events when button was added.
|
||||
if ( toolbar ) {
|
||||
/**
|
||||
* Append a widget inside toolbar span element identified by given group index.
|
||||
*
|
||||
* :param: e.detail.group integer specifying the span element where widget will be placed
|
||||
* :param: e.detail.element a dom element to add to the toolbar
|
||||
*/
|
||||
toolbar.addEventListener( "impress:toolbar:appendChild", function( e ) {
|
||||
var group = getGroupElement( e.detail.group );
|
||||
group.appendChild( e.detail.element );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Add a widget to toolbar using insertBefore() DOM method.
|
||||
*
|
||||
* :param: e.detail.before the reference dom element, before which new element is added
|
||||
* :param: e.detail.element a dom element to add to the toolbar
|
||||
*/
|
||||
toolbar.addEventListener( "impress:toolbar:insertBefore", function( e ) {
|
||||
toolbar.insertBefore( e.detail.element, e.detail.before );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Remove the widget in e.detail.remove.
|
||||
*/
|
||||
toolbar.addEventListener( "impress:toolbar:removeWidget", function( e ) {
|
||||
toolbar.removeChild( e.detail.remove );
|
||||
} );
|
||||
|
||||
document.addEventListener( "impress:init", function( event ) {
|
||||
var api = event.detail.api;
|
||||
api.lib.gc.pushCallback( function() {
|
||||
toolbar.innerHTML = "";
|
||||
groups = [];
|
||||
} );
|
||||
} );
|
||||
} // If toolbar
|
||||
|
||||
} )( document );
|
||||
68
src/plugins/touch/touch.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Support for swipe and tap on touch devices
|
||||
*
|
||||
* This plugin implements navigation for plugin devices, via swiping left/right,
|
||||
* or tapping on the left/right edges of the screen.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copyright 2015: Andrew Dunai (@and3rson)
|
||||
* Modified to a plugin, 2016: Henrik Ingo (@henrikingo)
|
||||
*
|
||||
* MIT License
|
||||
*/
|
||||
/* global document, window */
|
||||
( function( document, window ) {
|
||||
"use strict";
|
||||
|
||||
// Touch handler to detect swiping left and right based on window size.
|
||||
// If the difference in X change is bigger than 1/20 of the screen width,
|
||||
// we simply call an appropriate API function to complete the transition.
|
||||
var startX = 0;
|
||||
var lastX = 0;
|
||||
var lastDX = 0;
|
||||
var threshold = window.innerWidth / 20;
|
||||
|
||||
document.addEventListener( "touchstart", function( event ) {
|
||||
lastX = startX = event.touches[ 0 ].clientX;
|
||||
} );
|
||||
|
||||
document.addEventListener( "touchmove", function( event ) {
|
||||
var x = event.touches[ 0 ].clientX;
|
||||
var diff = x - startX;
|
||||
|
||||
// To be used in touchend
|
||||
lastDX = lastX - x;
|
||||
lastX = x;
|
||||
|
||||
window.impress().swipe( diff / window.innerWidth );
|
||||
} );
|
||||
|
||||
document.addEventListener( "touchend", function() {
|
||||
var totalDiff = lastX - startX;
|
||||
if ( Math.abs( totalDiff ) > window.innerWidth / 5 && ( totalDiff * lastDX ) <= 0 ) {
|
||||
if ( totalDiff > window.innerWidth / 5 && lastDX <= 0 ) {
|
||||
window.impress().prev();
|
||||
} else if ( totalDiff < -window.innerWidth / 5 && lastDX >= 0 ) {
|
||||
window.impress().next();
|
||||
}
|
||||
} else if ( Math.abs( lastDX ) > threshold ) {
|
||||
if ( lastDX < -threshold ) {
|
||||
window.impress().prev();
|
||||
} else if ( lastDX > threshold ) {
|
||||
window.impress().next();
|
||||
}
|
||||
} else {
|
||||
|
||||
// No movement - move (back) to the current slide
|
||||
window.impress().goto( document.querySelector( "#impress .step.active" ) );
|
||||
}
|
||||
} );
|
||||
|
||||
document.addEventListener( "touchcancel", function() {
|
||||
|
||||
// Move (back) to the current slide
|
||||
window.impress().goto( document.querySelector( "#impress .step.active" ) );
|
||||
} );
|
||||
|
||||
} )( document, window );
|
||||
33
test/bootstrap.js
vendored
@@ -1,12 +1,25 @@
|
||||
/*jshint browser:true */
|
||||
|
||||
var root = document.createElement( "div" );
|
||||
root.innerHTML = [
|
||||
"<div id='impress'>",
|
||||
" <div class='step' data-x='-1000' data-y='0'>First slide</div>",
|
||||
" <div class='step' data-x='-800' data-y='0'>Second slide</div>",
|
||||
" <div class='step' data-x='-600' data-y='0'>Third slide</div>",
|
||||
" <div class='step' data-x='-400' data-y='0'>Fourth slide</div>",
|
||||
"</div>"
|
||||
].join( "" );
|
||||
document.body.appendChild( root );
|
||||
// TODO: This is the bootstrap file for *karma*. Poorly named (since karma is
|
||||
// only one option, in this repo) but keeping the same name now to avoid
|
||||
// unnecessary deviation with upstream.
|
||||
// If you just want to run the tests locally, you can open test/index.html in Firefox.
|
||||
|
||||
// That's annoying: karma-qunit doesn't provide the qunit-fixture element
|
||||
// https://github.com/karma-runner/karma-qunit/issues/18
|
||||
|
||||
// This file contains so much HTML, that we will just respectfully disagree about js
|
||||
/* jshint quotmark:single */
|
||||
/* global document */
|
||||
|
||||
var fix = document.createElement( 'div' );
|
||||
fix.id = 'qunit-fixture';
|
||||
fix.innerHTML = [
|
||||
'\n',
|
||||
' <iframe id="presentation-iframe"\n',
|
||||
' src="SET THIS IN YOUR QUNIT TESTS"\n',
|
||||
' width="595" height="485"\n',
|
||||
' frameborder="0" marginwidth="0" marginheight="0" scrolling="no"\n',
|
||||
' style="border:1px solid #CCC; max-width: 100%;">\n',
|
||||
' </iframe>'
|
||||
].join( '' );
|
||||
|
||||
@@ -1,166 +1,266 @@
|
||||
(function() {
|
||||
var registerEventListener = function( target, eventType, callback ) {
|
||||
target.addEventListener( eventType, callback );
|
||||
return function removeRegisteredEventListener() {
|
||||
target.removeEventListener( eventType, callback );
|
||||
/*
|
||||
* Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
*
|
||||
* Released under the MIT license. See LICENSE file.
|
||||
*/
|
||||
|
||||
/* global document, console, setTimeout, loadIframe, initPresentation, _impressSupported, QUnit */
|
||||
|
||||
QUnit.module( "Core Tests" );
|
||||
|
||||
QUnit.test( "Initialize Impress.js", function( assert ) {
|
||||
console.log( "Begin init() test" );
|
||||
|
||||
// Init triggers impress:init and impress:stepenter events, which we want to catch.
|
||||
var doneInit = assert.async();
|
||||
var doneStepEnter = assert.async();
|
||||
var doneSync = assert.async();
|
||||
|
||||
loadIframe( "test/core_tests_presentation.html", assert, function() {
|
||||
var iframe = document.getElementById( "presentation-iframe" );
|
||||
var iframeDoc = iframe.contentDocument;
|
||||
var iframeWin = iframe.contentWindow;
|
||||
var root = iframeDoc.querySelector( "div#impress" );
|
||||
|
||||
// Catch events triggered by init()
|
||||
var assertInit = function() {
|
||||
assert.ok( true, "impress:init event triggered." );
|
||||
|
||||
var canvas = iframeDoc.querySelector( "div#impress > div" );
|
||||
|
||||
// Delay and duration don't become set before the first transition actually happened
|
||||
assert.equal( canvas.style.transitionDelay,
|
||||
"0ms",
|
||||
"canvas.style.transitionDelay initialized correctly" );
|
||||
assert.equal( canvas.style.transitionDuration,
|
||||
"0ms",
|
||||
"canvas.style.transitionDuration initialized correctly" );
|
||||
|
||||
doneInit();
|
||||
console.log( "End init() test (async)" );
|
||||
};
|
||||
};
|
||||
|
||||
QUnit.begin(function() {
|
||||
impress().init();
|
||||
});
|
||||
var assertInitWrapper = function() {
|
||||
setTimeout( function() { assertInit(); }, 10 );
|
||||
};
|
||||
root.addEventListener( "impress:init", assertInitWrapper );
|
||||
|
||||
QUnit.module( "Initialization" );
|
||||
root.addEventListener( "impress:stepenter", function( event ) {
|
||||
assert.ok( true, "impress:stepenter event triggered." );
|
||||
var step1 = iframeDoc.querySelector( "div#step-1" );
|
||||
assert.equal( event.target, step1,
|
||||
event.target.id + " triggered impress:stepenter event." );
|
||||
doneStepEnter();
|
||||
} );
|
||||
|
||||
QUnit.test( "Global Scope", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
assert.ok( impress, "impress declared in global scope" );
|
||||
});
|
||||
// Synchronous code and assertions
|
||||
assert.ok( iframeWin.impress,
|
||||
"impress declared in global scope" );
|
||||
assert.strictEqual( iframeWin.impress().init(), undefined,
|
||||
"impress().init() called." );
|
||||
assert.strictEqual( iframeWin.impress().init(), undefined,
|
||||
"It's ok to call impress().init() a second time, it's a no-op." );
|
||||
|
||||
QUnit.test( "Multiple API instantiation", function( assert ) {
|
||||
assert.expect( 0 );
|
||||
impress().init();
|
||||
});
|
||||
// The asserts below are true immediately after impress().init() returns.
|
||||
// Therefore we test them here, not in an event handler.
|
||||
var notSupportedClass = iframeDoc.body.classList.contains( "impress-not-supported" );
|
||||
var yesSupportedClass = iframeDoc.body.classList.contains( "impress-supported" );
|
||||
if ( !_impressSupported() ) {
|
||||
assert.ok( notSupportedClass,
|
||||
"body.impress-not-supported class still there." );
|
||||
assert.ok( !yesSupportedClass,
|
||||
"body.impress-supported class was NOT added." );
|
||||
} else {
|
||||
assert.ok( !notSupportedClass,
|
||||
"body.impress-not-supported class was removed." );
|
||||
assert.ok( yesSupportedClass,
|
||||
"body.impress-supported class was added." );
|
||||
|
||||
QUnit.test( "Support Markup", function( assert ) {
|
||||
assert.expect( 4 );
|
||||
assert.ok( !iframeDoc.body.classList.contains( "impress-disabled" ),
|
||||
"body.impress-disabled is removed." );
|
||||
assert.ok( iframeDoc.body.classList.contains( "impress-enabled" ),
|
||||
"body.impress-enabled is added." );
|
||||
|
||||
var impressNotSupported = document.body.classList.contains( "impress-not-supported" );
|
||||
var impressSupported = document.body.classList.contains( "impress-supported" );
|
||||
assert.ok( impressSupported, "Have class .impress-supported" );
|
||||
assert.notOk( impressNotSupported, "Don't have class .impress-not-supported" );
|
||||
var canvas = iframeDoc.querySelector( "div#impress > div" );
|
||||
assert.ok( !canvas.classList.contains( "step" ) && canvas.id === "",
|
||||
"Additional 'canvas' div inserted between div#impress root and steps." );
|
||||
assert.equal( canvas.style.transform,
|
||||
"rotateZ(0deg) rotateY(0deg) rotateX(0deg) translate3d(1000px, 0px, 0px)",
|
||||
"canvas.style.transform initialized correctly" );
|
||||
assert.equal( canvas.style.transformOrigin,
|
||||
"left top 0px",
|
||||
"canvas.style.transformOrigin initialized correctly" );
|
||||
assert.equal( canvas.style.transformStyle,
|
||||
"preserve-3d",
|
||||
"canvas.style.transformStyle initialized correctly" );
|
||||
assert.equal( canvas.style.transitionProperty,
|
||||
"all",
|
||||
"canvas.style.transitionProperty initialized correctly" );
|
||||
assert.equal( canvas.style.transitionTimingFunction,
|
||||
"ease-in-out",
|
||||
"canvas.style.transitionTimingFunction initialized correctly" );
|
||||
|
||||
var impressDisabled = document.body.classList.contains( "impress-disabled" );
|
||||
var impressEnabled = document.body.classList.contains( "impress-enabled" );
|
||||
assert.ok( impressEnabled, "Have class .impress-enabled" );
|
||||
assert.notOk( impressDisabled, "Don't have class .impress-disabled" );
|
||||
});
|
||||
assert.equal( iframeDoc.documentElement.style.height,
|
||||
"100%",
|
||||
"documentElement.style.height is 100%" );
|
||||
|
||||
QUnit.test( "Attributes", function( assert ) {
|
||||
assert.expect( 10 );
|
||||
// Steps initialization
|
||||
var step1 = iframeDoc.querySelector( "div#step-1" );
|
||||
assert.equal( step1.style.position,
|
||||
"absolute",
|
||||
"Step position is 'absolute'." );
|
||||
|
||||
var actual, expected;
|
||||
var root = document.querySelector( "#impress" );
|
||||
var canvas = document.querySelector( "div#impress > div" );
|
||||
assert.ok( step1.classList.contains( "active" ),
|
||||
"Step 1 has active css class." );
|
||||
|
||||
var canvasIsNotAStep = !canvas.classList.contains("step") && canvas.id === "";
|
||||
assert.ok( canvasIsNotAStep, "Canvas do not have step element data" );
|
||||
}
|
||||
doneSync();
|
||||
console.log( "End init() test (sync)" );
|
||||
} ); // LoadIframe()
|
||||
|
||||
actual = canvas.style.webkitTransform || canvas.style.transform;
|
||||
expected = "rotateZ(0deg) rotateY(0deg) rotateX(0deg) translate3d(1000px, 0px, 0px)";
|
||||
assert.strictEqual( actual, expected, "canvas.style.transform initialized correctly" );
|
||||
} );
|
||||
|
||||
// Normalize result for IE 11 and Safari.
|
||||
actual = canvas.style.webkitTransformOrigin || canvas.style.transformOrigin;
|
||||
expected = "left top 0px";
|
||||
// Note: Here we focus on testing the core functionality of moving between
|
||||
// steps, the css classes set and unset, and events triggered.
|
||||
// TODO: more complex animations and check position, transitions, delays, etc...
|
||||
QUnit.test( "Impress Core API", function( assert ) {
|
||||
console.log( "Begin core api test" );
|
||||
var done = assert.async();
|
||||
loadIframe( "test/core_tests_presentation.html", assert, function() {
|
||||
initPresentation( assert, function() {
|
||||
var iframe = document.getElementById( "presentation-iframe" );
|
||||
var iframeDoc = iframe.contentDocument;
|
||||
var iframeWin = iframe.contentWindow;
|
||||
|
||||
if ( actual === "left top" || actual === "0% 0%" ) {
|
||||
actual = expected;
|
||||
}
|
||||
assert.strictEqual( actual, expected, "canvas.style.transformOrigin initialized correctly" );
|
||||
// Impress.js itself uses event listeners to manipulate most CSS classes.
|
||||
// Wait a short while before checking, to avoid race.
|
||||
// (See assertStepEnterWrapper and assertStepLeaveWrapper.)
|
||||
var wait = 5; // Milliseconds
|
||||
|
||||
actual = canvas.style.webkitTransformStyle || canvas.style.transformStyle;
|
||||
expected = "preserve-3d";
|
||||
assert.strictEqual( actual, expected, "canvas.style.transformStyle initialized correctly" );
|
||||
var step1 = iframeDoc.querySelector( "div#step-1" );
|
||||
var step2 = iframeDoc.querySelector( "div#step-2" );
|
||||
var step3 = iframeDoc.querySelector( "div#step-3" );
|
||||
var step4 = iframeDoc.querySelector( "div#fourth" );
|
||||
var root = iframeDoc.querySelector( "div#impress" );
|
||||
|
||||
actual = canvas.style.transitionDelay;
|
||||
expected = "0ms";
|
||||
assert.strictEqual( actual, expected, "canvas.style.transitionDelay initialized correctly" );
|
||||
// On impress:stepenter, we do some assertions on the "entered" object.
|
||||
// On impress:stepleave, we do some assertions on the "left" object.
|
||||
// Finally we call next() to initialize the next transition, and it starts all over again.
|
||||
var i = 0;
|
||||
var sequence = [ { left: step1,
|
||||
entered: step2,
|
||||
next: function() { return iframeWin.impress().goto( 2 ); },
|
||||
text: "goto(<number>) called and returns ok (2->3)" },
|
||||
{ left: step2,
|
||||
entered: step3,
|
||||
next: function() { return iframeWin.impress().goto( "fourth" ); },
|
||||
text: "goto(<string>) called and returns ok (3->4)" },
|
||||
{ left: step3,
|
||||
entered: step4,
|
||||
next: function() { return iframeWin.impress().next(); },
|
||||
text: "next() wraps around to first step (4->1)" },
|
||||
{ left: step4,
|
||||
entered: step1,
|
||||
next: function() { return iframeWin.impress().prev(); },
|
||||
text: "prev() wraps around to last step (1->4)" },
|
||||
{ left: step1,
|
||||
entered: step4,
|
||||
next: function() { return iframeWin.impress().prev(); },
|
||||
text: "prev() called and returns ok (4->3)" },
|
||||
{ left: step4,
|
||||
entered: step3,
|
||||
next: function() { return iframeWin.impress().goto( 0 ); },
|
||||
text: "End of test suite, return to first step with goto(0)." },
|
||||
{ left: step3,
|
||||
entered: step1,
|
||||
next: false } // False = end of sequence
|
||||
];
|
||||
|
||||
actual = canvas.style.transitionDuration;
|
||||
expected = "0ms";
|
||||
assert.strictEqual( actual, expected, "canvas.style.transitionDuration initialized correctly" );
|
||||
// When both assertStepEnter and assertStepLeave are done, we can go to next step in sequence.
|
||||
var readyCount = 0;
|
||||
var readyForNext = function() {
|
||||
readyCount++;
|
||||
if ( readyCount % 2 === 0 ) {
|
||||
if ( sequence[ i ].next ) {
|
||||
assert.ok( sequence[ i ].next(), sequence[ i ].text );
|
||||
i++;
|
||||
assertImmediately();
|
||||
} else {
|
||||
done();
|
||||
console.log( "End core api test" );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
actual = canvas.style.transitionProperty;
|
||||
expected = "all";
|
||||
assert.strictEqual( actual, expected, "canvas.style.transitionProperty initialized correctly" );
|
||||
// Things to check on impress:stepenter event -----------------------------//
|
||||
var assertStepEnter = function( event ) {
|
||||
assert.equal( event.target, sequence[ i ].entered,
|
||||
event.target.id + " triggered impress:stepenter event." );
|
||||
assert.ok( event.target.classList.contains( "present" ),
|
||||
event.target.id + " set present css class." );
|
||||
assert.ok( !event.target.classList.contains( "future" ),
|
||||
event.target.id + " unset future css class." );
|
||||
assert.ok( !event.target.classList.contains( "past" ),
|
||||
event.target.id + " unset past css class." );
|
||||
assert.equal( "#/" + event.target.id, iframeWin.location.hash,
|
||||
"Hash is " + "#/" + event.target.id );
|
||||
|
||||
actual = canvas.style.transitionTimingFunction;
|
||||
expected = "ease-in-out";
|
||||
assert.strictEqual( actual, expected, "canvas.style.transitionTimingFunction initialized correctly" );
|
||||
// Just by way of comparison, check transitionDuration again, in a non-init transition
|
||||
var canvas = iframeDoc.querySelector( "div#impress > div" );
|
||||
assert.equal( canvas.style.transitionDelay,
|
||||
"0ms",
|
||||
"canvas.style.transitionDelay set correctly" );
|
||||
assert.equal( canvas.style.transitionDuration,
|
||||
"1000ms",
|
||||
"canvas.style.transitionDuration set correctly" );
|
||||
|
||||
actual = root.style.perspective;
|
||||
expected = "";
|
||||
assert.notStrictEqual( actual, expected, "root.style.perspective should be set explicitly for IE 11" );
|
||||
readyForNext();
|
||||
};
|
||||
|
||||
actual = document.documentElement.style.height;
|
||||
expected = "100%";
|
||||
assert.strictEqual( actual, expected, "documentElement.style.height is 100%" );
|
||||
});
|
||||
var assertStepEnterWrapper = function( event ) {
|
||||
setTimeout( function() { assertStepEnter( event ); }, wait );
|
||||
};
|
||||
root.addEventListener( "impress:stepenter", assertStepEnterWrapper );
|
||||
|
||||
QUnit.test( "Steps", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
// Things to check on impress:stepleave event -----------------------------//
|
||||
var assertStepLeave = function( event ) {
|
||||
assert.equal( event.target, sequence[ i ].left,
|
||||
event.target.id + " triggered impress:stepleave event." );
|
||||
assert.ok( !event.target.classList.contains( "present" ),
|
||||
event.target.id + " unset present css class." );
|
||||
assert.ok( !event.target.classList.contains( "future" ),
|
||||
event.target.id + " unset future css class." );
|
||||
assert.ok( event.target.classList.contains( "past" ),
|
||||
event.target.id + " set past css class." );
|
||||
readyForNext();
|
||||
};
|
||||
|
||||
var actual, expected;
|
||||
var step1 = document.querySelector( "div#step-1" );
|
||||
var assertStepLeaveWrapper = function( event ) {
|
||||
setTimeout( function() { assertStepLeave( event ); }, wait );
|
||||
};
|
||||
root.addEventListener( "impress:stepleave", assertStepLeaveWrapper );
|
||||
|
||||
actual = step1.style.position;
|
||||
expected = "absolute";
|
||||
assert.strictEqual( actual, expected, "Step position is 'absolute'" );
|
||||
// Things to check immediately after impress().goto() ---------------------------//
|
||||
var assertImmediately = function() {
|
||||
assert.ok( sequence[ i ].entered.classList.contains( "active" ),
|
||||
sequence[ i ].entered.id + " set active css class." );
|
||||
assert.ok( !sequence[ i ].left.classList.contains( "active" ),
|
||||
sequence[ i ].left.id + " unset active css class." );
|
||||
};
|
||||
|
||||
assert.ok( step1.classList.contains( "active" ), "Step 1 has active css class." );
|
||||
});
|
||||
// Done with setup. Start testing! -----------------------------------------------//
|
||||
// Do no-op tests first, then trigger the sequence of transitions we setup above. //
|
||||
|
||||
QUnit.module( "Core API" );
|
||||
assert.strictEqual( iframeWin.impress().goto( iframeDoc.querySelector( "div#impress" ) ),
|
||||
false,
|
||||
"goto() to a non-step element fails, as it should." );
|
||||
assert.strictEqual( iframeWin.impress().goto(),
|
||||
false,
|
||||
"goto(<nothing>) fails, as it should." );
|
||||
|
||||
QUnit.test( ".next()", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var root = document.querySelector( "div#impress" );
|
||||
var step1 = document.querySelector( "div#step-1" );
|
||||
var step2 = document.querySelector( "div#step-2" );
|
||||
var done = assert.async();
|
||||
|
||||
impress().next();
|
||||
|
||||
assert.ok( step2.classList.contains( "active" ), step2.id + " add active css class." );
|
||||
assert.notOk( step1.classList.contains( "active" ), step1.id + " remove active css class." );
|
||||
|
||||
// Reset to original state
|
||||
var removeStepEnterEvent = registerEventListener( root, "impress:stepenter", function() {
|
||||
removeStepEnterEvent();
|
||||
done();
|
||||
});
|
||||
impress().goto( step1 );
|
||||
});
|
||||
|
||||
QUnit.test( "impress:stepenter event", function( assert ) {
|
||||
assert.expect( 4 );
|
||||
|
||||
var actual, expected;
|
||||
var root = document.querySelector( "div#impress" );
|
||||
var step1 = document.querySelector( "div#step-1" );
|
||||
var step2 = document.querySelector( "div#step-2" );
|
||||
var done = assert.async();
|
||||
|
||||
var removeTestEvent = registerEventListener( root, "impress:stepenter", function( event ) {
|
||||
actual = event.target;
|
||||
expected = step2;
|
||||
assert.strictEqual( actual, expected, "Triggered event for the second step" );
|
||||
|
||||
assert.ok( step2.classList.contains( "present" ), event.target.id + " add present css class" );
|
||||
assert.notOk( step2.classList.contains( "future" ), event.target.id + " remove future css class" );
|
||||
assert.notOk( step2.classList.contains( "past" ), event.target.id + " remove active css class." );
|
||||
|
||||
removeTestEvent();
|
||||
|
||||
// Reset to original state
|
||||
var removeCleanupEvent = registerEventListener( root, "impress:stepenter", function() {
|
||||
removeCleanupEvent();
|
||||
done();
|
||||
});
|
||||
|
||||
impress().goto( step1 );
|
||||
});
|
||||
|
||||
impress().next();
|
||||
});
|
||||
|
||||
QUnit.done(function( details ) {
|
||||
// Impress.js will set the hash part of the url, we want to unset it when finished
|
||||
// Otherwise a refresh of browser page would not start tests from the last step step
|
||||
window.location.hash = "";
|
||||
// Add back vertical scrollbar so we can read results if there were failures.
|
||||
document.body.style.overflow = 'auto';
|
||||
});
|
||||
}());
|
||||
// This starts executing the sequence above
|
||||
assert.ok( iframeWin.impress().next(),
|
||||
"next() called and returns ok (1->2)" );
|
||||
} ); // InitPresentation()
|
||||
} ); // LoadIframe()
|
||||
} );
|
||||
|
||||
24
test/core_tests_presentation.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright 2016 Henrik Ingo (@henrikingo)
|
||||
Released under the MIT license. See LICENSE file.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>The presentation steps used in an iframe in core_tests.js</title>
|
||||
</head>
|
||||
<!-- id is used by syn -->
|
||||
<body class="impress-not-supported" id="bodyid">
|
||||
<div id="impress">
|
||||
<div class="step" data-x="-1000" data-y="0">First slide</div>
|
||||
<div class="step" data-x="-800" data-y="0">Second slide <br /><a href="#fourth" id="linktofourth">link to fourth slide</a></div>
|
||||
<div class="step" data-x="-600" data-y="0">Third slide<br /><a href="#step-1" id="linktofirst">link to first slide</a></div>
|
||||
<div class="step" id="fourth" data-x="-400" data-y="0">Fourth slide</div>
|
||||
</div>
|
||||
<script src="../js/impress.js"></script>
|
||||
<!-- This is a copy of dist/syn.js from bower install syn. (The one in npm install doesn't work in a browser.) -->
|
||||
<!-- See http://bitovi.com/blog/2010/07/syn-a-standalone-synthetic-event-library.html for simple usage guide. -->
|
||||
<script src="../node_modules/syn/dist/global/syn.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
110
test/helpers.js
Normal file
@@ -0,0 +1,110 @@
|
||||
// This file contains so much HTML, that we will just respectfully disagree about js
|
||||
/* jshint quotmark:single */
|
||||
/* global document, console, setTimeout, navigator */
|
||||
/* exported loadIframe, initPresentation, _impressSupported */
|
||||
|
||||
var loadIframe = function( src, assert, callback ) {
|
||||
console.log( 'Begin loadIframe' );
|
||||
|
||||
// When running in Karma, the #qunit-fixture appears from somewhere and we can't set its
|
||||
// contents in advance.
|
||||
var fix = document.getElementById( 'qunit-fixture' );
|
||||
fix.innerHTML = [
|
||||
'\n',
|
||||
' <iframe id="presentation-iframe"\n',
|
||||
' src="SET THIS IN YOUR QUNIT TESTS"\n',
|
||||
' width="595" height="485"\n',
|
||||
' frameborder="0" marginwidth="0" marginheight="0" scrolling="no"\n',
|
||||
' style="border:1px solid #CCC; max-width: 100%;">\n',
|
||||
' </iframe>'
|
||||
].join( '' );
|
||||
|
||||
var iframe = document.getElementById( 'presentation-iframe' );
|
||||
|
||||
var onLoad = function() {
|
||||
assert.ok( true,
|
||||
'Presentation loaded. iframe.src = ' + iframe.src );
|
||||
try {
|
||||
assert.ok( iframe.contentDocument,
|
||||
'Verifying that tests can access the presentation inside the iframe. ' +
|
||||
'Note: On Firefox this fails when using paths with "../" parts for the iframe.' );
|
||||
}
|
||||
catch ( err ) {
|
||||
assert.ok( false,
|
||||
'Error when trying to access presentation in iframe. Note: When using Chrome with ' +
|
||||
'local files (file:///) this will fail with SecurityError. ' +
|
||||
'You can however use Chrome over Karma.' );
|
||||
}
|
||||
console.log( 'End loadIframe' );
|
||||
callback();
|
||||
};
|
||||
|
||||
// FIXME: Seems to be some race in loading js files inside the iframe (in CircleCI).
|
||||
// The error that happens is that window.impress isn't set yet, even if onLoad event triggered.
|
||||
// Needs more investigation.
|
||||
var onLoadWrapper = function( event ) {
|
||||
setTimeout( function() { onLoad( event ); }, 1000 );
|
||||
};
|
||||
iframe.addEventListener( 'load', onLoadWrapper );
|
||||
|
||||
assert.ok( true,
|
||||
'Setting iframe.src = ' + src );
|
||||
iframe.src = src;
|
||||
};
|
||||
|
||||
var initPresentation = function( assert, callback ) {
|
||||
console.log( 'Begin initPresentation' );
|
||||
var iframe = document.getElementById( 'presentation-iframe' );
|
||||
var iframeDoc = iframe.contentDocument;
|
||||
var iframeWin = iframe.contentWindow;
|
||||
|
||||
// Impress:stepenter is the last event triggered in init(), so we wait for that.
|
||||
var waitForStepEnter = function( event ) {
|
||||
assert.ok( true, 'impress (' + event.target.id + ') is now initialized.' );
|
||||
iframeDoc.removeEventListener( 'impress:stepenter', waitForStepEnterWrapper );
|
||||
console.log( 'End initPresentation' );
|
||||
callback();
|
||||
};
|
||||
|
||||
// Unfortunately, impress.js uses the impress:stepenter event internally to
|
||||
// do some things related to entering a step. This causes a race condition when
|
||||
// we listen for the same event and expect it to be done with everything.
|
||||
// We wait 5 ms to resolve the race condition, then it's safe to start testing.
|
||||
var waitForStepEnterWrapper = function( event ) {
|
||||
setTimeout( function() { waitForStepEnter( event ); }, 5 );
|
||||
};
|
||||
iframeDoc.addEventListener( 'impress:stepenter', waitForStepEnterWrapper );
|
||||
|
||||
assert.strictEqual( iframeWin.impress().init(), undefined, 'Initializing impress.' );
|
||||
};
|
||||
|
||||
// Helper function to determine whether this browser is supported by
|
||||
// impress.js or not. Copied from impress.js itself.
|
||||
var _impressSupported = function() {
|
||||
var pfx = ( function() {
|
||||
var style = document.createElement( 'dummy' ).style,
|
||||
prefixes = 'Webkit Moz O ms Khtml'.split( ' ' ),
|
||||
memory = {};
|
||||
return function( prop ) {
|
||||
if ( typeof memory[ prop ] === 'undefined' ) {
|
||||
var ucProp = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),
|
||||
props = ( prop + ' ' + prefixes.join( ucProp + ' ' ) + ucProp ).split( ' ' );
|
||||
memory[ prop ] = null;
|
||||
for ( var i in props ) {
|
||||
if ( style[ props[ i ] ] !== undefined ) {
|
||||
memory[ prop ] = props[ i ];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return memory[ prop ];
|
||||
};
|
||||
} )();
|
||||
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
return ( pfx( 'perspective' ) !== null ) &&
|
||||
( document.body.classList ) &&
|
||||
( document.body.dataset ) &&
|
||||
( ua.search( /(iphone)|(ipod)|(android)/ ) === -1 );
|
||||
};
|
||||
|
||||