diff --git a/Pepiniere/docker/.gitignore b/Pepiniere/docker/.gitignore new file mode 100644 index 0000000..4635e8f --- /dev/null +++ b/Pepiniere/docker/.gitignore @@ -0,0 +1,2 @@ +*.tgz +*.pdf diff --git a/Pepiniere/docker/.gitlab-ci.yml b/Pepiniere/docker/.gitlab-ci.yml new file mode 100644 index 0000000..367be7b --- /dev/null +++ b/Pepiniere/docker/.gitlab-ci.yml @@ -0,0 +1,112 @@ +variables: + GIT_SUBMODULE_STRATEGY: recursive + +stages: + - build + +build-pdf-introduction-aux-conteneurs: + stage: build + image: + name: astefanutti/decktape:2.11.0 + entrypoint: [""] + only: + - schedules + tags: + - sii + - france + script: + # + # 1. We change the size with --size due to a strange rendering bug + # as decribed here: https://github.com/astefanutti/decktape/issues/151 + # + # 2. We also specify --chrome-arg=--disable-web-security to autorize + # Cross origin requests in chrome as described here: + # https://github.com/astefanutti/decktape/issues/157 + # + - node /decktape/decktape.js --chrome-path chromium-browser --chrome-arg=--no-sandbox --chrome-arg=--disable-web-security --size='1576x1182' 1.introduction-aux-conteneurs/index.html docker.introduction-aux-conteneurs.pdf + artifacts: + name: introduction-aux-conteneurs + expire_in: 8 days + paths: + - docker.introduction-aux-conteneurs.pdf + + +build-pdf-images-de-conteneurs: + stage: build + image: + name: astefanutti/decktape:2.11.0 + entrypoint: [""] + only: + - schedules + tags: + - sii + - france + script: + # + # 1. We change the size with --size due to a strange rendering bug + # as decribed here: https://github.com/astefanutti/decktape/issues/151 + # + # 2. We also specify --chrome-arg=--disable-web-security to autorize + # Cross origin requests in chrome as described here: + # https://github.com/astefanutti/decktape/issues/157 + # + - node /decktape/decktape.js --chrome-path chromium-browser --chrome-arg=--no-sandbox --chrome-arg=--disable-web-security --size='1576x1182' 2.images-de-conteneurs/index.html docker.images-de-conteneurs.pdf + artifacts: + name: images-de-conteneurs + expire_in: 8 days + paths: + - docker.images-de-conteneurs.pdf + + +build-pdf-conteneurs-utilisation-avancee: + stage: build + image: + name: astefanutti/decktape:2.11.0 + entrypoint: [""] + only: + - schedules + tags: + - sii + - france + script: + # + # 1. We change the size with --size due to a strange rendering bug + # as decribed here: https://github.com/astefanutti/decktape/issues/151 + # + # 2. We also specify --chrome-arg=--disable-web-security to autorize + # Cross origin requests in chrome as described here: + # https://github.com/astefanutti/decktape/issues/157 + # + - node /decktape/decktape.js --chrome-path chromium-browser --chrome-arg=--no-sandbox --chrome-arg=--disable-web-security --size='1576x1182' 3.conteneurs-utilisation-avancee/index.html docker.conteneurs-utilisation-avancee.pdf + artifacts: + name: conteneurs-utilisation-avancee + expire_in: 8 days + paths: + - docker.conteneurs-utilisation-avancee.pdf + + +build-pdf-swarm: + stage: build + image: + name: astefanutti/decktape:2.11.0 + entrypoint: [""] + only: + - schedules + tags: + - sii + - france + script: + # + # 1. We change the size with --size due to a strange rendering bug + # as decribed here: https://github.com/astefanutti/decktape/issues/151 + # + # 2. We also specify --chrome-arg=--disable-web-security to autorize + # Cross origin requests in chrome as described here: + # https://github.com/astefanutti/decktape/issues/157 + # + - node /decktape/decktape.js --chrome-path chromium-browser --chrome-arg=--no-sandbox --chrome-arg=--disable-web-security --size='1576x1182' 5.swarm/index.html docker.swarm.pdf + artifacts: + name: swarm + expire_in: 8 days + paths: + - docker.swarm.pdf diff --git a/Pepiniere/docker/.gitmodules b/Pepiniere/docker/.gitmodules new file mode 100644 index 0000000..7797423 --- /dev/null +++ b/Pepiniere/docker/.gitmodules @@ -0,0 +1,4 @@ +[submodule "revealjs"] + path = revealjs + url = ../../template-revealjs-sii-theme.git + diff --git a/Pepiniere/docker/0.introduction-formation/images/CTRITTEN.jpg b/Pepiniere/docker/0.introduction-formation/images/CTRITTEN.jpg new file mode 100644 index 0000000..6c0a9a0 Binary files /dev/null and b/Pepiniere/docker/0.introduction-formation/images/CTRITTEN.jpg differ diff --git a/Pepiniere/docker/0.introduction-formation/images/MPOULLAIN.jpg b/Pepiniere/docker/0.introduction-formation/images/MPOULLAIN.jpg new file mode 100644 index 0000000..ae93aa0 Binary files /dev/null and b/Pepiniere/docker/0.introduction-formation/images/MPOULLAIN.jpg differ diff --git a/Pepiniere/docker/0.introduction-formation/images/docker-wave-whale.svg b/Pepiniere/docker/0.introduction-formation/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/0.introduction-formation/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/0.introduction-formation/index.html b/Pepiniere/docker/0.introduction-formation/index.html new file mode 100755 index 0000000..3b7e54e --- /dev/null +++ b/Pepiniere/docker/0.introduction-formation/index.html @@ -0,0 +1,72 @@ + + + + + + + SII - Introduction + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/0.introduction-formation/introduction-formation.md b/Pepiniere/docker/0.introduction-formation/introduction-formation.md new file mode 100755 index 0000000..eec36da --- /dev/null +++ b/Pepiniere/docker/0.introduction-formation/introduction-formation.md @@ -0,0 +1,69 @@ +# Formation Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +Christian Tritten +ctritten@sii.fr + + +## Pré-requis + +* Savoir utiliser les commandes de base de Linux + +* Savoir utiliser `vim` ou `nano` + + +## Formation à distance + +* Vous pouvez intervenir quand vous voulez... + mais gardez votre micro coupé le reste du temps. + +* Lorsque vous intervenez n'hésitez pas à allumer + votre caméra afin de permettre un échange plus convivial. + +* Sur Teams, vous pouvez la main en cas de problème. + + +## Horaires + +||| +|:-|-:| +|démarrage|__9h30__| +|pause|__~ 11h00__| +|repas|__12h30__| +|reprise|__14h00__| +|pause|__~ 16h00__| +|fin|__17h30__| + + +# Badge + +Le port du badge SII de façon visible +est obligatoire dans les locaux. + + +# Tour de table + +* Qui êtes-vous ? + +* Connaissez-vous déjà Docker ? + +* Qu'attendez-vous de la formation ? + + + +# C'est parti !!! + + + +# Ressources internes + + +1. Formation Docker SII +[https://gitlab.sii.fr/sii-ouest/trainings/docker](https://gitlab.sii.fr/sii-ouest/trainings/docker) + +2. Mattermost SII ouest +[https://mattermost.siinergy.net/ouest/channels/docker](https://mattermost.siinergy.net/ouest/channels/docker) + +3. Mattermost SII France +[https://mattermost.siinergy.net/france/channels/community-docker](https://mattermost.siinergy.net/france/channels/community-docker) diff --git a/Pepiniere/docker/0.introduction-formation/revealjs b/Pepiniere/docker/0.introduction-formation/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/0.introduction-formation/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/build-ship-run-any-app-anywhere.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/build-ship-run-any-app-anywhere.png new file mode 100644 index 0000000..f70c333 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/build-ship-run-any-app-anywhere.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-container.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-container.png new file mode 100644 index 0000000..520ac62 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-container.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-customers.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-customers.png new file mode 100644 index 0000000..42fcd5c Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-customers.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-cycle.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-cycle.png new file mode 100644 index 0000000..783faf0 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-cycle.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-engine-containerd-runc.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-engine-containerd-runc.png new file mode 100644 index 0000000..54ac240 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-engine-containerd-runc.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-engine.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-engine.png new file mode 100644 index 0000000..3a51e2c Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-engine.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-networking-host.jpg b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-networking-host.jpg new file mode 100644 index 0000000..f5d2faf Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-networking-host.jpg differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-on-linux-platform.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-on-linux-platform.png new file mode 100644 index 0000000..235cc5c Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-on-linux-platform.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-on-windows-platform.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-on-windows-platform.png new file mode 100644 index 0000000..1356d5b Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-on-windows-platform.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-run-workflow.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-run-workflow.png new file mode 100644 index 0000000..ee554d9 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-run-workflow.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-subscription.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-subscription.png new file mode 100644 index 0000000..814d4e4 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-subscription.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-wave-whale.svg b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/1.introduction-aux-conteneurs/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/logo-docker.svg b/Pepiniere/docker/1.introduction-aux-conteneurs/images/logo-docker.svg new file mode 100644 index 0000000..4242689 --- /dev/null +++ b/Pepiniere/docker/1.introduction-aux-conteneurs/images/logo-docker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/logo-podman.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/logo-podman.png new file mode 100644 index 0000000..e5a68b5 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/logo-podman.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/micro-services.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/micro-services.png new file mode 100644 index 0000000..3bdf55d Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/micro-services.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/most-popular-docker-official-images-in-2020.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/most-popular-docker-official-images-in-2020.png new file mode 100644 index 0000000..8b83278 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/most-popular-docker-official-images-in-2020.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/network-expose-publish.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/network-expose-publish.png new file mode 100644 index 0000000..5848bb0 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/network-expose-publish.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/network-expose.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/network-expose.png new file mode 100644 index 0000000..60553fc Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/network-expose.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/network.jpg b/Pepiniere/docker/1.introduction-aux-conteneurs/images/network.jpg new file mode 100644 index 0000000..8d096ee Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/network.jpg differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/solomon-hykes.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/solomon-hykes.png new file mode 100644 index 0000000..019c1d6 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/solomon-hykes.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/tp.gif b/Pepiniere/docker/1.introduction-aux-conteneurs/images/tp.gif new file mode 100644 index 0000000..101ea93 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/tp.gif differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-Kernel-space-virtualization-vs-containerization.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-Kernel-space-virtualization-vs-containerization.png new file mode 100644 index 0000000..1e665b0 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-Kernel-space-virtualization-vs-containerization.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-julia-evans.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-julia-evans.png new file mode 100644 index 0000000..39c364a Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-julia-evans.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-simple-container.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-simple-container.png new file mode 100644 index 0000000..5d55c69 Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-simple-container.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-simple-user-space.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-simple-user-space.png new file mode 100644 index 0000000..18b8bfa Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/user-space-vs-kernel-space-simple-user-space.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/images/virtual-machine-vs-container.png b/Pepiniere/docker/1.introduction-aux-conteneurs/images/virtual-machine-vs-container.png new file mode 100644 index 0000000..a75ac2d Binary files /dev/null and b/Pepiniere/docker/1.introduction-aux-conteneurs/images/virtual-machine-vs-container.png differ diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/index.html b/Pepiniere/docker/1.introduction-aux-conteneurs/index.html new file mode 100755 index 0000000..5478467 --- /dev/null +++ b/Pepiniere/docker/1.introduction-aux-conteneurs/index.html @@ -0,0 +1,88 @@ + + + + + + + SII - Introduction aux conteneurs + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/introduction-aux-conteneurs.md b/Pepiniere/docker/1.introduction-aux-conteneurs/introduction-aux-conteneurs.md new file mode 100755 index 0000000..c594cde --- /dev/null +++ b/Pepiniere/docker/1.introduction-aux-conteneurs/introduction-aux-conteneurs.md @@ -0,0 +1,1121 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +__Introduction aux conteneurs Docker__ + +Maxime Poullain • Christian Tritten + + + + +Un conteneur est un environnement d'exécution +_maitrisé_ et _auto-suffisant_ +qui _partage le noyau du système hôte_ +et qui est _isolé_ du reste du système. + +![Conteneurs](images/docker-container.png) + + +Docker est une technologie +qui permet d'embarquer une application +dans un conteneur virtuel qui pourra +s'exécuter sur n'importe quelle machine. + + +### A quoi ça peut servir ? + +* Cloisonner des applications +(serveur web, de base de donnée, ...) + +* Exécuter un traitement ou un calcul ponctuel +(par ex. compilation, tests unitaires, transcodage, etc...) + +* Multiplier rapidement le nombre d'instances d'une application +(Orchestration : Docker Swarm, Kubernetes, etc...) + + +### Pour un développeur + +* Utiliser la même pile applicative lors des phases de développement et tests que celle qui tournera en production +(et ainsi réduire les sources d'erreurs...) + +* Lancer plusieurs versions distinctes d'une même application sur sa machine +(par ex. plusieurs stacks LAMP différentes) + + +![Les images Docker les plus populaires en 2020](images/most-popular-docker-official-images-in-2020.png) + +Source : https://www.docker.com/blog/docker-index-shows-continued-massive-developer-adoption-and-activity-to-build-and-share-apps-with-docker/ + + +### Principaux objectifs de Docker + +* Faciliter l'empaquetage et la distribution des applications. + +* Simplifier le déploiement et la mise à jour des applications. + +* Épouser les principes des philosophies devops et microservices. + + +![Build Ship Run](images/build-ship-run-any-app-anywhere.png) + + + +## Conteneurisation - Un peu d'histoire + + +### 1979 + +* _Chroot_ est un utilitaire qui permet de changer la racine du système de fichiers pour un processus et ses enfants. + +* Il s'agit d'une des premières mise en oeuvre d'un concept d'isolation au sein des systèmes d'exploitation. + + +### 2000 + +* _Jails_ permet d'aller plus loin que _chroot_ en isolant les processus, les utilisateurs, et le réseau sur un système BSD. + +* Chaque jail est un environnement virtuel isolé à l'intérieur duquel on peut déléguer l'administration tout en conservant un bon niveau de sécurité sur le système hôte. + + +### 2001 + +* L'idée est ensuite reprise sur Linux avec Linux VServer qui permet de partitionner le réseau, la mémoire, et le système de fichier. + + +### 2002 + +* La technologie _Linux Namespaces_ qui permet de faire de l'isolation par processus commence à être intégré dans le noyau Linux. + + +### 2006 + +* Le projet _Process Containers_ est initié chez Google. + +* Il s'agit d'un ensemble de mécanismes permettant de limiter les ressources disponibles pour un processus. + +* Cette technologie, connue sous le nom de _Control Groups_ est intégrée dans le noyaux Linux. + + +### 2008 + +* _LXC_ (LinuX Containers) propose la première implémentation de conteneurs basée sur les Namespaces et les Control Groups. + +* Reste assez complexe au niveau utilisation. + + +### 2013 + +* _Docker_ voit le jour et est la première solution de conteneurisation vraiment simple à utiliser. + + +## Docker - Un peu d'histoire... + + +### 2008 + +![Solomon Hykes](images/solomon-hykes.png) + +* Solomon Hykes créé la startup _dotCloud_ qui se spécialise comme fournisseur de solutions PaaS (Platform as a Service). + + +### 2010 - 2011 +* Solomon Hykes commence à travailler sur le projet de conteneurisation de processus qui deviendra _Docker_. + +* dotCloud s'installe dans la Silicon Valley. + + +### 2013 - 2014 +* Mars 2013, la technologie de conteneur de dotCloud est publié sous licence libre (Apache 2.0). + +* Dès fin 2013 le projet suscite sur Github un énorme engouement de la part des développeurs. + +* Fin 2013 Solomon Hykes décide de créer une nouvelle société entièrement dédiée au projet : _Docker Inc._ + +* En juin 2014, Docker Inc. publie la _version 1.0_ de Docker. + + +### 2014 - 2016 +* Tous les grands noms du cloud, Amazon Web Services, Microsoft Azure, Google Cloud Platform, OVH, Redhat OpenShift... proposent des offres permettant d'exécuter des conteneurs Docker. + +* Docker devient le standard de facto pour exécuter des conteneurs sous Linux. + +* Les outils d'orchestration de conteneurs Docker commencent à apparaître et à se démocratiser. + + +* En 2015, Docker participe à la création de la [Cloud Native Computing Foundation](https://www.cncf.io/) aux côtés de Google, IBM, Intel, et bien d'autres... + +* La mission de cette fondation est de populariser les infrastructures reposant sur les conteneurs et la notion de micro-services. + + +### 2017 + +* Fin 2017, Docker annonce le support de Kubernetes dans son offre Entreprise Edition 2.0. + + +### 2019 +* Kubernetes a gagné la guerre des orchestrateurs. + +* [Mirantis fait l'acquisition de Docker Enterprise Platform](https://www.mirantis.com/company/press-center/company-news/mirantis-acquires-docker-enterprise/). + + +### Aujourd'hui + +* Les conteneurs sont massivement utilisés partout. + +* La kubecon est un des évènements annuels les plus marquants autour des conteneurs. + + + +## Différences entre un conteneur et une VM ? + + +* Une __machine virtuelle__ isole l'intégralité d'un système d'exploitation (kernel + userspace). + +* Un __conteneur__ isole uniquement le userspace et utilise directement le kernel du système hôte. + + +* Le kernel (noyau du système d'exploitation) offre la possibilité de virtualiser ses différents sous-systèmes afin de ne présenter au conteneur qu'un sous-ensemble des ressources réellement disponibles. + +* On parle de virtualisation légère. + + +### De la VM au Conteneur + +![conteneurs / vms](images/virtual-machine-vs-container.png) + + +### Changement du niveau d'abstraction + +![Niveau d'abstraction](images/user-space-vs-Kernel-space-virtualization-vs-containerization.png) + + +### Communication processus <==> noyau + +![Niveau d'abstraction](images/user-space-vs-kernel-space-simple-user-space.png) +![Niveau d'abstraction](images/user-space-vs-kernel-space-simple-container.png) + + + +## L'outillage Docker + + +### Le Docker Engine + +![Docker engine](images/docker-engine.png) + + +### containerd + +* C'est le moteur d'exécution de conteneurs développé par Docker. + +* Il respecte la spécification CRI. + +* Il tourne en tant que daemon sur le système hôte. + +* Il fournit les fonctionnalités pour récupérer et gérer en local les images Docker, gérer le réseau et le stockage. + +* Il pilote l'outil _runc_ pour les opérations de bas niveau qui concernent la création des conteneurs. + + +### containerd + +* Le projet a été offert par Docker à la [CNCF](https://www.cncf.io "Cloud Native Computing Foundation") en mars 2017. + +* https://containerd.io/ + + +![Docker Engine / Containerd / Runc](images/docker-engine-containerd-runc.png) +Source : https://www.tutorialworks.com/difference-docker-containerd-runc-crio-oci/ + + +### Les images Docker + +* Docker fourni des outils permettant d'empaqueter d'une application sous la forme d'une image _légère_, _portable_ et _auto-suffisante_. + +* Ces outils facilitent la création, la mise à jour, le stockage et le transport des images. + +* Docker permet la création de nouvelles images de conteneurs _spécialisées_ à partir d'images de conteneurs plus _généralistes_. + + +### Le terme Docker + +est un raccourci utilisé un peu à tort et à travers pour nommer : + +* la société Docker + +* le Docker Engine + +* la CLI Docker (la commande `docker`) + +* une image Docker (respectant la spec OCI) + +* un conteneur Docker en cours d'exécution + + + +## Quelques avantages des conteneurs Docker + + +### Image en lecture seule + +Un conteneur est instancié à partir d'une image en lecture seule. Dans le conteneur en exécution : + +* Pas de mises à jour. + +* Pas de correctifs. + +* Pas de modifications de configuration. + + +* Pour mettre à jour le code de l'application ou appliquer un correctif, il faudra _créer une nouvelle image_ et _déployer un nouveau conteneur_. + + +L'immuabilité de l'image permet des déploiements sûrs et reproductibles. + +* Pile applicative identique sur le poste du développeur et sur l'environnement de production. + +* Un conteneur aura le même comportement où qu'il soit déployé. + +* Moins de mauvaises surprises lors des passages en production. + + +### Démarrage rapide + +* Démarrer un conteneur est à peine un peu plus coûteux que de lancer un nouveau processus sur le système hôte. + +* En effet un conteneur Docker ne fait tourner que les processus nécessaires à l'exécution d'une application. +(pas d'Init, pas de crontab, pas de...) + +* De plus grâce à la technique du _Copy-on-Write_ qui utilise des pointeurs aucune duplication de données n'est nécessaire au lancement du conteneur. + + +### Empreinte stockage faible + +* Les images sont peu volumineuses (comparativement à une VM) et idéalement limitées au seul code applicatif et librairies nécessaires. + +* Les images sont composées de couches superposées qui permettent la gestion des deltas de façon différentielle (FS de type *Union*). + +* Des conteneurs partageant les mêmes couches d'une image n'ont pas besoin de les dupliquer (technique du Copy-on-Write). + + +### Déployable partout + +* Sur n'importe quel système Linux de même architecture, du cloud à la machine locale. + +* Pas de problème d'incompatibilité de formats d'images (OCI) comme avec les VMs. + + +### Hybrid et Multi-Cloud ready + +* Une fois conteneurisées, les applications sont déployables sur n'importe quelle infrastructure : + + * machines virtuelles, + + * bare metal, + + * cloud public et privés quelque soit la technologie d'hyperviseur sous-jacente. + + +### Microservices + +* Docker facilite la mise en place d'applications orientées microservices. + + +![Architecture microservices](images/micro-services.png) + +[https://docs.microsoft.com/](https://docs.microsoft.com/fr-fr/dotnet/standard/microservices-architecture/architect-microservice-container-applications/media/image6.png) + + +* Chacun des composants de l'application (base de données, serveur web, api, ...) peut être : + + - exécuté dans son propre conteneur, + + - mis à jour séparément des autres, + + - mis à l'échelle séparément des autres. + + +### Agilité + +* Les conteneurs permettent un fonctionnement plus agile que les VMs + + - Construction automatique, + + - Déploiement rapide, + + - Immutabilité, + + - Patching simplifié, + + - Exécutables via scripts. + + + +## Quelques inconvénients des conteneurs Docker + + +### Kernel specific + +* La technologie Docker reposent sur des mécanismes spécifiques au noyau de l'OS. + + - Les conteneurs applicatifs Linux ne peuvent donc être exécutés que sur des systèmes Linux. + + - Les conteneurs applicatifs Windows ne peuvent donc être exécutés que sur des systèmes Windows. + + +### Architecture specific + +* Les conteneurs ne peuvent être exécutés que sur des systèmes hôtes de même architecture processeur (x86, amd64, arm). + + +### Sécurité + +* L'isolation avec des conteneurs est moins forte qu'entre un hyperviseur et ses systèmes invités. + +* Les risques sont essentiellement liés au partage du kernel entre l'hôte et les conteneurs. + +* En cas de compromission du kernel, le système entier et tous ses conteneurs doivent être considérés comme compromis. + + +### Difficultés à conteneuriser + +* Docker permet d'exécuter pratiquement n'importe quelle application dans un conteneur. + +* Mais de part leur conception ou leur choix techniques certaines applications peuvent être délicates à conteneuriser. + + +### Scalabilité complexe + +* Les conteneurs peuvent être faciles à gérer et utiliser sur une station de travail ou quelques serveurs... + +* ... mais la scalabilité nécessaire à un environnement de production est un tout autre challenge. + +* Bon c'était vrai en 2015 ! + + + +## Docker sous Linux + + +![Docker on Linux](images/docker-on-linux-platform.png) + + +## Docker sous Windows + + +* A l'origine l'outil _boot2docker_ permettait d'utiliser un hôte Linux minimaliste dans une VM VirtualBox sous Windows. + +* Le _Docker Runtime_ basé sur la technologie _Windows Containers_ est proposé à partir de _Windows Server 2016_ et autorise pour la première fois la conteneurisation d'applications Windows natives. + +* Pour faire tourner les applications Linux sur un hôte Windows, une couche de virtualisation reste néanmoins nécessaire. + + +* Les versions légères _core_ et _nano_ de _Windows 2016 Server_ peuvent être utilisées à l'intérieur des conteneurs mais aussi comme hôte Docker. + + - _core_ est un Windows 2016 Server sans interface graphique. + + - _nano_ est un Windows 2016 Server réduit au minimum sans interface graphique ni shell intéractif. + + +![Docker on Windows](images/docker-on-windows-platform.png) + + + +## There is no container! + +Le _conteneur_ est une notion qui n'existe pas +dans le noyau Linux. + + +La conteneurisation est rendue possible +par un assemblage de plusieurs technologies +inclues dans le Kernel : + +* namespaces +* control groups (cgroups) +* secure computing mode (seccomp) +* capabilities +* linux security modules (lsm) +* ulimit + + +### Ressources systèmes + +Ces technologies permettent à chaque conteneur de disposer de ses propres ressources systèmes + +* système de fichiers, +* interfaçage réseau, +* liste de processus en cours d'exécution, +* nom d'hôte, +* CPU, +* mémoire, +* etc. + + +### namespaces + +Service fourni par le noyau Linux +pour gérer l'_isolation_ des processus : + +* mount +* pid +* net +* uts +* ipc +* user +* uts (host and domain names) + +Chaque processus ou groupe de processus est placé dans un namespace. + + +> Les namespaces contrôlent ce qu'un processus peut voir. + + + +`$ lsns` +```none + NS TYPE NPROCS PID USER COMMAND +4026531835 cgroup 82 1931 bob /lib/systemd/systemd --user +4026531836 pid 83 1931 bob /lib/systemd/systemd --user +4026531837 user 75 1931 bob /lib/systemd/systemd --user +4026531838 uts 82 1931 bob /lib/systemd/systemd --user +4026531839 ipc 74 1931 bob /lib/systemd/systemd --user +4026531840 mnt 82 1931 bob /lib/systemd/systemd --user +4026532009 net 74 1931 bob /lib/systemd/systemd --user +4026532436 user 1 10955 bob /home/bob/bin/firefox/firefox-bin -content... +4026532437 ipc 1 10955 bob /home/bob/bin/firefox/firefox-bin -contentproc... +4026532439 net 1 10955 bob /home/bob/bin/firefox/firefox-bin -contentproc... +... +``` + + +Les _namespaces_ fonctionnent par : + +* _filtrage_ des appels systèmes pour masquer des éléments + - par exemple `ps` à l'intérieur d'un conteneur n'affichera que les processus du conteneur + +* _translation_ pour convertir des éléments + - par exemple `ps` à l'intérieur d'un conteneur affichera des PID différents des PID réels + + +#### Le Mount namespace (Linux 2.4.19 - 2002) + +* Isolation des points de montage du système de fichiers vus par un groupe de processus. + +* Les points de montage ne sont plus globaux mais spécifiques au namespace. + +* Racine propre (chroot). + + +#### Le PID namespace (Linux 2.6.24) + +* Isolation des identifiants de processus (PID). + +* PID 1 init-like par namespace. + +* Chaque namespace possède sa propre numérotation PID. + +* Un processus d'un namespace donné ne peut envoyer de systemcall sur un processus d'un autre PID namespace. + +* Gestion de pseudo-filesystem (ex : /proc) vu par le PID namespace qui le monte. + + +Un processus possède donc plusieurs PID : un dans le namespace, un en dehors (processus vu par l'hôte). + +---- + +Les processus http vus depuis le conteneur : + +```none +root@bf7fdbc297bb:~# ps auxfww +USER PID %CPU %MEM VSZ RSS STAT START TIME COMMAND +root 1 0.0 0.2 77160 4440 Ss+ 11:55 0:00 httpd -DFOREGROUND +daemon 7 0.0 0.1 366340 3568 Sl+ 11:55 0:02 \_ httpd -DFOREGROUND +daemon 8 0.0 0.1 366340 3568 Sl+ 11:55 0:02 \_ httpd -DFOREGROUND +``` + +Les processus http vus depuis l'hôte : + +```none +me@docker-node:~$ ps auxfww +USER PID %CPU %MEM VSZ RSS STAT START TIME COMMAND +root 1976 0.0 0.2 77160 4440 Ss+ 11:55 0:00 httpd -DFOREGROUND +daemon 1984 0.0 0.1 366340 3568 Sl+ 11:55 0:02 \_ httpd -DFOREGROUND +daemon 1985 0.0 0.1 366340 3568 Sl+ 11:55 0:02 \_ httpd -DFOREGROUND +``` + +Il s'agit bien des mêmes processus. + + +#### Le Net namespace (Linux 2.6.19-2.6.24) + +* Isolation du réseau. + +* Chaque namespace possède ses propres interfaces, ports, table de routage... + +* Chaque namespace possède son propre répertoire /proc/net. + + +### control groups + +Service fourni par le noyau pour _mesurer_ et _limiter_ les ressources allouées à un groupe de processus. + + +```none +$ ls /sys/fs/cgroup +blkio cgmanager cpu cpuacct cpuset devices freezer memory perf_event + +$ls /sys/fs/cgroup/cpuset/mon-cgroup +cgroup.procs cpuset.memory_pressure_enabled notify_on_release +cpuset.cpu_exclusive cpuset.memory_spread_page release_agent +cpuset.cpus cpuset.memory_spread_slab tasks +cpuset.mem_exclusive cpuset.mems +cpuset.mem_hardwall cpuset.sched_load_balance + +$ cat /sys/fs/cgroup/cpuset/mon-cgroup/cpuset.cpus +0-3 +``` + +control groups == cgroups + + +> Les control groups régulent ce qu'un processus peut utiliser. + + +#### Les cgroups et les conteneurs Docker + +```none +$ systemd-cgls /docker +Control group /docker: +├─ce1aa87edbef6072f56507874cc122642c66d2360741df4a6c1804204574241e +│ └─3900 /bin/sh +├─0fe89d4808503f2882480e74df69a45cbb50fe8d523d9e586a48176b0f61f60b +│ └─5980 /bin/sh +└─dde507e27656f9349574138160aaac0f3a46a99d2d1f0922013e0604c4abbc5f + ├─10195 httpd -DFOREGROUND + ├─10231 httpd -DFOREGROUND + ├─10232 httpd -DFOREGROUND + └─10233 httpd -DFOREGROUND + ``` + + +### secure computing mode (seccomp) + +* Service fourni par le noyau pour _filtrer_ les appels systèmes utilisables par un processus. + +* Il permet d'attacher à un processus une _liste blanche d'appels systèmes utilisables_, afin d'éviter que ce processus puisse effectuer des opérations jugées dangereuses. + +* Docker propose par défaut un profil seccomp peu restrictif, mais que l'on peut durcir si besoin. + + +### capabilities + +* Service fourni par le noyau pour regrouper des ensembles d'appels systèmes par thématiques. + +* Par défaut Docker désactive certaines 'capabilités'. + + +### Linux Security Modules (LSM) + +* Fonctionnalité du noyau Linux permettant de prendre en charge différents modèles de sécurité. + +* Les modèles les plus connus sont _SELinux_ et _AppArmor_. + +* Ces modèles appliquent des restrictions en fonction du contexte. + +* Docker fourni des profils pour SELinux et AppArmor. + + +### ulimit + +* Fonctionnalité du noyau Linux permettant de limiter le nombre de processus utilisable. + +* Par défaut Docker limite le nombre processus fils dans un conteneur à 512. + +* Ceci permet d'éviter les fork bomb ! + + +## Docker Desktop + +* Sur le poste de travail _Docker Desktop_ propose un environnement Docker près à l'emploi. + +* Pour Mac et Windows (>2010 Professional ou Enterprise 64-bit). + +![Docker Desktop](images/docker-subscription.png) + + +## Standardisation + +- __[Container Runtime Interface (CRI)](https://github.com/opencontainers/runtime-spec)__ + spécification d'une API commune à tous les moteurs d'exécution de conteneurs. + +- __[Open Container Initiative (OCI)](https://github.com/opencontainers/image-spec)__ + spécifications pour les images et conteneurs. + + +### Moteurs de Conteneurs compatibles CRI + +- [containerd](https://containerd.io/) (initié par Docker en 2016) + +- [cri-o](http://cri-o.io/) (initié par RedHat en 2017) + +- [Firecracker](https://firecracker-microvm.github.io/) (initié par AWS en 2017) + +- [Kata Containers](https://katacontainers.io/) (initié par OpenStack en 2017, basé la fusion de Intel Clear Containers et Hyper.sh RunV) + +- [gVisor](https://gvisor.dev/) (initié par Google en 2018) + + +### Alternative à Docker : Podman + +* Gestion de conteneurs via une CLI compatible Docker. + +* Poussé par RedHat (en standard sur RHEL 8 / Centos 8). + +* Apporte la fonctionnalité de Pods locaux (notion de base de Kubernetes). + + +* Podman n'utilise pas de daemon (contrairement à Docker). + +* Podman s'appuie sur systemd pour la surveillance des conteneurs. + +* Podman utilise les user namespaces pour permettre l'exécution de conteneurs par des utilisateurs non privilégiés. + +https://k-7.ch/podman-un-moteur-de-conteneur-deamon-less.html + + +## Opérations de base sur les conteneurs + + +### Docker CLI + +![Cycle de vie Docker](images/docker-cycle.png) + + +### Docker run + +Permet d'instancier un conteneur à partir d'une image. + +`docker run [OPTIONS] IMAGE [COMMAND] [ARG...]` + + +Option | Description +- | - +`--detach`, `-d` | Mode _détaché_ : lance le conteneur à l'arrière plan +`--name NAME` | Donne un nom au conteneur +`--interactive`, `-i` | Connexion à l'entrée standard du conteneur +`--tty`, `-t` | Nous souhaitons ouvrir un pseudo-terminal + +Exemple : + +`docker run --name test debian /bin/cat /etc/resolv.conf` + + +![Docker run workflow](images/docker-run-workflow.png) + + +### Lancer un conteneur en mode intéractif + +```none +$ docker run -ti busybox +/ # ps -ef +PID USER TIME COMMAND + 1 root 0:00 sh + 7 root 0:00 ps -ef +/ # ls +bin dev etc home proc root sys tmp usr var +/ # exit +``` + +* En combinant les options `-t` et `-i` on ouvre une session à l'intérieur du conteneur. + +* Lorsqu'on quitte le shell, le conteneur est automatiquement arrêté (mais pas détruit). + + +### Lancer une commande dans un conteneur et récupérer son résultat + +```none +$ docker run busybox /bin/cat /etc/passwd +root:x:0:0:root:/root:/bin/sh +daemon:x:1:1:daemon:/usr/sbin:/bin/false +bin:x:2:2:bin:/bin:/bin/false +sys:x:3:3:sys:/dev:/bin/false +sync:x:4:100:sync:/bin:/bin/sync +mail:x:8:8:mail:/var/spool/mail:/bin/false +www-data:x:33:33:www-data:/var/www:/bin/false +operator:x:37:37:Operator:/var:/bin/false +nobody:x:99:99:nobody:/home:/bin/false +``` + +* Ici le conteneur retourne le résultat de la commande sur la sortie standard, rend de suite la main, puis est automatiquement arrêté (mais pas détruit). + + +### Lancer un conteneur à l'arrière plan + +```none +$ docker run -d httpd +dde507e27656f9349574138160aaac0f3a46a99d2d1f0922013e0604c4abbc5f +``` + +* Docker retourne l'identifiant du conteneur créé et rend de suite la main. + +* Le conteneur continue à tourner à l'arrière plan jusqu'à ce que le processus plante ou qu'on l'arrête explicitement. + + +### Lister les conteneurs + +`docker ps [OPTIONS]` + + +```none +$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +dde507e27656 httpd "httpd..." 2 seconds ago Up 2 seconds 80/tcp reverent... +0fe89d480850 busybox "/bin/sh" 44 minutes ago Up 42 minutes vigilant... +ce1aa87edbef busybox "/bin/sh" About an ho... Up About a... trusting... +``` + +* Par défaut seuls les conteneurs actuellement en cours d'exécution sont affichés. + +* L'option `-a` permet d'afficher tous les conteneurs quelque soit leur état. + + +### Stopper des conteneurs + + +Commande | Description +---------------------------------|--------------------------------------------------------------------------------------------------------------------- +`exit` | Ou n'importe quelle autre commande permettant de terminer le processus principal depuis le conteneur +`docker stop CONTAINER` | Le processus principal à l'intérieur du conteneur reçoit un SIGTERM, et après un délai de grâce de 10s un SIGKILL +`docker kill CONTAINER` | Le processus principal à l'intérieur du conteneur reçoit un SIGKILL ou tout autre signal spécifié avec l'option `-s`
https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86 +`docker stop $(docker ps -a -q)` | Stoppe tous les conteneurs + + +### Autres opérations + + +Commande | Description +-----------------------------------------|------------------------------------------- +`docker start CONTAINER [CONTAINER...]` | Démarre un ou plusieurs conteneurs stoppés +`docker restart CONTAINER [CONTAINER...]`| Redémarre un ou plusieurs conteneurs +`docker rm CONTAINER [CONTAINER...]` | Supprime un ou plusieurs conteneurs +`docker container prune` | Supprime tous les conteneurs +`docker pause CONTAINER` | Suspend le conteneur + + +### Docker logs + +Afficher les logs d'un conteneur. + +`docker logs -f mon_conteneur` + + +Option | Description +- | - +`--details` | Affiche des détails supplémentaires +`--follow`, `-f` | Continue à afficher les logs de manière intéractive +`--since` | Affiche les logs à partir d'une certaine date +`--tail` | Affiche les `n` dernières lignes +`--timestamps`, `-t` | Affiche les timestamps + + +Par défaut, `docker logs` affiche la sortie d'une commande jouée à l'intérieur du conteneur exactement comme elle apparaîtrait si on la jouait interactivement dans un terminal. + + +Les commandes Linux ouvrent généralement 3 flux I/O : +`STDIN`, `STDOUT`, and `STDERR`. + + +Flux | Description +- | - +`STDIN` | Flux d'entrée de la commande (ex: clavier, sortie d'une autre commande...) +`STDOUT`| Flux de sortie pour les messages 'normaux' de la commande +`STDERR`| Flux de sortie pour les messages d'erreur de la commande + +Par défaut `docker logs` affiche les flux `STDOUT` et `STDERR` de la commande jouée à l'intérieur du conteneur. + + +### Logging drivers + + +Driver | Description +- | - +`none` | Aucune gestion de logs pour le conteneur. +`json-file` | Les logs sont formatés en `JSON`. C'est le choix par défaut. +`syslog` | Ecrit les logs dans syslog (Le démon syslog doit tourner sur la machine hôte). +`journald` | Ecrit les logs dans journald (Le démon journald doit tourner sur la machine hôte). +`gelf` | Ecrit les logs au format Graylog Extended Log Format, en vue d'un traitement par Graylog ou Logstash. +... | Y'en a d'autres ! + +Actuellement, seuls les drivers `json-file` et `journald` sont exploitables via la commande `docker logs`. + + +### Logging - bonnes pratiques + +* https://success.docker.com/article/logging-best-practices + +* https://docs.docker.com/config/containers/logging/configure/ + + +### Docker derrière un proxy + +#### Configuration du Docker-Engine + +Pour forcer le docker-engine à utiliser un proxy : + +`/etc/systemd/system/` +`docker.service.d/http-proxy.conf` +``` +[Service] +Environment="HTTP_PROXY=http://proxy.example.com:3128/" +Environment="HTTPS_PROXY=http://proxy.example.com:3128/" +``` + +``` +systemctl daemon-reload +systemctl restart docker.service +``` + + +## Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Docker Introduction](../travaux-pratiques/slides/docker/tp-docker-introduction.html) + + + +## Docker Network + +Comment fonctionne le réseau avec Docker ? + + +### Lister les réseaux existants + +`docker network ls` + +```none +$ docker network ls + +NETWORK ID NAME DRIVER SCOPE +b69de2fd946f bridge bridge local +90d83d01c5cd formation bridge local +e59c9b6ccc29 host host local +e15666fbca66 none null local +``` + +(+ le driver `container` !) + + +### Réseau none + + +* Un conteneur démarré sur le réseau `none` utilisant le driver `null` sera +complètement isolé. + +* Seule l'interface loopback sera disponible dans le conteneur. + +* Idéal pour des conteneurs de calculs qui n'ont besoin d'aucun accès à des +ressources externes. + +```none +$ docker run --net=none -ti busybox +``` + +```none +/ # ip a +1: lo: mtu 65536 qdisc noqueue qlen 1 + inet 127.0.0.1/8 scope host lo +``` + + +### Réseau host + + +* Un conteneur démarré sur le réseau `host` se trouvera dans le même namespace réseau que +l'hôte lui-même. + +* Le conteneur pourra donc utiliser directement la stack réseau de l'hôte. + +* Performances natives. (pas de NAT, de bridge ni de veth) + +```none +$ docker run --net=host -ti busybox +``` + +```none +/ # ip a +1: lo: mtu 65536 qdisc noqueue qlen 1 + inet 127.0.0.1/8 scope host lo +2: enp10s0: mtu 1500 qdisc... + inet 10.6.208.11/24 brd 10.6.208.255 scope global dynamic... +3: ... +``` + + +### Réseau host + +![Réseau Host](images/docker-networking-host.jpg) + +Attention aux conflits dans l'utilisation des ports réseaux. + + +### Réseau container + +* Un conteneur démarré en utilisant le driver `container` se trouvera dans le même namespace réseau que l'autre conteneur spécifié. + +* Les deux conteneurs partageront les mêmes interfaces réseaux, réseaux, règles iptables, etc... + +* Il pourront communiquer entre eux en utilisant l'interface loopback. + + +### Réseau container + + +```none +docker run -ti --name c1 busybox +/ # ip a +1: lo: mtu 65536 qdisc noqueue qlen 1 + inet 127.0.0.1/8 scope host lo +1077: eth0@if1078: mtu... + inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0 +``` + +```none +$ docker run -ti --name c2 --net container:c1 busybox +/ # ip a +1: lo: mtu 65536 qdisc noqueue qlen 1 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever +1077: eth0@if1078: mtu... + inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0 +``` + +Ici les conteneurs `c1` et `c2` partagent les mêmes interfaces réseau (`lo` et `eth0`). + + +### Réseau Bridge + + +* Par défaut les conteneurs sont démarrés sur le réseau Docker interne `bridge` nommé `docker0`. + +* Ces conteneurs n'exposent aucune connectivité au monde externe mais peuvent +communiquer entre eux à la condition qu'ils soient placés sur le même hôte. + +```none +$ docker run -ti busybox +``` +```none +/ # ip a +1: lo: mtu 65536 qdisc noqueue qlen 1 + inet 127.0.0.1/8 scope host lo +13: eth0@if14: mtu... + inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0 +``` + + +#### Bridge - Schéma + +![Docker Network](images/network.jpg) + + +#### Bridge - Fonctionnement + +* Les adresses sont allouées par défaut sur le subnet interne `172.17.0.0/16` (configurable avec `--bip`). + +* Le trafic sortant passe par une règle iptables MASQUERADE. + +* le trafic entrant passe par une règle iptables DNAT. + + +#### Bridge - Exposition de ports + +* Pour exposer un port au niveau du conteneur, on peut ajouter l'option `--expose` qui permet de surcharger la directive `EXPOSE` d'un Dockerfile. + +* Ceci permet d'attaquer le service à partir de l'adresse IP du conteneur. + + + +![Expose](images/network-expose.png) + + +### Bridge - Mapping de ports + +* Pour publier un port au niveau de l'hôte on peut ajouter l'option `--publish` qui permet de mapper un port déjà exposé sur le conteneur vers l'hôte. + +* On le formate de la manière : +`--publish HOST-PORT:CONTAINER-PORT` + +* Avec `--publish-all` on ouvre tout les ports exposés d'un conteneur (ce n'est pas forcément conseillé). + + + +![Expose](images/network-expose-publish.png) + + +#### Exemple + +```none +$ docker run -d --name web --publish 8000:5000 httpd:2.4 +``` + +On ouvre le port 8000 de l'hôte et on le mappe au port 5000 de notre conteneur. + + +### Commande network + + +1. Créer un réseau bridge +`$ docker network create --driver bridge NETWORK` + +2. Afficher les détails d'un réseau +`$ docker network inspect NETWORK` + +3. Supprimer un réseau existant +`$ docker network rm NETWORK` + +4. Attacher un réseau existant à un conteneur existant +`$ docker network connect NETWORK CONTAINER` + + +### Docker DNS embarqué + +- Sur le réseau bridge par défaut, il n'est pas possible de résoudre les adresses IP des conteneurs depuis leurs noms. + +- Il faut pour ça créer un réseau personalisé. + +- Ainsi, tous les conteneurs démarrés sur ce réseau vont pouvoir communiquer entre eux grâce à leurs noms. + +- Le fichier _/etc/resolv.conf_ du conteneur est automatiquement alimenté avec _nameserver 127.0.0.11_. + + +### Exemple + +* Ajout d'un nouveau réseau de type Bridge : + +```none +$ docker network create --driver bridge mon-reseau +``` + +* Démarrage d'un conteneur sur le nouveau réseau avec l'option `--network` : + +```none +$ docker run --detach --name apache --publish 8080:80 \ + --network mon-reseau httpd:2.4 +``` + +Si on ajoute d'autres conteneurs sur ce réseau, il pourront communiquer entre eux directement en utilisant le nom attribué avec l'option `--name`. + + +### Plus de détails sur les réseaux Docker + +* https://success.docker.com/article/networking + + +## Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Network](../travaux-pratiques/slides/docker/tp-network.html) diff --git a/Pepiniere/docker/1.introduction-aux-conteneurs/revealjs b/Pepiniere/docker/1.introduction-aux-conteneurs/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/1.introduction-aux-conteneurs/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/2.images-de-conteneurs/images-de-conteneurs.md b/Pepiniere/docker/2.images-de-conteneurs/images-de-conteneurs.md new file mode 100755 index 0000000..b679450 --- /dev/null +++ b/Pepiniere/docker/2.images-de-conteneurs/images-de-conteneurs.md @@ -0,0 +1,793 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +__Images de conteneurs__ + +Maxime Poullain • Christian Tritten + + + +### Qu'est-ce qu'une image de conteneur ? + +Une image : + +- Est un template de conteneur en lecture seule. + +- Est composée de fichiers et de métadonnées. + +- Peut par exemple contenir un système d'exploitation Debian avec Apache et une application web pré-installés. + +- Est "instanciée" pour créer un ou plusieurs conteneurs. + + +![Les images Docker les plus populaires en 2020](images/most-popular-docker-official-images-in-2020.png) + +Source : https://www.docker.com/blog/docker-index-shows-continued-massive-developer-adoption-and-activity-to-build-and-share-apps-with-docker/ + + +### Images incrémentales et réutilisables + +![Images réutilisables](images/docker-image-reusability.png) + + +**Remarque importante** + +Si l'image de base est modifiée (par exemple dans le cadre de l'application d'une mise à jour de sécurité), et que l'on souhaite propager cette mise à jour sur les images dérivées, il faudra reconstruire ces dernières. + + +### Système de fichiers multi-couches + +- Les images sont composées d'une ou plusieurs couches superposées. + +- Chaque couche représente un différentiel des changements apportés par rapport à la couche inférieure. + +- Lorsque plusieurs images partagent des couches, cela permet d'optimiser l'espace disque, et les temps de transfert. + + + +![Système de fichiers multi-couches](images/docker-image-layers.jpg) + + +- La principale différence entre un conteneur et une image réside dans la _couche en r/w_ du sommet. + +- Toutes les écritures qui ajoutent ou modifient des données dans un conteneur sont stockées sur cette couche. + +- Quand le conteneur est supprimé la couche en r/w est aussi supprimée, les couches inférieures de l'image de base restent inchangées. + + +- On peut sauvegarder les modifications effectuée au sein d'un conteneur en utilisant la commande : `docker commit` + +- Ceci va ajouter une _nouvelle couche_ en lecture seule au dessus de la pile composant l'image. + + +Lorsqu'une image est modifiée, une nouvelle couche est ajoutée au sommet de la pile : + +![Ajout d'une nouvelle couche](images/docker-image-new-layer.jpg) + + +### Partage d'image entre plusieurs conteneurs + +![Partage d'image entre plusieurs conteneurs](images/docker-container-sharing-layers.jpg) + + + +## Gestion des images + +Outils et commandes pour la gestion des images + + +### Images locales + +`docker image ls` + + +```none +$ docker image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +composeformation_web latest 0d2d42971538 20 hours ago 237MB +debian-formation latest 257c415ffcc7 20 hours ago 237MB +mariadb 10.1.24 98f78d96be9c 2 weeks ago 395MB +debian jessie 3e83c23dba6a 3 weeks ago 124MB +hello-world latest 48b5124b2768 4 months ago 1.84kB +``` + + +### Le Docker Hub + +Le [Docker Hub](https://hub.docker.com/) est un entrepôt d'images de conteneurs sur lequel on peut télécharger : + +* des images _officielles_ certifiées par Docker +* des images _publiques_ maintenues par la communauté + + +![Recherche mariadb sur le Docker Hub](images/docker-hub.png) + + +__Attention !__ + +Docker ne garantie pas le bon fonctionnement +ni même l'absence de faille de sécurité +sur les images non officielles. + + +### Chercher une image sur le Docker Hub + +`docker search IMAGE` + +```none +$ docker search mariadb +NAME DESCRIPTION STARS OFFICIAL +mariadb MariaDB is a community-developed for... 1354 [OK] +bitnami/mariadb Bitnami MariaDB Docker Image 37 +paintedfox/mariadb A docker image for running MariaDB 5... 29 +million12/mariadb MariaDB 10 on CentOS-7 with UTF8 default 14 +toughiq/mariadb-cluster Dockerized Automated MariaDB Galera ... 11 +webhippie/mariadb Docker images for mariadb 9 +gists/mariadb MariaDB on Alpine 7 +panubo/mariadb-galera MariaDB Galera Cluster 7 +kakilangit/mariadb Docker for MariaDB with OQGraph & To... 6 +maxexcloo/mariadb Service container with MariaDB insta... 4 +tianon/mariadb DEPRECATED; use mariadb:* -- ♪ "I ju... 4 +takaomag/mariadb docker image of archlinux (mariadb) 2 +drupaldocker/mariadb MariaDB for Drupal 1 +... +``` + + +### Récupérer une image sur le Docker Hub + +`docker pull IMAGE[:TAG]` + +```none +$ docker pull mariadb:10.7.1 +Using default tag: latest +latest: Pulling from library/mariadb +10a267c67f42: Pull complete +c2dcc7bb2a88: Pull complete +17e7a0445698: Pull complete +9a61839a176f: Pull complete +64675690edb1: Pull complete +3de17e251488: Pull complete +f814b22b783e: Pull complete +733ce1f03439: Pull complete +fb7b719835fd: Pull complete +8d3f82357729: Pull complete +a4f4cbdfcf7c: Pull complete +Digest: sha256:4b54358541679032f6c3a9d9fc944ad96d77ae72fecd6cb44bf18cf97743da24 +Status: Downloaded newer image for mariadb:10.7.1 +``` + + +### Visualiser l'historique d'une image + +`docker history IMAGE` + +```none +$ docker history mariadb:10.7.1 +IMAGE CREATED CREATED BY SIZE +98f78d96be9c 2 weeks ago /bin/sh -c #(nop) CMD ["mysqld"] 0B + 2 weeks ago /bin/sh -c #(nop) EXPOSE 3306/tcp 0B + 2 weeks ago /bin/sh -c #(nop) ENTRYPOINT ["docker-ent... 0B + 2 weeks ago /bin/sh -c ln -s usr/local/bin/docker-entr... 34B + 2 weeks ago /bin/sh -c #(nop) COPY file:d559178e6a2929... 5.6kB + 2 weeks ago /bin/sh -c #(nop) VOLUME [/var/lib/mysql] 0B + 2 weeks ago /bin/sh -c sed -Ei 's/^(bind-address|log)/... 5.27kB + 2 weeks ago /bin/sh -c { echo mariadb-server-$MARIAD... 252MB + 2 weeks ago /bin/sh -c echo "deb https://repo.percona.... 114B + 2 weeks ago /bin/sh -c set -ex; export GNUPGHOME="$(m... 21.1kB + 2 weeks ago /bin/sh -c apt-get update && apt-get insta... 14.3MB + 2 weeks ago /bin/sh -c set -x && apt-get update && ap... 4.58MB + 2 weeks ago /bin/sh -c groupadd -r mysql && useradd -r... 330kB + 3 weeks ago /bin/sh -c #(nop) ADD file:f4e6551ac34ab44... 124MB +``` + + +### "Inspecter" une image + +`docker inspect IMAGE` + +```none +$ docker inspect mariadb +[ + { + "Id": "sha256:98f78d96be9c7f513f21de040d083ee7ba23d74c8f3bc499373e56e93c...", + "RepoTags": [ + "mariadb:10.7.1" + ], + "RepoDigests": [ + "mariadb@sha256:4b54358541679032f6c3a9d9fc944ad96d77ae72fecd6cb44bf1..." + ], + "Parent": "", + "Comment": "", + "Created": "2017-05-09T17:28:06.071608373Z", + "Container": "83ce76bba170200d3783bde70b7c1d06a61ed2b91bec7351a5c5a664f5...", + "ContainerConfig": { + "Hostname": "200591939db7", + "Domainname": "", + "User": "", + "ExposedPorts": { + "3306/tcp": {} +``` + + +### Supprimer une image + +`docker image rm IMAGE [IMAGE...]` + +```none +$ docker image rm mariadb:10.7.1 +Untagged: mariadb:10.7.1 +Untagged: mariadb@sha256:4b54358541679032f6c3a9d9fc944ad96d77ae72fecd6cb44bf18cf... +Deleted: sha256:98f78d96be9c7f513f21de040d083ee7ba23d74c8f3bc499373e56e93c8e9ec9 +Deleted: sha256:bea03b338eb87d64861847305aa63f6104212c60719168f25b54ca713db4b870 +Deleted: sha256:519db73d66bef13a78573160ddf2059f9dc382e03fd2e85f354c3172ded67b90 +Deleted: sha256:7f728a3fd818a51a5425306ef40f398c7698f4252ade70cb83b3d26b825bb613 +Deleted: sha256:48159803f1446a31e60af329025fc5c3ae8ef07f950d8750a7e14d46d1d1191c +Deleted: sha256:ff5b1cc6d50c6f7ab9e6ee77ff89b0b037a6840f7b1f44cbe234499362221c15 +Deleted: sha256:d147674f5cce42f85942e815f154c6a7ecb86359689d823a9840b28126a12f4e +Deleted: sha256:571be45150dde0fb8f6c3862abbcfa06fbad0e6a128d459a6b8ad0660f9f0660 +Deleted: sha256:458271f19a2c854fc6fd3338f9151662173b96a14cfe1a2e46eca95d27e4102c +Deleted: sha256:ba779192baede4aadd009c269406b5e8fd885c653ce19719316bf40cc66a6cf3 +Deleted: sha256:2302bd8bbdd530199aa432c357a4da9eab2621c3ba4c4dacb4ea0f4afecbcae7 +Deleted: sha256:00771f8e1e12bdfc9d47bc52a78e3f5ce5306a1caa5dd6237731cff9ca106040 +Deleted: sha256:8d4d1ab5ff74fc361fb74212fff3b6dc1e6c16d1e1f0e8b44f9a9112b00b564f +``` + + +### Importer / Exporter une image + +1. Export +`$ docker save -o mon-image.tar IMAGE` + +2. Import +`$ docker load -i mon-image.tar` + + +### Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Docker Images](../travaux-pratiques/slides/docker/tp-images.html) + + + +## Dockerfile + +Automatiser la construction d'une image + + +- Il est possible de construire une image à la main puis de la sauvegarder avec un `docker commit`. + +- Toutefois ceci est fastidieux, non parfaitement reproductible et donc potentiellement source d'erreur. + +- D'autre part, comment gérer les mises à jours d'une telle image ? + + +- Docker est capable de construire des images automatiquement à partir des instructions d'un _Dockerfile_. + +- Le Dockerfile est un fichier texte qui contient toutes les instructions permettant de construire une image Docker pour une application donnée. + +[https://docs.docker.com/engine/reference/builder/](https://docs.docker.com/engine/reference/builder/) + + +![Dockerfile](images/dockerfile-image-container.jpg) + + +- Le Dockerfile est versionnable et permet de produire une image à tout moment. + +- Ceci s'inscrit dans la philosophie _Infrastructure as Code_ qui prône la définition d'une architecture dans des fichiers textes déclaratifs. + +- Grâce au Dockerfile on peut reconstruire périodiquement une image afin quelle intègre les dernières mises à jour applicatives et les derniers patches de sécurité. + + +### Exemple de Dockerfile + +```docker +FROM debian:bullseye +LABEL maintainer "robert@produpot.com" + +# On installe Apache httpd +ENV DEBIAN_FRONTEND noninteractive +RUN apt update \ + && apt install -y apache2 \ + && rm -rf /var/lib/apt/lists/* + +# Ajout d'un script d'init +ADD run.sh /run.sh +RUN chmod 755 /run.sh + +# Importe l'application +RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html +ADD homepage/ /app + +# On expose le port 80 +EXPOSE 80 + +# On indique le script qui doit être lancé au démarrage du conteneur +ENTRYPOINT ["/run.sh"] +``` + + +### Principales directives + + +Directive | Description +- | - +`FROM` | Spécifie l'image de départ pour la construction de la nouvelle image. +`LABEL` | Ajoute des métadonnées à la nouvelle image. +`ENV` / `ARG` | Ajoute des variables d'environnement. +`ADD` / `COPY` | Copie des fichiers ou des dossiers sur le système de fichiers de l'image. +`VOLUME` | Créé un point de montage à l'instanciation du conteneur. + + +### Principales directives (suite) + + +Directive | Description +- | - +`RUN` | Exécute une commande et "commite" le résultat dans une nouvelle couche de l'image. +`USER` | Spécifie l'utilisateur à utiliser pour jouer les instructions `RUN` et `ENTRYPOINT`. +`HEALTHCHECK` | Indique une commande qui sera lancée à l'intérieur du conteneur pour vérifier que celui-ci tourne correctement. +`ENTRYPOINT` | Définie une commande de base à exécuter dans le conteneur. +`CMD` | Définie les paramètres par défaut de la commande de base. + + +### LABEL + +```docker +LABEL maintainer="user@example.com" \ + vendor=ACME\ Incorporated \ + com.example.version="0.0.1-beta" \ + com.example.release-date="2015-02-12" +``` + + +### Choisir entre `ARG` et `ENV` + +* `ARG` et `ENV` permettent de déclarer des variables qui sont utilisables à partir du moment où elles sont déclarées dans le Dockerfile. + +* Les `ARG` peuvent être surchargées au moment du build via l'option `--build-arg`. + +* Les `ENV` peuvent être surchargées à l'exécution via l'option `-e`. + +* Si une variable `ARG` est utilisée sans valeur par défaut et qu'aucune valeur n'est fournie via `--build-arg`, cela déclenche une erreur lors du build. + + +![ARG vs ENV](images/docker-environment-args-env.png) + +https://vsupalov.com/docker-arg-env-variable-guide/ + + + +`Dockerfile` +```docker +ARG MY_VAR_1 <---- expect a build-time variable +ARG MY_VAR_2=pouet <---- set a build-time variable + +RUN touch "$MY_VAR_2" + +ARG A_VARIABLE <---- expect a build-time variable +ENV another_var=$A_VARIABLE <---- use the value to set the ENV var default + + if not overridden, that value of another_var + will be available to your containers! +``` + + +### Choisir entre `ADD` et `COPY` + +Les deux directives ont la même syntaxe : + +```docker +COPY ... +ADD ... +``` + +Selon le guide des bonnes pratiques Docker : + +* Utilisez `COPY` dans tous les cas, sauf si vous avez besoin d'extraire automatiquement le contenu d'une archive, dans ce cas précis utilisez `ADD`. + +* Pour récupérer des fichiers distants, préférez plutôt l'instruction `RUN wget ...`. + + +### CMD et ENTRYPOINT + +Les commandes `CMD` et `ENTRYPOINT` permettent +de définir la commande par défaut à exécuter +à l'intérieur du conteneur. + +- `ENTRYPOINT` définie la commande de base pour le conteneur, + +- `CMD` définie les paramètres par défaut pour cette commande. + + +```docker +FROM debian:bullseye +RUN apt update && apt install -y cowsay +ENTRYPOINT ["/usr/games/cowsay"] +CMD ["hello"] +``` + +```none +$ docker build -t cowsay . +... +Successfully built a27691083512 +Successfully tagged cowsay:latest +``` + + +```none +$ docker run cowsay + ------- +< hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || +``` + +```none +$ docker run cowsay 2,21 Gigowatts ?! + ------------------- +< 2,21 Gigowatts ?! > + ------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || +``` + + +### HEALTHCHECK + +L'exemple suivant teste toutes les 5 minutes que le conteneur est capable de servir une ressource HTTP en moins de 3 secondes : + +```docker +HEALTHCHECK --interval=5m --timeout=3s \ + CMD curl -f http://localhost/ || exit 1 +``` + +Le test de santé étant lancé depuis l'intérieur du conteneur, _la commande `curl` utilisée dans l'exemple ci-dessus doit être présente dans le conteneur_. + + + +Le status _healthy_ / _unhealthy_ est consultable +via `docker ps` ou `docker inspect` + +```none +$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS +9e2ea5f59f8b xian/web "/start.sh" 28 minutes ago Up 28 minutes (healthy) +20851619e1af xian/web "/start.sh" 23 minutes ago Up 23 minutes (unhealthy) +``` + +```none +$ docker inspect -f '{{json .State.Health.Status}}' conteneur +"healthy" +``` + +Il s'agit d'un simple message informatif, en effet Docker ne relance pas de lui-même un conteneur détecté comme _unhealthy_. + + +* Toutefois, Le changement de santé d’un conteneur génère un évenement Docker que les outils de monitoring et d’orchestration peuvent intercepter. + +* Par exemple l'orchestrateur Swarm utilise cette information pour remplacer automatiquement le conteneur défectueux par une nouvelle instance. + + +### Construire l'image à partir du Dockerfile + +`docker build -t IMAGE[:TAG] .` + +Les tags permettent de proposer +plusieurs versions d'une image. + +`docker build -t mon-image:v1 .` + + +Une même image peut +être tagguée plusieurs fois : + +ex : `debian:10` et `debian:buster` + + +### Derrière un proxy + +`--build-arg http_proxy=PROXY` +```none +$ docker build --build-arg http_proxy=http://my.proxy.url:3128 \ + --tag debian-formation . +``` + + +## Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Dockerfile](../travaux-pratiques/slides/docker/tp-dockerfile.html) + + +### Rendre une image publique + +* On peut rendre une image publique en la poussant sur le Docker Hub. + +* La création d'un Docker ID est nécessaire. + +* Le Docker ID sera le nom d'utilisateur pour le Docker Hub. + +* La commande `docker login` permet de se connecter au Hub. + + +Pour pouvoir pousser une image sur le Hub, il faut la nommer avec un nom de la forme `docker-id/image:tag` + +Ceci se fait avec la commande `docker tag` : + +```none +$ docker tag mon-image mon-docker-id/mon-image:1.0.0 +``` + + +Il est ensuite possible de pousser l'image avec la commande `docker push` : + +```none +$ docker push mon-docker-id/mon-image:1.0.0 +``` + +A partir de là, l'image devient accessible publiquement par n'importe qui. + + +### Dockerfile +#### les bonnes pratiques + + +Réutiliser au maximum la même image de base afin de mutualiser les couches entre vos différentes images applicatives. + + +Eviter d'installer tout ce qui n'est pas strictement nécessaire. + +Paquets de la distribution, paquets applicatifs, ... + + +Alléger les images en supprimant les données inutiles, mais pas n'importe comment ! + +```docker +RUN apt-get update && apt-get install -y package +RUN rm -rf /var/lib/apt/lists/* +``` + +Chaque couche est commitée en readonly avant de passer à l'instruction suivante ! + + +Il faut nettoyer dans la même couche ! + +```docker +RUN apt update \ + && apt install -y package \ + && rm -rf /var/lib/apt/lists/* +``` + +```docker +RUN wget archive.tar.gz \ + && tar xzvf archive.tar.gz \ + && rm archive.tar.gz +``` + +(Combiner plusieurs instructions `RUN` permet également de diminuer le nombre de couches constituant l'image.) + + +Ne pas utiliser `apt-get upgrade` ou `apt-get dist-upgrade` dans vos images spécialisées. + +Ceci doit être fait dans l'image OS de base. + + +Chaque conteneur devrait se focaliser sur une seule tâche. + +![Un processus par conteneur](images/docker-one-process.png) + + +Utiliser une image de base légère. + +Par exemple, [debian:bullseye-slim](https://hub.docker.com/_/debian/) pèse ~30MB tout en restant une distribution complète. + + +Proscrire l'utilisation du tag `latest` en production. + +__Attention !__ +`docker pull myimage` == `docker pull myimage:latest` + +Le tag `latest` est utilisé par défaut si vous n'en fournissez pas un dans vos commandes Docker ! + + +3 bonnes raisons de ne pas utiliser le tag `latest` + +* Votre outil de déploiement ne déploiera pas une nouvelle version de votre application taggué latest, tout simplement parce qu'il ne détectera pas la différence avec l'ancienne version elle aussi tagguée avec latest. + +* Tagguer une image avec un numéro de version unique permet d'effectuer de la tracabilité. On sait exactement quelle version est déployée. + +* En réutilisant systématiquement le tag latest, tout retour arrière à une ancienne version de l'image est impossible, car vous écrasez systématiquement la précédente version de l'image docker. + + +Déterminer une stratégie pour les tags + +* Lorsque on crée une image, il nous appartient de lui ajouter des tags appropriés. + +* Utiliser une stratégie pour les tags qui soit cohérente et consistante sur toutes les images produites. + +* La stratégie doit être facilement compréhensible par les utilisateurs de ces images. + + + +__L'exécution de processus avec l'utilisateur `root` à l'intérieur d'un conteneur est un préliminaire à de nombreux types d'attaques.__ + +Déclarer un utilisateur dédié permet d'éviter un grand nombre d'attaques : + +```docker +RUN useradd -d /home/my-app-user -m -s /bin/bash my-app-user +USER my-app-user +``` + +On peut forcer l'utilisateur à l'exécution : + +```none +$ docker run --user my-app-user -d -t my-application +``` + +L'utilisateur doit exister dans `/etc/passwd` à l'intérieur du conteneur. + + +Ne pas écrire de secrets dans le Dockerfile. +(secret == mot de passe, clé de chiffrement, clé d'API) + +Injecter la configuration à l'exécution du conteneur. + + +Utiliser la fonctionnalité de _multi-stage build_ (Docker > v17.05) pour produire des images plus petites. + +Un cas d'usage est celui où l'on doit compiler une binaire afin de produire l'image applicative finale. + +En découpant le processus de build, on va tout d'abord construire une image dédié à la compilation du binaire et injecter le résultat de cette compilation dans l'image finale qui sera ainsi d'une beaucoup plus réduite. + + + +`Dockerfile` + +```docker +FROM golang:1.10 as builder + +WORKDIR /tmp/go +COPY hello.go ./ +RUN CGO_ENABLED=0 go build -a -ldflags '-s' -o hello + +FROM scratch +CMD [ "/hello" ] +COPY --from=builder /tmp/go/hello /hello +``` + +`$ docker build -t hello:1 .` + + + +`$ docker image ls` + +```none +REPOSITORY TAG IMAGE ID CREATED SIZE +hello latest 212f44bc4048 4 seconds ago 3.2MB + 08370cf772b1 5 seconds ago 693MB +``` + +Le résultat final est une image d'environ 3Mb au lieu de 700Mb sans le multi-stage build. + + +Pour le reste des bonnes pratiques : + +* https://sysdig.com/blog/dockerfile-best-practices/ +* https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/ +* https://cloud.google.com/solutions/best-practices-for-building-containers + + +#### Haskell Dockerfile Linter + +Un outil pour vérifier les bonnes pratiques +sur les fichiers Dockerfile + + +```none +$ docker run --rm -i hadolint/hadolint < Dockerfile +/dev/stdin:2 DL3020 Use COPY instead of ADD for files and folders +/dev/stdin:4 DL3025 Use arguments JSON notation for CMD and ENTRYPOINT arguments +``` + +https://github.com/hadolint/hadolint + +Alternatives : [Dockle](https://github.com/goodwithtech/dockle) | [Trivy](https://aquasecurity.github.io/trivy/) + + +## Nettoyer les images + +Les images ont tendance à s'accumuler et à remplir progressivement l'espace de stockage sur les hôtes. + +* `$ docker image prune` +Supprime toutes les images qui ne sont ni taguées ni référencées par au moins un conteneur. + +* `$ docker image prune -a` +Supprime toutes les images qui ne sont pas référencées par au moins un conteneur. + + +## Registry + +* Le composant Docker Registry permet le stockage et la distribution d'images Docker. + +* Docker Inc. fourni une image officielle prête à l'emploi pour déployer facilement un Registry. + + +### Fonctionnalités + +* Authentification des utilisateurs + +* Push/Pull d'images + +* Stockage des images sur une grande variété de backends (S3, Posix Filesystems, Ceph, Swift...) + + +### Utilisation du Docker Registry + +```none +$ docker pull hello-world +$ docker tag hello-world mon_nom_de_domaine:5000/hello-world +$ docker push mon_nom_de_domaine:5000/hello-world +... +$ docker pull mon_nom_de_domaine:5000/hello-world +``` + + +## Sécurité - rapports + +* __NCC Group__ +Understanding and Hardening Linux Containers +Juin 2016 +[www.nccgroup.trust/](https://www.nccgroup.trust/globalassets/our-research/us/whitepapers/2016/april/ncc_group_understanding_hardening_linux_containers-1-1.pdf) + +* __NIST__ +Application Container Security Guide +Sept. 2017 +[http://nvlpubs.nist.gov/](http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-190.pdf) + + +### Sécurité - outils + +* Docker Bench for Security +[github.com/docker/docker-bench-security](https://github.com/docker/docker-bench-security) + +* Trivy - Analyse de vulnérabilités sur les images +[https://aquasecurity.github.io/trivy/](https://aquasecurity.github.io/trivy/) + + +### Outils alternatifs pour construire des Images compatibles OCI + +* Kaniko +[https://github.com/GoogleContainerTools/kaniko](https://github.com/GoogleContainerTools/kaniko) + +* makisu +[https://github.com/uber/makisu](https://github.com/uber/makisu) + +* Buildah +[https://github.com/containers/buildah](https://github.com/containers/buildah) + + +* Pas besoin d'élévation de privilèges (Docker build nécessite d'être root). + +* Utilisation d'un cache distribué pour optimiser les performances sur un cluster de build. + +* Permet de contrôler les couches générées dans l'image. + + +### Inspecter les couches d'une image + +* Dive +https://github.com/wagoodman/dive + + +![dive](images/dive.gif) diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/dive.gif b/Pepiniere/docker/2.images-de-conteneurs/images/dive.gif new file mode 100644 index 0000000..0341005 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/dive.gif differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-container-sharing-layers.jpg b/Pepiniere/docker/2.images-de-conteneurs/images/docker-container-sharing-layers.jpg new file mode 100644 index 0000000..e59fa83 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-container-sharing-layers.jpg differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-environment-args-env.png b/Pepiniere/docker/2.images-de-conteneurs/images/docker-environment-args-env.png new file mode 100644 index 0000000..26ff649 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-environment-args-env.png differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-hub.png b/Pepiniere/docker/2.images-de-conteneurs/images/docker-hub.png new file mode 100644 index 0000000..ed2c707 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-hub.png differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-layers.jpg b/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-layers.jpg new file mode 100644 index 0000000..00c30a2 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-layers.jpg differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-new-layer.jpg b/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-new-layer.jpg new file mode 100644 index 0000000..125d56c Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-new-layer.jpg differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-reusability.png b/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-reusability.png new file mode 100644 index 0000000..25baa38 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-image-reusability.png differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-one-process.png b/Pepiniere/docker/2.images-de-conteneurs/images/docker-one-process.png new file mode 100644 index 0000000..cbaf1b2 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-one-process.png differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-registry.png b/Pepiniere/docker/2.images-de-conteneurs/images/docker-registry.png new file mode 100644 index 0000000..27d26dd Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/docker-registry.png differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/docker-wave-whale.svg b/Pepiniere/docker/2.images-de-conteneurs/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/2.images-de-conteneurs/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/dockerfile-image-container.jpg b/Pepiniere/docker/2.images-de-conteneurs/images/dockerfile-image-container.jpg new file mode 100644 index 0000000..f283780 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/dockerfile-image-container.jpg differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/most-popular-docker-official-images-in-2020.png b/Pepiniere/docker/2.images-de-conteneurs/images/most-popular-docker-official-images-in-2020.png new file mode 100644 index 0000000..8b83278 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/most-popular-docker-official-images-in-2020.png differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/images/tp.gif b/Pepiniere/docker/2.images-de-conteneurs/images/tp.gif new file mode 100644 index 0000000..101ea93 Binary files /dev/null and b/Pepiniere/docker/2.images-de-conteneurs/images/tp.gif differ diff --git a/Pepiniere/docker/2.images-de-conteneurs/index.html b/Pepiniere/docker/2.images-de-conteneurs/index.html new file mode 100755 index 0000000..e9e72a5 --- /dev/null +++ b/Pepiniere/docker/2.images-de-conteneurs/index.html @@ -0,0 +1,88 @@ + + + + + + + SII - Images de conteneurs + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/2.images-de-conteneurs/revealjs b/Pepiniere/docker/2.images-de-conteneurs/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/2.images-de-conteneurs/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/conteneurs-utilisation-avancee.md b/Pepiniere/docker/3.conteneurs-utilisation-avancee/conteneurs-utilisation-avancee.md new file mode 100755 index 0000000..ff3788e --- /dev/null +++ b/Pepiniere/docker/3.conteneurs-utilisation-avancee/conteneurs-utilisation-avancee.md @@ -0,0 +1,737 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +**Les conteneurs - Utilisation avancée** + +Maxime Poullain • Christian Tritten + + + +## Docker run + +Permet d'instancier un conteneur à partir d'une image + + +### Docker run - options + + +Option | Description +- | - +`--detach`, `-d` | Mode _détaché_ : lance le conteneur à l'arrière plan +`--name NAME` | Donne un nom au conteneur +`--interactive`, `-i` | Conserve STDIN ouvert +`--tty`, `-t` | Alloue un pseudo-TTY + + +### Docker run - restart policies + +On utilise l'option `--restart` avec ces paramètres : + + +Policy | Result +-------------------------|--------------------------------------- +`no` | Par défaut. Ne redémarre pas +`on-failure[:max-retries]` | Redémarre seulement avec un _non-zero exit status_ +`always` | Redémarre tout le temps et indéfiniment. Démarre aussi en même temps que le démon Docker +`unless-stopped` | Redémarre tout le temps sauf si il a été coupé + + +### Contraintes sur les ressources + +* Par défaut une application conteneurisée peut consommer l'intégralité de la mémoire disponible de l'hôte. + +* Lorsqu'il n'y a plus de mémoire disponible, le kernel Linux : + + 1. lance une _Out Of Memory Exception_ (OOME), + + 2. commence à [tuer des processus](https://www.kernel.org/doc/gorman/html/understand/understand016.html) pour libérer de la mémoire. + + +Il est possible de limiter les ressources allouées à un conteneur grâce à la technologie des _control groups_. + + +Option | Description +-------------------------|--------------------------------------- +`--memory` | Limite mémoire, minimum 4M +`--memory-swap` | Limite mémoire totale, (memoire + swap) +`--cpu` | Limite sur l'utilisation du cpu + +https://docs.docker.com/config/containers/resource_constraints/ + +Sur un système en production il est recommandé d'appliquer systématiquement des limitations sur l'utilisation de la mémoire. + + + +## Docker exec + +Permet d'éxécuter des commandes dans le conteneur en plus du processus de base. + +Notamment utile pour débugger. + + +### Docker exec - options + + +Option | Shorthand | Default | Description +----------------|-------------|---------|------------------------------ +`--detach` | `-d` | False | Detached mode: run command in the background +`--interactive` | `-i` | False | Keep STDIN open even if not attached +`--tty` | `-t` | False | Allocate a pseudo-TTY +`--user` | `-u` | False | Username or UID + + +### Docker exec - exemple + +* Ouvrir une console Bash dans le conteneur : +`$ docker exec -it mon_conteneur /bin/bash` + +* Créer un fichier à l'intérieur du conteneur : +`$ docker exec mon_conteneur touch /tmp/test` + + + +## Docker cp + +Permet de copier des fichiers/dossiers depuis et vers un conteneur en cours d'exécution. + +* Copie un fichier de l'hôte vers le conteneur : +`$ docker cp fichier nom-du-conteneur:/chemin/vers/fichier` + +* Créer un fichier du conteneur vers l'hôte : +`$ docker cp nom-du-conteneur:/chemin/vers/fichier fichier` + + + +## Docker diff + +Affiche les modifications effectuées sur le système de fichiers du conteneur. + + +``` +$ docker diff mon-conteneur +C /var +C /var/lib +C /var/lib/apt +C /var/lib/apt/lists +A /var/lib/apt/lists/lock +A /var/lib/apt/lists/auxfiles +A /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_InRelease +A /var/lib/apt/lists/partial +``` + + + +## Monitoring simple des conteneurs + + +### Docker Stats + +Docker embarque un équivalent de la commande `top` permettant d'afficher les métriques des conteneurs en cours d'exécution. + +`docker stats` + +```none +CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS +5098617c3654 0.05% 0B / 0B 0.00% 648B / 0B 0B / 0B 2 +b2d0efcb5151 1.00% 0B / 0B 0.00% 648B / 0B 0B / 0B 3 +cbdb1069b241 0.10% 0B / 0B 0.00% 648B / 0B 0B / 0B 5 +``` + + +### ctop + +Métriques des conteneurs dans une interface à la `top`. + +![ctop](images/ctop.gif) + +Source : [https://ctop.sh/](https://ctop.sh/) + + + +## Configuration d'une application + + +### Variables d'environnement + +- Il est possible d'injecter des variables d'environnement dans le conteneur au moment de sa création. + +- L'option `--env` permet de spécifier une variable et sa valeur. + +- L'option `--env-file` permet de passer un fichier de variables. + +- Une fois injectées dans le conteneur ces variables sont accessibles par le premier processus lancé. + + +#### Exemple + +- L'image de _MariaDB_ est conçue pour être configurée à l'exécution à l'aide de variables d'environnement. + +- Ces variables vont permettre d'initialiser une base avec un utilisateur et mot de passe personnalisés. + +```none +$ docker run --name mariadb \ + --env MYSQL_ROOT_PASSWORD=docker \ + --env MYSQL_DATABASE=docker \ + --env MYSQL_USER=docker \ + --env MYSQL_PASSWORD=docker \ + mariadb:10.7.1 +``` + + +#### Exemple avec --env-file + +`mariadb-vars` +```none +MYSQL_ROOT_PASSWORD=docker +MYSQL_DATABASE=docker +MYSQL_USER=docker +MYSQL_PASSWORD=docker +``` + +```none +$ docker run --name mariadb \ + --env-file=mariadb-vars \ + mariadb:10.7.1 +``` + + +#### Mini TP : variables d'environnement + + +![Travaux pratiques](images/tp.gif) + + +Créer un conteneur basé sur l'image `xian310/who-is-there:21` avec la configuration suivante : + +- Lancer le conteneur au premier plan. + +- Publier le port d'écoute dans le conteneur (8080) vers le port de votre choix sur l'hôte. + +Accéder à l'application dans le navigateur web en précisant le chemin `/env` dans l'url. + + + +Créer le conteneur : +```none +$ docker run --rm --publish 8080:8080 xian310/who-is-there:21 +``` + +Accéder à l'application : +```none +$ firefox http://127.0.0.1:8080/env +``` + + +- Supprimer le conteneur. + +- Créer un nouveau conteneur en lui passant au moins 2 variables d'environnement de votre choix. + +- Recharger la page web. + + + +Créer un nouveau conteneur en lui passant des variables d'environnement : +```none +$ docker run --rm --publish 8080:8080 \ + --env MA_VARIABLE=hello --env MON_AUTRE_VARIABLE="au revoir" \ + xian310/who-is-there:21 +``` + + +- On peut configurer la couleur de fond de la page `/env` en passant la variable `COLOR` au conteneur. + +- Pour une liste des couleur possibles : +https://fr.wikipedia.org/wiki/Couleur_du_Web + + + +Changer la couleur de fond de la page `/env` : +```none +$ docker run --rm --publish 8080:8080 \ + --env COLOR=lightblue \ + xian310/who-is-there:21 +``` + +```none +$ docker run --rm --publish 8080:8080 \ + --env COLOR=pink \ + xian310/who-is-there:21 +``` + + + +## Gestion des données + +Persistance des données avec Docker + + +### 3 mécanismes différents + +Docker offre trois mécanismes permettant de monter des données de l'hôte dans un conteneur : + +- volumes + +- bind mounts + +- tmpfs volumes + +Dans le doute les _volumes_ sont presque toujours le bon choix. + + +![Type de montage](images/types-of-mounts.png) + +Source : documentation officielle Docker + +Quel que soit le type de montage utilisé, les données seront présentées de la même façon au conteneur, c'est à dire sous la forme d'un dossier ou d'un fichier unique. + + +### Volumes + +![Type de montage](images/types-of-mounts-volume.png) + +- Les _volumes_ sont stockés sur le système de fichiers de l'hôte dans le dossier +`/var/lib/docker/volumes/`. + + +- Un volume est créé et _managé_ par Docker. + +- Les processus autres que Docker ne devraient donc pas y modifier directement les données. + + +- Un volume peut être monté simultanément dans plusieurs conteneurs + + * en lecture/écriture ou lecture seule, + + * très utile pour partager des données entre conteneurs. + + +- Un volume est indépendant des conteneurs. + +- Le contenu persiste même si aucun conteneur n'utilise le volume. + +- Un volume doit être explicitement supprimé. + + +- un volume peut être nommé ou anonyme. +(Un volume anonyme se voit attribuer un identifiant unique sur l'hôte) + +- Les volumes supportent la notion de _volume drivers_. +(pour stocker les données sur des hôtes distant ou dans le cloud par exemple) + +- un volume peut être sauvegardé, restoré ou migré facilement d'un hôte Docker à l'autre. +(Stopper les conteneurs utilisant le volume, sauvegarder le dossier `/var/lib/docker/volumes//`). + + + + +1. Créer un volume +`$ docker volume create VOLUME` + +2. Lister les volumes +`$ docker volume ls` + +3. Inspecter un volume +`$ docker volume inspect VOLUME` + +4. Supprimer un volume +`$ docker volume rm VOLUME` + +5. Supprimer tous les volumes non-utilisés +`$ docker volume prune` + + + +```none +$ docker volume create mon-volume +``` +```none +$ docker volume inspect mon-volume +``` +```json +[ + { + "CreatedAt": "2018-01-16T10:15:51+01:00", + "Driver": "local", + "Labels": {}, + "Mountpoint": "/var/lib/docker/volumes/mon-volume/_data", + "Name": "mon-volume", + "Options": {}, + "Scope": "local" + } +] +``` + +* `docker volume inspect` permet de connaître le chemin réel du volume sur le système hôte. + + +### Bind mounts + +![Type de montage](images/types-of-mounts-bind.png) + +- Les _bind mounts_ permettent de "monter" n'importe quel fichier ou dossier du système hôte à l'intérieur du conteneur. + + +- Exemples d'utilisation de Bind mount : + + * partager des fichiers de configuration entre l'hôte et des conteneurs. + + * partager du code source entre l'hôte et un conteneur (sur un poste de développement). + +- Le fichier ou le répertoire source peut ne pas exister au préalable sur l'hôte (il sera créé le cas échéant). + + +- __Attention !__ + +Si un dossier ou fichier critique pour le système hôte est monté dans le conteneur, ce dernier peut y accéder sans restriction. + + +### tmpfs mounts + +![Type de montage](images/types-of-mounts-tmpfs.png) + +- Les _tmpfs mounts_ sont stockés directement dans la mémoire de l'hôte. + + +- Les données sont donc volatiles et détruites en même temps que le conteneur qui les utilise (ou en cas de reboot du système). + +- Les _tmpfs mounts_ ne peuvent pas être partagés entre plusieurs conteneurs. + + +### Exemples de montages + + + +1. Monte un volume nommé +```none + $ docker run --detach \ + --name apache \ + --publish 8080:80 \ + --mount source=mon-volume,target=/var/www/mon-app \ + httpd:2.4 +``` + +2. Monte un répertoire local (bind mount) +```none + $ docker run --detach \ + --name apache \ + --publish 8080:80 \ + --mount type=bind,source=/home/debian/mon-app,destination=/var/www/mon-app \ + httpd:2.4 +``` + +3. Monte un répertoire local (bind mount) en read-only +```none + $ docker run --detach \ + --name apache \ + --publish 8080:80 \ + --mount type=bind,source=/home/debian/mon-app,destination=/var/www/mon-app,readonly \ + httpd:2.4 +``` + + +### -v ou --mount ? + +- A l'origine , les options `-v` et `--volume` étaient utilisées pour les conteneurs _standalone_ et l'option `--mount` pour les _services_ Swarm. + +- On peut utiliser les 2 syntaxes. + + +### Volumes et droits d'accès + +Attention : les accès sur les fichiers +restent soumis aux droits Linux. + + +### Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Docker Volumes](../travaux-pratiques/slides/docker/tp-volumes.html) + + +### Accéder à la racine du système de fichiers du conteneur + + +```none +# docker inspect -f '{{.State.Pid}}' mon-conteneur +11384 + +# cd /proc/11384/root/ +total 52 +drwxr-xr-x 19 root root 4096 déc. 18 17:26 ./ +drwxr-xr-x 19 root root 4096 déc. 18 17:26 ../ +drwxr-xr-x 2 root root 12288 mars 9 2017 bin/ +drwxr-xr-x 5 root root 360 déc. 18 17:08 dev/ +-rwxr-xr-x 1 root root 0 déc. 18 17:08 .dockerenv* +drwxr-xr-x 2 root root 4096 déc. 18 17:08 etc/ +drwxr-xr-x 2 99 99 4096 mars 9 2017 home/ +dr-xr-xr-x 263 root root 0 déc. 18 17:08 proc/ +drwxr-xr-x 2 root root 4096 déc. 18 17:23 root/ +dr-xr-xr-x 13 root root 0 déc. 18 17:11 sys/ +drwxrwxrwt 2 root root 4096 mars 9 2017 tmp/ +drwxr-xr-x 3 root root 4096 mars 9 2017 usr/ +drwxr-xr-x 4 root root 4096 mars 9 2017 var/ +``` +Spécification RunC : [https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md) + + +### Connaître l'espace disque utilisé par Docker + +`docker system df` + + +```none +$ docker system df +TYPE TOTAL ACTIVE SIZE RECLAIMABLE +Images 23 2 3.871GB 3.794GB (98%) +Containers 11 0 2.989GB 2.989GB (100%) +Local Volumes 4 0 94.22MB 94.22MB (100%) +``` + + +### Nettoyer le système + +`docker system prune` + +* Supprime les conteneurs arrêtés + +* Supprimes les images qui n'ont plus de tag associé + + * avec `-a` supprime aussi les images non utilisées + +* Supprime les volumes orphelins + +* Supprime les réseaux vides + + + +## Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP application complète Web + DB](../travaux-pratiques/slides/docker/tp-web-db.html) + + + +## Docker Compose + +Application multi-conteneurs + + +- _Compose_ est un outil permettant de configurer et déployer une application composée de plusieurs conteneurs. + +- _Compose_ n'est pas inclus dans Docker il faut donc l'installer en plus. + +[https://docs.docker.com/compose/](https://docs.docker.com/compose/) + + +- L'application (mono-conteneur ou multi-conteneurs) est décrite dans un fichier texte au format _yml_. + +- Chaque service (conteneur) possède sa propre section de configuration. + +- Par défaut un réseau personnalisé de type Bridge est automatiquement créé pour que l'ensemble des conteneurs de l'application : + + * puissent communiquer entre eux, + + * être isolés des autres conteneurs. + + +### docker-compose.yml + + +```yaml +version: '3' +services: + web: + build: . # ici l'image sera construite à partir d'un Dockerfile + ports: + - "5000:5000" + volumes: + - .:/code + - logvolume01:/var/log + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost"] + interval: 1m30s + timeout: 10s + retries: 3 + redis: + image: redis # ici on reprend une image déjà existante +volumes: + logvolume01: {} +``` + + + +Directive | Description +-------------------------|--------------------------------------- +`image` | Spécifie l'image Docker à utiliser +`build` | Spécifie le chemin pour build l'image +`ports` | Configure la publication de ports +`depends_on` | Exprime la dépendance entre plusieurs services et ainsi l'ordre de lancement +`restart` | Spécifie le configuration de redémarrage du conteneur +`healthcheck` | Configure une vérification de la santé du service +`...` | https://docs.docker.com/compose/compose-file/ + + +Derrière un proxy : +```yaml +version: "3" +services: + my-service: + build: + context: my-folder/ + args: + - http_proxy=http:///my.proxy.url:3128 + - https_proxy=https:///my.proxy.url:3128 +``` + + +Pour vérifier la syntaxe du fichier docker-compose.yml : + +`$ docker-compose config` + + +Pour déployer la stack applicative +en une seule commande : + +`$ docker-compose up -d` + + +Pour arrêter la stack sans supprimer les conteneurs : + +`$ docker-compose stop` + + +Pour supprimer complètement la stack : + +`$ docker-compose down` + +Cela entraîne la suppression des conteneurs et des réseaux associés. + + +Pour afficher les logs +de tous les conteneurs de la stack : + +`$ docker-compose logs` + + +### Le fichier `.env` + +* Permet de déclarer des variables dont la valeur sera automatiquement substituée lors du traitement du fichier _docker-compose.yml_. + +* Est localisé dans le même dossier que _docker-compose.yml_. + +* `docker-compose config` permet de visualiser le fichier final. + + +`.env` +```bash +MA_VARIABLE=hello-world +MON_AUTRE_VARIABLE=bonjour +``` + +`docker-compose.yml` +```yaml +version: '3' + +services: + hello: + image: ${MA_VARIABLE} + environment: + - env_var_name=${MON_AUTRE_VARIABLE} +``` + + +### Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Docker Compose](../travaux-pratiques/slides/docker/tp-compose.html) + + + +## Docker CMD --format + +Permet d'utiliser des templates Go pour personnaliser l'affichage + +```none +$ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}" +``` +```none +IMAGE ID REPOSITORY TAG +1afc387274f5 cheatsheet latest +258031686918 node 8.1.2 +a2ff708b7413 debian latest +00f017a8c2a6 busybox latest +00f017a8c2a6 10.6.30.30:5000/mpoullain/busybox latest +``` + +[https://docs.docker.com/engine/admin/formatting/](https://docs.docker.com/engine/admin/formatting/) + + + +## API du démon Docker + +* Le démon Docker fourni une API qui permet de : + + - récupérer des informations sur le démon et les objets Docker + + - lancer des commandes + +* Documentation : [https://docs.docker.com/develop/sdk/](https://docs.docker.com/develop/sdk/) + + + +Lister les conteneurs : +```none +$ curl --unix-socket /var/run/docker.sock http://1.24/containers/json | jq . +``` +```json +[ + { + "Id": "4ab7c5898ac9a594b42406c0afc2250b1b7da36e8966348c09e32fde84515608", + "Names": [ + "/determined_bohr" + ], + "Image": "debian:stretch", + "ImageID": "sha256:8626492fecd368469e92258dfcafe055f636c21a5865a98a0a6...", + "Command": "bash" + } + ... +] +``` + + + +Démarrer un conteneur : +```none +$ curl --unix-socket /var/run/docker.sock -X POST \ + http://1.24/containers/4ab7c5898ac9/start +``` + +Afficher les logs d'un conteneur : +```none +$ curl --unix-socket /var/run/docker.sock \ + http://1.24/containers/4ab7c5898ac9/logs?stdout=1 +``` + + +## Mode debug + +Il est possible d'activer le mode debug +du démon Docker : + +```none +root@node1: # sudo cat /etc/docker/daemon.json +{"debug":true} +``` + +```none +root@node1: # systemctl reload docker +``` + +```none +root@node1: # tail -f /var/log/syslog +c'est beaucoup plus verbeux !! +``` diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/ctop.gif b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/ctop.gif new file mode 100644 index 0000000..26b86da Binary files /dev/null and b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/ctop.gif differ diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/docker-wave-whale.svg b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/tp.gif b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/tp.gif new file mode 100644 index 0000000..101ea93 Binary files /dev/null and b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/tp.gif differ diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-bind.png b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-bind.png new file mode 100644 index 0000000..2d8d409 Binary files /dev/null and b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-bind.png differ diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-tmpfs.png b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-tmpfs.png new file mode 100644 index 0000000..c332c60 Binary files /dev/null and b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-tmpfs.png differ diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-volume.png b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-volume.png new file mode 100644 index 0000000..229b1ff Binary files /dev/null and b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts-volume.png differ diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts.png b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts.png new file mode 100644 index 0000000..5950036 Binary files /dev/null and b/Pepiniere/docker/3.conteneurs-utilisation-avancee/images/types-of-mounts.png differ diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/index.html b/Pepiniere/docker/3.conteneurs-utilisation-avancee/index.html new file mode 100755 index 0000000..d02b0a7 --- /dev/null +++ b/Pepiniere/docker/3.conteneurs-utilisation-avancee/index.html @@ -0,0 +1,88 @@ + + + + + + + SII - Conteneurs : utilisation avancée + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/3.conteneurs-utilisation-avancee/revealjs b/Pepiniere/docker/3.conteneurs-utilisation-avancee/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/3.conteneurs-utilisation-avancee/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/4.hotes-docker/hotes-docker.md b/Pepiniere/docker/4.hotes-docker/hotes-docker.md new file mode 100755 index 0000000..ebcc988 --- /dev/null +++ b/Pepiniere/docker/4.hotes-docker/hotes-docker.md @@ -0,0 +1,366 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +__Les hôtes Docker__ + +Maxime Poullain • Christian Tritten + + + +## Où déployer ses conteneurs ? + + +* Bare-metal + + +* IaaS - cloud public + + * Amazon Web Services (AWS) + + * Google Cloud Engine (GCE) + + * Microsoft Azure + + * ... + + +* IaaS - cloud privé + + * OpenStack + + +* CaaS + + * Google Kubernetes Engine + + * Amazon Elastic Container Service for Kubernetes + + * ... + + +## Offres CaaS + + +### Google Kubernetes Engine + +* Google gère l'infrastructure multi-masters de kubernetes. + +* Kubernetes Engine est certifié conforme Kubernetes : compatibilité complète avec l'écosystème Kubernetes. + +* Monitoring complet du cluster. + +* Les applications Kubernetes standard sont entièrement compatibles et peuvent facilement être migrées vers Google Kubernetes Engine. + +* C'est l'offre la plus complète du marché. + +* [https://cloud.google.com/kubernetes-engine/](https://cloud.google.com/kubernetes-engine/) + + +### Amazon Elastic Container Service for Kubernetes + +* Amazon gère l'infrastructure multi-masters de Kubernetes. + +* Amazon EKS est certifié conforme Kubernetes : compatibilité complète avec l'écosystème Kubernetes. + +* Les applications Kubernetes standard sont entièrement compatibles et peuvent facilement être migrées vers Amazon EKS. + +* [https://aws.amazon.com/fr/eks/](https://aws.amazon.com/fr/eks/) + + +## Distributions classiques + +Toutes les grandes distributions incluent désormais Docker dans leurs dépôts de paquets : + +* Debian + +* Ubuntu + +* RedHat + +* CentOS + + +Toutefois les versions de Docker proposées dans ces dépôts peuvent dater. + +Pour pallier cela Docker Inc. maintient ses propres dépôts avec les versions à jour de ses produits : + +* http://apt.dockerproject.org + +* http://yum.dockerproject.org + + + +## Systèmes d'exploitation spécialisés + +* Systèmes légers, conçus et optimisés pour les conteneurs + +* Peuvent intégrer nativement des fonctionnalités avancées + +* Peuvent présenter une sécurité accrue + + +### RedHat Atomic + +![Logo Atomic](images/logo-atomic.png) + +* Développé par RedHat +* Système Linux léger et immutable (read only OS) +* Basé sur systemd +* Intègre une IHM dédiée : Cockpit +* Orchestration possible via Kubernetes + + +### CoreOS + +![Logo CoreOS](images/logo-coreos.jpg) + +* Basé sur systemd, etcd, rkt, fleet, flannel +* Peut faire tourner des conteneurs rkt et docker +* Fleet est un système d'init distribué basé sur systemd qui permet l'orchestration de conteneurs sur plusieurs hôtes. +* Intégration facile avec Kubernetes +* Production ready + + +### RancherOS + +![Logo Rancher](images/logo-rancher.jpg) + +* Système Linux minimaliste (20Mb) basé sur Docker +* Docker tourne directement au dessus du kernel, avec le PID 1 (en remplacement de... sysVinit / systemd) +* Tous les services habituels du "user-space" sont fournis sous forme de conteneurs Docker +* Les conteneurs applicatifs utilisent un daemon Docker séparé + + +#### Architecture de RancherOS + +![Architecture RancherOS](images/rancheros-architecture.png) + + +### VMware Photon OS + +![Logo Photon](images/logo-photon.jpg) + +* Développé par VMware en opensource +* Système Linux léger optimisé pour les plateformes VMware +* Intégration avec vSphere et vCloud Air +* Supporte les conteneurs Docker et rkt + + + +## Comment Déployer ? + +- À la main ;-) + +- Infrastructure as code + * Ansible + * Heat + * Terraform + * ... + + +### Infrastructure as Code + +L'infrastructure cible est décrite dans des fichiers de configuration à l'aide d'une syntaxe spécifique. + +Il devient possible gérer et versionner les modifications apportées à l'infrastructure. + +Reconstruire, modifier partiellement ou dupliquer une infrastructure s'en trouve d'autant simplifié. + + +#### Exemple de workflow de déploiement + +- Authentification auprès du fournisseur +- Allocation des ressources stockage et d'adressage IP +- Création du réseau +- Déploiement des VMs +- Configuration OS +- Installation et configuration du démon Docker (et/ou Swarm) + + +#### Ansible + +![Ansible](images/logo-ansible.png) + +_Ansible_ est un outil de gestion de configuration très populaire. + +Sa force réside dans un écosystème riche de centaines de modules permettant de gérer à peu près tous les aspects d'une infrastructure ou d'un système. + + +A l'origine conçu comme outil de gestion de configuration pour les systèmes Linux, il peut désormais s'interfacer avec les cloud les plus populaires : +* AWS, +* GCP, +* Azure, +* OpenStack, +* VMware, +* et bien d'autres ... + + +Par exemple les modules Ansible pour OpenStack offrent les fonctionnalités suivantes : + +* Keystone: users, groups, roles, projects +* Nova: servers, keypairs, security-groups, flavors +* Neutron: ports, network, subnets, routers, floating IPs +* Ironic: nodes, introspection +* Swift Objects +* Cinder volumes +* Glance images + + +Il offre également une gestion partielle de Docker via des modules dédiés : + +* docker (D) - manage docker containers +* docker_container - manage docker containers +* docker_image - Manage docker images. +* docker_image_facts - Inspect docker images +* docker_login - Log into a Docker registry. +* docker_network - Manage Docker networks +* docker_service - Manage docker services and containers. + + + +``` +--- +# Ansible and OpenStack automation +- name: VM deployment + hosts: docker-cluster + tasks: + ... + - name: Create the network + os_network: + state: present + name: testnet + external: False + shared: False + register: testnet_network + + - name: Create the test subnet + os_subnet: + state: present + network_name: "{{ testnet_network.id }}" + name: testnet_sub + ip_version: 4 + cidr: 192.168.0.0/24 + gateway_ip: 192.168.0.1 + enable_dhcp: yes + dns_nameservers: + - 8.8.8.8 + register: testnet_sub + + - name: Create server instance + os_server: + state: present + name: testServer + image: debian + flavor: m1.small + security_groups: secgr + key_name: ansible_key + nics: + - net-id: "{{ testnet_network.id }}" + register: testServer +``` + + +#### Heat + +![Terraform](images/logo-heat.jpg) + +_Heat_ est un outil d'orchestration spécifiquement conçu pour gérer des déploiements dans un environnement OpenStack. + +Il permet le déploiement de l’infrastructure initiale puis de son évolution à l'aide de fichiers "Templates" qui décrivent les ressources à produire. + + +##### Exemple de template Heat + + +``` +description: Deploys a Docker Swarm +parameters: + ... + docker_node: + type: OS::Nova::Server + properties: + name: {get_param: hostname} + image: { get_param: instance_image } + flavor: { get_param: instance_flavor } + key_name: { get_param: ssh_key } + networks: + - port: { get_resource: docker_node_port } + user_data_format: RAW + user_data: | + #!/bin/bash + apt-get update + apt-get -y upgrade + wget -q https://test.docker.com/ -O /root/install_docker.sh + chmod 755 /root/install_docker.sh + /bin/bash /root/install_docker.sh + docker swarm join 10.0.2.21:2377 +``` + + +#### Terraform + +![Terraform](images/logo-terraform.jpg) + +_Terraform_ est un outil pour construire, modifier, versionner une infrastructure de manière sécurisé et efficiente. + + +Il gère les fournisseurs les plus populaires : +* IaaS (AWS, GCP, Microsoft Azure, OpenStack, ...) +* PaaS (Heroku, ...) +* SaaS services (Terraform Enterprise, DNSimple, CloudFlare, ...) + + + +`variables.tf` +``` +variable "network" { + type = "string" + default = "training-docker" +} + +variable "nodes" { + default = 3 +} +``` + + +`formation.tf` + +``` +resource "openstack_compute_instance_v2" "formation" { + + name = "training-${count.index + 1}" + count = "${var.nodes}" + flavor_name = "m1.tiny" + key_pair = "training-keypair" + region = "RegionOne" + block_device { + uuid = "724d7bd0-2ea3-4e39-b3d8-dd394ea933f1" + source_type = "image" + volume_size = 8 + boot_index = 0 + destination_type = "volume" + delete_on_termination = true + } + + network { + name = "${var.network}" + } +``` + + +`formation.tf (suite)` + +``` + provisioner "remote-exec" { + inline = [ + "sudo apt update -y", + "sudo apt upgrade -y", + "sudo apt install -y curl", + "sudo curl -fsSL https://get.docker.com/ | sh", + ] + } + +} +``` diff --git a/Pepiniere/docker/4.hotes-docker/images/docker-wave-whale.svg b/Pepiniere/docker/4.hotes-docker/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/4.hotes-docker/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-ansible.png b/Pepiniere/docker/4.hotes-docker/images/logo-ansible.png new file mode 100644 index 0000000..b62c903 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-ansible.png differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-atomic.png b/Pepiniere/docker/4.hotes-docker/images/logo-atomic.png new file mode 100644 index 0000000..74d64f1 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-atomic.png differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-coreos.jpg b/Pepiniere/docker/4.hotes-docker/images/logo-coreos.jpg new file mode 100644 index 0000000..0de81bb Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-coreos.jpg differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-docker-machine.jpg b/Pepiniere/docker/4.hotes-docker/images/logo-docker-machine.jpg new file mode 100644 index 0000000..ff3c1bb Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-docker-machine.jpg differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-heat.jpg b/Pepiniere/docker/4.hotes-docker/images/logo-heat.jpg new file mode 100644 index 0000000..72b9a12 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-heat.jpg differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-photon.jpg b/Pepiniere/docker/4.hotes-docker/images/logo-photon.jpg new file mode 100644 index 0000000..7a41198 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-photon.jpg differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-rancher.jpg b/Pepiniere/docker/4.hotes-docker/images/logo-rancher.jpg new file mode 100644 index 0000000..bd0d62b Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-rancher.jpg differ diff --git a/Pepiniere/docker/4.hotes-docker/images/logo-terraform.jpg b/Pepiniere/docker/4.hotes-docker/images/logo-terraform.jpg new file mode 100644 index 0000000..5093c26 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/logo-terraform.jpg differ diff --git a/Pepiniere/docker/4.hotes-docker/images/machine.png b/Pepiniere/docker/4.hotes-docker/images/machine.png new file mode 100644 index 0000000..7c39f77 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/machine.png differ diff --git a/Pepiniere/docker/4.hotes-docker/images/machine2.png b/Pepiniere/docker/4.hotes-docker/images/machine2.png new file mode 100644 index 0000000..3b7e49b Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/machine2.png differ diff --git a/Pepiniere/docker/4.hotes-docker/images/rancheros-architecture.png b/Pepiniere/docker/4.hotes-docker/images/rancheros-architecture.png new file mode 100644 index 0000000..7bc2d67 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/rancheros-architecture.png differ diff --git a/Pepiniere/docker/4.hotes-docker/images/tp.gif b/Pepiniere/docker/4.hotes-docker/images/tp.gif new file mode 100644 index 0000000..101ea93 Binary files /dev/null and b/Pepiniere/docker/4.hotes-docker/images/tp.gif differ diff --git a/Pepiniere/docker/4.hotes-docker/index.html b/Pepiniere/docker/4.hotes-docker/index.html new file mode 100755 index 0000000..44e57a7 --- /dev/null +++ b/Pepiniere/docker/4.hotes-docker/index.html @@ -0,0 +1,72 @@ + + + + + + + SII - Hôtes Docker + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/4.hotes-docker/revealjs b/Pepiniere/docker/4.hotes-docker/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/4.hotes-docker/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/5.swarm/images/container-mess.jpg b/Pepiniere/docker/5.swarm/images/container-mess.jpg new file mode 100644 index 0000000..29adcaf Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/container-mess.jpg differ diff --git a/Pepiniere/docker/5.swarm/images/docker-networking-overlay-addresses.jpg b/Pepiniere/docker/5.swarm/images/docker-networking-overlay-addresses.jpg new file mode 100644 index 0000000..8871a67 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/docker-networking-overlay-addresses.jpg differ diff --git a/Pepiniere/docker/5.swarm/images/docker-networking-overlay-routing.jpg b/Pepiniere/docker/5.swarm/images/docker-networking-overlay-routing.jpg new file mode 100644 index 0000000..c2ed1e9 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/docker-networking-overlay-routing.jpg differ diff --git a/Pepiniere/docker/5.swarm/images/docker-networking-overlay.jpg b/Pepiniere/docker/5.swarm/images/docker-networking-overlay.jpg new file mode 100644 index 0000000..a81494a Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/docker-networking-overlay.jpg differ diff --git a/Pepiniere/docker/5.swarm/images/docker-wave-whale.svg b/Pepiniere/docker/5.swarm/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/5.swarm/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/5.swarm/images/glusterfs.png b/Pepiniere/docker/5.swarm/images/glusterfs.png new file mode 100644 index 0000000..b494152 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/glusterfs.png differ diff --git a/Pepiniere/docker/5.swarm/images/orchestration-principle.jpg b/Pepiniere/docker/5.swarm/images/orchestration-principle.jpg new file mode 100644 index 0000000..ce412ac Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/orchestration-principle.jpg differ diff --git a/Pepiniere/docker/5.swarm/images/swarm-network-ingress-lb.png b/Pepiniere/docker/5.swarm/images/swarm-network-ingress-lb.png new file mode 100644 index 0000000..90b7505 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/swarm-network-ingress-lb.png differ diff --git a/Pepiniere/docker/5.swarm/images/swarm-network-ingress-routing-mesh.png b/Pepiniere/docker/5.swarm/images/swarm-network-ingress-routing-mesh.png new file mode 100644 index 0000000..55ad8e1 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/swarm-network-ingress-routing-mesh.png differ diff --git a/Pepiniere/docker/5.swarm/images/swarm.png b/Pepiniere/docker/5.swarm/images/swarm.png new file mode 100644 index 0000000..88bb14b Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/swarm.png differ diff --git a/Pepiniere/docker/5.swarm/images/swarm2.png b/Pepiniere/docker/5.swarm/images/swarm2.png new file mode 100644 index 0000000..4e6d383 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/swarm2.png differ diff --git a/Pepiniere/docker/5.swarm/images/swarm3.png b/Pepiniere/docker/5.swarm/images/swarm3.png new file mode 100644 index 0000000..289c828 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/swarm3.png differ diff --git a/Pepiniere/docker/5.swarm/images/tp.gif b/Pepiniere/docker/5.swarm/images/tp.gif new file mode 100644 index 0000000..101ea93 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/tp.gif differ diff --git a/Pepiniere/docker/5.swarm/images/traefik.png b/Pepiniere/docker/5.swarm/images/traefik.png new file mode 100644 index 0000000..85cde64 Binary files /dev/null and b/Pepiniere/docker/5.swarm/images/traefik.png differ diff --git a/Pepiniere/docker/5.swarm/index.html b/Pepiniere/docker/5.swarm/index.html new file mode 100755 index 0000000..4f50822 --- /dev/null +++ b/Pepiniere/docker/5.swarm/index.html @@ -0,0 +1,88 @@ + + + + + + + SII - Docker Swarm + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/5.swarm/revealjs b/Pepiniere/docker/5.swarm/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/5.swarm/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/5.swarm/swarm.md b/Pepiniere/docker/5.swarm/swarm.md new file mode 100644 index 0000000..be30f1d --- /dev/null +++ b/Pepiniere/docker/5.swarm/swarm.md @@ -0,0 +1,750 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +**Swarm** + +Maxime Poullain • Christian Tritten + + + + + + + +Le passage à l'échelle d'une infrastructure Docker +nécessite des outils adaptés. + + +## Orchestrateur de conteneurs + +Un orchestrateur de conteneurs permet +de construire (facilement) un système distribué. + + +### Fonctionnalités d'un orchestrateur (1/2) + +- Gestion d'un ensemble de machines (cluster) +Extension horizontale de la capacité du système par l'ajout de nouvelles machines + +- Gestion des déploiements de conteneurs (scheduler) +Selon des critères : label, affinité, charge, ... + +- Gestion de la résilience +Via des tests de santé périodique sur les conteneurs et les hôtes + + +### Fonctionnalités d'un orchestrateur (2/2) + +- Gestion d'un réseau distribué +Qui s'étend sur l'ensemble des machines du cluster + +- Gestion de la haute disponibilité des applications +En créant plusieurs instances d'une même application sur des hôtes différents + +- Gestion de la découverte de services +Pour détecter automatiquement les nouvelles instances d'une application + + + +### Principe d'un orchestrateur + +![Schema de principe](images/orchestration-principle.jpg) + + +### Les principaux orchestrateurs + +- Swarm (Docker) + +- Kubernetes (Google) + +- OpenShift (RedHat) + +- Mesos/Marathon (Apache) + +- Nomad (HashiCorp) + +- Rancher + +- ... + + +## Docker Swarm +![Logo Docker Swarm](images/swarm.png) +- Orchestrateur maison de Docker Inc. +- Très bien intégré dans Docker (rien à installer) +- Facile à prendre en main +- Solution idéale pour les petits environnements + + +## Swarm - Fonctionnalités + + +- Gestion du cluster + + - Ajout/retrait de machines + + - Maintient opérationnel de l'état du cluster + + - Chiffrement des transactions entre les noeuds (control plane) + +- Orchestration des déploiements + + - Placement des conteneurs + + - Stratégies / Filtres + + +- Gestion d'applications multi-conteneurs (Stack) + +- Réseau distribué (Overlay) + +- Mise à l'échelle + +- Équilibrage de charge + +- Gestion de la résilience + + + +## Concepts + +La terminologie Swarm + +* node + +* task + +* service + +* stack + +* network + +* secret / config + + +### Node + +* Un noeud (_node_) est une instance de Docker Engine intégrée dans le cluster Docker Swarm. + +* On peut joindre autant de noeuds que nécessaire au cluster. + +* On peut également retirer des noeuds si besoin. + + +Deux types de noeuds : + +* __Manager__ + - Maintient l'état du cluster + - Orchestre les tâches (_tasks_) sur les noeuds actifs + +* __Worker__ + - Reçoit les tâches (_tasks_) envoyées par les noeuds manager + - Exécute les tâches localement + + +* Par défaut les noeuds de type _manager_ sont aussi des _worker_. + +* Il est possible de configurer un noeud manager pour qu'il fasse seulement office de manager (`drain`). + +* Un noeud peut changer de rôle au cours de son existence en passant de worker à manager ou inversement (`promote/demote`). + + +![Schema Docker Swarm](images/swarm2.png) + + +Un noeud _Manager_ peut être dans l'un des états suivants : + +* _Leader_ : noeud manager primaire du système, il prend les décisions d'orchestration au sein du cluster. + +* _Reachable_ : noeud pouvant devenir leader en cas de défaillance de l'actuel noeud leader. + +* _Unavailable_ : noeud non joignable d'un point de vue réseau. + + +* Afin d'augmenter la résilience du cluster, il est recommandé d'opter pour un nombre impair de noeuds de type _manager_ : + +* Avec _3_ noeuds managers, le système peut survivre à une perte maximum d'_1 manager_. + +* Avec _5_ noeuds managers, le système peut survivre à une perte maximum de _2 managers_. + +* L'augmentation du nombre de noeuds manager ne procure pas de meilleures performances au système global. + + +Managers | Majorité Quorum | Tolérence de perte +:-------:|:---------------:|:-----------------: +1 | 1 | 0 +2 | 2 | 0 +3 | 2 | 1 +4 | 3 | 1 +5 | 3 | 2 +6 | 4 | 2 +7 | 4 | 3 +8 | 5 | 3 +9 | 5 | 4 + + +Niveaux de disponibilité d'un noeud : + +- Active + +- Pause + +- Drain + + +Niveau _Active_ : + +* Le noeud peut recevoir de nouvelles tâches de la part de l'orchestrateur. + +* C'est le niveau de fonctionnement normal. + + +Niveau _Pause_ : + +* Le noeud ne peut plus recevoir de nouvelles tâches de la part de l'orchestrateur. + +* Les éventuelles tâches en cours d'exécution sur ce noeud continuent d'être exécutées sur ce noeud. + + +Niveau _Drain_ : + +* Le noeud ne peut plus recevoir de nouvelles tâches de la part de l'orchestrateur. + +* Les éventuelles tâches en cours d'exécution sur ce noeud sont automatiquement basculées sur un noeud actif. + +* Ce mode est prévu pour la maintenance de l'hôte. + + +### Task + +* Une tâche (_task_) est l'unité atomique directement orchestrable au sein du cluster Swarm. + +* Une tâche correspond à l'exécution d'_un conteneur_ sur _un noeud_ du cluster. + + +* Les noeuds de type _manager_ assignent les _tâches_ directement aux noeuds de niveau _active_ selon le mode de mise à l'échelle défini pour le service (_replicated/global_). + +* Si l'exécution d'une tâche échoue, l'orchestrateur la supprime et en créé une nouvelle en remplacement. + + +### Service + +* Un service est la formalisation de tâches (_tasks_) qui seront exécutées par les noeuds de niveau active. + +* Un service peut donc avoir plusieurs tâches. + + +2 modes pour la scalabilité d'un service : + +* _Replicated_ : le manager génère des tâches de type réplica pour le service jusqu'à atteindre le nombre de réplicas souhaité et les distribue sur les noeuds active du cluster. + +* _Global_ : le manager lance une tâche du service sur chaque noeud disponible dans le cluster, ce qui peut se révéler pratique dans le cas d'agents de monitoring par exemple. + + +La montée de version pour un _service_ donné peut être gérée de façon séquentielle (une tâche remplacée après l'autre) ou parallèle n tâches du service remplacées en même temps). + + +### Overlay Network + +* Un réseau de type `overlay` est distribué sur l'ensemble des noeuds du cluster swarm. + +* Il permet de connecter un ou plusieurs services à l'intérieur du cluster Swarm sans avoir besoin de publier des ports réseau sur les hôtes. + + +* La technologie `VXLAN` est utilisée pour créer les réseaux overlay au dessus du réseau existant. + +* Par défaut tout le trafic transitant sur un réseau overlay est en clair (pour des raisons de performance). + +* Il est possible de chiffrer un réseau overlay donné (Kernel `IPSEC` encryption) via l'ajout d'une option lors de sa création. + + +Le tunnel ainsi créé permet aux conteneurs +de communiquer même s'ils sont placés +sur des hôtes différents. + +![Réseau Overlay](images/docker-networking-overlay.jpg) + + +Chaque conteneur démarré sur un réseau overlay se voit attribuer deux adresses IP : une pour la communication entre les conteneurs du réseau (10.0.0.x) et une pour la VXLAN Tunnel End Point address (VTEP) (172.18.0.x). + +![Réseau Overlay](images/docker-networking-overlay-addresses.jpg) + + +Swarm permet de publier des services à l'extérieur en assignant un _PublishedPort_ à un service donné. + +Un port ainsi publié est ouvert sur tous les noeuds du cluster. Les requêtes sont routées automatiquement. + + +![Réseau Overlay](images/docker-networking-overlay-routing.jpg) + + +#### VIP et DNS + +* Par défaut une adresse IP virtuelle (VIP) et une entrée DNS sont créées pour chaque service géré par Swarm, le rendant ainsi disponible par son nom aux conteneurs présents sur le même réseau overlay. + +* Swarm intègre un service de _DNS interne_ permettant de résoudre facilement le nom d'un service. + + +#### Load Balancing interne + +Swarm utilise un mécanisme interne de répartition de charge pour distribuer les requêtes aux services. + +![Réseau Ingress](images/swarm-network-ingress-routing-mesh.png) + + +#### Load Balancing externe + +Des composants externes tels des _load balancers_ peuvent être placés en amont du cluster Swarm et accéder à un service sur le port publié (_PublishedPort_) à partir de n'importe quel noeud du cluster. + + +Reverse Proxy et Load Balancing HAProxy + +![Réseau Ingress](images/swarm-network-ingress-lb.png) + + +Swarm se charge ensuite de router de façon transparente les requêtes à destination du service sur l'un des noeuds exécutant une tâche correspondant au service demandé. + + +### Stack + +* Une _stack_ est la formalisation d'une application composée d'un ou plusieurs services. + +* Elle se présente sous la forme d'un fichier de description `docker-compose.yml` + +* Il devient ainsi possible de déployer une application complexe sur l'ensemble du cluster. + + +#### Stack = Swarm + Compose + +![Schema Docker Swarm](images/swarm3.png) + + +### Secret + +Gestion sécurisée des données sensibles. + + +* Exemples de données sensibles : + + - Nom d'utilisateur + + - Mot de passe + + - Certificats et clés TLS + + - Clés SSH + + - Nom d'une base de données + + - nom d'un serveur interne + + - Chaines de caractères ou fichier binaire (< 500 Kb) + + +* Limitation : les secrets sont _utilisables seulement avec les services Swarm_. + +* Les secrets sont chiffrés et stokés par Swarm. + +* Les secrets sont distribués aux différents noeuds du cluster et transmis seulement aux services qui en font la demande. + + +* Les secrets sont présentés aux conteneurs d'un service sous la formation d'un dossier en mémoire RAM monté dans `/run/secrets`. Ce dossier contient les secrets déchiffrés. + +* A partir de Docker 17.06 il est possible de définir l'emplacement où un secret doit être monté à l'intérieur du conteneur. + + +### Config + +* Le concept de `config` est disponible à partir de Docker 17.06. + +* Il s'agit de l'équivalent des secrets mais pour des données non sensibles (par exemple un fichier de configuration). + +* Limitation : les configs sont _utilisables seulement avec les services Swarm_. + + +* Le but des configs est d'éviter : + - les montages de type `bind-mount` pour faire de la configuration, + - l'utilisation de variables d'environnement. + +* Les données des configs ne sont pas chiffrées et sont montées directement dans système de fichiers du conteneur (sans utilisation de RAM disks). + + + +## Manipuler Swarm + +Les fondamentaux + + +### Initialisation du cluster + +Sur l'hôte Docker qui sera le premier _manager_ du cluster + +`$ docker swarm init --advertise-addr MANAGER-IP` + +```nohighlight +Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager. + +To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-2scvxnrfa53pxfcf7w1qvdm25ofv6lg776tszvnjbtg727ozau \ + 192.168.99.100:2377 + +To add a manager to this swarm, run 'docker swarm join-token manager' and follow +the instructions.Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) +is now a manager. + +``` + + +Pour ajouter un _worker_ ou un _manager_ au cluster une seule commande suffit. + + +1. On peut retrouver cette commande depuis le premier manager : +`$ docker swarm join-token worker` +```nohighlight +To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-2scvxnrfa53pxfcf7w1qvdm25ofv6lg776tszvnjbtg727ozau \ + 192.168.99.100:2377 +``` +`$ docker swarm join-token manager` +```nohighlight +To add a manager to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-2scvxnrfa53pxfcf7w1qvdm25ofv6lg776tszvnjbtg727ozau \ + 192.168.99.100:2377 +``` + + +Par exemple, on ajoute un _worker_ en jouant la commande récupérée précédemment. + +Sur le futur noeud _worker_ : + +```nohighlight +$ docker swarm join \ +--token SWMTKN-1-2scvxnrfa53pxfcf7w1qvdm25ofv6lg776tszvnjbtg727ozau \ +172.16.2.11:2377 +This node joined a swarm as a worker. + +``` + + +Pour administrer les noeuds du Swarm on doit exécuter les commandes depuis un _manager_. + + +Pour afficher les liste des noeuds : + +`$ docker node ls` + +```nohighlight +ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS +3raehvrbi5u0rz4y2kaqreakr * docker-node-1 Ready Active Leader +jel9o08m2tcfmpyryt1d3nr59 docker-node-2 Ready Active Reachable +lennvj9r57wgl6cwi5k7ac0cb docker-node-5 Ready Active +om4pm2xcc9fl4uyehzeuwfklm docker-node-3 Ready Active Reachable +ynj6x2tblko0ulvaz6ojrxueu docker-node-4 Ready Active +``` + + + +1. Pour transformer un noeud _worker_ en _manager_ : +`$ docker node promote NODE` + +2. Et inversement : +`$ docker node demote NODE` + +3. Pour supprimer un noeud du Swarm: +`$ docker node rm NODE` + + +#### Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Initialisation d'un cluster Swarm](../travaux-pratiques/slides/swarm/tp-swarm-init.html) + + +### Services + +Pour lancer un service sur le cluster Swarm : +`docker service create` +```nohighlight +$ docker service create --name busybox busybox sleep 600 +``` + + +`docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]` + +Créer un nouveau service + + +Option | Description +-------------------------|--------------------------------------- +`--constraint` | Placement constraints +`--network` | Network attachments +`--name` | Service name +`--publish` | Publish a port as a node port +`--replicas` | Number of tasks +`...` | [https://docs.docker.com/engine/reference/ commandline/service_create/](https://docs.docker.com/engine/reference/commandline/service_create/) + + + +1. Lister les services du cluster : +`$ docker service ls` +```nohighlight +ID NAME MODE REPLICAS IMAGE +uutgao0sp6qi busybox replicated 1/1 busybox:latest +``` + +2. Supprimer un service : +`$ docker service rm SERVICE` + +3. Mettre à jour un service avec : +`$ docker service update [OPTIONS] SERVICE` + +4. Pour revenir à la version précédente de la configuration d'un service : +`$ docker service rollback SERVICE` + + +Par exemple, il est possible d'ajouter une contrainte sur un service pour qu'il ne démarre que sur un noeud spécifique. + + +```bash +$ docker service update --constraint-add 'node.hostname == ' busybox +``` + + +On peut revenir à la configuration précédente en utilisant la fonctionnalité de rollback. +```nohighlight +$ docker service rollback busybox +``` + +Attention, on ne peut pas revenir en arrière plusieurs fois d'affilé. + + + +Pour voir en détail les _tasks_ d'un service : +`docker service ps SERVICE` +```nohighlight +$ docker service ps busybox +ID NAME IMAGE NODE DESIRED STATE +uzb1ovvp4tnx busybox.1 busybox:latest docker-node-1 Running +cs5vud4gpq1n \_ busybox.1 busybox:latest docker-node-2 Shutdown +``` +```nohighlight +$ docker service ps busybox --filter desired-state=Running +ID NAME IMAGE NODE DESIRED STATE +uzb1ovvp4tnx busybox.1 busybox:latest docker-node-1 Running +``` + + +Pour mettre à l'échelle un service : +`docker service scale SERVICE=REPLICAS` + +```nohighlight +$ docker service scale busybox=3 +busybox scaled to 3 + +$ docker service ps busybox +ID NAME IMAGE NODE DESIRED STATE +uzb1ovvp4tnx busybox.1 busybox:latest docker-node-1 Running +cs5vud4gpq1n \_ busybox.1 busybox:latest docker-node-2 Shutdown +pmdpmocyf106 busybox.2 busybox:latest docker-node-1 Running +hzk9x2ak8win busybox.3 busybox:latest docker-node-1 Running +``` + + +Pour déployer une _stack_ + +`docker stack deploy [OPTIONS] STACK` + +* Une multitude de nouvelles options a été ajouté dans le version 3 du format _docker-compose.yml_. + +* https://docs.docker.com/compose/compose-file/ + + +`docker stack COMMAND` + +Gère une stack Docker + +Commande | Description +- | - +`deploy` | Déploie une nouvelle stack ou met à jour une stack existante +`ls` | Liste les stacks +`services` | Liste les services de la stack +`ps` | Liste les tasks de la stack +`rm` | Supprime la stack + + +### Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Déploiement d'applications sur Swarm](../travaux-pratiques/slides/swarm/tp-swarm.html) + +[TP Docker Secret](../travaux-pratiques/slides/swarm/tp-secrets.html) + +[TP Rolling Update](../travaux-pratiques/slides/swarm/tp-rolling-update.html) + + + +## Dépannage + +Se sortir de situations difficiles + + +### Dépannage Manager + +Si un noeud `Manager` est défaillant, la solution peut être de lui faire quitter puis rejoindre le cluster. + +1. Rétrograder le Manager en worker : +`docker node demote ` + +2. Supprimer le Node du cluster : +`docker node rm `. + +3. Re-joindre le Node au cluster : +`docker swarm join`. + +Source : [https://docs.docker.com/engine/swarm/admin_guide/#troubleshoot-a-manager-node](https://docs.docker.com/engine/swarm/admin_guide/#troubleshoot-a-manager-node) + + +### Sauvegarde de l'état d'un Manager + +1. Si l'auto-lock est activé, le désactiver. + +2. Stopper Docker sur l'hôte cible. + +3. Sauvegarder le répertoire `/var/lib/docker/swarm` + +4. Redémarrer Docker. + +Source : [https://docs.docker.com/engine/swarm/admin_guide/#back-up-the-swarm](https://docs.docker.com/engine/swarm/admin_guide/#back-up-the-swarm) + + +### Restaurer l'état d'un Manager + +1. Stopper Docker sur l'hôte cible. + +2. Supprimer le dossier `/var/lib/docker/swarm` + +3. Restaurer le dossier `/var/lib/docker/swarm` depuis une sauvegarde. + +4. Démarrer Docker sur le nouveau noeud, et réinitialiser le noeud avec +`docker swarm init --force-new-cluster` + +5. Vérifier l'état du swarm. + +Source : [https://docs.docker.com/engine/swarm/admin_guide/#recover-from-disaster](https://docs.docker.com/engine/swarm/admin_guide/#recover-from-disaster) + + +### Logging + +Les logs des démons Docker et Swarm se situent : + + +Operating system | Location +-----------------------|------------------------ +RHEL, Oracle Linux | `/var/log/messages` +Debian | `/var/log/daemon.log` +Ubuntu 16.04+, CentOS | Use the command `journalctl -u docker.service` +Ubuntu 14.10- | `/var/log/upstart/docker.log` +macOS | `~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring` +Windows | `AppData\Local` + + +### Enable Debugging + +Pour activer le debugging du démon Docker, éditer le fichier `/etc/docker/daemon.json` pour y ajouter : + +``` +{ + "debug": true +} +``` + +Rédémarrer le démon ou recharger sa configuration. + +Source : [https://docs.docker.com/engine/admin/](https://docs.docker.com/engine/admin/#force-a-stack-trace-to-be-logged) + + + +## Reverse Proxy + +Accéder au cluster Swarm depuis l'extérieur + + +### Traefik + +https://traefik.io/ + +* Reverse Proxy HTTP & Load Balancer + +* Rapide + +* Supporte une grande variété de backends +(Docker, Swarm, Kubernetes, Mesos/Marathon, Consul, Etcd, Rest API, file...) + + +* Configuration dynamique pour simplifier l'accès aux applications orientées micro-services + +* Gestion automatique des certificats TLS avec Let's Encrypt + +* Interface web de supervision + + +### Fonctionnement + +* Traefik se lance dans un conteneur sur le cluster et se connecte à la socket Docker pour écouter les évènements du cluster. + +* Les conteneurs applicatifs déclarent des _labels traefik.*_ afin de se signaler auprès de Traefik. + + +### Schéma de principe + +![Schema Traefik](images/traefik.png) + + +### Travaux pratiques + +![Travaux pratiques](images/tp.gif) + +[TP Traefik](../travaux-pratiques/slides/swarm/tp-traefik.html) + + +### Plus de détails sur Traefik v2 + +* https://blog.containo.us/traefik-2-0-docker-101-fc2893944b9d +* https://blog.containo.us/traefik-2-tls-101-23b4fbee81f1 + + +## Stockage distribué + +GlusterFS + + +Lorsque des applications sont déployées sur plusieurs noeuds, il devient nécessaire de : + +* Rendre certaines données accessibles sur tous les noeuds du cluster Swarm. + +* Rendre possible la persistance des données des conteneurs sur n'importe quel noeud. + + +* GlusterFS est un système de fichiers libre distribué, qui permet de stocker jusqu'à plusieurs pétaoctets. + +* GlusterFS réplique automatiquement les données sur tous les noeuds du cluster de stockage. + + +GlusterFS repose sur un modèle client-serveur. + +* Les serveurs sont déployés comme des "briques de stockage", chaque serveur exécutant un daemon qui exporte un système de fichier local comme un _volume_. + +* Les clients sont sans état, et ne communiquent pas entre eux. Ils peuvent monter les volumes exportés par les serveurs. + + +![GlusterFS](images/glusterfs.png) diff --git a/Pepiniere/docker/6.outils-administration/images/docker-wave-whale.svg b/Pepiniere/docker/6.outils-administration/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/6.outils-administration/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/6.outils-administration/images/harbor-1.jpg b/Pepiniere/docker/6.outils-administration/images/harbor-1.jpg new file mode 100644 index 0000000..524270d Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/harbor-1.jpg differ diff --git a/Pepiniere/docker/6.outils-administration/images/logo-harbor.png b/Pepiniere/docker/6.outils-administration/images/logo-harbor.png new file mode 100644 index 0000000..c1289b4 Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/logo-harbor.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/logo-portainer.png b/Pepiniere/docker/6.outils-administration/images/logo-portainer.png new file mode 100644 index 0000000..f599f98 Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/logo-portainer.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/logo-portus.png b/Pepiniere/docker/6.outils-administration/images/logo-portus.png new file mode 100644 index 0000000..c69d993 Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/logo-portus.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/logo-weave.png b/Pepiniere/docker/6.outils-administration/images/logo-weave.png new file mode 100644 index 0000000..7ded7f8 Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/logo-weave.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/portainer-containers.png b/Pepiniere/docker/6.outils-administration/images/portainer-containers.png new file mode 100644 index 0000000..763a22f Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/portainer-containers.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/portainer-dashboard.png b/Pepiniere/docker/6.outils-administration/images/portainer-dashboard.png new file mode 100644 index 0000000..d2e781d Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/portainer-dashboard.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/portus-1.png b/Pepiniere/docker/6.outils-administration/images/portus-1.png new file mode 100644 index 0000000..3f6dfdc Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/portus-1.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/weave-scope-1.png b/Pepiniere/docker/6.outils-administration/images/weave-scope-1.png new file mode 100644 index 0000000..9b96396 Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/weave-scope-1.png differ diff --git a/Pepiniere/docker/6.outils-administration/images/weave-scope-2.png b/Pepiniere/docker/6.outils-administration/images/weave-scope-2.png new file mode 100644 index 0000000..3239f99 Binary files /dev/null and b/Pepiniere/docker/6.outils-administration/images/weave-scope-2.png differ diff --git a/Pepiniere/docker/6.outils-administration/index.html b/Pepiniere/docker/6.outils-administration/index.html new file mode 100755 index 0000000..27153b6 --- /dev/null +++ b/Pepiniere/docker/6.outils-administration/index.html @@ -0,0 +1,72 @@ + + + + + + + SII - Outils d'administration + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/6.outils-administration/outils-administration.md b/Pepiniere/docker/6.outils-administration/outils-administration.md new file mode 100755 index 0000000..3a38eb2 --- /dev/null +++ b/Pepiniere/docker/6.outils-administration/outils-administration.md @@ -0,0 +1,126 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +__Outils d'administration__ + +Maxime Poullain • Christian Tritten + + + +## Introduction + + +Des outils existent pour : + +* exploiter de façon plus conviviale une infrastructure Docker, +* enrichir les fonctionnalité des produits fournis par Docker Inc. + + + + +## Administration d'une infrastructure Docker + + +### Portainer + +![Portainer](images/logo-portainer.png) + +IHM de gestion d'une infrastructure Docker + +* Tableau de bord de l'infrastructure +* Swarm (services, stack, secrets, overlay networks) +* Conteneurs (détails, en mode local : statistiques, logs) +* Images +* Volumes +* Gestion d'utilisateurs + + +![Portainer](images/portainer-dashboard.png) + + +![Portainer](images/portainer-containers.png) + + +### Weave Scope + +![Weave](images/logo-weave.png) + +IHM de gestion / monitoring d'une infrastructure Docker + +* Intégré avec Kubernetes, Docker Swarm, Mesos +* Gère les hôtes Docker, les conteneurs et les services Swarm + * Visualisation en temps réel + * Monitoring + * Console sur un hôte ou un conteneur +* Pas de gestion d'utilisateurs + + +![Weave Scope](images/weave-scope-1.png) + + +![Weave Scope](images/weave-scope-2.png) + + + +## Administration d'un +## Registry Docker + + +## Harbor | Portus + +Le composant Docker Registry souffre du manque de certaines fonctionnalités indispensables pour un fonctionnement en équipes / projets. + +Des solutions opensource existent pour combler ces lacunes : + +![Harbor](images/logo-harbor.png) + +![Portus](images/logo-portus.png) + + +### Contrôle d'accès + +Utilisateurs et images sont organisés en projets. + +Un utilisateur peut avoir différentes permissions +pour les images d'un projet. + + +### Réplication d'images + +Les images peuvent être répliquées +sur plusieurs instances de registry. + +Permet la répartition de charge, +et la haute disponibilité. + + +### Interface graphique de gestion + +Un utilisateur peut gérer, parcourir, et chercher des images sur les différents projets. + + +### Support AD/LDAP + +Intégration avec un annuaire AD/LDAP pour l'authentification et la gestion des utilisateurs. + + +### Traçabilité + +Toutes les opérations effectuées sur les images +et les projets sont tracées. + + +### API RESTful + +Une API RESTful permet de réaliser la plupart des opérations de façon programmatique, permettant une intégration aisée avec des systèmes externes. + + +#### Portus + +![Portus](images/portus-1.png) + + +#### HARBOR + +![Harbor](images/harbor-1.jpg) diff --git a/Pepiniere/docker/6.outils-administration/revealjs b/Pepiniere/docker/6.outils-administration/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/6.outils-administration/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/cadvisor.jpg b/Pepiniere/docker/7.monitoring-conteneurs/images/cadvisor.jpg new file mode 100644 index 0000000..82587fe Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/cadvisor.jpg differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/ctop.gif b/Pepiniere/docker/7.monitoring-conteneurs/images/ctop.gif new file mode 100644 index 0000000..26b86da Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/ctop.gif differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/docker-wave-whale.svg b/Pepiniere/docker/7.monitoring-conteneurs/images/docker-wave-whale.svg new file mode 100644 index 0000000..2d94a52 --- /dev/null +++ b/Pepiniere/docker/7.monitoring-conteneurs/images/docker-wave-whale.svg @@ -0,0 +1,40 @@ + + + docker_wave_whale + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/grafana-dashboard.png b/Pepiniere/docker/7.monitoring-conteneurs/images/grafana-dashboard.png new file mode 100644 index 0000000..a102d6b Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/grafana-dashboard.png differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/grafana.png b/Pepiniere/docker/7.monitoring-conteneurs/images/grafana.png new file mode 100644 index 0000000..14088e5 Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/grafana.png differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring.png b/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring.png new file mode 100644 index 0000000..938e240 Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring.png differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring2.png b/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring2.png new file mode 100644 index 0000000..bfacdc8 Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring2.png differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring3.png b/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring3.png new file mode 100644 index 0000000..19c3173 Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/monitoring3.png differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/images/prometheus.png b/Pepiniere/docker/7.monitoring-conteneurs/images/prometheus.png new file mode 100644 index 0000000..be24442 Binary files /dev/null and b/Pepiniere/docker/7.monitoring-conteneurs/images/prometheus.png differ diff --git a/Pepiniere/docker/7.monitoring-conteneurs/index.html b/Pepiniere/docker/7.monitoring-conteneurs/index.html new file mode 100755 index 0000000..29157a3 --- /dev/null +++ b/Pepiniere/docker/7.monitoring-conteneurs/index.html @@ -0,0 +1,72 @@ + + + + + + + SII - Monitoring de conteneurs + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + diff --git a/Pepiniere/docker/7.monitoring-conteneurs/monitoring-conteneurs.md b/Pepiniere/docker/7.monitoring-conteneurs/monitoring-conteneurs.md new file mode 100755 index 0000000..01c703e --- /dev/null +++ b/Pepiniere/docker/7.monitoring-conteneurs/monitoring-conteneurs.md @@ -0,0 +1,128 @@ +# Docker + +![Schema Docker Swarm](images/docker-wave-whale.svg "Schema Docker Swarm") + +**Monitoring des conteneurs** + +Maxime Poullain • Christian Tritten + + + +## Monitorer des conteneurs + +Pourquoi c'est différent ? + + +Avec l'introduction des conteneurs et des microservices, +le monitoring doit pouvoir gérer des applications souvent éphémères et en perpétuelle fluctuation. + + +Les solutions de monitoring ont donc besoin de s'adapter pour continuer à fournir des données pertinentes. + + +### Le monitoring sans conteneurs + +![Stack Monitoring](images/monitoring2.png) + +Les outils de monitoring classiques permettent une couverture complète des éléments à surveiller. + + +### Le monitoring avec conteneurs + +![Stack Monitoring](images/monitoring3.png) + +Les éléments propres à la couche des conteneurs ne peuvent pas être monitorés avec les outils classiques. +Par exemple, il serait difficile de suivre la consommation mémoire de l'application A. + + +## Quelques outils + +Pour se faciliter la tâche + + +### Docker Stats + +Docker propose un équivalent de la commande `top` permettant d'afficher les statistiques des conteneurs en cours d'exécution sur l'hôte. + +Bien que pratique, ceci n'est pas adapté à une grosse infrastructure. + + +`docker stats` + +``` +CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS +5098617c3654 0.05% 0B / 0B 0.00% 648B / 0B 0B / 0B 0 +b2d0efcb5151 1.00% 0B / 0B 0.00% 648B / 0B 0B / 0B 0 +cbdb1069b241 0.10% 0B / 0B 0.00% 648B / 0B 0B / 0B 0 +``` + + +### ctop + +Métriques des conteneurs dans une interface à la _top_ + +![ctop](images/ctop.gif) + + +### Node-Exporter + +![Prometheus](images/prometheus.png) + +* Outil de collecte de métriques système +* Développé par Prometheus +* C'est l'équivalent d'un collectd +* Facile à déployer sur chaque hôte (sous forme de conteneur) + + +### cadvisor + +![cadvisor](images/cadvisor.jpg) + +* Outil de monitoring de conteneurs +* Développé par Google +* Supporte nativement Docker +* Collecte et exporte les métriques des conteneurs présents sur l'hôte +* C'est un peu l'équivalent d'un `docker stats --all` +* Facile à déployer sur chaque hôte (sous forme de conteneur) + + +### Prometheus + +![Prometheus](images/prometheus.png) + +* Projet initié en 2012 chez Soundcloud +* Interroge les agents _Node-Exporter_ et _cAdvisor_ des différents hôtes +* Stocke les données de type time-series dans ses propres bases +* Permet la configuration d'alertes via l'outil _Alert-Manager_ de Prometheus +* Peut être lancé en tant que conteneur (1 seule instance pour un cluster ou plus) + + +### Alert Manager + +![Prometheus](images/prometheus.png) + +* Outil de gestion et routage d'alertes +* Développé par Prometheus +* Se couple avec un serveur Prometheus +* Supporte les notifications par Email/Webhook/Slack/... + + +### Grafana + +![grafana](images/grafana.png) + +* Outil de conception et visualisation de tableaux de bord +* Développé par Grafana Labs +* Peut exploiter une base InfluxBD ou Prometheus +* Peut être lancé en tant que conteneur (1 seule instance pour un cluster ou plus) + + + + + +### Exemple de solution complète + +![Stack Monitoring](images/monitoring.png) + + +[https://github.com/stefanprodan/swarmprom](https://github.com/stefanprodan/swarmprom) diff --git a/Pepiniere/docker/7.monitoring-conteneurs/revealjs b/Pepiniere/docker/7.monitoring-conteneurs/revealjs new file mode 120000 index 0000000..4248068 --- /dev/null +++ b/Pepiniere/docker/7.monitoring-conteneurs/revealjs @@ -0,0 +1 @@ +../revealjs \ No newline at end of file diff --git a/Pepiniere/docker/README.md b/Pepiniere/docker/README.md new file mode 100644 index 0000000..b6df95a --- /dev/null +++ b/Pepiniere/docker/README.md @@ -0,0 +1,95 @@ +# Formation Docker + + +## Programme + +### Conteneurs + +- Qu'est-ce qu'un conteneur ? +- Historique de la conteneurisation +- Différence entre conteneur et VM +- Technologies sous-jacentes +- Opérations de base sur les conteneurs +- Mise en réseau d'un conteneur +- Configuration d'une application conteneurisée + +### Images de conteneurs + +- Qu'est-ce qu'une image Docker ? +- DockerHub +- Création d'une image via docker commit +- Création d'une image via Dockerfile +- Bonnes pratiques pour la construction des images +- Note de couches pour le stockage des images +- Intérêt des tags pour le versionning des images +- Stockage et transport des images (Registry) + +### Persistence des données + +- Volumes Docker +- Bind mounts + +### Gestion d'une stack applicative + +- Déploiement d'une application multi-conteneurs avec docker-compose + +### Orchestration + +- Principes et intérêt d'un orchestrateur +- Panorama des principales solutions d'orchestration +- Fonctionnalités et principaux concepts de Docker Swarm +- Initialisation d'un cluster minimal +- Déploiement d'une stack applicative en utilisant les services Swarm +- Déploiement d'une stack applicative en utilisant une stack Swarm +- Mettre à l'échelle une application et répartir la charge +- Gestion des données sensibles +- Déployer un Registry local +- Installation et prise en main d’une interface graphique d’administration + + +## Slides + +| Module | Format | +| :- | :- | +| 0. Introduction à la formation | [html](0.introduction-formation/index.html) | +| 1. Introduction aux conteneurs | [html](1.introduction-aux-conteneurs/index.html) - [markdown](1.introduction-aux-conteneurs/introduction-aux-conteneurs.md) - [pdf](https://gitlab.sii.fr/sii-ouest/trainings/docker/-/jobs/artifacts/master/raw/1.docker.introduction-aux-conteneurs.pdf?job=build-pdf-introduction-aux-conteneurs) | +| 2. Images de conteneurs | [html](2.images-de-conteneurs/index.html) - [markdown](2.images-de-conteneurs/images-de-conteneurs.md) - [pdf](https://gitlab.sii.fr/sii-ouest/trainings/docker/-/jobs/artifacts/master/raw/2.docker.images-de-conteneurs.pdf?job=build-pdf-images-de-conteneurs) | +| 3. Conteneurs : utilisation avancée | [html](3.conteneurs-utilisation-avancee/index.html) - [markdown](3.conteneurs-utilisation-avancee/conteneurs-utilisation-avancee.md) - [pdf](https://gitlab.sii.fr/sii-ouest/trainings/docker/-/jobs/artifacts/master/raw/3.docker.conteneurs-utilisation-avancee.pdf?job=build-pdf-conteneurs-utilisation-avancee) | +| 4. Docker Swarm | [html](5.swarm/index.html) - [markdown](5.swarm/swarm.md) - [pdf](https://gitlab.sii.fr/sii-ouest/trainings/docker/-/jobs/artifacts/master/raw/5.docker.swarm.pdf?job=build-pdf-swarm) | +| 5. Outils d'administration | [html](6.outils-administration/index.html) - [markdown](6.outils-administration/outils-administration.md) | +| 6. Monitoring de conteneurs | [html](7.monitoring-conteneurs/index.html) - [markdown](7.monitoring-conteneurs/monitoring-conteneurs.md) | + + +## Travaux pratiques + +1. [Les bases](travaux-pratiques/slides/docker/tp-docker-introduction.html) +2. [Le réseau](travaux-pratiques/slides/docker/tp-network.html) +3. [Les images](travaux-pratiques/slides/docker/tp-images.html) +4. [Dockerfile](travaux-pratiques/slides/docker/tp-dockerfile.html) +5. [Les volumes](travaux-pratiques/slides/docker/tp-volumes.html) +6. [Application complète](travaux-pratiques/slides/docker/tp-web-db.html) +7. [Application complète avec Docker Compose](travaux-pratiques/slides/docker/tp-compose.html) +8. [Initialisation d'un cluster Swarm](travaux-pratiques/slides/swarm/tp-swarm-init.html) +9. Le réseau Overlay +10. [Déploiement d'applications - Services - Stacks](travaux-pratiques/slides/swarm/tp-swarm.html) +11. [Gestion des données sensibles](travaux-pratiques/slides/swarm/tp-secrets.html) +12. [Mise à jour d'une application](travaux-pratiques/slides/swarm/tp-rolling-update.html) + + +## Jouer les slides en local + +1. Cloner le dépôt : +`git clone --recurse-submodules https://gitlab.sii.fr/sii-ouest/trainings/docker.git` +`cd docker` + +2. Lancer le serveur : +`docker run --rm -p 127.0.0.1:8080:80 --name http -v "$(pwd)":/usr/local/apache2/htdocs:ro httpd` + +3. Ouvrir la page dans le navigateur : +`firefox http://127.0.0.1:8080` + +__Note concernant les utilisateurs de systèmes Windows__ + +* Des problèmes existent dans la gestion des liens symboliques avec Git, il faudra peut-être dupliquer le dossier `revealjs` à l'intérieur de chacun dossier contenant une présentation. + +* Des problèmes de rendu peuvent exister sur les postes Windows, à cause des délimiteurs de fin de lignes. Il faut donc paramétrer `git` avec le paramètre `core.autocrlf` à la valeur `false`. diff --git a/Pepiniere/docker/index.html b/Pepiniere/docker/index.html new file mode 100644 index 0000000..ca94967 --- /dev/null +++ b/Pepiniere/docker/index.html @@ -0,0 +1,41 @@ + + + + + SII - Formation Docker + + + + +
+ + + + + + + + diff --git a/Pepiniere/docker/index/favicon-logo-sii.png b/Pepiniere/docker/index/favicon-logo-sii.png new file mode 100755 index 0000000..2365c7b Binary files /dev/null and b/Pepiniere/docker/index/favicon-logo-sii.png differ diff --git a/Pepiniere/docker/index/header-sii.png b/Pepiniere/docker/index/header-sii.png new file mode 100755 index 0000000..1ed6ad3 Binary files /dev/null and b/Pepiniere/docker/index/header-sii.png differ diff --git a/Pepiniere/docker/index/logo-sii.svg b/Pepiniere/docker/index/logo-sii.svg new file mode 100755 index 0000000..eee6478 --- /dev/null +++ b/Pepiniere/docker/index/logo-sii.svg @@ -0,0 +1,83 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Pepiniere/docker/index/marked.min.js b/Pepiniere/docker/index/marked.min.js new file mode 100755 index 0000000..d6e5f23 --- /dev/null +++ b/Pepiniere/docker/index/marked.min.js @@ -0,0 +1,6 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/markedjs/marked + */ +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:d,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:d,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:d,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||m.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=//,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=f({},t),t.gfm=f({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=f({},t.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),t.pedantic=f({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g,d,f;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))&&(a={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===a.align.length){for(e=e.substring(i[0].length),p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),f=void 0,(d=/^\[[ xX]\] /.test(a))&&(f=" "!==a[1],a=a.replace(/^\[[ xX]\] +/,"")),this.tokens.push({type:s?"loose_item_start":"list_item_start",task:d,checked:f}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))&&(a={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/(?: *\| *)?\n$/,"").split("\n"):[]}).header.length===a.align.length){for(e=e.substring(i[0].length),p=0;p?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:d,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:d,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=f({},r),r.pedantic=f({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=f({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=f({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r=l[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=l[3]?l[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:a(e,!0))+"
\n":"
"+(n?e:a(e,!0))+"
"},i.prototype.blockquote=function(e){return"
\n"+e+"
\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.checkbox=function(e){return" "},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,f({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;et)n.splice(t);else for(;n.lengthAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}d.exec=d,m.options=m.setOptions=function(e){return f(m.defaults,e),m},m.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},m.defaults=m.getDefaults(),m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=l,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=s,m.inlineLexer=s.output,m.parse=m,"undefined"!=typeof module&&"object"==typeof exports?module.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):e.marked=m}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file diff --git a/Pepiniere/docker/index/sii.css b/Pepiniere/docker/index/sii.css new file mode 100755 index 0000000..5c640aa --- /dev/null +++ b/Pepiniere/docker/index/sii.css @@ -0,0 +1,134 @@ + +/********************************************* + * GLOBAL STYLES + *********************************************/ + +html { + background-color: #fff; /* fix dark background on full screen mode */ } + +body { + margin: 0; + background: #fff; + background-color: #fff; + background-image: url('header-sii.png'); /* SII header with 5 colors */ + background-size: contain; + background-repeat: no-repeat; + font-family: Helvetica, sans-serif; + font-size: 1rem; + font-weight: normal; + line-height: 1.6; + color: #222; } + +#content { + margin: auto; + width: 40rem; + padding: 2rem 1rem 2rem 1rem ; +} + +/********************************************* + * HEADERS + *********************************************/ +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 2.5rem 0 20px 0; + color: #222; + font-family: Helvetica, sans-serif; + font-weight: 600; + line-height: 1.2; + letter-spacing: normal; + text-shadow: none; + word-wrap: break-word; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 1.6em; } + +h3 { + font-size: 1.3em; } + +h4 { + font-size: 1em; } + +h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +strong, +b { + font-weight: bold; } + +em { + text-decoration: underline;} + +ol { + list-style-type: decimal; } + +ul { + list-style-type: square; } + +ul ul { + list-style-type: disc; } + +ul ul ul { + list-style-type: circle; } + + + +/********************************************* + * LINKS + *********************************************/ +a { + color: #6ca0e8; + text-decoration: underline; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +a:hover { + color: #2a76dd; + border: none; } + + +/********************************************* + * IMAGES + *********************************************/ +img { + margin: 15px 0px; +} + +a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #2a76dd; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + + +/********************************************* + * Logo and footer + *********************************************/ +.logo { + position: absolute; + top: 1.5rem; + right: 1.5rem; + width: 8rem; +} + +.footer { + margin: 0; + padding: 0.2rem; + font-size: 0.8rem; + color: #fff; + background-color: #88B4DC; +} diff --git a/Pepiniere/docker/revealjs/.gitignore b/Pepiniere/docker/revealjs/.gitignore new file mode 100644 index 0000000..8eda50e --- /dev/null +++ b/Pepiniere/docker/revealjs/.gitignore @@ -0,0 +1,13 @@ +.idea/ +*.iml +*.iws +*.eml +out/ +.DS_Store +.svn +log/*.log +tmp/** +node_modules/ +.sass-cache +css/reveal.min.css +js/reveal.min.js diff --git a/Pepiniere/docker/revealjs/README.md b/Pepiniere/docker/revealjs/README.md new file mode 100644 index 0000000..c389a82 --- /dev/null +++ b/Pepiniere/docker/revealjs/README.md @@ -0,0 +1,13 @@ +# template-revealjs-sii-theme + +Template SII pour diaporama [reveal.js](http://lab.hakim.se/reveal-js/). + +Ce thème est actuellement utilisé pour les slides des formations Ansible, Docker, GitLab, Kubernetes et OpenStack. + +Le thème propose : + +- un habillage respecteux de la charte graphique SII, + +- quelques [fonctionnalités utiles](content.md) (comme la gestion de taille des portions de code ou des tableaux). + +Enjoy! diff --git a/Pepiniere/docker/revealjs/bower.json b/Pepiniere/docker/revealjs/bower.json new file mode 100644 index 0000000..036d276 --- /dev/null +++ b/Pepiniere/docker/revealjs/bower.json @@ -0,0 +1,24 @@ +{ + "name": "reveal.js", + "version": "3.8.0", + "main": [ + "js/reveal.js", + "css/reveal.css" + ], + "homepage": "http://revealjs.com", + "license": "MIT", + "description": "The HTML Presentation Framework", + "authors": [ + "Hakim El Hattab " + ], + "repository": { + "type": "git", + "url": "git://github.com/hakimel/reveal.js.git" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test" + ] +} \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/content.md b/Pepiniere/docker/revealjs/content.md new file mode 100644 index 0000000..d1497e0 --- /dev/null +++ b/Pepiniere/docker/revealjs/content.md @@ -0,0 +1,239 @@ +# Titre +__Sous-titre__ + + + +## Enchaînements + + +* Avec 2 lignes d'espacement, les diapo défilent __vers le bas__ + + +* Avec 3 lignes d'espacement, les diapo défilent __vers la droite__ + + + +## Formatage + + +### Styles + +\_\_gras\_\_ : __gras__ +\_emphase\_ : _emphase_ +\`code\` : `code` + + +### Puces + +* rouge +* vert +* bleu + * bleu marine + * bleu ciel +* noir + + + +## Images + + +* On peut préciser la _taille des images_ avec +`` + +![Logo SII](images/logo-sii.png) +![Logo SII](images/logo-sii.png) + + + +## Liens + +\[Nom de la ressource\](Url de la ressource) + +\[GitHub SII\](https://github.com/groupe-sii) + + + +## Code + + +Taille normale + +```javascript +function toggle(elemID){ + var elem = document.getElementById(elemID); + if (elem.style.display === 'block') { + elem.style.display = 'none'; + } + else { + elem.style.display = 'block'; + } +} +``` + + +Taille moyenne + +`` + + +```javascript +function toggle(elemID){ + var elem = document.getElementById(elemID); + if (elem.style.display === 'block') { + elem.style.display = 'none'; + } + else { + elem.style.display = 'block'; + } +} +``` + + +Petite taille + +`` + + +```javascript +function toggle(elemID){ + var elem = document.getElementById(elemID); + if (elem.style.display === 'block') { + elem.style.display = 'none'; + } + else { + elem.style.display = 'block'; + } +} +``` + + + +## Tableaux + + +Taille normale + +| Colonne 1 | Colonne 2 | Colonne 3 | +| - | - | - | +| A1 | B1 | C1 | +| A2 | B2 | C2 | + + +Taille moyenne + +`` + + +| Colonne 1 | Colonne 2 | Colonne 3 | +| - | - | - | +| A1 | B1 | C1 | +| A2 | B2 | C2 | + + +Petite taille + +`` + + +| Colonne 1 | Colonne 2 | Colonne 3 | +| - | - | - | +| A1 | B1 | C1 | +| A2 | B2 | C2 | + + + +## Fonctionnalités avancées + + +### Utilisation de balises HTML dans le Markdown + +- La formule Chimique de l'eau est H2O. + +- E=mc2 ! + +- Voici du texte en fonte réduite. Cool non ? + + +``` +- La formule Chimique de l'eau est H2O. + +- E=mc2 ! + +- Voici du texte en fonte réduite. Cool non ? +``` + + +### Background + + +Modifier le background des slides : + +`` + +`` + +`` + +`` + + +### Transitions + + + +Changer le type de transition : +* default +* cube +* page +* concave +* zoom +* linear +* fade +* none + +`` + + +### Vitesse de transition + + + +Changer la vitesse de la transition : +* default +* fast +* slow + +`` + + +### data-state + + +L'ajout de `data-state` sur une slide permet d'appliquer une *classe CSS* spécifique à une slide. + +`` + +```css +.data-state-slide em { + color: #951753 !important; +} +``` + + +### Cheat-Sheet + + +1. On peut afficher une liste ordonnée façon Cheat-Sheet +`` + +2. Afficher une vache +`$ apt moo` + +3. Faire beugler une vache +`$ echo "Meuhhhh" | cowsay` + + +### Masquer le logo + + +`` diff --git a/Pepiniere/docker/revealjs/css/print/paper.css b/Pepiniere/docker/revealjs/css/print/paper.css new file mode 100644 index 0000000..27d19dd --- /dev/null +++ b/Pepiniere/docker/revealjs/css/print/paper.css @@ -0,0 +1,203 @@ +/* Default Print Stylesheet Template + by Rob Glazebrook of CSSnewbie.com + Last Updated: June 4, 2008 + + Feel free (nay, compelled) to edit, append, and + manipulate this file as you see fit. */ + + +@media print { + + /* SECTION 1: Set default width, margin, float, and + background. This prevents elements from extending + beyond the edge of the printed page, and prevents + unnecessary background images from printing */ + html { + background: #fff; + width: auto; + height: auto; + overflow: visible; + } + body { + background: #fff; + font-size: 20pt; + width: auto; + height: auto; + border: 0; + margin: 0 5%; + padding: 0; + overflow: visible; + float: none !important; + } + + /* SECTION 2: Remove any elements not needed in print. + This would include navigation, ads, sidebars, etc. */ + .nestedarrow, + .controls, + .fork-reveal, + .share-reveal, + .state-background, + .reveal .progress, + .reveal .backgrounds, + .reveal .slide-number { + display: none !important; + } + + /* SECTION 3: Set body font face, size, and color. + Consider using a serif font for readability. */ + body, p, td, li, div { + font-size: 20pt!important; + font-family: Georgia, "Times New Roman", Times, serif !important; + color: #000; + } + + /* SECTION 4: Set heading font face, sizes, and color. + Differentiate your headings from your body text. + Perhaps use a large sans-serif for distinction. */ + h1,h2,h3,h4,h5,h6 { + color: #000!important; + height: auto; + line-height: normal; + font-family: Georgia, "Times New Roman", Times, serif !important; + text-shadow: 0 0 0 #000 !important; + text-align: left; + letter-spacing: normal; + } + /* Need to reduce the size of the fonts for printing */ + h1 { font-size: 28pt !important; } + h2 { font-size: 24pt !important; } + h3 { font-size: 22pt !important; } + h4 { font-size: 22pt !important; font-variant: small-caps; } + h5 { font-size: 21pt !important; } + h6 { font-size: 20pt !important; font-style: italic; } + + /* SECTION 5: Make hyperlinks more usable. + Ensure links are underlined, and consider appending + the URL to the end of the link for usability. */ + a:link, + a:visited { + color: #000 !important; + font-weight: bold; + text-decoration: underline; + } + /* + .reveal a:link:after, + .reveal a:visited:after { + content: " (" attr(href) ") "; + color: #222 !important; + font-size: 90%; + } + */ + + + /* SECTION 6: more reveal.js specific additions by @skypanther */ + ul, ol, div, p { + visibility: visible; + position: static; + width: auto; + height: auto; + display: block; + overflow: visible; + margin: 0; + text-align: left !important; + } + .reveal pre, + .reveal table { + margin-left: 0; + margin-right: 0; + } + .reveal pre code { + padding: 20px; + border: 1px solid #ddd; + } + .reveal blockquote { + margin: 20px 0; + } + .reveal .slides { + position: static !important; + width: auto !important; + height: auto !important; + + left: 0 !important; + top: 0 !important; + margin-left: 0 !important; + margin-top: 0 !important; + padding: 0 !important; + zoom: 1 !important; + + overflow: visible !important; + display: block !important; + + text-align: left !important; + -webkit-perspective: none; + -moz-perspective: none; + -ms-perspective: none; + perspective: none; + + -webkit-perspective-origin: 50% 50%; + -moz-perspective-origin: 50% 50%; + -ms-perspective-origin: 50% 50%; + perspective-origin: 50% 50%; + } + .reveal .slides section { + visibility: visible !important; + position: static !important; + width: auto !important; + height: auto !important; + display: block !important; + overflow: visible !important; + + left: 0 !important; + top: 0 !important; + margin-left: 0 !important; + margin-top: 0 !important; + padding: 60px 20px !important; + z-index: auto !important; + + opacity: 1 !important; + + page-break-after: always !important; + + -webkit-transform-style: flat !important; + -moz-transform-style: flat !important; + -ms-transform-style: flat !important; + transform-style: flat !important; + + -webkit-transform: none !important; + -moz-transform: none !important; + -ms-transform: none !important; + transform: none !important; + + -webkit-transition: none !important; + -moz-transition: none !important; + -ms-transition: none !important; + transition: none !important; + } + .reveal .slides section.stack { + padding: 0 !important; + } + .reveal section:last-of-type { + page-break-after: avoid !important; + } + .reveal section .fragment { + opacity: 1 !important; + visibility: visible !important; + + -webkit-transform: none !important; + -moz-transform: none !important; + -ms-transform: none !important; + transform: none !important; + } + .reveal section img { + display: block; + margin: 15px 0px; + background: rgba(255,255,255,1); + border: 1px solid #666; + box-shadow: none; + } + + .reveal section small { + font-size: 0.8em; + } + +} diff --git a/Pepiniere/docker/revealjs/css/print/pdf.css b/Pepiniere/docker/revealjs/css/print/pdf.css new file mode 100644 index 0000000..752d955 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/print/pdf.css @@ -0,0 +1,164 @@ +/** + * This stylesheet is used to print reveal.js + * presentations to PDF. + * + * https://github.com/hakimel/reveal.js#pdf-export + */ + +* { + -webkit-print-color-adjust: exact; +} + +body { + margin: 0 auto !important; + border: 0; + padding: 0; + float: none !important; + overflow: visible; +} + +html { + width: 100%; + height: 100%; + overflow: visible; +} + +/* Remove any elements not needed in print. */ +.nestedarrow, +.reveal .controls, +.reveal .progress, +.reveal .playback, +.reveal.overview, +.fork-reveal, +.share-reveal, +.state-background { + display: none !important; +} + +h1, h2, h3, h4, h5, h6 { + text-shadow: 0 0 0 #000 !important; +} + +.reveal pre code { + overflow: hidden !important; + font-family: Courier, 'Courier New', monospace !important; +} + +ul, ol, div, p { + visibility: visible; + position: static; + width: auto; + height: auto; + display: block; + overflow: visible; + margin: auto; +} +.reveal { + width: auto !important; + height: auto !important; + overflow: hidden !important; +} +.reveal .slides { + position: static; + width: 100% !important; + height: auto !important; + zoom: 1 !important; + + left: auto; + top: auto; + margin: 0 !important; + padding: 0 !important; + + overflow: visible; + display: block; + + perspective: none; + perspective-origin: 50% 50%; +} + +.reveal .slides .pdf-page { + position: relative; + overflow: hidden; + z-index: 1; + + page-break-after: always; +} + +.reveal .slides section { + visibility: visible !important; + display: block !important; + position: absolute !important; + + margin: 0 !important; + padding: 0 !important; + box-sizing: border-box !important; + min-height: 1px; + + opacity: 1 !important; + + transform-style: flat !important; + transform: none !important; +} + +.reveal section.stack { + position: relative !important; + margin: 0 !important; + padding: 0 !important; + page-break-after: avoid !important; + height: auto !important; + min-height: auto !important; +} + +.reveal img { + box-shadow: none; +} + +.reveal .roll { + overflow: visible; + line-height: 1em; +} + +/* Slide backgrounds are placed inside of their slide when exporting to PDF */ +.reveal .slide-background { + display: block !important; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: auto !important; +} + +/* Display slide speaker notes when 'showNotes' is enabled */ +.reveal.show-notes { + max-width: none; + max-height: none; +} +.reveal .speaker-notes-pdf { + display: block; + width: 100%; + height: auto; + max-height: none; + top: auto; + right: auto; + bottom: auto; + left: auto; + z-index: 100; +} + +/* Layout option which makes notes appear on a separate page */ +.reveal .speaker-notes-pdf[data-layout="separate-page"] { + position: relative; + color: inherit; + background-color: transparent; + padding: 20px; + page-break-after: always; + border: 0; +} + +/* Display slide numbers when 'slideNumber' is enabled */ +.reveal .slide-number-pdf { + display: block; + position: absolute; + font-size: 14px; +} diff --git a/Pepiniere/docker/revealjs/css/reset.css b/Pepiniere/docker/revealjs/css/reset.css new file mode 100644 index 0000000..e238539 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/reset.css @@ -0,0 +1,30 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v4.0 | 20180602 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +main, menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, main, menu, nav, section { + display: block; +} \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/reveal.css b/Pepiniere/docker/revealjs/css/reveal.css new file mode 100644 index 0000000..1b9651b --- /dev/null +++ b/Pepiniere/docker/revealjs/css/reveal.css @@ -0,0 +1,1598 @@ +/*! + * reveal.js + * http://revealjs.com + * MIT licensed + * + * Copyright (C) 2019 Hakim El Hattab, http://hakim.se + */ +/********************************************* + * GLOBAL STYLES + *********************************************/ +html { + width: 100%; + height: 100%; + height: 100vh; + height: calc( var(--vh, 1vh) * 100); + overflow: hidden; } + +body { + height: 100%; + overflow: hidden; + position: relative; + line-height: 1; + margin: 0; + background-color: #fff; + color: #000; } + +/********************************************* + * VIEW FRAGMENTS + *********************************************/ +.reveal .slides section .fragment { + opacity: 0; + visibility: hidden; + transition: all .2s ease; } + .reveal .slides section .fragment.visible { + opacity: 1; + visibility: inherit; } + +.reveal .slides section .fragment.grow { + opacity: 1; + visibility: inherit; } + .reveal .slides section .fragment.grow.visible { + -webkit-transform: scale(1.3); + transform: scale(1.3); } + +.reveal .slides section .fragment.shrink { + opacity: 1; + visibility: inherit; } + .reveal .slides section .fragment.shrink.visible { + -webkit-transform: scale(0.7); + transform: scale(0.7); } + +.reveal .slides section .fragment.zoom-in { + -webkit-transform: scale(0.1); + transform: scale(0.1); } + .reveal .slides section .fragment.zoom-in.visible { + -webkit-transform: none; + transform: none; } + +.reveal .slides section .fragment.fade-out { + opacity: 1; + visibility: inherit; } + .reveal .slides section .fragment.fade-out.visible { + opacity: 0; + visibility: hidden; } + +.reveal .slides section .fragment.semi-fade-out { + opacity: 1; + visibility: inherit; } + .reveal .slides section .fragment.semi-fade-out.visible { + opacity: 0.5; + visibility: inherit; } + +.reveal .slides section .fragment.strike { + opacity: 1; + visibility: inherit; } + .reveal .slides section .fragment.strike.visible { + text-decoration: line-through; } + +.reveal .slides section .fragment.fade-up { + -webkit-transform: translate(0, 20%); + transform: translate(0, 20%); } + .reveal .slides section .fragment.fade-up.visible { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); } + +.reveal .slides section .fragment.fade-down { + -webkit-transform: translate(0, -20%); + transform: translate(0, -20%); } + .reveal .slides section .fragment.fade-down.visible { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); } + +.reveal .slides section .fragment.fade-right { + -webkit-transform: translate(-20%, 0); + transform: translate(-20%, 0); } + .reveal .slides section .fragment.fade-right.visible { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); } + +.reveal .slides section .fragment.fade-left { + -webkit-transform: translate(20%, 0); + transform: translate(20%, 0); } + .reveal .slides section .fragment.fade-left.visible { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); } + +.reveal .slides section .fragment.fade-in-then-out, +.reveal .slides section .fragment.current-visible { + opacity: 0; + visibility: hidden; } + .reveal .slides section .fragment.fade-in-then-out.current-fragment, + .reveal .slides section .fragment.current-visible.current-fragment { + opacity: 1; + visibility: inherit; } + +.reveal .slides section .fragment.fade-in-then-semi-out { + opacity: 0; + visibility: hidden; } + .reveal .slides section .fragment.fade-in-then-semi-out.visible { + opacity: 0.5; + visibility: inherit; } + .reveal .slides section .fragment.fade-in-then-semi-out.current-fragment { + opacity: 1; + visibility: inherit; } + +.reveal .slides section .fragment.highlight-red, +.reveal .slides section .fragment.highlight-current-red, +.reveal .slides section .fragment.highlight-green, +.reveal .slides section .fragment.highlight-current-green, +.reveal .slides section .fragment.highlight-blue, +.reveal .slides section .fragment.highlight-current-blue { + opacity: 1; + visibility: inherit; } + +.reveal .slides section .fragment.highlight-red.visible { + color: #ff2c2d; } + +.reveal .slides section .fragment.highlight-green.visible { + color: #17ff2e; } + +.reveal .slides section .fragment.highlight-blue.visible { + color: #1b91ff; } + +.reveal .slides section .fragment.highlight-current-red.current-fragment { + color: #ff2c2d; } + +.reveal .slides section .fragment.highlight-current-green.current-fragment { + color: #17ff2e; } + +.reveal .slides section .fragment.highlight-current-blue.current-fragment { + color: #1b91ff; } + +/********************************************* + * DEFAULT ELEMENT STYLES + *********************************************/ +/* Fixes issue in Chrome where italic fonts did not appear when printing to PDF */ +.reveal:after { + content: ''; + font-style: italic; } + +.reveal iframe { + z-index: 1; } + +/** Prevents layering issues in certain browser/transition combinations */ +.reveal a { + position: relative; } + +.reveal .stretch { + max-width: none; + max-height: none; } + +.reveal pre.stretch code { + height: 100%; + max-height: 100%; + box-sizing: border-box; } + +/********************************************* + * CONTROLS + *********************************************/ +@-webkit-keyframes bounce-right { + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateX(0); + transform: translateX(0); } + 20% { + -webkit-transform: translateX(10px); + transform: translateX(10px); } + 30% { + -webkit-transform: translateX(-5px); + transform: translateX(-5px); } } +@keyframes bounce-right { + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateX(0); + transform: translateX(0); } + 20% { + -webkit-transform: translateX(10px); + transform: translateX(10px); } + 30% { + -webkit-transform: translateX(-5px); + transform: translateX(-5px); } } + +@-webkit-keyframes bounce-down { + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateY(0); + transform: translateY(0); } + 20% { + -webkit-transform: translateY(10px); + transform: translateY(10px); } + 30% { + -webkit-transform: translateY(-5px); + transform: translateY(-5px); } } + +@keyframes bounce-down { + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateY(0); + transform: translateY(0); } + 20% { + -webkit-transform: translateY(10px); + transform: translateY(10px); } + 30% { + -webkit-transform: translateY(-5px); + transform: translateY(-5px); } } + +.reveal .controls { + display: none; + position: absolute; + top: auto; + bottom: 12px; + right: 12px; + left: auto; + z-index: 1; + color: #000; + pointer-events: none; + font-size: 10px; } + .reveal .controls button { + position: absolute; + padding: 0; + background-color: transparent; + border: 0; + outline: 0; + cursor: pointer; + color: currentColor; + -webkit-transform: scale(0.9999); + transform: scale(0.9999); + transition: color 0.2s ease, opacity 0.2s ease, -webkit-transform 0.2s ease; + transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease; + z-index: 2; + pointer-events: auto; + font-size: inherit; + visibility: hidden; + opacity: 0; + -webkit-appearance: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + .reveal .controls .controls-arrow:before, + .reveal .controls .controls-arrow:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 2.6em; + height: 0.5em; + border-radius: 0.25em; + background-color: currentColor; + transition: all 0.15s ease, background-color 0.8s ease; + -webkit-transform-origin: 0.2em 50%; + transform-origin: 0.2em 50%; + will-change: transform; } + .reveal .controls .controls-arrow { + position: relative; + width: 3.6em; + height: 3.6em; } + .reveal .controls .controls-arrow:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(45deg); } + .reveal .controls .controls-arrow:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); } + .reveal .controls .controls-arrow:hover:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(40deg); + transform: translateX(0.5em) translateY(1.55em) rotate(40deg); } + .reveal .controls .controls-arrow:hover:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-40deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-40deg); } + .reveal .controls .controls-arrow:active:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(36deg); + transform: translateX(0.5em) translateY(1.55em) rotate(36deg); } + .reveal .controls .controls-arrow:active:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-36deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-36deg); } + .reveal .controls .navigate-left { + right: 6.4em; + bottom: 3.2em; + -webkit-transform: translateX(-10px); + transform: translateX(-10px); } + .reveal .controls .navigate-right { + right: 0; + bottom: 3.2em; + -webkit-transform: translateX(10px); + transform: translateX(10px); } + .reveal .controls .navigate-right .controls-arrow { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); } + .reveal .controls .navigate-right.highlight { + -webkit-animation: bounce-right 2s 50 both ease-out; + animation: bounce-right 2s 50 both ease-out; } + .reveal .controls .navigate-up { + right: 3.2em; + bottom: 6.4em; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); } + .reveal .controls .navigate-up .controls-arrow { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); } + .reveal .controls .navigate-down { + right: 3.2em; + bottom: 0; + -webkit-transform: translateY(10px); + transform: translateY(10px); } + .reveal .controls .navigate-down .controls-arrow { + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); } + .reveal .controls .navigate-down.highlight { + -webkit-animation: bounce-down 2s 50 both ease-out; + animation: bounce-down 2s 50 both ease-out; } + .reveal .controls[data-controls-back-arrows="faded"] .navigate-left.enabled, + .reveal .controls[data-controls-back-arrows="faded"] .navigate-up.enabled { + opacity: 0.3; } + .reveal .controls[data-controls-back-arrows="faded"] .navigate-left.enabled:hover, + .reveal .controls[data-controls-back-arrows="faded"] .navigate-up.enabled:hover { + opacity: 1; } + .reveal .controls[data-controls-back-arrows="hidden"] .navigate-left.enabled, + .reveal .controls[data-controls-back-arrows="hidden"] .navigate-up.enabled { + opacity: 0; + visibility: hidden; } + .reveal .controls .enabled { + visibility: visible; + opacity: 0.9; + cursor: pointer; + -webkit-transform: none; + transform: none; } + .reveal .controls .enabled.fragmented { + opacity: 0.5; } + .reveal .controls .enabled:hover, + .reveal .controls .enabled.fragmented:hover { + opacity: 1; } + +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-up, +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-down { + display: none; } + +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-left, +.reveal:not(.has-vertical-slides) .controls .navigate-left { + bottom: 1.4em; + right: 5.5em; } + +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-right, +.reveal:not(.has-vertical-slides) .controls .navigate-right { + bottom: 1.4em; + right: 0.5em; } + +.reveal:not(.has-horizontal-slides) .controls .navigate-up { + right: 1.4em; + bottom: 5em; } + +.reveal:not(.has-horizontal-slides) .controls .navigate-down { + right: 1.4em; + bottom: 0.5em; } + +.reveal.has-dark-background .controls { + color: #fff; } + +.reveal.has-light-background .controls { + color: #000; } + +.reveal.no-hover .controls .controls-arrow:hover:before, +.reveal.no-hover .controls .controls-arrow:active:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(45deg); } + +.reveal.no-hover .controls .controls-arrow:hover:after, +.reveal.no-hover .controls .controls-arrow:active:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); } + +@media screen and (min-width: 500px) { + .reveal .controls[data-controls-layout="edges"] { + top: 0; + right: 0; + bottom: 0; + left: 0; } + .reveal .controls[data-controls-layout="edges"] .navigate-left, + .reveal .controls[data-controls-layout="edges"] .navigate-right, + .reveal .controls[data-controls-layout="edges"] .navigate-up, + .reveal .controls[data-controls-layout="edges"] .navigate-down { + bottom: auto; + right: auto; } + .reveal .controls[data-controls-layout="edges"] .navigate-left { + top: 50%; + left: 8px; + margin-top: -1.8em; } + .reveal .controls[data-controls-layout="edges"] .navigate-right { + top: 50%; + right: 8px; + margin-top: -1.8em; } + .reveal .controls[data-controls-layout="edges"] .navigate-up { + top: 8px; + left: 50%; + margin-left: -1.8em; } + .reveal .controls[data-controls-layout="edges"] .navigate-down { + bottom: 8px; + left: 50%; + margin-left: -1.8em; } } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + position: absolute; + display: none; + height: 3px; + width: 100%; + bottom: 0; + left: 0; + z-index: 10; + background-color: rgba(0, 0, 0, 0.2); + color: #fff; } + +.reveal .progress:after { + content: ''; + display: block; + position: absolute; + height: 10px; + width: 100%; + top: -10px; } + +.reveal .progress span { + display: block; + height: 100%; + width: 0px; + background-color: currentColor; + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * SLIDE NUMBER + *********************************************/ +.reveal .slide-number { + position: absolute; + display: block; + right: 8px; + bottom: 8px; + z-index: 31; + font-family: Helvetica, sans-serif; + font-size: 12px; + line-height: 1; + color: #fff; + background-color: rgba(0, 0, 0, 0.4); + padding: 5px; } + +.reveal .slide-number a { + color: currentColor; } + +.reveal .slide-number-delimiter { + margin: 0 3px; } + +/********************************************* + * SLIDES + *********************************************/ +.reveal { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; + -ms-touch-action: pinch-zoom; + touch-action: pinch-zoom; } + +.reveal .slides { + position: absolute; + width: 100%; + height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin: auto; + pointer-events: none; + overflow: visible; + z-index: 1; + text-align: center; + -webkit-perspective: 600px; + perspective: 600px; + -webkit-perspective-origin: 50% 40%; + perspective-origin: 50% 40%; } + +.reveal .slides > section { + -webkit-perspective: 600px; + perspective: 600px; } + +.reveal .slides > section, +.reveal .slides > section > section { + display: none; + position: absolute; + width: 100%; + padding: 20px 0px; + pointer-events: auto; + z-index: 10; + -webkit-transform-style: flat; + transform-style: flat; + transition: -webkit-transform-origin 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), -webkit-transform 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), visibility 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), opacity 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: transform-origin 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), transform 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), visibility 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), opacity 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/* Global transition speed settings */ +.reveal[data-transition-speed="fast"] .slides section { + transition-duration: 400ms; } + +.reveal[data-transition-speed="slow"] .slides section { + transition-duration: 1200ms; } + +/* Slide-specific transition speed overrides */ +.reveal .slides section[data-transition-speed="fast"] { + transition-duration: 400ms; } + +.reveal .slides section[data-transition-speed="slow"] { + transition-duration: 1200ms; } + +.reveal .slides > section.stack { + padding-top: 0; + padding-bottom: 0; + pointer-events: none; + height: 100%; } + +.reveal .slides > section.present, +.reveal .slides > section > section.present { + display: block; + z-index: 11; + opacity: 1; } + +.reveal .slides > section:empty, +.reveal .slides > section > section:empty, +.reveal .slides > section[data-background-interactive], +.reveal .slides > section > section[data-background-interactive] { + pointer-events: none; } + +.reveal.center, +.reveal.center .slides, +.reveal.center .slides section { + min-height: 0 !important; } + +/* Don't allow interaction with invisible slides */ +.reveal .slides > section.future, +.reveal .slides > section > section.future, +.reveal .slides > section.past, +.reveal .slides > section > section.past { + pointer-events: none; } + +.reveal.overview .slides > section, +.reveal.overview .slides > section > section { + pointer-events: auto; } + +.reveal .slides > section.past, +.reveal .slides > section.future, +.reveal .slides > section > section.past, +.reveal .slides > section > section.future { + opacity: 0; } + +/********************************************* + * Mixins for readability of transitions + *********************************************/ +/********************************************* + * SLIDE TRANSITION + * Aliased 'linear' for backwards compatibility + *********************************************/ +.reveal.slide section { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.reveal .slides > section[data-transition=slide].past, +.reveal .slides > section[data-transition~=slide-out].past, +.reveal.slide .slides > section:not([data-transition]).past { + -webkit-transform: translate(-150%, 0); + transform: translate(-150%, 0); } + +.reveal .slides > section[data-transition=slide].future, +.reveal .slides > section[data-transition~=slide-in].future, +.reveal.slide .slides > section:not([data-transition]).future { + -webkit-transform: translate(150%, 0); + transform: translate(150%, 0); } + +.reveal .slides > section > section[data-transition=slide].past, +.reveal .slides > section > section[data-transition~=slide-out].past, +.reveal.slide .slides > section > section:not([data-transition]).past { + -webkit-transform: translate(0, -150%); + transform: translate(0, -150%); } + +.reveal .slides > section > section[data-transition=slide].future, +.reveal .slides > section > section[data-transition~=slide-in].future, +.reveal.slide .slides > section > section:not([data-transition]).future { + -webkit-transform: translate(0, 150%); + transform: translate(0, 150%); } + +.reveal.linear section { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.reveal .slides > section[data-transition=linear].past, +.reveal .slides > section[data-transition~=linear-out].past, +.reveal.linear .slides > section:not([data-transition]).past { + -webkit-transform: translate(-150%, 0); + transform: translate(-150%, 0); } + +.reveal .slides > section[data-transition=linear].future, +.reveal .slides > section[data-transition~=linear-in].future, +.reveal.linear .slides > section:not([data-transition]).future { + -webkit-transform: translate(150%, 0); + transform: translate(150%, 0); } + +.reveal .slides > section > section[data-transition=linear].past, +.reveal .slides > section > section[data-transition~=linear-out].past, +.reveal.linear .slides > section > section:not([data-transition]).past { + -webkit-transform: translate(0, -150%); + transform: translate(0, -150%); } + +.reveal .slides > section > section[data-transition=linear].future, +.reveal .slides > section > section[data-transition~=linear-in].future, +.reveal.linear .slides > section > section:not([data-transition]).future { + -webkit-transform: translate(0, 150%); + transform: translate(0, 150%); } + +/********************************************* + * CONVEX TRANSITION + * Aliased 'default' for backwards compatibility + *********************************************/ +.reveal .slides section[data-transition=default].stack, +.reveal.default .slides section.stack { + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; } + +.reveal .slides > section[data-transition=default].past, +.reveal .slides > section[data-transition~=default-out].past, +.reveal.default .slides > section:not([data-transition]).past { + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } + +.reveal .slides > section[data-transition=default].future, +.reveal .slides > section[data-transition~=default-in].future, +.reveal.default .slides > section:not([data-transition]).future { + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } + +.reveal .slides > section > section[data-transition=default].past, +.reveal .slides > section > section[data-transition~=default-out].past, +.reveal.default .slides > section > section:not([data-transition]).past { + -webkit-transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); + transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); } + +.reveal .slides > section > section[data-transition=default].future, +.reveal .slides > section > section[data-transition~=default-in].future, +.reveal.default .slides > section > section:not([data-transition]).future { + -webkit-transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); + transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); } + +.reveal .slides section[data-transition=convex].stack, +.reveal.convex .slides section.stack { + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; } + +.reveal .slides > section[data-transition=convex].past, +.reveal .slides > section[data-transition~=convex-out].past, +.reveal.convex .slides > section:not([data-transition]).past { + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } + +.reveal .slides > section[data-transition=convex].future, +.reveal .slides > section[data-transition~=convex-in].future, +.reveal.convex .slides > section:not([data-transition]).future { + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } + +.reveal .slides > section > section[data-transition=convex].past, +.reveal .slides > section > section[data-transition~=convex-out].past, +.reveal.convex .slides > section > section:not([data-transition]).past { + -webkit-transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); + transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); } + +.reveal .slides > section > section[data-transition=convex].future, +.reveal .slides > section > section[data-transition~=convex-in].future, +.reveal.convex .slides > section > section:not([data-transition]).future { + -webkit-transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); + transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); } + +/********************************************* + * CONCAVE TRANSITION + *********************************************/ +.reveal .slides section[data-transition=concave].stack, +.reveal.concave .slides section.stack { + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; } + +.reveal .slides > section[data-transition=concave].past, +.reveal .slides > section[data-transition~=concave-out].past, +.reveal.concave .slides > section:not([data-transition]).past { + -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); } + +.reveal .slides > section[data-transition=concave].future, +.reveal .slides > section[data-transition~=concave-in].future, +.reveal.concave .slides > section:not([data-transition]).future { + -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); } + +.reveal .slides > section > section[data-transition=concave].past, +.reveal .slides > section > section[data-transition~=concave-out].past, +.reveal.concave .slides > section > section:not([data-transition]).past { + -webkit-transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); + transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); } + +.reveal .slides > section > section[data-transition=concave].future, +.reveal .slides > section > section[data-transition~=concave-in].future, +.reveal.concave .slides > section > section:not([data-transition]).future { + -webkit-transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); + transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); } + +/********************************************* + * ZOOM TRANSITION + *********************************************/ +.reveal .slides section[data-transition=zoom], +.reveal.zoom .slides section:not([data-transition]) { + transition-timing-function: ease; } + +.reveal .slides > section[data-transition=zoom].past, +.reveal .slides > section[data-transition~=zoom-out].past, +.reveal.zoom .slides > section:not([data-transition]).past { + visibility: hidden; + -webkit-transform: scale(16); + transform: scale(16); } + +.reveal .slides > section[data-transition=zoom].future, +.reveal .slides > section[data-transition~=zoom-in].future, +.reveal.zoom .slides > section:not([data-transition]).future { + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); } + +.reveal .slides > section > section[data-transition=zoom].past, +.reveal .slides > section > section[data-transition~=zoom-out].past, +.reveal.zoom .slides > section > section:not([data-transition]).past { + -webkit-transform: scale(16); + transform: scale(16); } + +.reveal .slides > section > section[data-transition=zoom].future, +.reveal .slides > section > section[data-transition~=zoom-in].future, +.reveal.zoom .slides > section > section:not([data-transition]).future { + -webkit-transform: scale(0.2); + transform: scale(0.2); } + +/********************************************* + * CUBE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. + *********************************************/ +.reveal.cube .slides { + -webkit-perspective: 1300px; + perspective: 1300px; } + +.reveal.cube .slides section { + padding: 30px; + min-height: 700px; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + box-sizing: border-box; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; } + +.reveal.center.cube .slides section { + min-height: 0; } + +.reveal.cube .slides section:not(.stack):before { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.1); + border-radius: 4px; + -webkit-transform: translateZ(-20px); + transform: translateZ(-20px); } + +.reveal.cube .slides section:not(.stack):after { + content: ''; + position: absolute; + display: block; + width: 90%; + height: 30px; + left: 5%; + bottom: 0; + background: none; + z-index: 1; + border-radius: 4px; + box-shadow: 0px 95px 25px rgba(0, 0, 0, 0.2); + -webkit-transform: translateZ(-90px) rotateX(65deg); + transform: translateZ(-90px) rotateX(65deg); } + +.reveal.cube .slides > section.stack { + padding: 0; + background: none; } + +.reveal.cube .slides > section.past { + -webkit-transform-origin: 100% 0%; + transform-origin: 100% 0%; + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg); + transform: translate3d(-100%, 0, 0) rotateY(-90deg); } + +.reveal.cube .slides > section.future { + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg); + transform: translate3d(100%, 0, 0) rotateY(90deg); } + +.reveal.cube .slides > section > section.past { + -webkit-transform-origin: 0% 100%; + transform-origin: 0% 100%; + -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg); + transform: translate3d(0, -100%, 0) rotateX(90deg); } + +.reveal.cube .slides > section > section.future { + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg); + transform: translate3d(0, 100%, 0) rotateX(-90deg); } + +/********************************************* + * PAGE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. + *********************************************/ +.reveal.page .slides { + -webkit-perspective-origin: 0% 50%; + perspective-origin: 0% 50%; + -webkit-perspective: 3000px; + perspective: 3000px; } + +.reveal.page .slides section { + padding: 30px; + min-height: 700px; + box-sizing: border-box; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; } + +.reveal.page .slides section.past { + z-index: 12; } + +.reveal.page .slides section:not(.stack):before { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.1); + -webkit-transform: translateZ(-20px); + transform: translateZ(-20px); } + +.reveal.page .slides section:not(.stack):after { + content: ''; + position: absolute; + display: block; + width: 90%; + height: 30px; + left: 5%; + bottom: 0; + background: none; + z-index: 1; + border-radius: 4px; + box-shadow: 0px 95px 25px rgba(0, 0, 0, 0.2); + -webkit-transform: translateZ(-90px) rotateX(65deg); } + +.reveal.page .slides > section.stack { + padding: 0; + background: none; } + +.reveal.page .slides > section.past { + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(-40%, 0, 0) rotateY(-80deg); + transform: translate3d(-40%, 0, 0) rotateY(-80deg); } + +.reveal.page .slides > section.future { + -webkit-transform-origin: 100% 0%; + transform-origin: 100% 0%; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); } + +.reveal.page .slides > section > section.past { + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(0, -40%, 0) rotateX(80deg); + transform: translate3d(0, -40%, 0) rotateX(80deg); } + +.reveal.page .slides > section > section.future { + -webkit-transform-origin: 0% 100%; + transform-origin: 0% 100%; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); } + +/********************************************* + * FADE TRANSITION + *********************************************/ +.reveal .slides section[data-transition=fade], +.reveal.fade .slides section:not([data-transition]), +.reveal.fade .slides > section > section:not([data-transition]) { + -webkit-transform: none; + transform: none; + transition: opacity 0.5s; } + +.reveal.fade.overview .slides section, +.reveal.fade.overview .slides > section > section { + transition: none; } + +/********************************************* + * NO TRANSITION + *********************************************/ +.reveal .slides section[data-transition=none], +.reveal.none .slides section:not([data-transition]) { + -webkit-transform: none; + transform: none; + transition: none; } + +/********************************************* + * PAUSED MODE + *********************************************/ +.reveal .pause-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: black; + visibility: hidden; + opacity: 0; + z-index: 100; + transition: all 1s ease; } + +.reveal .pause-overlay .resume-button { + position: absolute; + bottom: 20px; + right: 20px; + color: #ccc; + border-radius: 2px; + padding: 6px 14px; + border: 2px solid #ccc; + font-size: 16px; + background: transparent; + cursor: pointer; } + .reveal .pause-overlay .resume-button:hover { + color: #fff; + border-color: #fff; } + +.reveal.paused .pause-overlay { + visibility: visible; + opacity: 1; } + +/********************************************* + * FALLBACK + *********************************************/ +.no-transforms { + overflow-y: auto; } + +.no-transforms .reveal { + overflow: visible; } + +.no-transforms .reveal .slides { + position: relative; + width: 80%; + max-width: 1280px; + height: auto; + top: 0; + margin: 0 auto; + text-align: center; } + +.no-transforms .reveal .controls, +.no-transforms .reveal .progress { + display: none; } + +.no-transforms .reveal .slides section { + display: block; + opacity: 1; + position: relative; + height: auto; + min-height: 0; + top: 0; + left: 0; + margin: 10vh 0; + margin: 70px 0; + -webkit-transform: none; + transform: none; } + +.reveal .no-transition, +.reveal .no-transition * { + transition: none !important; } + +/********************************************* + * PER-SLIDE BACKGROUNDS + *********************************************/ +.reveal .backgrounds { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + -webkit-perspective: 600px; + perspective: 600px; } + +.reveal .slide-background { + display: none; + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + visibility: hidden; + overflow: hidden; + background-color: rgba(0, 0, 0, 0); + transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +.reveal .slide-background-content { + position: absolute; + width: 100%; + height: 100%; + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: cover; } + +.reveal .slide-background.stack { + display: block; } + +.reveal .slide-background.present { + opacity: 1; + visibility: visible; + z-index: 2; } + +.print-pdf .reveal .slide-background { + opacity: 1 !important; + visibility: visible !important; } + +/* Video backgrounds */ +.reveal .slide-background video { + position: absolute; + width: 100%; + height: 100%; + max-width: none; + max-height: none; + top: 0; + left: 0; + -o-object-fit: cover; + object-fit: cover; } + +.reveal .slide-background[data-background-size="contain"] video { + -o-object-fit: contain; + object-fit: contain; } + +/* Immediate transition style */ +.reveal[data-background-transition=none] > .backgrounds .slide-background, +.reveal > .backgrounds .slide-background[data-background-transition=none] { + transition: none; } + +/* Slide */ +.reveal[data-background-transition=slide] > .backgrounds .slide-background, +.reveal > .backgrounds .slide-background[data-background-transition=slide] { + opacity: 1; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.reveal[data-background-transition=slide] > .backgrounds .slide-background.past, +.reveal > .backgrounds .slide-background.past[data-background-transition=slide] { + -webkit-transform: translate(-100%, 0); + transform: translate(-100%, 0); } + +.reveal[data-background-transition=slide] > .backgrounds .slide-background.future, +.reveal > .backgrounds .slide-background.future[data-background-transition=slide] { + -webkit-transform: translate(100%, 0); + transform: translate(100%, 0); } + +.reveal[data-background-transition=slide] > .backgrounds .slide-background > .slide-background.past, +.reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=slide] { + -webkit-transform: translate(0, -100%); + transform: translate(0, -100%); } + +.reveal[data-background-transition=slide] > .backgrounds .slide-background > .slide-background.future, +.reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=slide] { + -webkit-transform: translate(0, 100%); + transform: translate(0, 100%); } + +/* Convex */ +.reveal[data-background-transition=convex] > .backgrounds .slide-background.past, +.reveal > .backgrounds .slide-background.past[data-background-transition=convex] { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } + +.reveal[data-background-transition=convex] > .backgrounds .slide-background.future, +.reveal > .backgrounds .slide-background.future[data-background-transition=convex] { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } + +.reveal[data-background-transition=convex] > .backgrounds .slide-background > .slide-background.past, +.reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=convex] { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); } + +.reveal[data-background-transition=convex] > .backgrounds .slide-background > .slide-background.future, +.reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=convex] { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); } + +/* Concave */ +.reveal[data-background-transition=concave] > .backgrounds .slide-background.past, +.reveal > .backgrounds .slide-background.past[data-background-transition=concave] { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); } + +.reveal[data-background-transition=concave] > .backgrounds .slide-background.future, +.reveal > .backgrounds .slide-background.future[data-background-transition=concave] { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); } + +.reveal[data-background-transition=concave] > .backgrounds .slide-background > .slide-background.past, +.reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=concave] { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); } + +.reveal[data-background-transition=concave] > .backgrounds .slide-background > .slide-background.future, +.reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=concave] { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); } + +/* Zoom */ +.reveal[data-background-transition=zoom] > .backgrounds .slide-background, +.reveal > .backgrounds .slide-background[data-background-transition=zoom] { + transition-timing-function: ease; } + +.reveal[data-background-transition=zoom] > .backgrounds .slide-background.past, +.reveal > .backgrounds .slide-background.past[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + -webkit-transform: scale(16); + transform: scale(16); } + +.reveal[data-background-transition=zoom] > .backgrounds .slide-background.future, +.reveal > .backgrounds .slide-background.future[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); } + +.reveal[data-background-transition=zoom] > .backgrounds .slide-background > .slide-background.past, +.reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + -webkit-transform: scale(16); + transform: scale(16); } + +.reveal[data-background-transition=zoom] > .backgrounds .slide-background > .slide-background.future, +.reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); } + +/* Global transition speed settings */ +.reveal[data-transition-speed="fast"] > .backgrounds .slide-background { + transition-duration: 400ms; } + +.reveal[data-transition-speed="slow"] > .backgrounds .slide-background { + transition-duration: 1200ms; } + +/********************************************* + * OVERVIEW + *********************************************/ +.reveal.overview { + -webkit-perspective-origin: 50% 50%; + perspective-origin: 50% 50%; + -webkit-perspective: 700px; + perspective: 700px; } + .reveal.overview .slides { + -moz-transform-style: preserve-3d; } + .reveal.overview .slides section { + height: 100%; + top: 0 !important; + opacity: 1 !important; + overflow: hidden; + visibility: visible !important; + cursor: pointer; + box-sizing: border-box; } + .reveal.overview .slides section:hover, + .reveal.overview .slides section.present { + outline: 10px solid rgba(150, 150, 150, 0.4); + outline-offset: 10px; } + .reveal.overview .slides section .fragment { + opacity: 1; + transition: none; } + .reveal.overview .slides section:after, + .reveal.overview .slides section:before { + display: none !important; } + .reveal.overview .slides > section.stack { + padding: 0; + top: 0 !important; + background: none; + outline: none; + overflow: visible; } + .reveal.overview .backgrounds { + -webkit-perspective: inherit; + perspective: inherit; + -moz-transform-style: preserve-3d; } + .reveal.overview .backgrounds .slide-background { + opacity: 1; + visibility: visible; + outline: 10px solid rgba(150, 150, 150, 0.1); + outline-offset: 10px; } + .reveal.overview .backgrounds .slide-background.stack { + overflow: visible; } + +.reveal.overview .slides section, +.reveal.overview-deactivating .slides section { + transition: none; } + +.reveal.overview .backgrounds .slide-background, +.reveal.overview-deactivating .backgrounds .slide-background { + transition: none; } + +/********************************************* + * RTL SUPPORT + *********************************************/ +.reveal.rtl .slides, +.reveal.rtl .slides h1, +.reveal.rtl .slides h2, +.reveal.rtl .slides h3, +.reveal.rtl .slides h4, +.reveal.rtl .slides h5, +.reveal.rtl .slides h6 { + direction: rtl; + font-family: sans-serif; } + +.reveal.rtl pre, +.reveal.rtl code { + direction: ltr; } + +.reveal.rtl ol, +.reveal.rtl ul { + text-align: right; } + +.reveal.rtl .progress span { + float: right; } + +/********************************************* + * PARALLAX BACKGROUND + *********************************************/ +.reveal.has-parallax-background .backgrounds { + transition: all 0.8s ease; } + +/* Global transition speed settings */ +.reveal.has-parallax-background[data-transition-speed="fast"] .backgrounds { + transition-duration: 400ms; } + +.reveal.has-parallax-background[data-transition-speed="slow"] .backgrounds { + transition-duration: 1200ms; } + +/********************************************* + * OVERLAY FOR LINK PREVIEWS AND HELP + *********************************************/ +.reveal > .overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background: rgba(0, 0, 0, 0.9); + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; } + +.reveal > .overlay.visible { + opacity: 1; + visibility: visible; } + +.reveal > .overlay .spinner { + position: absolute; + display: block; + top: 50%; + left: 50%; + width: 32px; + height: 32px; + margin: -16px 0 0 -16px; + z-index: 10; + background-image: url(data:image/gif;base64,R0lGODlhIAAgAPMAAJmZmf%2F%2F%2F6%2Bvr8nJybW1tcDAwOjo6Nvb26ioqKOjo7Ozs%2FLy8vz8%2FAAAAAAAAAAAACH%2FC05FVFNDQVBFMi4wAwEAAAAh%2FhpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh%2BQQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ%2FV%2FnmOM82XiHRLYKhKP1oZmADdEAAAh%2BQQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY%2FCZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB%2BA4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6%2BHo7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq%2BB6QDtuetcaBPnW6%2BO7wDHpIiK9SaVK5GgV543tzjgGcghAgAh%2BQQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK%2B%2BG%2Bw48edZPK%2BM6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE%2BG%2BcD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm%2BFNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk%2BaV%2BoJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0%2FVNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc%2BXiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30%2FiI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE%2FjiuL04RGEBgwWhShRgQExHBAAh%2BQQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR%2BipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY%2BYip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd%2BMFCN6HAAIKgNggY0KtEBAAh%2BQQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1%2BvsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d%2BjYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg%2BygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0%2Bbm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h%2BKr0SJ8MFihpNbx%2B4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX%2BBP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA%3D%3D); + visibility: visible; + opacity: 0.6; + transition: all 0.3s ease; } + +.reveal > .overlay header { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 40px; + z-index: 2; + border-bottom: 1px solid #222; } + +.reveal > .overlay header a { + display: inline-block; + width: 40px; + height: 40px; + line-height: 36px; + padding: 0 10px; + float: right; + opacity: 0.6; + box-sizing: border-box; } + +.reveal > .overlay header a:hover { + opacity: 1; } + +.reveal > .overlay header a .icon { + display: inline-block; + width: 20px; + height: 20px; + background-position: 50% 50%; + background-size: 100%; + background-repeat: no-repeat; } + +.reveal > .overlay header a.close .icon { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkklEQVRYR8WX4VHDMAxG6wnoJrABZQPYBCaBTWAD2g1gE5gg6OOsXuxIlr40d81dfrSJ9V4c2VLK7spHuTJ/5wpM07QXuXc5X0opX2tEJcadjHuV80li/FgxTIEK/5QBCICBD6xEhSMGHgQPgBgLiYVAB1dpSqKDawxTohFw4JSEA3clzgIBPCURwE2JucBR7rhPJJv5OpJwDX+SfDjgx1wACQeJG1aChP9K/IMmdZ8DtESV1WyP3Bt4MwM6sj4NMxMYiqUWHQu4KYA/SYkIjOsm3BXYWMKFDwU2khjCQ4ELJUJ4SmClRArOCmSXGuKma0fYD5CbzHxFpCSGAhfAVSSUGDUk2BWZaff2g6GE15BsBQ9nwmpIGDiyHQddwNTMKkbZaf9fajXQca1EX44puJZUsnY0ObGmITE3GVLCbEhQUjGVt146j6oasWN+49Vph2w1pZ5EansNZqKBm1txbU57iRRcZ86RWMDdWtBJUHBHwoQPi1GV+JCbntmvok7iTX4/Up9mgyTc/FJYDTcndgH/AA5A/CHsyEkVAAAAAElFTkSuQmCC); } + +.reveal > .overlay header a.external .icon { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAcElEQVRYR+2WSQoAIQwEzf8f7XiOMkUQxUPlGkM3hVmiQfQR9GYnH1SsAQlI4DiBqkCMoNb9y2e90IAEJPAcgdznU9+engMaeJ7Azh5Y1U67gAho4DqBqmB1buAf0MB1AlVBek83ZPkmJMGc1wAR+AAqod/B97TRpQAAAABJRU5ErkJggg==); } + +.reveal > .overlay .viewport { + position: absolute; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + top: 40px; + right: 0; + bottom: 0; + left: 0; } + +.reveal > .overlay.overlay-preview .viewport iframe { + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + border: 0; + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; } + +.reveal > .overlay.overlay-preview.loaded .viewport iframe { + opacity: 1; + visibility: visible; } + +.reveal > .overlay.overlay-preview.loaded .viewport-inner { + position: absolute; + z-index: -1; + left: 0; + top: 45%; + width: 100%; + text-align: center; + letter-spacing: normal; } + +.reveal > .overlay.overlay-preview .x-frame-error { + opacity: 0; + transition: opacity 0.3s ease 0.3s; } + +.reveal > .overlay.overlay-preview.loaded .x-frame-error { + opacity: 1; } + +.reveal > .overlay.overlay-preview.loaded .spinner { + opacity: 0; + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); } + +.reveal > .overlay.overlay-help .viewport { + overflow: auto; + color: #fff; } + +.reveal > .overlay.overlay-help .viewport .viewport-inner { + width: 600px; + margin: auto; + padding: 20px 20px 80px 20px; + text-align: center; + letter-spacing: normal; } + +.reveal > .overlay.overlay-help .viewport .viewport-inner .title { + font-size: 20px; } + +.reveal > .overlay.overlay-help .viewport .viewport-inner table { + border: 1px solid #fff; + border-collapse: collapse; + font-size: 16px; } + +.reveal > .overlay.overlay-help .viewport .viewport-inner table th, +.reveal > .overlay.overlay-help .viewport .viewport-inner table td { + width: 200px; + padding: 14px; + border: 1px solid #fff; + vertical-align: middle; } + +.reveal > .overlay.overlay-help .viewport .viewport-inner table th { + padding-top: 20px; + padding-bottom: 20px; } + +/********************************************* + * PLAYBACK COMPONENT + *********************************************/ +.reveal .playback { + position: absolute; + left: 15px; + bottom: 20px; + z-index: 30; + cursor: pointer; + transition: all 400ms ease; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.reveal.overview .playback { + opacity: 0; + visibility: hidden; } + +/********************************************* + * CODE HIGHLGIHTING + *********************************************/ +.reveal .hljs table { + margin: initial; } + +.reveal .hljs-ln-code, +.reveal .hljs-ln-numbers { + padding: 0; + border: 0; } + +.reveal .hljs-ln-numbers { + opacity: 0.6; + padding-right: 0.75em; + text-align: right; + vertical-align: top; } + +.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) { + opacity: 0.4; } + +/********************************************* + * ROLLING LINKS + *********************************************/ +.reveal .roll { + display: inline-block; + line-height: 1.2; + overflow: hidden; + vertical-align: top; + -webkit-perspective: 400px; + perspective: 400px; + -webkit-perspective-origin: 50% 50%; + perspective-origin: 50% 50%; } + +.reveal .roll:hover { + background: none; + text-shadow: none; } + +.reveal .roll span { + display: block; + position: relative; + padding: 0 2px; + pointer-events: none; + transition: all 400ms ease; + -webkit-transform-origin: 50% 0%; + transform-origin: 50% 0%; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.reveal .roll:hover span { + background: rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0px, 0px, -45px) rotateX(90deg); + transform: translate3d(0px, 0px, -45px) rotateX(90deg); } + +.reveal .roll span:after { + content: attr(data-title); + display: block; + position: absolute; + left: 0; + top: 0; + padding: 0 2px; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform-origin: 50% 0%; + transform-origin: 50% 0%; + -webkit-transform: translate3d(0px, 110%, 0px) rotateX(-90deg); + transform: translate3d(0px, 110%, 0px) rotateX(-90deg); } + +/********************************************* + * SPEAKER NOTES + *********************************************/ +.reveal aside.notes { + display: none; } + +.reveal .speaker-notes { + display: none; + position: absolute; + width: 33.3333333333%; + height: 100%; + top: 0; + left: 100%; + padding: 14px 18px 14px 18px; + z-index: 1; + font-size: 18px; + line-height: 1.4; + border: 1px solid rgba(0, 0, 0, 0.05); + color: #222; + background-color: #f5f5f5; + overflow: auto; + box-sizing: border-box; + text-align: left; + font-family: Helvetica, sans-serif; + -webkit-overflow-scrolling: touch; } + .reveal .speaker-notes .notes-placeholder { + color: #ccc; + font-style: italic; } + .reveal .speaker-notes:focus { + outline: none; } + .reveal .speaker-notes:before { + content: 'Speaker notes'; + display: block; + margin-bottom: 10px; + opacity: 0.5; } + +.reveal.show-notes { + max-width: 75%; + overflow: visible; } + +.reveal.show-notes .speaker-notes { + display: block; } + +@media screen and (min-width: 1600px) { + .reveal .speaker-notes { + font-size: 20px; } } + +@media screen and (max-width: 1024px) { + .reveal.show-notes { + border-left: 0; + max-width: none; + max-height: 70%; + max-height: 70vh; + overflow: visible; } + .reveal.show-notes .speaker-notes { + top: 100%; + left: 0; + width: 100%; + height: 42.8571428571%; + height: 30vh; + border: 0; } } + +@media screen and (max-width: 600px) { + .reveal.show-notes { + max-height: 60%; + max-height: 60vh; } + .reveal.show-notes .speaker-notes { + top: 100%; + height: 66.6666666667%; + height: 40vh; } + .reveal .speaker-notes { + font-size: 14px; } } + +/********************************************* + * ZOOM PLUGIN + *********************************************/ +.zoomed .reveal *, +.zoomed .reveal *:before, +.zoomed .reveal *:after { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; } + +.zoomed .reveal .progress, +.zoomed .reveal .controls { + opacity: 0; } + +.zoomed .reveal .roll span { + background: none; } + +.zoomed .reveal .roll span:after { + visibility: hidden; } diff --git a/Pepiniere/docker/revealjs/css/reveal.scss b/Pepiniere/docker/revealjs/css/reveal.scss new file mode 100644 index 0000000..ab732a4 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/reveal.scss @@ -0,0 +1,1768 @@ +/*! + * reveal.js + * http://revealjs.com + * MIT licensed + * + * Copyright (C) 2019 Hakim El Hattab, http://hakim.se + */ + + +/********************************************* + * GLOBAL STYLES + *********************************************/ + +html { + width: 100%; + height: 100%; + height: 100vh; + height: calc( var(--vh, 1vh) * 100 ); + overflow: hidden; +} + +body { + height: 100%; + overflow: hidden; + position: relative; + line-height: 1; + margin: 0; + + background-color: #fff; + color: #000; +} + + +/********************************************* + * VIEW FRAGMENTS + *********************************************/ + +.reveal .slides section .fragment { + opacity: 0; + visibility: hidden; + transition: all .2s ease; + + &.visible { + opacity: 1; + visibility: inherit; + } +} + +.reveal .slides section .fragment.grow { + opacity: 1; + visibility: inherit; + + &.visible { + transform: scale( 1.3 ); + } +} + +.reveal .slides section .fragment.shrink { + opacity: 1; + visibility: inherit; + + &.visible { + transform: scale( 0.7 ); + } +} + +.reveal .slides section .fragment.zoom-in { + transform: scale( 0.1 ); + + &.visible { + transform: none; + } +} + +.reveal .slides section .fragment.fade-out { + opacity: 1; + visibility: inherit; + + &.visible { + opacity: 0; + visibility: hidden; + } +} + +.reveal .slides section .fragment.semi-fade-out { + opacity: 1; + visibility: inherit; + + &.visible { + opacity: 0.5; + visibility: inherit; + } +} + +.reveal .slides section .fragment.strike { + opacity: 1; + visibility: inherit; + + &.visible { + text-decoration: line-through; + } +} + +.reveal .slides section .fragment.fade-up { + transform: translate(0, 20%); + + &.visible { + transform: translate(0, 0); + } +} + +.reveal .slides section .fragment.fade-down { + transform: translate(0, -20%); + + &.visible { + transform: translate(0, 0); + } +} + +.reveal .slides section .fragment.fade-right { + transform: translate(-20%, 0); + + &.visible { + transform: translate(0, 0); + } +} + +.reveal .slides section .fragment.fade-left { + transform: translate(20%, 0); + + &.visible { + transform: translate(0, 0); + } +} + +.reveal .slides section .fragment.fade-in-then-out, +.reveal .slides section .fragment.current-visible { + opacity: 0; + visibility: hidden; + + &.current-fragment { + opacity: 1; + visibility: inherit; + } +} + +.reveal .slides section .fragment.fade-in-then-semi-out { + opacity: 0; + visibility: hidden; + + &.visible { + opacity: 0.5; + visibility: inherit; + } + + &.current-fragment { + opacity: 1; + visibility: inherit; + } +} + +.reveal .slides section .fragment.highlight-red, +.reveal .slides section .fragment.highlight-current-red, +.reveal .slides section .fragment.highlight-green, +.reveal .slides section .fragment.highlight-current-green, +.reveal .slides section .fragment.highlight-blue, +.reveal .slides section .fragment.highlight-current-blue { + opacity: 1; + visibility: inherit; +} + .reveal .slides section .fragment.highlight-red.visible { + color: #ff2c2d + } + .reveal .slides section .fragment.highlight-green.visible { + color: #17ff2e; + } + .reveal .slides section .fragment.highlight-blue.visible { + color: #1b91ff; + } + +.reveal .slides section .fragment.highlight-current-red.current-fragment { + color: #ff2c2d +} +.reveal .slides section .fragment.highlight-current-green.current-fragment { + color: #17ff2e; +} +.reveal .slides section .fragment.highlight-current-blue.current-fragment { + color: #1b91ff; +} + + +/********************************************* + * DEFAULT ELEMENT STYLES + *********************************************/ + +/* Fixes issue in Chrome where italic fonts did not appear when printing to PDF */ +.reveal:after { + content: ''; + font-style: italic; +} + +.reveal iframe { + z-index: 1; +} + +/** Prevents layering issues in certain browser/transition combinations */ +.reveal a { + position: relative; +} + +.reveal .stretch { + max-width: none; + max-height: none; +} + +.reveal pre.stretch code { + height: 100%; + max-height: 100%; + box-sizing: border-box; +} + + +/********************************************* + * CONTROLS + *********************************************/ + +@keyframes bounce-right { + 0%, 10%, 25%, 40%, 50% {transform: translateX(0);} + 20% {transform: translateX(10px);} + 30% {transform: translateX(-5px);} +} + +@keyframes bounce-down { + 0%, 10%, 25%, 40%, 50% {transform: translateY(0);} + 20% {transform: translateY(10px);} + 30% {transform: translateY(-5px);} +} + +$controlArrowSize: 3.6em; +$controlArrowSpacing: 1.4em; +$controlArrowLength: 2.6em; +$controlArrowThickness: 0.5em; +$controlsArrowAngle: 45deg; +$controlsArrowAngleHover: 40deg; +$controlsArrowAngleActive: 36deg; + +@mixin controlsArrowTransform( $angle ) { + &:before { + transform: translateX(($controlArrowSize - $controlArrowLength)/2) translateY(($controlArrowSize - $controlArrowThickness)/2) rotate( $angle ); + } + + &:after { + transform: translateX(($controlArrowSize - $controlArrowLength)/2) translateY(($controlArrowSize - $controlArrowThickness)/2) rotate( -$angle ); + } +} + +.reveal .controls { + $spacing: 12px; + + display: none; + position: absolute; + top: auto; + bottom: $spacing; + right: $spacing; + left: auto; + z-index: 1; + color: #000; + pointer-events: none; + font-size: 10px; + + button { + position: absolute; + padding: 0; + background-color: transparent; + border: 0; + outline: 0; + cursor: pointer; + color: currentColor; + transform: scale(.9999); + transition: color 0.2s ease, + opacity 0.2s ease, + transform 0.2s ease; + z-index: 2; // above slides + pointer-events: auto; + font-size: inherit; + + visibility: hidden; + opacity: 0; + + -webkit-appearance: none; + -webkit-tap-highlight-color: rgba( 0, 0, 0, 0 ); + } + + .controls-arrow:before, + .controls-arrow:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: $controlArrowLength; + height: $controlArrowThickness; + border-radius: $controlArrowThickness/2; + background-color: currentColor; + + transition: all 0.15s ease, background-color 0.8s ease; + transform-origin: floor(($controlArrowThickness/2)*10)/10 50%; + will-change: transform; + } + + .controls-arrow { + position: relative; + width: $controlArrowSize; + height: $controlArrowSize; + + @include controlsArrowTransform( $controlsArrowAngle ); + + &:hover { + @include controlsArrowTransform( $controlsArrowAngleHover ); + } + + &:active { + @include controlsArrowTransform( $controlsArrowAngleActive ); + } + } + + .navigate-left { + right: $controlArrowSize + $controlArrowSpacing*2; + bottom: $controlArrowSpacing + $controlArrowSize/2; + transform: translateX( -10px ); + } + + .navigate-right { + right: 0; + bottom: $controlArrowSpacing + $controlArrowSize/2; + transform: translateX( 10px ); + + .controls-arrow { + transform: rotate( 180deg ); + } + + &.highlight { + animation: bounce-right 2s 50 both ease-out; + } + } + + .navigate-up { + right: $controlArrowSpacing + $controlArrowSize/2; + bottom: $controlArrowSpacing*2 + $controlArrowSize; + transform: translateY( -10px ); + + .controls-arrow { + transform: rotate( 90deg ); + } + } + + .navigate-down { + right: $controlArrowSpacing + $controlArrowSize/2; + bottom: 0; + transform: translateY( 10px ); + + .controls-arrow { + transform: rotate( -90deg ); + } + + &.highlight { + animation: bounce-down 2s 50 both ease-out; + } + } + + // Back arrow style: "faded": + // Deemphasize backwards navigation arrows in favor of drawing + // attention to forwards navigation + &[data-controls-back-arrows="faded"] .navigate-left.enabled, + &[data-controls-back-arrows="faded"] .navigate-up.enabled { + opacity: 0.3; + + &:hover { + opacity: 1; + } + } + + // Back arrow style: "hidden": + // Never show arrows for backwards navigation + &[data-controls-back-arrows="hidden"] .navigate-left.enabled, + &[data-controls-back-arrows="hidden"] .navigate-up.enabled { + opacity: 0; + visibility: hidden; + } + + // Any control button that can be clicked is "enabled" + .enabled { + visibility: visible; + opacity: 0.9; + cursor: pointer; + transform: none; + } + + // Any control button that leads to showing or hiding + // a fragment + .enabled.fragmented { + opacity: 0.5; + } + + .enabled:hover, + .enabled.fragmented:hover { + opacity: 1; + } +} + +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-up, +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-down { + display: none; +} + +// Adjust the layout when there are no vertical slides +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-left, +.reveal:not(.has-vertical-slides) .controls .navigate-left { + bottom: $controlArrowSpacing; + right: 0.5em + $controlArrowSpacing + $controlArrowSize; +} + +.reveal[data-navigation-mode="linear"].has-horizontal-slides .navigate-right, +.reveal:not(.has-vertical-slides) .controls .navigate-right { + bottom: $controlArrowSpacing; + right: 0.5em; +} + +// Adjust the layout when there are no horizontal slides +.reveal:not(.has-horizontal-slides) .controls .navigate-up { + right: $controlArrowSpacing; + bottom: $controlArrowSpacing + $controlArrowSize; +} +.reveal:not(.has-horizontal-slides) .controls .navigate-down { + right: $controlArrowSpacing; + bottom: 0.5em; +} + +// Invert arrows based on background color +.reveal.has-dark-background .controls { + color: #fff; +} +.reveal.has-light-background .controls { + color: #000; +} + +// Disable active states on touch devices +.reveal.no-hover .controls .controls-arrow:hover, +.reveal.no-hover .controls .controls-arrow:active { + @include controlsArrowTransform( $controlsArrowAngle ); +} + +// Edge aligned controls layout +@media screen and (min-width: 500px) { + + $spacing: 8px; + + .reveal .controls[data-controls-layout="edges"] { + & { + top: 0; + right: 0; + bottom: 0; + left: 0; + } + + .navigate-left, + .navigate-right, + .navigate-up, + .navigate-down { + bottom: auto; + right: auto; + } + + .navigate-left { + top: 50%; + left: $spacing; + margin-top: -$controlArrowSize/2; + } + + .navigate-right { + top: 50%; + right: $spacing; + margin-top: -$controlArrowSize/2; + } + + .navigate-up { + top: $spacing; + left: 50%; + margin-left: -$controlArrowSize/2; + } + + .navigate-down { + bottom: $spacing; + left: 50%; + margin-left: -$controlArrowSize/2; + } + } + +} + + +/********************************************* + * PROGRESS BAR + *********************************************/ + +.reveal .progress { + position: absolute; + display: none; + height: 3px; + width: 100%; + bottom: 0; + left: 0; + z-index: 10; + + background-color: rgba( 0, 0, 0, 0.2 ); + color: #fff; +} + .reveal .progress:after { + content: ''; + display: block; + position: absolute; + height: 10px; + width: 100%; + top: -10px; + } + .reveal .progress span { + display: block; + height: 100%; + width: 0px; + + background-color: currentColor; + transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + } + +/********************************************* + * SLIDE NUMBER + *********************************************/ + +.reveal .slide-number { + position: absolute; + display: block; + right: 8px; + bottom: 8px; + z-index: 31; + font-family: Helvetica, sans-serif; + font-size: 12px; + line-height: 1; + color: #fff; + background-color: rgba( 0, 0, 0, 0.4 ); + padding: 5px; +} + +.reveal .slide-number a { + color: currentColor; +} + +.reveal .slide-number-delimiter { + margin: 0 3px; +} + +/********************************************* + * SLIDES + *********************************************/ + +.reveal { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; + touch-action: pinch-zoom; +} + +.reveal .slides { + position: absolute; + width: 100%; + height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin: auto; + pointer-events: none; + + overflow: visible; + z-index: 1; + text-align: center; + perspective: 600px; + perspective-origin: 50% 40%; +} + +.reveal .slides>section { + perspective: 600px; +} + +.reveal .slides>section, +.reveal .slides>section>section { + display: none; + position: absolute; + width: 100%; + padding: 20px 0px; + pointer-events: auto; + + z-index: 10; + transform-style: flat; + transition: transform-origin 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985), + transform 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985), + visibility 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985), + opacity 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); +} + +/* Global transition speed settings */ +.reveal[data-transition-speed="fast"] .slides section { + transition-duration: 400ms; +} +.reveal[data-transition-speed="slow"] .slides section { + transition-duration: 1200ms; +} + +/* Slide-specific transition speed overrides */ +.reveal .slides section[data-transition-speed="fast"] { + transition-duration: 400ms; +} +.reveal .slides section[data-transition-speed="slow"] { + transition-duration: 1200ms; +} + +.reveal .slides>section.stack { + padding-top: 0; + padding-bottom: 0; + pointer-events: none; + height: 100%; +} + +.reveal .slides>section.present, +.reveal .slides>section>section.present { + display: block; + z-index: 11; + opacity: 1; +} + +.reveal .slides>section:empty, +.reveal .slides>section>section:empty, +.reveal .slides>section[data-background-interactive], +.reveal .slides>section>section[data-background-interactive] { + pointer-events: none; +} + +.reveal.center, +.reveal.center .slides, +.reveal.center .slides section { + min-height: 0 !important; +} + +/* Don't allow interaction with invisible slides */ +.reveal .slides>section.future, +.reveal .slides>section>section.future, +.reveal .slides>section.past, +.reveal .slides>section>section.past { + pointer-events: none; +} + +.reveal.overview .slides>section, +.reveal.overview .slides>section>section { + pointer-events: auto; +} + +.reveal .slides>section.past, +.reveal .slides>section.future, +.reveal .slides>section>section.past, +.reveal .slides>section>section.future { + opacity: 0; +} + + +/********************************************* + * Mixins for readability of transitions + *********************************************/ + +@mixin transition-global($style) { + .reveal .slides section[data-transition=#{$style}], + .reveal.#{$style} .slides section:not([data-transition]) { + @content; + } +} +@mixin transition-stack($style) { + .reveal .slides section[data-transition=#{$style}].stack, + .reveal.#{$style} .slides section.stack { + @content; + } +} +@mixin transition-horizontal-past($style) { + .reveal .slides>section[data-transition=#{$style}].past, + .reveal .slides>section[data-transition~=#{$style}-out].past, + .reveal.#{$style} .slides>section:not([data-transition]).past { + @content; + } +} +@mixin transition-horizontal-future($style) { + .reveal .slides>section[data-transition=#{$style}].future, + .reveal .slides>section[data-transition~=#{$style}-in].future, + .reveal.#{$style} .slides>section:not([data-transition]).future { + @content; + } +} + +@mixin transition-vertical-past($style) { + .reveal .slides>section>section[data-transition=#{$style}].past, + .reveal .slides>section>section[data-transition~=#{$style}-out].past, + .reveal.#{$style} .slides>section>section:not([data-transition]).past { + @content; + } +} +@mixin transition-vertical-future($style) { + .reveal .slides>section>section[data-transition=#{$style}].future, + .reveal .slides>section>section[data-transition~=#{$style}-in].future, + .reveal.#{$style} .slides>section>section:not([data-transition]).future { + @content; + } +} + +/********************************************* + * SLIDE TRANSITION + * Aliased 'linear' for backwards compatibility + *********************************************/ + +@each $stylename in slide, linear { + .reveal.#{$stylename} section { + backface-visibility: hidden; + } + @include transition-horizontal-past(#{$stylename}) { + transform: translate(-150%, 0); + } + @include transition-horizontal-future(#{$stylename}) { + transform: translate(150%, 0); + } + @include transition-vertical-past(#{$stylename}) { + transform: translate(0, -150%); + } + @include transition-vertical-future(#{$stylename}) { + transform: translate(0, 150%); + } +} + +/********************************************* + * CONVEX TRANSITION + * Aliased 'default' for backwards compatibility + *********************************************/ + +@each $stylename in default, convex { + @include transition-stack(#{$stylename}) { + transform-style: preserve-3d; + } + + @include transition-horizontal-past(#{$stylename}) { + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + } + @include transition-horizontal-future(#{$stylename}) { + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + } + @include transition-vertical-past(#{$stylename}) { + transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); + } + @include transition-vertical-future(#{$stylename}) { + transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); + } +} + +/********************************************* + * CONCAVE TRANSITION + *********************************************/ + +@include transition-stack(concave) { + transform-style: preserve-3d; +} + +@include transition-horizontal-past(concave) { + transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); +} +@include transition-horizontal-future(concave) { + transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); +} +@include transition-vertical-past(concave) { + transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); +} +@include transition-vertical-future(concave) { + transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); +} + + +/********************************************* + * ZOOM TRANSITION + *********************************************/ + +@include transition-global(zoom) { + transition-timing-function: ease; +} +@include transition-horizontal-past(zoom) { + visibility: hidden; + transform: scale(16); +} +@include transition-horizontal-future(zoom) { + visibility: hidden; + transform: scale(0.2); +} +@include transition-vertical-past(zoom) { + transform: scale(16); +} +@include transition-vertical-future(zoom) { + transform: scale(0.2); +} + + +/********************************************* + * CUBE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. + *********************************************/ + +.reveal.cube .slides { + perspective: 1300px; +} + +.reveal.cube .slides section { + padding: 30px; + min-height: 700px; + backface-visibility: hidden; + box-sizing: border-box; + transform-style: preserve-3d; +} + .reveal.center.cube .slides section { + min-height: 0; + } + .reveal.cube .slides section:not(.stack):before { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0,0,0,0.1); + border-radius: 4px; + transform: translateZ( -20px ); + } + .reveal.cube .slides section:not(.stack):after { + content: ''; + position: absolute; + display: block; + width: 90%; + height: 30px; + left: 5%; + bottom: 0; + background: none; + z-index: 1; + + border-radius: 4px; + box-shadow: 0px 95px 25px rgba(0,0,0,0.2); + transform: translateZ(-90px) rotateX( 65deg ); + } + +.reveal.cube .slides>section.stack { + padding: 0; + background: none; +} + +.reveal.cube .slides>section.past { + transform-origin: 100% 0%; + transform: translate3d(-100%, 0, 0) rotateY(-90deg); +} + +.reveal.cube .slides>section.future { + transform-origin: 0% 0%; + transform: translate3d(100%, 0, 0) rotateY(90deg); +} + +.reveal.cube .slides>section>section.past { + transform-origin: 0% 100%; + transform: translate3d(0, -100%, 0) rotateX(90deg); +} + +.reveal.cube .slides>section>section.future { + transform-origin: 0% 0%; + transform: translate3d(0, 100%, 0) rotateX(-90deg); +} + + +/********************************************* + * PAGE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. + *********************************************/ + +.reveal.page .slides { + perspective-origin: 0% 50%; + perspective: 3000px; +} + +.reveal.page .slides section { + padding: 30px; + min-height: 700px; + box-sizing: border-box; + transform-style: preserve-3d; +} + .reveal.page .slides section.past { + z-index: 12; + } + .reveal.page .slides section:not(.stack):before { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0,0,0,0.1); + transform: translateZ( -20px ); + } + .reveal.page .slides section:not(.stack):after { + content: ''; + position: absolute; + display: block; + width: 90%; + height: 30px; + left: 5%; + bottom: 0; + background: none; + z-index: 1; + + border-radius: 4px; + box-shadow: 0px 95px 25px rgba(0,0,0,0.2); + + -webkit-transform: translateZ(-90px) rotateX( 65deg ); + } + +.reveal.page .slides>section.stack { + padding: 0; + background: none; +} + +.reveal.page .slides>section.past { + transform-origin: 0% 0%; + transform: translate3d(-40%, 0, 0) rotateY(-80deg); +} + +.reveal.page .slides>section.future { + transform-origin: 100% 0%; + transform: translate3d(0, 0, 0); +} + +.reveal.page .slides>section>section.past { + transform-origin: 0% 0%; + transform: translate3d(0, -40%, 0) rotateX(80deg); +} + +.reveal.page .slides>section>section.future { + transform-origin: 0% 100%; + transform: translate3d(0, 0, 0); +} + + +/********************************************* + * FADE TRANSITION + *********************************************/ + +.reveal .slides section[data-transition=fade], +.reveal.fade .slides section:not([data-transition]), +.reveal.fade .slides>section>section:not([data-transition]) { + transform: none; + transition: opacity 0.5s; +} + + +.reveal.fade.overview .slides section, +.reveal.fade.overview .slides>section>section { + transition: none; +} + + +/********************************************* + * NO TRANSITION + *********************************************/ + +@include transition-global(none) { + transform: none; + transition: none; +} + + +/********************************************* + * PAUSED MODE + *********************************************/ + +.reveal .pause-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: black; + visibility: hidden; + opacity: 0; + z-index: 100; + transition: all 1s ease; +} + +.reveal .pause-overlay .resume-button { + position: absolute; + bottom: 20px; + right: 20px; + color: #ccc; + border-radius: 2px; + padding: 6px 14px; + border: 2px solid #ccc; + font-size: 16px; + background: transparent; + cursor: pointer; + + &:hover { + color: #fff; + border-color: #fff; + } +} + +.reveal.paused .pause-overlay { + visibility: visible; + opacity: 1; +} + + +/********************************************* + * FALLBACK + *********************************************/ + +.no-transforms { + overflow-y: auto; +} + +.no-transforms .reveal { + overflow: visible; +} + +.no-transforms .reveal .slides { + position: relative; + width: 80%; + max-width: 1280px; + height: auto; + top: 0; + margin: 0 auto; + text-align: center; +} + +.no-transforms .reveal .controls, +.no-transforms .reveal .progress { + display: none; +} + +.no-transforms .reveal .slides section { + display: block; + opacity: 1; + position: relative; + height: auto; + min-height: 0; + top: 0; + left: 0; + margin: 10vh 0; + margin: 70px 0; + transform: none; +} + +.reveal .no-transition, +.reveal .no-transition * { + transition: none !important; +} + + +/********************************************* + * PER-SLIDE BACKGROUNDS + *********************************************/ + +.reveal .backgrounds { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + perspective: 600px; +} + .reveal .slide-background { + display: none; + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + visibility: hidden; + overflow: hidden; + + background-color: rgba( 0, 0, 0, 0 ); + + transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + } + + .reveal .slide-background-content { + position: absolute; + width: 100%; + height: 100%; + + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: cover; + } + + .reveal .slide-background.stack { + display: block; + } + + .reveal .slide-background.present { + opacity: 1; + visibility: visible; + z-index: 2; + } + + .print-pdf .reveal .slide-background { + opacity: 1 !important; + visibility: visible !important; + } + +/* Video backgrounds */ +.reveal .slide-background video { + position: absolute; + width: 100%; + height: 100%; + max-width: none; + max-height: none; + top: 0; + left: 0; + object-fit: cover; +} + .reveal .slide-background[data-background-size="contain"] video { + object-fit: contain; + } + +/* Immediate transition style */ +.reveal[data-background-transition=none]>.backgrounds .slide-background, +.reveal>.backgrounds .slide-background[data-background-transition=none] { + transition: none; +} + +/* Slide */ +.reveal[data-background-transition=slide]>.backgrounds .slide-background, +.reveal>.backgrounds .slide-background[data-background-transition=slide] { + opacity: 1; + backface-visibility: hidden; +} + .reveal[data-background-transition=slide]>.backgrounds .slide-background.past, + .reveal>.backgrounds .slide-background.past[data-background-transition=slide] { + transform: translate(-100%, 0); + } + .reveal[data-background-transition=slide]>.backgrounds .slide-background.future, + .reveal>.backgrounds .slide-background.future[data-background-transition=slide] { + transform: translate(100%, 0); + } + + .reveal[data-background-transition=slide]>.backgrounds .slide-background>.slide-background.past, + .reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=slide] { + transform: translate(0, -100%); + } + .reveal[data-background-transition=slide]>.backgrounds .slide-background>.slide-background.future, + .reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=slide] { + transform: translate(0, 100%); + } + + +/* Convex */ +.reveal[data-background-transition=convex]>.backgrounds .slide-background.past, +.reveal>.backgrounds .slide-background.past[data-background-transition=convex] { + opacity: 0; + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); +} +.reveal[data-background-transition=convex]>.backgrounds .slide-background.future, +.reveal>.backgrounds .slide-background.future[data-background-transition=convex] { + opacity: 0; + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); +} + +.reveal[data-background-transition=convex]>.backgrounds .slide-background>.slide-background.past, +.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=convex] { + opacity: 0; + transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); +} +.reveal[data-background-transition=convex]>.backgrounds .slide-background>.slide-background.future, +.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=convex] { + opacity: 0; + transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); +} + + +/* Concave */ +.reveal[data-background-transition=concave]>.backgrounds .slide-background.past, +.reveal>.backgrounds .slide-background.past[data-background-transition=concave] { + opacity: 0; + transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); +} +.reveal[data-background-transition=concave]>.backgrounds .slide-background.future, +.reveal>.backgrounds .slide-background.future[data-background-transition=concave] { + opacity: 0; + transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); +} + +.reveal[data-background-transition=concave]>.backgrounds .slide-background>.slide-background.past, +.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=concave] { + opacity: 0; + transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); +} +.reveal[data-background-transition=concave]>.backgrounds .slide-background>.slide-background.future, +.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=concave] { + opacity: 0; + transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); +} + +/* Zoom */ +.reveal[data-background-transition=zoom]>.backgrounds .slide-background, +.reveal>.backgrounds .slide-background[data-background-transition=zoom] { + transition-timing-function: ease; +} + +.reveal[data-background-transition=zoom]>.backgrounds .slide-background.past, +.reveal>.backgrounds .slide-background.past[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + transform: scale(16); +} +.reveal[data-background-transition=zoom]>.backgrounds .slide-background.future, +.reveal>.backgrounds .slide-background.future[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + transform: scale(0.2); +} + +.reveal[data-background-transition=zoom]>.backgrounds .slide-background>.slide-background.past, +.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + transform: scale(16); +} +.reveal[data-background-transition=zoom]>.backgrounds .slide-background>.slide-background.future, +.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=zoom] { + opacity: 0; + visibility: hidden; + transform: scale(0.2); +} + + +/* Global transition speed settings */ +.reveal[data-transition-speed="fast"]>.backgrounds .slide-background { + transition-duration: 400ms; +} +.reveal[data-transition-speed="slow"]>.backgrounds .slide-background { + transition-duration: 1200ms; +} + + +/********************************************* + * OVERVIEW + *********************************************/ + +.reveal.overview { + perspective-origin: 50% 50%; + perspective: 700px; + + .slides { + // Fixes overview rendering errors in FF48+, not applied to + // other browsers since it degrades performance + -moz-transform-style: preserve-3d; + } + + .slides section { + height: 100%; + top: 0 !important; + opacity: 1 !important; + overflow: hidden; + visibility: visible !important; + cursor: pointer; + box-sizing: border-box; + } + .slides section:hover, + .slides section.present { + outline: 10px solid rgba(150,150,150,0.4); + outline-offset: 10px; + } + .slides section .fragment { + opacity: 1; + transition: none; + } + .slides section:after, + .slides section:before { + display: none !important; + } + .slides>section.stack { + padding: 0; + top: 0 !important; + background: none; + outline: none; + overflow: visible; + } + + .backgrounds { + perspective: inherit; + + // Fixes overview rendering errors in FF48+, not applied to + // other browsers since it degrades performance + -moz-transform-style: preserve-3d; + } + + .backgrounds .slide-background { + opacity: 1; + visibility: visible; + + // This can't be applied to the slide itself in Safari + outline: 10px solid rgba(150,150,150,0.1); + outline-offset: 10px; + } + + .backgrounds .slide-background.stack { + overflow: visible; + } +} + +// Disable transitions transitions while we're activating +// or deactivating the overview mode. +.reveal.overview .slides section, +.reveal.overview-deactivating .slides section { + transition: none; +} + +.reveal.overview .backgrounds .slide-background, +.reveal.overview-deactivating .backgrounds .slide-background { + transition: none; +} + + +/********************************************* + * RTL SUPPORT + *********************************************/ + +.reveal.rtl .slides, +.reveal.rtl .slides h1, +.reveal.rtl .slides h2, +.reveal.rtl .slides h3, +.reveal.rtl .slides h4, +.reveal.rtl .slides h5, +.reveal.rtl .slides h6 { + direction: rtl; + font-family: sans-serif; +} + +.reveal.rtl pre, +.reveal.rtl code { + direction: ltr; +} + +.reveal.rtl ol, +.reveal.rtl ul { + text-align: right; +} + +.reveal.rtl .progress span { + float: right +} + +/********************************************* + * PARALLAX BACKGROUND + *********************************************/ + +.reveal.has-parallax-background .backgrounds { + transition: all 0.8s ease; +} + +/* Global transition speed settings */ +.reveal.has-parallax-background[data-transition-speed="fast"] .backgrounds { + transition-duration: 400ms; +} +.reveal.has-parallax-background[data-transition-speed="slow"] .backgrounds { + transition-duration: 1200ms; +} + + +/********************************************* + * OVERLAY FOR LINK PREVIEWS AND HELP + *********************************************/ + +.reveal > .overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background: rgba( 0, 0, 0, 0.9 ); + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; +} + .reveal > .overlay.visible { + opacity: 1; + visibility: visible; + } + + .reveal > .overlay .spinner { + position: absolute; + display: block; + top: 50%; + left: 50%; + width: 32px; + height: 32px; + margin: -16px 0 0 -16px; + z-index: 10; + background-image: url(data:image/gif;base64,R0lGODlhIAAgAPMAAJmZmf%2F%2F%2F6%2Bvr8nJybW1tcDAwOjo6Nvb26ioqKOjo7Ozs%2FLy8vz8%2FAAAAAAAAAAAACH%2FC05FVFNDQVBFMi4wAwEAAAAh%2FhpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh%2BQQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ%2FV%2FnmOM82XiHRLYKhKP1oZmADdEAAAh%2BQQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY%2FCZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB%2BA4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6%2BHo7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq%2BB6QDtuetcaBPnW6%2BO7wDHpIiK9SaVK5GgV543tzjgGcghAgAh%2BQQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK%2B%2BG%2Bw48edZPK%2BM6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE%2BG%2BcD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm%2BFNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk%2BaV%2BoJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0%2FVNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc%2BXiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30%2FiI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE%2FjiuL04RGEBgwWhShRgQExHBAAh%2BQQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR%2BipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY%2BYip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd%2BMFCN6HAAIKgNggY0KtEBAAh%2BQQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1%2BvsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d%2BjYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg%2BygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0%2Bbm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h%2BKr0SJ8MFihpNbx%2B4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX%2BBP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA%3D%3D); + + visibility: visible; + opacity: 0.6; + transition: all 0.3s ease; + } + + .reveal > .overlay header { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 40px; + z-index: 2; + border-bottom: 1px solid #222; + } + .reveal > .overlay header a { + display: inline-block; + width: 40px; + height: 40px; + line-height: 36px; + padding: 0 10px; + float: right; + opacity: 0.6; + + box-sizing: border-box; + } + .reveal > .overlay header a:hover { + opacity: 1; + } + .reveal > .overlay header a .icon { + display: inline-block; + width: 20px; + height: 20px; + + background-position: 50% 50%; + background-size: 100%; + background-repeat: no-repeat; + } + .reveal > .overlay header a.close .icon { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkklEQVRYR8WX4VHDMAxG6wnoJrABZQPYBCaBTWAD2g1gE5gg6OOsXuxIlr40d81dfrSJ9V4c2VLK7spHuTJ/5wpM07QXuXc5X0opX2tEJcadjHuV80li/FgxTIEK/5QBCICBD6xEhSMGHgQPgBgLiYVAB1dpSqKDawxTohFw4JSEA3clzgIBPCURwE2JucBR7rhPJJv5OpJwDX+SfDjgx1wACQeJG1aChP9K/IMmdZ8DtESV1WyP3Bt4MwM6sj4NMxMYiqUWHQu4KYA/SYkIjOsm3BXYWMKFDwU2khjCQ4ELJUJ4SmClRArOCmSXGuKma0fYD5CbzHxFpCSGAhfAVSSUGDUk2BWZaff2g6GE15BsBQ9nwmpIGDiyHQddwNTMKkbZaf9fajXQca1EX44puJZUsnY0ObGmITE3GVLCbEhQUjGVt146j6oasWN+49Vph2w1pZ5EansNZqKBm1txbU57iRRcZ86RWMDdWtBJUHBHwoQPi1GV+JCbntmvok7iTX4/Up9mgyTc/FJYDTcndgH/AA5A/CHsyEkVAAAAAElFTkSuQmCC); + } + .reveal > .overlay header a.external .icon { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAcElEQVRYR+2WSQoAIQwEzf8f7XiOMkUQxUPlGkM3hVmiQfQR9GYnH1SsAQlI4DiBqkCMoNb9y2e90IAEJPAcgdznU9+engMaeJ7Azh5Y1U67gAho4DqBqmB1buAf0MB1AlVBek83ZPkmJMGc1wAR+AAqod/B97TRpQAAAABJRU5ErkJggg==); + } + + .reveal > .overlay .viewport { + position: absolute; + display: flex; + top: 40px; + right: 0; + bottom: 0; + left: 0; + } + + .reveal > .overlay.overlay-preview .viewport iframe { + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + border: 0; + + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; + } + + .reveal > .overlay.overlay-preview.loaded .viewport iframe { + opacity: 1; + visibility: visible; + } + + .reveal > .overlay.overlay-preview.loaded .viewport-inner { + position: absolute; + z-index: -1; + left: 0; + top: 45%; + width: 100%; + text-align: center; + letter-spacing: normal; + } + .reveal > .overlay.overlay-preview .x-frame-error { + opacity: 0; + transition: opacity 0.3s ease 0.3s; + } + .reveal > .overlay.overlay-preview.loaded .x-frame-error { + opacity: 1; + } + + .reveal > .overlay.overlay-preview.loaded .spinner { + opacity: 0; + visibility: hidden; + transform: scale(0.2); + } + + .reveal > .overlay.overlay-help .viewport { + overflow: auto; + color: #fff; + } + + .reveal > .overlay.overlay-help .viewport .viewport-inner { + width: 600px; + margin: auto; + padding: 20px 20px 80px 20px; + text-align: center; + letter-spacing: normal; + } + + .reveal > .overlay.overlay-help .viewport .viewport-inner .title { + font-size: 20px; + } + + .reveal > .overlay.overlay-help .viewport .viewport-inner table { + border: 1px solid #fff; + border-collapse: collapse; + font-size: 16px; + } + + .reveal > .overlay.overlay-help .viewport .viewport-inner table th, + .reveal > .overlay.overlay-help .viewport .viewport-inner table td { + width: 200px; + padding: 14px; + border: 1px solid #fff; + vertical-align: middle; + } + + .reveal > .overlay.overlay-help .viewport .viewport-inner table th { + padding-top: 20px; + padding-bottom: 20px; + } + + +/********************************************* + * PLAYBACK COMPONENT + *********************************************/ + +.reveal .playback { + position: absolute; + left: 15px; + bottom: 20px; + z-index: 30; + cursor: pointer; + transition: all 400ms ease; + -webkit-tap-highlight-color: rgba( 0, 0, 0, 0 ); +} + +.reveal.overview .playback { + opacity: 0; + visibility: hidden; +} + + +/********************************************* + * CODE HIGHLGIHTING + *********************************************/ + +.reveal .hljs table { + margin: initial; +} + +.reveal .hljs-ln-code, +.reveal .hljs-ln-numbers { + padding: 0; + border: 0; +} + +.reveal .hljs-ln-numbers { + opacity: 0.6; + padding-right: 0.75em; + text-align: right; + vertical-align: top; +} + +.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) { + opacity: 0.4; +} + + +/********************************************* + * ROLLING LINKS + *********************************************/ + +.reveal .roll { + display: inline-block; + line-height: 1.2; + overflow: hidden; + + vertical-align: top; + perspective: 400px; + perspective-origin: 50% 50%; +} + .reveal .roll:hover { + background: none; + text-shadow: none; + } +.reveal .roll span { + display: block; + position: relative; + padding: 0 2px; + + pointer-events: none; + transition: all 400ms ease; + transform-origin: 50% 0%; + transform-style: preserve-3d; + backface-visibility: hidden; +} + .reveal .roll:hover span { + background: rgba(0,0,0,0.5); + transform: translate3d( 0px, 0px, -45px ) rotateX( 90deg ); + } +.reveal .roll span:after { + content: attr(data-title); + + display: block; + position: absolute; + left: 0; + top: 0; + padding: 0 2px; + backface-visibility: hidden; + transform-origin: 50% 0%; + transform: translate3d( 0px, 110%, 0px ) rotateX( -90deg ); +} + + +/********************************************* + * SPEAKER NOTES + *********************************************/ + +$notesWidthPercent: 25%; + +// Hide on-page notes +.reveal aside.notes { + display: none; +} + +// An interface element that can optionally be used to show the +// speaker notes to all viewers, on top of the presentation +.reveal .speaker-notes { + display: none; + position: absolute; + width: $notesWidthPercent / (1-$notesWidthPercent/100) * 1%; + height: 100%; + top: 0; + left: 100%; + padding: 14px 18px 14px 18px; + z-index: 1; + font-size: 18px; + line-height: 1.4; + border: 1px solid rgba( 0, 0, 0, 0.05 ); + color: #222; + background-color: #f5f5f5; + overflow: auto; + box-sizing: border-box; + text-align: left; + font-family: Helvetica, sans-serif; + -webkit-overflow-scrolling: touch; + + .notes-placeholder { + color: #ccc; + font-style: italic; + } + + &:focus { + outline: none; + } + + &:before { + content: 'Speaker notes'; + display: block; + margin-bottom: 10px; + opacity: 0.5; + } +} + + +.reveal.show-notes { + max-width: 100% - $notesWidthPercent; + overflow: visible; +} + +.reveal.show-notes .speaker-notes { + display: block; +} + +@media screen and (min-width: 1600px) { + .reveal .speaker-notes { + font-size: 20px; + } +} + +@media screen and (max-width: 1024px) { + .reveal.show-notes { + border-left: 0; + max-width: none; + max-height: 70%; + max-height: 70vh; + overflow: visible; + } + + .reveal.show-notes .speaker-notes { + top: 100%; + left: 0; + width: 100%; + height: (30/0.7)*1%; + height: 30vh; + border: 0; + } +} + +@media screen and (max-width: 600px) { + .reveal.show-notes { + max-height: 60%; + max-height: 60vh; + } + + .reveal.show-notes .speaker-notes { + top: 100%; + height: (40/0.6)*1%; + height: 40vh; + } + + .reveal .speaker-notes { + font-size: 14px; + } +} + + +/********************************************* + * ZOOM PLUGIN + *********************************************/ + +.zoomed .reveal *, +.zoomed .reveal *:before, +.zoomed .reveal *:after { + backface-visibility: visible !important; +} + +.zoomed .reveal .progress, +.zoomed .reveal .controls { + opacity: 0; +} + +.zoomed .reveal .roll span { + background: none; +} + +.zoomed .reveal .roll span:after { + visibility: hidden; +} diff --git a/Pepiniere/docker/revealjs/css/theme/README.md b/Pepiniere/docker/revealjs/css/theme/README.md new file mode 100644 index 0000000..8ae164b --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/README.md @@ -0,0 +1,21 @@ +## Dependencies + +Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceeding: https://github.com/hakimel/reveal.js#full-setup + +## Creating a Theme + +To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js)) when you run `npm run build -- css-themes`. + +Each theme file does four things in the following order: + +1. **Include [/css/theme/template/mixins.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/mixins.scss)** +Shared utility functions. + +2. **Include [/css/theme/template/settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss)** +Declares a set of custom variables that the template file (step 4) expects. Can be overridden in step 3. + +3. **Override** +This is where you override the default theme. Either by specifying variables (see [settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss) for reference) or by adding any selectors and styles you please. + +4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)** +The template theme file which will generate final CSS output based on the currently defined variables. diff --git a/Pepiniere/docker/revealjs/css/theme/beige.css b/Pepiniere/docker/revealjs/css/theme/beige.css new file mode 100644 index 0000000..615dd6d --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/beige.css @@ -0,0 +1,277 @@ +/** + * Beige theme for reveal.js. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #f7f2d3; + background: -moz-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); + background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, white), color-stop(100%, #f7f2d3)); + background: -webkit-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); + background: -o-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); + background: -ms-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); + background: radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); + background-color: #f7f3de; } + +.reveal { + font-family: "Lato", sans-serif; + font-size: 40px; + font-weight: normal; + color: #333; } + +::selection { + color: #fff; + background: rgba(79, 64, 28, 0.99); + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: rgba(79, 64, 28, 0.99); + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #333; + font-family: "League Gothic", Impact, sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #8b743d; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #c0a86e; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #564826; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #333; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #8b743d; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #8b743d; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #8b743d; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #f7f3de; } } diff --git a/Pepiniere/docker/revealjs/css/theme/black.css b/Pepiniere/docker/revealjs/css/theme/black.css new file mode 100644 index 0000000..7dd88c2 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/black.css @@ -0,0 +1,273 @@ +/** + * Black theme for reveal.js. This is the opposite of the 'white' theme. + * + * By Hakim El Hattab, http://hakim.se + */ +@import url(../../lib/font/source-sans-pro/source-sans-pro.css); +section.has-light-background, section.has-light-background h1, section.has-light-background h2, section.has-light-background h3, section.has-light-background h4, section.has-light-background h5, section.has-light-background h6 { + color: #222; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #191919; + background-color: #191919; } + +.reveal { + font-family: "Source Sans Pro", Helvetica, sans-serif; + font-size: 42px; + font-weight: normal; + color: #fff; } + +::selection { + color: #fff; + background: #bee4fd; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #bee4fd; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #fff; + font-family: "Source Sans Pro", Helvetica, sans-serif; + font-weight: 600; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 2.5em; } + +.reveal h2 { + font-size: 1.6em; } + +.reveal h3 { + font-size: 1.3em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #42affa; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #8dcffc; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #068de9; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #42affa; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #42affa; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #42affa; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #191919; } } diff --git a/Pepiniere/docker/revealjs/css/theme/blood.css b/Pepiniere/docker/revealjs/css/theme/blood.css new file mode 100644 index 0000000..5cbd488 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/blood.css @@ -0,0 +1,296 @@ +/** + * Blood theme for reveal.js + * Author: Walther http://github.com/Walther + * + * Designed to be used with highlight.js theme + * "monokai_sublime.css" available from + * https://github.com/isagalaev/highlight.js/ + * + * For other themes, change $codeBackground accordingly. + * + */ +@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic); +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #222; + background-color: #222; } + +.reveal { + font-family: Ubuntu, "sans-serif"; + font-size: 40px; + font-weight: normal; + color: #eee; } + +::selection { + color: #fff; + background: #a23; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #a23; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #eee; + font-family: Ubuntu, "sans-serif"; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: 2px 2px 2px #222; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #a23; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #dd5566; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #6a1520; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #eee; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #a23; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #a23; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #a23; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #222; } } + +.reveal p { + font-weight: 300; + text-shadow: 1px 1px #222; } + +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + font-weight: 700; } + +.reveal p code { + background-color: #23241f; + display: inline-block; + border-radius: 7px; } + +.reveal small code { + vertical-align: baseline; } diff --git a/Pepiniere/docker/revealjs/css/theme/league.css b/Pepiniere/docker/revealjs/css/theme/league.css new file mode 100644 index 0000000..f8fba4d --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/league.css @@ -0,0 +1,279 @@ +/** + * League theme for reveal.js. + * + * This was the default theme pre-3.0.0. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #1c1e20; + background: -moz-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); + background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #555a5f), color-stop(100%, #1c1e20)); + background: -webkit-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); + background: -o-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); + background: -ms-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); + background: radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); + background-color: #2b2b2b; } + +.reveal { + font-family: "Lato", sans-serif; + font-size: 40px; + font-weight: normal; + color: #eee; } + +::selection { + color: #fff; + background: #FF5E99; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #FF5E99; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #eee; + font-family: "League Gothic", Impact, sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #13DAEC; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #71e9f4; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #0d99a5; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #eee; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #13DAEC; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #13DAEC; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #13DAEC; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #2b2b2b; } } diff --git a/Pepiniere/docker/revealjs/css/theme/moon.css b/Pepiniere/docker/revealjs/css/theme/moon.css new file mode 100644 index 0000000..d18f526 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/moon.css @@ -0,0 +1,277 @@ +/** + * Solarized Dark theme for reveal.js. + * Author: Achim Staebler + */ +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); +/** + * Solarized colors by Ethan Schoonover + */ +html * { + color-profile: sRGB; + rendering-intent: auto; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #002b36; + background-color: #002b36; } + +.reveal { + font-family: "Lato", sans-serif; + font-size: 40px; + font-weight: normal; + color: #93a1a1; } + +::selection { + color: #fff; + background: #d33682; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #d33682; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #eee8d5; + font-family: "League Gothic", Impact, sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #268bd2; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #78b9e6; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #1a6091; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #93a1a1; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #268bd2; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #268bd2; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #268bd2; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #002b36; } } diff --git a/Pepiniere/docker/revealjs/css/theme/night.css b/Pepiniere/docker/revealjs/css/theme/night.css new file mode 100644 index 0000000..f5ccb52 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/night.css @@ -0,0 +1,271 @@ +/** + * Black theme for reveal.js. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ +@import url(https://fonts.googleapis.com/css?family=Montserrat:700); +@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #111; + background-color: #111; } + +.reveal { + font-family: "Open Sans", sans-serif; + font-size: 40px; + font-weight: normal; + color: #eee; } + +::selection { + color: #fff; + background: #e7ad52; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #e7ad52; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #eee; + font-family: "Montserrat", Impact, sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: -0.03em; + text-transform: none; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #e7ad52; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #f3d7ac; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #d08a1d; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #eee; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #e7ad52; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #e7ad52; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #e7ad52; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #111; } } diff --git a/Pepiniere/docker/revealjs/css/theme/serif.css b/Pepiniere/docker/revealjs/css/theme/serif.css new file mode 100644 index 0000000..6514a6f --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/serif.css @@ -0,0 +1,273 @@ +/** + * A simple theme for reveal.js presentations, similar + * to the default theme. The accent color is brown. + * + * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. + */ +.reveal a { + line-height: 1.3em; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #F0F1EB; + background-color: #F0F1EB; } + +.reveal { + font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; + font-size: 40px; + font-weight: normal; + color: #000; } + +::selection { + color: #fff; + background: #26351C; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #26351C; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #383D3D; + font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: none; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #51483D; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #8b7c69; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #25211c; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #000; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #51483D; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #51483D; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #51483D; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #F0F1EB; } } diff --git a/Pepiniere/docker/revealjs/css/theme/sii.css b/Pepiniere/docker/revealjs/css/theme/sii.css new file mode 100644 index 0000000..034688e --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/sii.css @@ -0,0 +1,398 @@ +/** + * SII theme for reveal.js. This theme is based on official White theme. + * + */ +@import url(../../lib/font/source-sans-pro/source-sans-pro.css); +section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 { + color: #fff; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ + +.align-left p{ + text-align: left; +} + +.min-code code { + font-size: 18px; + line-height: 1; +} + + +.min-code-14 code { + font-size: 14px; + line-height: 1; +} + +html { + background-color: #fff; /* fix dark background on full screen mode */ } + +body { + background: #fff; + background-color: #fff; + background-image: url('../../images/header-sii.png'); /* SII header with 5 colors */ + background-size: contain; + background-repeat: no-repeat; } + +.reveal { + font-family: "Source Sans Pro", Helvetica, sans-serif; + font-size: 36px; + font-weight: normal; + color: #222; } + +::selection { + color: #fff; + background: #98bdef; + text-shadow: none; } + +.reveal .slides > section, +.reveal .slides > section > section { + line-height: 1.3; + font-weight: inherit; } + +.reveal .controls { + margin-bottom: 2rem; + color: #88b4dc; +} + +.reveal .slide-number a { + text-decoration: none; +} + + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #222; + font-family: "Source Sans Pro", Helvetica, sans-serif; + font-weight: 600; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 2.5em; } + +.reveal h2 { + font-size: 1.6em; } + +.reveal h3 { + font-size: 1.3em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + /*color: #559BDB; */ + text-decoration: underline;} + +.reveal pre em { + text-decoration: none; +} + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: square; } + +.reveal ul ul { + list-style-type: disc; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal q, +.reveal blockquote { + quotes: none; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal li pre, +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); + width: 100%; + font-size: 1.5rem; + background-color: #3f3f3f; /* default background color for code sections */ + color: #dddddd; /* default color for code sections */ +} + +.hljs { + background-color: #3f3f3f !important; /* force background color for code sections */ +} + +.language-yaml .hljs-number { + color: #a6e22e; /* color the number in green in yaml code */ +} + +.reveal code { + font-family: monospace; + font-size: 1.7rem; +} + +.reveal pre code { + font-family: monospace; +} + +.reveal li pre code { + border-radius: 4px; + line-height: 1.1em; +} + +.reveal li pre code, +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal sup { + vertical-align: super; } + +.reveal sub { + vertical-align: sub; } + +.reveal small { + font-size: 0.6em; + line-height: 1.2em; } + +.reveal p small code { + font-size: 1em; } + + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #6ca0e8; + text-decoration: underline; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #2a76dd; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #1a53a1; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; +} + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #2a76dd; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * Custom size for code + *********************************************/ +.reveal ul code, +.reveal p code , +.reveal td code { + padding: 0.1rem 0.4rem; + background-color: #fbe5e1; + color: #c0341d; + border-radius: 4px; +/* font-size: 1.9rem;*/ +} + +.medium-code pre code { + font-size: 1.4rem; + line-height: 1.7rem; +} + +.small-code pre code { + font-size: 1.1rem; + line-height: 1.5rem; +} + +.reveal pre { + width: 100%; +} + +.reveal td code { + padding: 0 0.5rem; +} + +/********************************************* + * Custom size for tables + *********************************************/ +.medium-table table { + font-size: 2rem; } + +.medium-table td code { + font-size: 1.6rem; } + +.small-table table { + font-size: 1.4rem; } + +.small-table td code { + font-size: 1.2rem; } + +/********************************************* + * Custom size for code + *********************************************/ +.medium-code pre { + line-height: 1.1em; + font-size: 1.2rem; } + +.small-code pre { + line-height: 1.0em; + font-size: 1rem; } + +/********************************************* + * Logo and footer + *********************************************/ +.logo { + position: absolute; + top: 2.5rem; + right: 1rem; + width: 10%; +} + +.footer { + position: absolute; + bottom: 0.2rem; + left: 0; + margin: 0.2rem; + padding: 0.2rem; + font-size: 0.8rem; + color: #fff; + background-color: #999999; +} + +.nologo-slide .logo { + display:none; } + + /********************************************* + * Display ordered list in cheat-sheet style + *********************************************/ +.cheat-sheet ol { + width: 100%; + list-style-type: disc; + list-style: none; +} diff --git a/Pepiniere/docker/revealjs/css/theme/simple.css b/Pepiniere/docker/revealjs/css/theme/simple.css new file mode 100644 index 0000000..a7a29a6 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/simple.css @@ -0,0 +1,276 @@ +/** + * A simple theme for reveal.js presentations, similar + * to the default theme. The accent color is darkblue. + * + * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. + * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ +@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); +section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 { + color: #fff; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #fff; + background-color: #fff; } + +.reveal { + font-family: "Lato", sans-serif; + font-size: 40px; + font-weight: normal; + color: #000; } + +::selection { + color: #fff; + background: rgba(0, 0, 0, 0.99); + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: rgba(0, 0, 0, 0.99); + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #000; + font-family: "News Cycle", Impact, sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: none; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #00008B; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #0000f1; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #00003f; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #000; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #00008B; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #00008B; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #00008B; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #fff; } } diff --git a/Pepiniere/docker/revealjs/css/theme/sky.css b/Pepiniere/docker/revealjs/css/theme/sky.css new file mode 100644 index 0000000..d8734c9 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/sky.css @@ -0,0 +1,280 @@ +/** + * Sky theme for reveal.js. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ +@import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); +@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); +.reveal a { + line-height: 1.3em; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #add9e4; + background: -moz-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); + background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #f7fbfc), color-stop(100%, #add9e4)); + background: -webkit-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); + background: -o-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); + background: -ms-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); + background: radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); + background-color: #f7fbfc; } + +.reveal { + font-family: "Open Sans", sans-serif; + font-size: 40px; + font-weight: normal; + color: #333; } + +::selection { + color: #fff; + background: #134674; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #134674; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #333; + font-family: "Quicksand", sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: -0.08em; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #3b759e; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #74a7cb; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #264c66; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #333; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #3b759e; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #3b759e; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #3b759e; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #f7fbfc; } } diff --git a/Pepiniere/docker/revealjs/css/theme/solarized.css b/Pepiniere/docker/revealjs/css/theme/solarized.css new file mode 100644 index 0000000..f1a2b9e --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/solarized.css @@ -0,0 +1,277 @@ +/** + * Solarized Light theme for reveal.js. + * Author: Achim Staebler + */ +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); +/** + * Solarized colors by Ethan Schoonover + */ +html * { + color-profile: sRGB; + rendering-intent: auto; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #fdf6e3; + background-color: #fdf6e3; } + +.reveal { + font-family: "Lato", sans-serif; + font-size: 40px; + font-weight: normal; + color: #657b83; } + +::selection { + color: #fff; + background: #d33682; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #d33682; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #586e75; + font-family: "League Gothic", Impact, sans-serif; + font-weight: normal; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 3.77em; } + +.reveal h2 { + font-size: 2.11em; } + +.reveal h3 { + font-size: 1.55em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #268bd2; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #78b9e6; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #1a6091; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #657b83; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #268bd2; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #268bd2; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #268bd2; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #fdf6e3; } } diff --git a/Pepiniere/docker/revealjs/css/theme/source/beige.scss b/Pepiniere/docker/revealjs/css/theme/source/beige.scss new file mode 100644 index 0000000..5564f53 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/beige.scss @@ -0,0 +1,39 @@ +/** + * Beige theme for reveal.js. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); + + +// Override theme settings (see ../template/settings.scss) +$mainColor: #333; +$headingColor: #333; +$headingTextShadow: none; +$backgroundColor: #f7f3de; +$linkColor: #8b743d; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: rgba(79, 64, 28, 0.99); +$heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); + +// Background generator +@mixin bodyBackground() { + @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) ); +} + + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/source/black.scss b/Pepiniere/docker/revealjs/css/theme/source/black.scss new file mode 100644 index 0000000..4720c8a --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/black.scss @@ -0,0 +1,49 @@ +/** + * Black theme for reveal.js. This is the opposite of the 'white' theme. + * + * By Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + +// Include theme-specific fonts +@import url(../../lib/font/source-sans-pro/source-sans-pro.css); + + +// Override theme settings (see ../template/settings.scss) +$backgroundColor: #191919; + +$mainColor: #fff; +$headingColor: #fff; + +$mainFontSize: 42px; +$mainFont: 'Source Sans Pro', Helvetica, sans-serif; +$headingFont: 'Source Sans Pro', Helvetica, sans-serif; +$headingTextShadow: none; +$headingLetterSpacing: normal; +$headingTextTransform: uppercase; +$headingFontWeight: 600; +$linkColor: #42affa; +$linkColorHover: lighten( $linkColor, 15% ); +$selectionBackgroundColor: lighten( $linkColor, 25% ); + +$heading1Size: 2.5em; +$heading2Size: 1.6em; +$heading3Size: 1.3em; +$heading4Size: 1.0em; + +section.has-light-background { + &, h1, h2, h3, h4, h5, h6 { + color: #222; + } +} + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/source/blood.scss b/Pepiniere/docker/revealjs/css/theme/source/blood.scss new file mode 100644 index 0000000..4533fc0 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/blood.scss @@ -0,0 +1,78 @@ +/** + * Blood theme for reveal.js + * Author: Walther http://github.com/Walther + * + * Designed to be used with highlight.js theme + * "monokai_sublime.css" available from + * https://github.com/isagalaev/highlight.js/ + * + * For other themes, change $codeBackground accordingly. + * + */ + + // Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + +// Include theme-specific fonts + +@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic); + +// Colors used in the theme +$blood: #a23; +$coal: #222; +$codeBackground: #23241f; + +$backgroundColor: $coal; + +// Main text +$mainFont: Ubuntu, 'sans-serif'; +$mainColor: #eee; + +// Headings +$headingFont: Ubuntu, 'sans-serif'; +$headingTextShadow: 2px 2px 2px $coal; + +// h1 shadow, borrowed humbly from +// (c) Default theme by Hakim El Hattab +$heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); + +// Links +$linkColor: $blood; +$linkColorHover: lighten( $linkColor, 20% ); + +// Text selection +$selectionBackgroundColor: $blood; +$selectionColor: #fff; + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- + +// some overrides after theme template import + +.reveal p { + font-weight: 300; + text-shadow: 1px 1px $coal; +} + +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + font-weight: 700; +} + +.reveal p code { + background-color: $codeBackground; + display: inline-block; + border-radius: 7px; +} + +.reveal small code { + vertical-align: baseline; +} \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/source/league.scss b/Pepiniere/docker/revealjs/css/theme/source/league.scss new file mode 100644 index 0000000..46ea04a --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/league.scss @@ -0,0 +1,34 @@ +/** + * League theme for reveal.js. + * + * This was the default theme pre-3.0.0. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); + +// Override theme settings (see ../template/settings.scss) +$headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2); +$heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); + +// Background generator +@mixin bodyBackground() { + @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) ); +} + + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/source/moon.scss b/Pepiniere/docker/revealjs/css/theme/source/moon.scss new file mode 100644 index 0000000..e47e5b5 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/moon.scss @@ -0,0 +1,57 @@ +/** + * Solarized Dark theme for reveal.js. + * Author: Achim Staebler + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); + +/** + * Solarized colors by Ethan Schoonover + */ +html * { + color-profile: sRGB; + rendering-intent: auto; +} + +// Solarized colors +$base03: #002b36; +$base02: #073642; +$base01: #586e75; +$base00: #657b83; +$base0: #839496; +$base1: #93a1a1; +$base2: #eee8d5; +$base3: #fdf6e3; +$yellow: #b58900; +$orange: #cb4b16; +$red: #dc322f; +$magenta: #d33682; +$violet: #6c71c4; +$blue: #268bd2; +$cyan: #2aa198; +$green: #859900; + +// Override theme settings (see ../template/settings.scss) +$mainColor: $base1; +$headingColor: $base2; +$headingTextShadow: none; +$backgroundColor: $base03; +$linkColor: $blue; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: $magenta; + + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- diff --git a/Pepiniere/docker/revealjs/css/theme/source/night.scss b/Pepiniere/docker/revealjs/css/theme/source/night.scss new file mode 100644 index 0000000..d49a282 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/night.scss @@ -0,0 +1,34 @@ +/** + * Black theme for reveal.js. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + +// Include theme-specific fonts +@import url(https://fonts.googleapis.com/css?family=Montserrat:700); +@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); + + +// Override theme settings (see ../template/settings.scss) +$backgroundColor: #111; + +$mainFont: 'Open Sans', sans-serif; +$linkColor: #e7ad52; +$linkColorHover: lighten( $linkColor, 20% ); +$headingFont: 'Montserrat', Impact, sans-serif; +$headingTextShadow: none; +$headingLetterSpacing: -0.03em; +$headingTextTransform: none; +$selectionBackgroundColor: #e7ad52; + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/source/serif.scss b/Pepiniere/docker/revealjs/css/theme/source/serif.scss new file mode 100644 index 0000000..ec3fcb3 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/serif.scss @@ -0,0 +1,35 @@ +/** + * A simple theme for reveal.js presentations, similar + * to the default theme. The accent color is brown. + * + * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Override theme settings (see ../template/settings.scss) +$mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; +$mainColor: #000; +$headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; +$headingColor: #383D3D; +$headingTextShadow: none; +$headingTextTransform: none; +$backgroundColor: #F0F1EB; +$linkColor: #51483D; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: #26351C; + +.reveal a { + line-height: 1.3em; +} + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- diff --git a/Pepiniere/docker/revealjs/css/theme/source/simple.scss b/Pepiniere/docker/revealjs/css/theme/source/simple.scss new file mode 100644 index 0000000..394c9cd --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/simple.scss @@ -0,0 +1,43 @@ +/** + * A simple theme for reveal.js presentations, similar + * to the default theme. The accent color is darkblue. + * + * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. + * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); + + +// Override theme settings (see ../template/settings.scss) +$mainFont: 'Lato', sans-serif; +$mainColor: #000; +$headingFont: 'News Cycle', Impact, sans-serif; +$headingColor: #000; +$headingTextShadow: none; +$headingTextTransform: none; +$backgroundColor: #fff; +$linkColor: #00008B; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: rgba(0, 0, 0, 0.99); + +section.has-dark-background { + &, h1, h2, h3, h4, h5, h6 { + color: #fff; + } +} + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/source/sky.scss b/Pepiniere/docker/revealjs/css/theme/source/sky.scss new file mode 100644 index 0000000..3fee67c --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/sky.scss @@ -0,0 +1,46 @@ +/** + * Sky theme for reveal.js. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); +@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); + + +// Override theme settings (see ../template/settings.scss) +$mainFont: 'Open Sans', sans-serif; +$mainColor: #333; +$headingFont: 'Quicksand', sans-serif; +$headingColor: #333; +$headingLetterSpacing: -0.08em; +$headingTextShadow: none; +$backgroundColor: #f7fbfc; +$linkColor: #3b759e; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: #134674; + +// Fix links so they are not cut off +.reveal a { + line-height: 1.3em; +} + +// Background generator +@mixin bodyBackground() { + @include radial-gradient( #add9e4, #f7fbfc ); +} + + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- diff --git a/Pepiniere/docker/revealjs/css/theme/source/solarized.scss b/Pepiniere/docker/revealjs/css/theme/source/solarized.scss new file mode 100644 index 0000000..912be56 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/solarized.scss @@ -0,0 +1,63 @@ +/** + * Solarized Light theme for reveal.js. + * Author: Achim Staebler + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(../../lib/font/league-gothic/league-gothic.css); +@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); + + +/** + * Solarized colors by Ethan Schoonover + */ +html * { + color-profile: sRGB; + rendering-intent: auto; +} + +// Solarized colors +$base03: #002b36; +$base02: #073642; +$base01: #586e75; +$base00: #657b83; +$base0: #839496; +$base1: #93a1a1; +$base2: #eee8d5; +$base3: #fdf6e3; +$yellow: #b58900; +$orange: #cb4b16; +$red: #dc322f; +$magenta: #d33682; +$violet: #6c71c4; +$blue: #268bd2; +$cyan: #2aa198; +$green: #859900; + +// Override theme settings (see ../template/settings.scss) +$mainColor: $base00; +$headingColor: $base01; +$headingTextShadow: none; +$backgroundColor: $base3; +$linkColor: $blue; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: $magenta; + +// Background generator +// @mixin bodyBackground() { +// @include radial-gradient( rgba($base3,1), rgba(lighten($base3, 20%),1) ); +// } + + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- diff --git a/Pepiniere/docker/revealjs/css/theme/source/white.scss b/Pepiniere/docker/revealjs/css/theme/source/white.scss new file mode 100644 index 0000000..7f06ffd --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/source/white.scss @@ -0,0 +1,49 @@ +/** + * White theme for reveal.js. This is the opposite of the 'black' theme. + * + * By Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + +// Include theme-specific fonts +@import url(../../lib/font/source-sans-pro/source-sans-pro.css); + + +// Override theme settings (see ../template/settings.scss) +$backgroundColor: #fff; + +$mainColor: #222; +$headingColor: #222; + +$mainFontSize: 42px; +$mainFont: 'Source Sans Pro', Helvetica, sans-serif; +$headingFont: 'Source Sans Pro', Helvetica, sans-serif; +$headingTextShadow: none; +$headingLetterSpacing: normal; +$headingTextTransform: uppercase; +$headingFontWeight: 600; +$linkColor: #2a76dd; +$linkColorHover: lighten( $linkColor, 15% ); +$selectionBackgroundColor: lighten( $linkColor, 25% ); + +$heading1Size: 2.5em; +$heading2Size: 1.6em; +$heading3Size: 1.3em; +$heading4Size: 1.0em; + +section.has-dark-background { + &, h1, h2, h3, h4, h5, h6 { + color: #fff; + } +} + + +// Theme template ------------------------------ +@import "../template/theme"; +// --------------------------------------------- \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/template/mixins.scss b/Pepiniere/docker/revealjs/css/theme/template/mixins.scss new file mode 100644 index 0000000..e0c5606 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/template/mixins.scss @@ -0,0 +1,29 @@ +@mixin vertical-gradient( $top, $bottom ) { + background: $top; + background: -moz-linear-gradient( top, $top 0%, $bottom 100% ); + background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) ); + background: -webkit-linear-gradient( top, $top 0%, $bottom 100% ); + background: -o-linear-gradient( top, $top 0%, $bottom 100% ); + background: -ms-linear-gradient( top, $top 0%, $bottom 100% ); + background: linear-gradient( top, $top 0%, $bottom 100% ); +} + +@mixin horizontal-gradient( $top, $bottom ) { + background: $top; + background: -moz-linear-gradient( left, $top 0%, $bottom 100% ); + background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) ); + background: -webkit-linear-gradient( left, $top 0%, $bottom 100% ); + background: -o-linear-gradient( left, $top 0%, $bottom 100% ); + background: -ms-linear-gradient( left, $top 0%, $bottom 100% ); + background: linear-gradient( left, $top 0%, $bottom 100% ); +} + +@mixin radial-gradient( $outer, $inner, $type: circle ) { + background: $outer; + background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); + background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) ); + background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); + background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); + background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); + background: radial-gradient( center, $type cover, $inner 0%, $outer 100% ); +} \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/css/theme/template/settings.scss b/Pepiniere/docker/revealjs/css/theme/template/settings.scss new file mode 100644 index 0000000..5a917f8 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/template/settings.scss @@ -0,0 +1,45 @@ +// Base settings for all themes that can optionally be +// overridden by the super-theme + +// Background of the presentation +$backgroundColor: #2b2b2b; + +// Primary/body text +$mainFont: 'Lato', sans-serif; +$mainFontSize: 40px; +$mainColor: #eee; + +// Vertical spacing between blocks of text +$blockMargin: 20px; + +// Headings +$headingMargin: 0 0 $blockMargin 0; +$headingFont: 'League Gothic', Impact, sans-serif; +$headingColor: #eee; +$headingLineHeight: 1.2; +$headingLetterSpacing: normal; +$headingTextTransform: uppercase; +$headingTextShadow: none; +$headingFontWeight: normal; +$heading1TextShadow: $headingTextShadow; + +$heading1Size: 3.77em; +$heading2Size: 2.11em; +$heading3Size: 1.55em; +$heading4Size: 1.00em; + +$codeFont: monospace; + +// Links and actions +$linkColor: #13DAEC; +$linkColorHover: lighten( $linkColor, 20% ); + +// Text selection +$selectionBackgroundColor: #FF5E99; +$selectionColor: #fff; + +// Generates the presentation background, can be overridden +// to return a background image or gradient +@mixin bodyBackground() { + background: $backgroundColor; +} diff --git a/Pepiniere/docker/revealjs/css/theme/template/theme.scss b/Pepiniere/docker/revealjs/css/theme/template/theme.scss new file mode 100644 index 0000000..9ccfaf5 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/template/theme.scss @@ -0,0 +1,325 @@ +// Base theme template for reveal.js + +/********************************************* + * GLOBAL STYLES + *********************************************/ + +body { + @include bodyBackground(); + background-color: $backgroundColor; +} + +.reveal { + font-family: $mainFont; + font-size: $mainFontSize; + font-weight: normal; + color: $mainColor; +} + +::selection { + color: $selectionColor; + background: $selectionBackgroundColor; + text-shadow: none; +} + +::-moz-selection { + color: $selectionColor; + background: $selectionBackgroundColor; + text-shadow: none; +} + +.reveal .slides section, +.reveal .slides section>section { + line-height: 1.3; + font-weight: inherit; +} + +/********************************************* + * HEADERS + *********************************************/ + +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: $headingMargin; + color: $headingColor; + + font-family: $headingFont; + font-weight: $headingFontWeight; + line-height: $headingLineHeight; + letter-spacing: $headingLetterSpacing; + + text-transform: $headingTextTransform; + text-shadow: $headingTextShadow; + + word-wrap: break-word; +} + +.reveal h1 {font-size: $heading1Size; } +.reveal h2 {font-size: $heading2Size; } +.reveal h3 {font-size: $heading3Size; } +.reveal h4 {font-size: $heading4Size; } + +.reveal h1 { + text-shadow: $heading1TextShadow; +} + + +/********************************************* + * OTHER + *********************************************/ + +.reveal p { + margin: $blockMargin 0; + line-height: 1.3; +} + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; +} +.reveal strong, +.reveal b { + font-weight: bold; +} + +.reveal em { + font-style: italic; +} + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + + text-align: left; + margin: 0 0 0 1em; +} + +.reveal ol { + list-style-type: decimal; +} + +.reveal ul { + list-style-type: disc; +} + +.reveal ul ul { + list-style-type: square; +} + +.reveal ul ul ul { + list-style-type: circle; +} + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; +} + +.reveal dt { + font-weight: bold; +} + +.reveal dd { + margin-left: 40px; +} + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: $blockMargin auto; + padding: 5px; + + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0,0,0,0.2); +} + .reveal blockquote p:first-child, + .reveal blockquote p:last-child { + display: inline-block; + } + +.reveal q { + font-style: italic; +} + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: $blockMargin auto; + + text-align: left; + font-size: 0.55em; + font-family: $codeFont; + line-height: 1.2em; + + word-wrap: break-word; + + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); +} + +.reveal code { + font-family: $codeFont; + text-transform: none; +} + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; +} + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; +} + +.reveal table th { + font-weight: bold; +} + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; +} + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; +} + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; +} + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; +} + +.reveal sup { + vertical-align: super; + font-size: smaller; +} +.reveal sub { + vertical-align: sub; + font-size: smaller; +} + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; +} + +.reveal small * { + vertical-align: top; +} + + +/********************************************* + * LINKS + *********************************************/ + +.reveal a { + color: $linkColor; + text-decoration: none; + + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; +} + .reveal a:hover { + color: $linkColorHover; + + text-shadow: none; + border: none; + } + +.reveal .roll span:after { + color: #fff; + background: darken( $linkColor, 15% ); +} + + +/********************************************* + * IMAGES + *********************************************/ + +.reveal section img { + margin: 15px 0px; + background: rgba(255,255,255,0.12); + border: 4px solid $mainColor; + + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); +} + + .reveal section img.plain { + border: 0; + box-shadow: none; + } + + .reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; + } + + .reveal a:hover img { + background: rgba(255,255,255,0.2); + border-color: $linkColor; + + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); + } + + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ + +.reveal .controls { + color: $linkColor; +} + + +/********************************************* + * PROGRESS BAR + *********************************************/ + +.reveal .progress { + background: rgba(0,0,0,0.2); + color: $linkColor; +} + .reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + -moz-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ + @media print { + .backgrounds { + background-color: $backgroundColor; + } +} diff --git a/Pepiniere/docker/revealjs/css/theme/white.css b/Pepiniere/docker/revealjs/css/theme/white.css new file mode 100644 index 0000000..43ef2c7 --- /dev/null +++ b/Pepiniere/docker/revealjs/css/theme/white.css @@ -0,0 +1,273 @@ +/** + * White theme for reveal.js. This is the opposite of the 'black' theme. + * + * By Hakim El Hattab, http://hakim.se + */ +@import url(../../lib/font/source-sans-pro/source-sans-pro.css); +section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 { + color: #fff; } + +/********************************************* + * GLOBAL STYLES + *********************************************/ +body { + background: #fff; + background-color: #fff; } + +.reveal { + font-family: "Source Sans Pro", Helvetica, sans-serif; + font-size: 42px; + font-weight: normal; + color: #222; } + +::selection { + color: #fff; + background: #98bdef; + text-shadow: none; } + +::-moz-selection { + color: #fff; + background: #98bdef; + text-shadow: none; } + +.reveal .slides section, +.reveal .slides section > section { + line-height: 1.3; + font-weight: inherit; } + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #222; + font-family: "Source Sans Pro", Helvetica, sans-serif; + font-weight: 600; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; } + +.reveal h1 { + font-size: 2.5em; } + +.reveal h2 { + font-size: 1.6em; } + +.reveal h3 { + font-size: 1.3em; } + +.reveal h4 { + font-size: 1em; } + +.reveal h1 { + text-shadow: none; } + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; } + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; } + +.reveal strong, +.reveal b { + font-weight: bold; } + +.reveal em { + font-style: italic; } + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } + +.reveal ol { + list-style-type: decimal; } + +.reveal ul { + list-style-type: disc; } + +.reveal ul ul { + list-style-type: square; } + +.reveal ul ul ul { + list-style-type: circle; } + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; } + +.reveal dt { + font-weight: bold; } + +.reveal dd { + margin-left: 40px; } + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; } + +.reveal q { + font-style: italic; } + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); } + +.reveal code { + font-family: monospace; + text-transform: none; } + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; } + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; } + +.reveal table th { + font-weight: bold; } + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; } + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; } + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; } + +.reveal sup { + vertical-align: super; + font-size: smaller; } + +.reveal sub { + vertical-align: sub; + font-size: smaller; } + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } + +.reveal small * { + vertical-align: top; } + +/********************************************* + * LINKS + *********************************************/ +.reveal a { + color: #2a76dd; + text-decoration: none; + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + transition: color .15s ease; } + +.reveal a:hover { + color: #6ca0e8; + text-shadow: none; + border: none; } + +.reveal .roll span:after { + color: #fff; + background: #1a53a1; } + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #222; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } + +.reveal section img.plain { + border: 0; + box-shadow: none; } + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; } + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #2a76dd; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ +.reveal .controls { + color: #2a76dd; } + +/********************************************* + * PROGRESS BAR + *********************************************/ +.reveal .progress { + background: rgba(0, 0, 0, 0.2); + color: #2a76dd; } + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + +/********************************************* + * PRINT BACKGROUND + *********************************************/ +@media print { + .backgrounds { + background-color: #fff; } } diff --git a/Pepiniere/docker/revealjs/demo.html b/Pepiniere/docker/revealjs/demo.html new file mode 100644 index 0000000..6743d27 --- /dev/null +++ b/Pepiniere/docker/revealjs/demo.html @@ -0,0 +1,425 @@ + + + + + + + reveal.js – The HTML Presentation Framework + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +

    Reveal.js

    +

    The HTML Presentation Framework

    +

    + Created by Hakim El Hattab and contributors +

    +
    + +
    +

    Hello There

    +

    + reveal.js enables you to create beautiful interactive slide decks using HTML. This presentation will show you examples of what it can do. +

    +
    + + +
    +
    +

    Vertical Slides

    +

    Slides can be nested inside of each other.

    +

    Use the Space key to navigate through all slides.

    +
    + + Down arrow + +
    +
    +

    Basement Level 1

    +

    Nested slides are useful for adding additional detail underneath a high level horizontal slide.

    +
    +
    +

    Basement Level 2

    +

    That's it, time to go back up.

    +
    + + Up arrow + +
    +
    + +
    +

    Slides

    +

    + Not a coder? Not a problem. There's a fully-featured visual editor for authoring these, try it out at https://slides.com. +

    +
    + +
    +

    Point of View

    +

    + Press ESC to enter the slide overview. +

    +

    + Hold down the alt key (ctrl in Linux) and click on any element to zoom towards it using zoom.js. Click again to zoom back out. +

    +

    + (NOTE: Use ctrl + click in Linux.) +

    +
    + +
    +

    Touch Optimized

    +

    + Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides. +

    +
    + +
    + +
    + +
    +
    +

    Fragments

    +

    Hit the next arrow...

    +

    ... to step through ...

    +

    ... a fragmented slide.

    + + +
    +
    +

    Fragment Styles

    +

    There's different types of fragments, like:

    +

    grow

    +

    shrink

    +

    fade-out

    +

    + fade-right, + up, + down, + left +

    +

    fade-in-then-out

    +

    fade-in-then-semi-out

    +

    Highlight red blue green

    +
    +
    + +
    +

    Transition Styles

    +

    + You can select from different transitions, like:
    + None - + Fade - + Slide - + Convex - + Concave - + Zoom +

    +
    + +
    +

    Themes

    +

    + reveal.js comes with a few themes built in:
    + + Black (default) - + White - + League - + Sky - + Beige - + Simple
    + Serif - + Blood - + Night - + Moon - + Solarized +

    +
    + +
    +
    +

    Slide Backgrounds

    +

    + Set data-background="#dddddd" on a slide to change the background color. All CSS color formats are supported. +

    + + Down arrow + +
    +
    +

    Image Backgrounds

    +
    <section data-background="image.png">
    +
    +
    +

    Tiled Backgrounds

    +
    <section data-background="image.png" data-background-repeat="repeat" data-background-size="100px">
    +
    +
    +
    +

    Video Backgrounds

    +
    <section data-background-video="video.mp4,video.webm">
    +
    +
    +
    +

    ... and GIFs!

    +
    +
    + +
    +

    Background Transitions

    +

    + Different background transitions are available via the backgroundTransition option. This one's called "zoom". +

    +
    Reveal.configure({ backgroundTransition: 'zoom' })
    +
    + +
    +

    Background Transitions

    +

    + You can override background transitions per-slide. +

    +
    <section data-background-transition="zoom">
    +
    + +
    +
    +

    Iframe Backgrounds

    +

    Since reveal.js runs on the web, you can easily embed other web content. Try interacting with the page in the background.

    +
    +
    + +
    +

    Pretty Code

    +
    
    +import React, { useState } from 'react';
    +
    +function Example() {
    +  const [count, setCount] = useState(0);
    +
    +  return (
    +    <div>
    +      <p>You clicked {count} times</p>
    +      <button onClick={() => setCount(count + 1)}>
    +        Click me
    +      </button>
    +    </div>
    +  );
    +}
    +					
    +

    Code syntax highlighting courtesy of highlight.js.

    +
    + +
    +

    Marvelous List

    +
      +
    • No order here
    • +
    • Or here
    • +
    • Or here
    • +
    • Or here
    • +
    +
    + +
    +

    Fantastic Ordered List

    +
      +
    1. One is smaller than...
    2. +
    3. Two is smaller than...
    4. +
    5. Three!
    6. +
    +
    + +
    +

    Tabular Tables

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    ItemValueQuantity
    Apples$17
    Lemonade$218
    Bread$32
    +
    + +
    +

    Clever Quotes

    +

    + These guys come in two forms, inline: The nice thing about standards is that there are so many to choose from and block: +

    +
    + “For years there has been a theory that millions of monkeys typing at random on millions of typewriters would + reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.” +
    +
    + +
    +

    Intergalactic Interconnections

    +

    + You can link between slides internally, + like this. +

    +
    + +
    +

    Speaker View

    +

    There's a speaker view. It includes a timer, preview of the upcoming slide as well as your speaker notes.

    +

    Press the S key to try it out.

    + + +
    + +
    +

    Export to PDF

    +

    Presentations can be exported to PDF, here's an example:

    + +
    + +
    +

    Global State

    +

    + Set data-state="something" on a slide and "something" + will be added as a class to the document element when the slide is open. This lets you + apply broader style changes, like switching the page background. +

    +
    + +
    +

    State Events

    +

    + Additionally custom events can be triggered on a per slide basis by binding to the data-state name. +

    +
    
    +Reveal.addEventListener( 'customevent', function() {
    +	console.log( '"customevent" has fired' );
    +} );
    +					
    +
    + +
    +

    Take a Moment

    +

    + Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen. +

    +
    + +
    +

    Much more

    + +
    + +
    +

    THE END

    +

    + - Try the online editor
    + - Source code & documentation +

    +
    + +
    + +
    + + + + + + + diff --git a/Pepiniere/docker/revealjs/gruntfile.js b/Pepiniere/docker/revealjs/gruntfile.js new file mode 100644 index 0000000..edebddd --- /dev/null +++ b/Pepiniere/docker/revealjs/gruntfile.js @@ -0,0 +1,192 @@ +const sass = require('node-sass'); + +module.exports = grunt => { + + require('load-grunt-tasks')(grunt); + + let port = grunt.option('port') || 8000; + let root = grunt.option('root') || '.'; + + if (!Array.isArray(root)) root = [root]; + + // Project configuration + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + meta: { + banner: + '/*!\n' + + ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + + ' * http://revealjs.com\n' + + ' * MIT licensed\n' + + ' *\n' + + ' * Copyright (C) 2019 Hakim El Hattab, http://hakim.se\n' + + ' */' + }, + + qunit: { + files: [ 'test/*.html' ] + }, + + uglify: { + options: { + banner: '<%= meta.banner %>\n', + ie8: true + }, + build: { + src: 'js/reveal.js', + dest: 'js/reveal.min.js' + } + }, + + sass: { + options: { + implementation: sass, + sourceMap: false + }, + core: { + src: 'css/reveal.scss', + dest: 'css/reveal.css' + }, + themes: { + expand: true, + cwd: 'css/theme/source', + src: ['*.sass', '*.scss'], + dest: 'css/theme', + ext: '.css' + } + }, + + autoprefixer: { + core: { + src: 'css/reveal.css' + } + }, + + cssmin: { + options: { + compatibility: 'ie9' + }, + compress: { + src: 'css/reveal.css', + dest: 'css/reveal.min.css' + } + }, + + jshint: { + options: { + curly: false, + eqeqeq: true, + immed: true, + esnext: true, + latedef: 'nofunc', + newcap: true, + noarg: true, + sub: true, + undef: true, + eqnull: true, + browser: true, + expr: true, + loopfunc: true, + globals: { + head: false, + module: false, + console: false, + unescape: false, + define: false, + exports: false, + require: false + } + }, + files: [ 'gruntfile.js', 'js/reveal.js' ] + }, + + connect: { + server: { + options: { + port: port, + base: root, + livereload: true, + open: true, + useAvailablePort: true + } + } + }, + + zip: { + bundle: { + src: [ + 'index.html', + 'css/**', + 'js/**', + 'lib/**', + 'images/**', + 'plugin/**', + '**.md' + ], + dest: 'reveal-js-presentation.zip' + } + }, + + watch: { + js: { + files: [ 'gruntfile.js', 'js/reveal.js' ], + tasks: 'js' + }, + theme: { + files: [ + 'css/theme/source/*.sass', + 'css/theme/source/*.scss', + 'css/theme/template/*.sass', + 'css/theme/template/*.scss' + ], + tasks: 'css-themes' + }, + css: { + files: [ 'css/reveal.scss' ], + tasks: 'css-core' + }, + test: { + files: [ 'test/*.html' ], + tasks: 'test' + }, + html: { + files: root.map(path => path + '/*.html') + }, + markdown: { + files: root.map(path => path + '/*.md') + }, + options: { + livereload: true + } + } + + }); + + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + + // Default task + grunt.registerTask( 'default', [ 'css', 'js' ] ); + + // JS task + grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); + + // Theme CSS + grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); + + // Core framework CSS + grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); + + // All CSS + grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); + + // Package presentation to archive + grunt.registerTask( 'package', [ 'default', 'zip' ] ); + + // Serve presentation locally + grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); + + // Run tests + grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); + +}; diff --git a/Pepiniere/docker/revealjs/images/favicon-logo-sii.png b/Pepiniere/docker/revealjs/images/favicon-logo-sii.png new file mode 100644 index 0000000..2365c7b Binary files /dev/null and b/Pepiniere/docker/revealjs/images/favicon-logo-sii.png differ diff --git a/Pepiniere/docker/revealjs/images/header-sii.png b/Pepiniere/docker/revealjs/images/header-sii.png new file mode 100644 index 0000000..1ed6ad3 Binary files /dev/null and b/Pepiniere/docker/revealjs/images/header-sii.png differ diff --git a/Pepiniere/docker/revealjs/images/logo-sii.svg b/Pepiniere/docker/revealjs/images/logo-sii.svg new file mode 100644 index 0000000..eee6478 --- /dev/null +++ b/Pepiniere/docker/revealjs/images/logo-sii.svg @@ -0,0 +1,83 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Pepiniere/docker/revealjs/index.html b/Pepiniere/docker/revealjs/index.html new file mode 100644 index 0000000..3af962d --- /dev/null +++ b/Pepiniere/docker/revealjs/index.html @@ -0,0 +1,91 @@ + + + + + + + Fonctionnalités supplémentaires + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + diff --git a/Pepiniere/docker/revealjs/js/reveal.js b/Pepiniere/docker/revealjs/js/reveal.js new file mode 100644 index 0000000..5c026db --- /dev/null +++ b/Pepiniere/docker/revealjs/js/reveal.js @@ -0,0 +1,6028 @@ +/*! + * reveal.js + * http://revealjs.com + * MIT licensed + * + * Copyright (C) 2019 Hakim El Hattab, http://hakim.se + */ +(function( root, factory ) { + if( typeof define === 'function' && define.amd ) { + // AMD. Register as an anonymous module. + define( function() { + root.Reveal = factory(); + return root.Reveal; + } ); + } else if( typeof exports === 'object' ) { + // Node. Does not work with strict CommonJS. + module.exports = factory(); + } else { + // Browser globals. + root.Reveal = factory(); + } +}( this, function() { + + 'use strict'; + + var Reveal; + + // The reveal.js version + var VERSION = '3.8.0'; + + var SLIDES_SELECTOR = '.slides section', + HORIZONTAL_SLIDES_SELECTOR = '.slides>section', + VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section', + HOME_SLIDE_SELECTOR = '.slides>section:first-of-type', + UA = navigator.userAgent, + + // Configuration defaults, can be overridden at initialization time + config = { + + // The "normal" size of the presentation, aspect ratio will be preserved + // when the presentation is scaled to fit different resolutions + width: 960, + height: 700, + + // Factor of the display size that should remain empty around the content + margin: 0.04, + + // Bounds for smallest/largest possible scale to apply to content + minScale: 0.2, + maxScale: 2.0, + + // Display presentation control arrows + controls: true, + + // Help the user learn the controls by providing hints, for example by + // bouncing the down arrow when they first encounter a vertical slide + controlsTutorial: true, + + // Determines where controls appear, "edges" or "bottom-right" + controlsLayout: 'bottom-right', + + // Visibility rule for backwards navigation arrows; "faded", "hidden" + // or "visible" + controlsBackArrows: 'faded', + + // Display a presentation progress bar + progress: true, + + // Display the page number of the current slide + // - true: Show slide number + // - false: Hide slide number + // + // Can optionally be set as a string that specifies the number formatting: + // - "h.v": Horizontal . vertical slide number (default) + // - "h/v": Horizontal / vertical slide number + // - "c": Flattened slide number + // - "c/t": Flattened slide number / total slides + // + // Alternatively, you can provide a function that returns the slide + // number for the current slide. The function needs to return an array + // with one string [slideNumber] or three strings [n1,delimiter,n2]. + // See #formatSlideNumber(). + slideNumber: false, + + // Can be used to limit the contexts in which the slide number appears + // - "all": Always show the slide number + // - "print": Only when printing to PDF + // - "speaker": Only in the speaker view + showSlideNumber: 'all', + + // Use 1 based indexing for # links to match slide number (default is zero + // based) + hashOneBasedIndex: false, + + // Add the current slide number to the URL hash so that reloading the + // page/copying the URL will return you to the same slide + hash: false, + + // Push each slide change to the browser history. Implies `hash: true` + history: false, + + // Enable keyboard shortcuts for navigation + keyboard: true, + + // Optional function that blocks keyboard events when retuning false + keyboardCondition: null, + + // Enable the slide overview mode + overview: true, + + // Disables the default reveal.js slide layout so that you can use + // custom CSS layout + disableLayout: false, + + // Vertical centering of slides + center: true, + + // Enables touch navigation on devices with touch input + touch: true, + + // Loop the presentation + loop: false, + + // Change the presentation direction to be RTL + rtl: false, + + // Changes the behavior of our navigation directions. + // + // "default" + // Left/right arrow keys step between horizontal slides, up/down + // arrow keys step between vertical slides. Space key steps through + // all slides (both horizontal and vertical). + // + // "linear" + // Removes the up/down arrows. Left/right arrows step through all + // slides (both horizontal and vertical). + // + // "grid" + // When this is enabled, stepping left/right from a vertical stack + // to an adjacent vertical stack will land you at the same vertical + // index. + // + // Consider a deck with six slides ordered in two vertical stacks: + // 1.1 2.1 + // 1.2 2.2 + // 1.3 2.3 + // + // If you're on slide 1.3 and navigate right, you will normally move + // from 1.3 -> 2.1. If "grid" is used, the same navigation takes you + // from 1.3 -> 2.3. + navigationMode: 'default', + + // Randomizes the order of slides each time the presentation loads + shuffle: false, + + // Turns fragments on and off globally + fragments: true, + + // Flags whether to include the current fragment in the URL, + // so that reloading brings you to the same fragment position + fragmentInURL: false, + + // Flags if the presentation is running in an embedded mode, + // i.e. contained within a limited portion of the screen + embedded: false, + + // Flags if we should show a help overlay when the question-mark + // key is pressed + help: true, + + // Flags if it should be possible to pause the presentation (blackout) + pause: true, + + // Flags if speaker notes should be visible to all viewers + showNotes: false, + + // Global override for autolaying embedded media (video/audio/iframe) + // - null: Media will only autoplay if data-autoplay is present + // - true: All media will autoplay, regardless of individual setting + // - false: No media will autoplay, regardless of individual setting + autoPlayMedia: null, + + // Global override for preloading lazy-loaded iframes + // - null: Iframes with data-src AND data-preload will be loaded when within + // the viewDistance, iframes with only data-src will be loaded when visible + // - true: All iframes with data-src will be loaded when within the viewDistance + // - false: All iframes with data-src will be loaded only when visible + preloadIframes: null, + + // Controls automatic progression to the next slide + // - 0: Auto-sliding only happens if the data-autoslide HTML attribute + // is present on the current slide or fragment + // - 1+: All slides will progress automatically at the given interval + // - false: No auto-sliding, even if data-autoslide is present + autoSlide: 0, + + // Stop auto-sliding after user input + autoSlideStoppable: true, + + // Use this method for navigation when auto-sliding (defaults to navigateNext) + autoSlideMethod: null, + + // Specify the average time in seconds that you think you will spend + // presenting each slide. This is used to show a pacing timer in the + // speaker view + defaultTiming: null, + + // Enable slide navigation via mouse wheel + mouseWheel: false, + + // Apply a 3D roll to links on hover + rollingLinks: false, + + // Hides the address bar on mobile devices + hideAddressBar: true, + + // Opens links in an iframe preview overlay + // Add `data-preview-link` and `data-preview-link="false"` to customise each link + // individually + previewLinks: false, + + // Exposes the reveal.js API through window.postMessage + postMessage: true, + + // Dispatches all reveal.js events to the parent window through postMessage + postMessageEvents: false, + + // Focuses body when page changes visibility to ensure keyboard shortcuts work + focusBodyOnPageVisibilityChange: true, + + // Transition style + transition: 'slide', // none/fade/slide/convex/concave/zoom + + // Transition speed + transitionSpeed: 'default', // default/fast/slow + + // Transition style for full page slide backgrounds + backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom + + // Parallax background image + parallaxBackgroundImage: '', // CSS syntax, e.g. "a.jpg" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "3000px 2000px" + + // Parallax background repeat + parallaxBackgroundRepeat: '', // repeat/repeat-x/repeat-y/no-repeat/initial/inherit + + // Parallax background position + parallaxBackgroundPosition: '', // CSS syntax, e.g. "top left" + + // Amount of pixels to move the parallax background per slide step + parallaxBackgroundHorizontal: null, + parallaxBackgroundVertical: null, + + // The maximum number of pages a single slide can expand onto when printing + // to PDF, unlimited by default + pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY, + + // Prints each fragment on a separate slide + pdfSeparateFragments: true, + + // Offset used to reduce the height of content within exported PDF pages. + // This exists to account for environment differences based on how you + // print to PDF. CLI printing options, like phantomjs and wkpdf, can end + // on precisely the total height of the document whereas in-browser + // printing has to end one pixel before. + pdfPageHeightOffset: -1, + + // Number of slides away from the current that are visible + viewDistance: 3, + + // The display mode that will be used to show slides + display: 'block', + + // Hide cursor if inactive + hideInactiveCursor: true, + + // Time before the cursor is hidden (in ms) + hideCursorTime: 5000, + + // Script dependencies to load + dependencies: [] + + }, + + // Flags if Reveal.initialize() has been called + initialized = false, + + // Flags if reveal.js is loaded (has dispatched the 'ready' event) + loaded = false, + + // Flags if the overview mode is currently active + overview = false, + + // Holds the dimensions of our overview slides, including margins + overviewSlideWidth = null, + overviewSlideHeight = null, + + // The horizontal and vertical index of the currently active slide + indexh, + indexv, + + // The previous and current slide HTML elements + previousSlide, + currentSlide, + + previousBackground, + + // Remember which directions that the user has navigated towards + hasNavigatedRight = false, + hasNavigatedDown = false, + + // Slides may hold a data-state attribute which we pick up and apply + // as a class to the body. This list contains the combined state of + // all current slides. + state = [], + + // The current scale of the presentation (see width/height config) + scale = 1, + + // CSS transform that is currently applied to the slides container, + // split into two groups + slidesTransform = { layout: '', overview: '' }, + + // Cached references to DOM elements + dom = {}, + + // A list of registered reveal.js plugins + plugins = {}, + + // List of asynchronously loaded reveal.js dependencies + asyncDependencies = [], + + // Features supported by the browser, see #checkCapabilities() + features = {}, + + // Client is a mobile device, see #checkCapabilities() + isMobileDevice, + + // Client is a desktop Chrome, see #checkCapabilities() + isChrome, + + // Throttles mouse wheel navigation + lastMouseWheelStep = 0, + + // Delays updates to the URL due to a Chrome thumbnailer bug + writeURLTimeout = 0, + + // Is the mouse pointer currently hidden from view + cursorHidden = false, + + // Timeout used to determine when the cursor is inactive + cursorInactiveTimeout = 0, + + // Flags if the interaction event listeners are bound + eventsAreBound = false, + + // The current auto-slide duration + autoSlide = 0, + + // Auto slide properties + autoSlidePlayer, + autoSlideTimeout = 0, + autoSlideStartTime = -1, + autoSlidePaused = false, + + // Holds information about the currently ongoing touch input + touch = { + startX: 0, + startY: 0, + startCount: 0, + captured: false, + threshold: 40 + }, + + // A key:value map of shortcut keyboard keys and descriptions of + // the actions they trigger, generated in #configure() + keyboardShortcuts = {}, + + // Holds custom key code mappings + registeredKeyBindings = {}; + + /** + * Starts up the presentation if the client is capable. + */ + function initialize( options ) { + + // Make sure we only initialize once + if( initialized === true ) return; + + initialized = true; + + checkCapabilities(); + + if( !features.transforms2d && !features.transforms3d ) { + document.body.setAttribute( 'class', 'no-transforms' ); + + // Since JS won't be running any further, we load all lazy + // loading elements upfront + var images = toArray( document.getElementsByTagName( 'img' ) ), + iframes = toArray( document.getElementsByTagName( 'iframe' ) ); + + var lazyLoadable = images.concat( iframes ); + + for( var i = 0, len = lazyLoadable.length; i < len; i++ ) { + var element = lazyLoadable[i]; + if( element.getAttribute( 'data-src' ) ) { + element.setAttribute( 'src', element.getAttribute( 'data-src' ) ); + element.removeAttribute( 'data-src' ); + } + } + + // If the browser doesn't support core features we won't be + // using JavaScript to control the presentation + return; + } + + // Cache references to key DOM elements + dom.wrapper = document.querySelector( '.reveal' ); + dom.slides = document.querySelector( '.reveal .slides' ); + + // Force a layout when the whole page, incl fonts, has loaded + window.addEventListener( 'load', layout, false ); + + var query = Reveal.getQueryHash(); + + // Do not accept new dependencies via query config to avoid + // the potential of malicious script injection + if( typeof query['dependencies'] !== 'undefined' ) delete query['dependencies']; + + // Copy options over to our config object + extend( config, options ); + extend( config, query ); + + // Hide the address bar in mobile browsers + hideAddressBar(); + + // Loads dependencies and continues to #start() once done + load(); + + } + + /** + * Inspect the client to see what it's capable of, this + * should only happens once per runtime. + */ + function checkCapabilities() { + + isMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA ); + isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA ); + + var testElement = document.createElement( 'div' ); + + features.transforms3d = 'WebkitPerspective' in testElement.style || + 'MozPerspective' in testElement.style || + 'msPerspective' in testElement.style || + 'OPerspective' in testElement.style || + 'perspective' in testElement.style; + + features.transforms2d = 'WebkitTransform' in testElement.style || + 'MozTransform' in testElement.style || + 'msTransform' in testElement.style || + 'OTransform' in testElement.style || + 'transform' in testElement.style; + + features.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; + features.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function'; + + features.canvas = !!document.createElement( 'canvas' ).getContext; + + // Transitions in the overview are disabled in desktop and + // Safari due to lag + features.overviewTransitions = !/Version\/[\d\.]+.*Safari/.test( UA ); + + // Flags if we should use zoom instead of transform to scale + // up slides. Zoom produces crisper results but has a lot of + // xbrowser quirks so we only use it in whitelsited browsers. + features.zoom = 'zoom' in testElement.style && !isMobileDevice && + ( isChrome || /Version\/[\d\.]+.*Safari/.test( UA ) ); + + } + + /** + * Loads the dependencies of reveal.js. Dependencies are + * defined via the configuration option 'dependencies' + * and will be loaded prior to starting/binding reveal.js. + * Some dependencies may have an 'async' flag, if so they + * will load after reveal.js has been started up. + */ + function load() { + + var scripts = [], + scriptsToLoad = 0; + + config.dependencies.forEach( function( s ) { + // Load if there's no condition or the condition is truthy + if( !s.condition || s.condition() ) { + if( s.async ) { + asyncDependencies.push( s ); + } + else { + scripts.push( s ); + } + } + } ); + + if( scripts.length ) { + scriptsToLoad = scripts.length; + + // Load synchronous scripts + scripts.forEach( function( s ) { + loadScript( s.src, function() { + + if( typeof s.callback === 'function' ) s.callback(); + + if( --scriptsToLoad === 0 ) { + initPlugins(); + } + + } ); + } ); + } + else { + initPlugins(); + } + + } + + /** + * Initializes our plugins and waits for them to be ready + * before proceeding. + */ + function initPlugins() { + + var pluginsToInitialize = Object.keys( plugins ).length; + + // If there are no plugins, skip this step + if( pluginsToInitialize === 0 ) { + loadAsyncDependencies(); + } + // ... otherwise initialize plugins + else { + + var afterPlugInitialized = function() { + if( --pluginsToInitialize === 0 ) { + loadAsyncDependencies(); + } + }; + + for( var i in plugins ) { + + var plugin = plugins[i]; + + // If the plugin has an 'init' method, invoke it + if( typeof plugin.init === 'function' ) { + var callback = plugin.init(); + + // If the plugin returned a Promise, wait for it + if( callback && typeof callback.then === 'function' ) { + callback.then( afterPlugInitialized ); + } + else { + afterPlugInitialized(); + } + } + else { + afterPlugInitialized(); + } + + } + + } + + } + + /** + * Loads all async reveal.js dependencies. + */ + function loadAsyncDependencies() { + + if( asyncDependencies.length ) { + asyncDependencies.forEach( function( s ) { + loadScript( s.src, s.callback ); + } ); + } + + start(); + + } + + /** + * Loads a JavaScript file from the given URL and executes it. + * + * @param {string} url Address of the .js file to load + * @param {function} callback Method to invoke when the script + * has loaded and executed + */ + function loadScript( url, callback ) { + + var script = document.createElement( 'script' ); + script.type = 'text/javascript'; + script.async = false; + script.defer = false; + script.src = url; + + if( callback ) { + + // Success callback + script.onload = script.onreadystatechange = function( event ) { + if( event.type === "load" || (/loaded|complete/.test( script.readyState ) ) ) { + + // Kill event listeners + script.onload = script.onreadystatechange = script.onerror = null; + + callback(); + + } + }; + + // Error callback + script.onerror = function( err ) { + + // Kill event listeners + script.onload = script.onreadystatechange = script.onerror = null; + + callback( new Error( 'Failed loading script: ' + script.src + '\n' + err) ); + + }; + + } + + // Append the script at the end of + var head = document.querySelector( 'head' ); + head.insertBefore( script, head.lastChild ); + + } + + /** + * Starts up reveal.js by binding input events and navigating + * to the current URL deeplink if there is one. + */ + function start() { + + loaded = true; + + // Make sure we've got all the DOM elements we need + setupDOM(); + + // Listen to messages posted to this window + setupPostMessage(); + + // Prevent the slides from being scrolled out of view + setupScrollPrevention(); + + // Resets all vertical slides so that only the first is visible + resetVerticalSlides(); + + // Updates the presentation to match the current configuration values + configure(); + + // Read the initial hash + readURL(); + + // Update all backgrounds + updateBackground( true ); + + // Notify listeners that the presentation is ready but use a 1ms + // timeout to ensure it's not fired synchronously after #initialize() + setTimeout( function() { + // Enable transitions now that we're loaded + dom.slides.classList.remove( 'no-transition' ); + + dom.wrapper.classList.add( 'ready' ); + + dispatchEvent( 'ready', { + 'indexh': indexh, + 'indexv': indexv, + 'currentSlide': currentSlide + } ); + }, 1 ); + + // Special setup and config is required when printing to PDF + if( isPrintingPDF() ) { + removeEventListeners(); + + // The document needs to have loaded for the PDF layout + // measurements to be accurate + if( document.readyState === 'complete' ) { + setupPDF(); + } + else { + window.addEventListener( 'load', setupPDF ); + } + } + + } + + /** + * Finds and stores references to DOM elements which are + * required by the presentation. If a required element is + * not found, it is created. + */ + function setupDOM() { + + // Prevent transitions while we're loading + dom.slides.classList.add( 'no-transition' ); + + if( isMobileDevice ) { + dom.wrapper.classList.add( 'no-hover' ); + } + else { + dom.wrapper.classList.remove( 'no-hover' ); + } + + if( /iphone/gi.test( UA ) ) { + dom.wrapper.classList.add( 'ua-iphone' ); + } + else { + dom.wrapper.classList.remove( 'ua-iphone' ); + } + + // Background element + dom.background = createSingletonNode( dom.wrapper, 'div', 'backgrounds', null ); + + // Progress bar + dom.progress = createSingletonNode( dom.wrapper, 'div', 'progress', '' ); + dom.progressbar = dom.progress.querySelector( 'span' ); + + // Arrow controls + dom.controls = createSingletonNode( dom.wrapper, 'aside', 'controls', + '' + + '' + + '' + + '' ); + + // Slide number + dom.slideNumber = createSingletonNode( dom.wrapper, 'div', 'slide-number', '' ); + + // Element containing notes that are visible to the audience + dom.speakerNotes = createSingletonNode( dom.wrapper, 'div', 'speaker-notes', null ); + dom.speakerNotes.setAttribute( 'data-prevent-swipe', '' ); + dom.speakerNotes.setAttribute( 'tabindex', '0' ); + + // Overlay graphic which is displayed during the paused mode + dom.pauseOverlay = createSingletonNode( dom.wrapper, 'div', 'pause-overlay', config.controls ? '' : null ); + + dom.wrapper.setAttribute( 'role', 'application' ); + + // There can be multiple instances of controls throughout the page + dom.controlsLeft = toArray( document.querySelectorAll( '.navigate-left' ) ); + dom.controlsRight = toArray( document.querySelectorAll( '.navigate-right' ) ); + dom.controlsUp = toArray( document.querySelectorAll( '.navigate-up' ) ); + dom.controlsDown = toArray( document.querySelectorAll( '.navigate-down' ) ); + dom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) ); + dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) ); + + // The right and down arrows in the standard reveal.js controls + dom.controlsRightArrow = dom.controls.querySelector( '.navigate-right' ); + dom.controlsDownArrow = dom.controls.querySelector( '.navigate-down' ); + + dom.statusDiv = createStatusDiv(); + } + + /** + * Creates a hidden div with role aria-live to announce the + * current slide content. Hide the div off-screen to make it + * available only to Assistive Technologies. + * + * @return {HTMLElement} + */ + function createStatusDiv() { + + var statusDiv = document.getElementById( 'aria-status-div' ); + if( !statusDiv ) { + statusDiv = document.createElement( 'div' ); + statusDiv.style.position = 'absolute'; + statusDiv.style.height = '1px'; + statusDiv.style.width = '1px'; + statusDiv.style.overflow = 'hidden'; + statusDiv.style.clip = 'rect( 1px, 1px, 1px, 1px )'; + statusDiv.setAttribute( 'id', 'aria-status-div' ); + statusDiv.setAttribute( 'aria-live', 'polite' ); + statusDiv.setAttribute( 'aria-atomic','true' ); + dom.wrapper.appendChild( statusDiv ); + } + return statusDiv; + + } + + /** + * Converts the given HTML element into a string of text + * that can be announced to a screen reader. Hidden + * elements are excluded. + */ + function getStatusText( node ) { + + var text = ''; + + // Text node + if( node.nodeType === 3 ) { + text += node.textContent; + } + // Element node + else if( node.nodeType === 1 ) { + + var isAriaHidden = node.getAttribute( 'aria-hidden' ); + var isDisplayHidden = window.getComputedStyle( node )['display'] === 'none'; + if( isAriaHidden !== 'true' && !isDisplayHidden ) { + + toArray( node.childNodes ).forEach( function( child ) { + text += getStatusText( child ); + } ); + + } + + } + + return text; + + } + + /** + * Configures the presentation for printing to a static + * PDF. + */ + function setupPDF() { + + var slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight ); + + // Dimensions of the PDF pages + var pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ), + pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) ); + + // Dimensions of slides within the pages + var slideWidth = slideSize.width, + slideHeight = slideSize.height; + + // Let the browser know what page size we want to print + injectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0px;}' ); + + // Limit the size of certain elements to the dimensions of the slide + injectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' ); + + document.body.classList.add( 'print-pdf' ); + document.body.style.width = pageWidth + 'px'; + document.body.style.height = pageHeight + 'px'; + + // Make sure stretch elements fit on slide + layoutSlideContents( slideWidth, slideHeight ); + + // Add each slide's index as attributes on itself, we need these + // indices to generate slide numbers below + toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) { + hslide.setAttribute( 'data-index-h', h ); + + if( hslide.classList.contains( 'stack' ) ) { + toArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) { + vslide.setAttribute( 'data-index-h', h ); + vslide.setAttribute( 'data-index-v', v ); + } ); + } + } ); + + // Slide and slide background layout + toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { + + // Vertical stacks are not centred since their section + // children will be + if( slide.classList.contains( 'stack' ) === false ) { + // Center the slide inside of the page, giving the slide some margin + var left = ( pageWidth - slideWidth ) / 2, + top = ( pageHeight - slideHeight ) / 2; + + var contentHeight = slide.scrollHeight; + var numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 ); + + // Adhere to configured pages per slide limit + numberOfPages = Math.min( numberOfPages, config.pdfMaxPagesPerSlide ); + + // Center slides vertically + if( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) { + top = Math.max( ( pageHeight - contentHeight ) / 2, 0 ); + } + + // Wrap the slide in a page element and hide its overflow + // so that no page ever flows onto another + var page = document.createElement( 'div' ); + page.className = 'pdf-page'; + page.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px'; + slide.parentNode.insertBefore( page, slide ); + page.appendChild( slide ); + + // Position the slide inside of the page + slide.style.left = left + 'px'; + slide.style.top = top + 'px'; + slide.style.width = slideWidth + 'px'; + + if( slide.slideBackgroundElement ) { + page.insertBefore( slide.slideBackgroundElement, slide ); + } + + // Inject notes if `showNotes` is enabled + if( config.showNotes ) { + + // Are there notes for this slide? + var notes = getSlideNotes( slide ); + if( notes ) { + + var notesSpacing = 8; + var notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline'; + var notesElement = document.createElement( 'div' ); + notesElement.classList.add( 'speaker-notes' ); + notesElement.classList.add( 'speaker-notes-pdf' ); + notesElement.setAttribute( 'data-layout', notesLayout ); + notesElement.innerHTML = notes; + + if( notesLayout === 'separate-page' ) { + page.parentNode.insertBefore( notesElement, page.nextSibling ); + } + else { + notesElement.style.left = notesSpacing + 'px'; + notesElement.style.bottom = notesSpacing + 'px'; + notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px'; + page.appendChild( notesElement ); + } + + } + + } + + // Inject slide numbers if `slideNumbers` are enabled + if( config.slideNumber && /all|print/i.test( config.showSlideNumber ) ) { + var slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1, + slideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1; + + var numberElement = document.createElement( 'div' ); + numberElement.classList.add( 'slide-number' ); + numberElement.classList.add( 'slide-number-pdf' ); + numberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV ); + page.appendChild( numberElement ); + } + + // Copy page and show fragments one after another + if( config.pdfSeparateFragments ) { + + // Each fragment 'group' is an array containing one or more + // fragments. Multiple fragments that appear at the same time + // are part of the same group. + var fragmentGroups = sortFragments( page.querySelectorAll( '.fragment' ), true ); + + var previousFragmentStep; + var previousPage; + + fragmentGroups.forEach( function( fragments ) { + + // Remove 'current-fragment' from the previous group + if( previousFragmentStep ) { + previousFragmentStep.forEach( function( fragment ) { + fragment.classList.remove( 'current-fragment' ); + } ); + } + + // Show the fragments for the current index + fragments.forEach( function( fragment ) { + fragment.classList.add( 'visible', 'current-fragment' ); + } ); + + // Create a separate page for the current fragment state + var clonedPage = page.cloneNode( true ); + page.parentNode.insertBefore( clonedPage, ( previousPage || page ).nextSibling ); + + previousFragmentStep = fragments; + previousPage = clonedPage; + + } ); + + // Reset the first/original page so that all fragments are hidden + fragmentGroups.forEach( function( fragments ) { + fragments.forEach( function( fragment ) { + fragment.classList.remove( 'visible', 'current-fragment' ); + } ); + } ); + + } + // Show all fragments + else { + toArray( page.querySelectorAll( '.fragment:not(.fade-out)' ) ).forEach( function( fragment ) { + fragment.classList.add( 'visible' ); + } ); + } + + } + + } ); + + // Notify subscribers that the PDF layout is good to go + dispatchEvent( 'pdf-ready' ); + + } + + /** + * This is an unfortunate necessity. Some actions – such as + * an input field being focused in an iframe or using the + * keyboard to expand text selection beyond the bounds of + * a slide – can trigger our content to be pushed out of view. + * This scrolling can not be prevented by hiding overflow in + * CSS (we already do) so we have to resort to repeatedly + * checking if the slides have been offset :( + */ + function setupScrollPrevention() { + + setInterval( function() { + if( dom.wrapper.scrollTop !== 0 || dom.wrapper.scrollLeft !== 0 ) { + dom.wrapper.scrollTop = 0; + dom.wrapper.scrollLeft = 0; + } + }, 1000 ); + + } + + /** + * Creates an HTML element and returns a reference to it. + * If the element already exists the existing instance will + * be returned. + * + * @param {HTMLElement} container + * @param {string} tagname + * @param {string} classname + * @param {string} innerHTML + * + * @return {HTMLElement} + */ + function createSingletonNode( container, tagname, classname, innerHTML ) { + + // Find all nodes matching the description + var nodes = container.querySelectorAll( '.' + classname ); + + // Check all matches to find one which is a direct child of + // the specified container + for( var i = 0; i < nodes.length; i++ ) { + var testNode = nodes[i]; + if( testNode.parentNode === container ) { + return testNode; + } + } + + // If no node was found, create it now + var node = document.createElement( tagname ); + node.className = classname; + if( typeof innerHTML === 'string' ) { + node.innerHTML = innerHTML; + } + container.appendChild( node ); + + return node; + + } + + /** + * Creates the slide background elements and appends them + * to the background container. One element is created per + * slide no matter if the given slide has visible background. + */ + function createBackgrounds() { + + var printMode = isPrintingPDF(); + + // Clear prior backgrounds + dom.background.innerHTML = ''; + dom.background.classList.add( 'no-transition' ); + + // Iterate over all horizontal slides + toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( slideh ) { + + var backgroundStack = createBackground( slideh, dom.background ); + + // Iterate over all vertical slides + toArray( slideh.querySelectorAll( 'section' ) ).forEach( function( slidev ) { + + createBackground( slidev, backgroundStack ); + + backgroundStack.classList.add( 'stack' ); + + } ); + + } ); + + // Add parallax background if specified + if( config.parallaxBackgroundImage ) { + + dom.background.style.backgroundImage = 'url("' + config.parallaxBackgroundImage + '")'; + dom.background.style.backgroundSize = config.parallaxBackgroundSize; + dom.background.style.backgroundRepeat = config.parallaxBackgroundRepeat; + dom.background.style.backgroundPosition = config.parallaxBackgroundPosition; + + // Make sure the below properties are set on the element - these properties are + // needed for proper transitions to be set on the element via CSS. To remove + // annoying background slide-in effect when the presentation starts, apply + // these properties after short time delay + setTimeout( function() { + dom.wrapper.classList.add( 'has-parallax-background' ); + }, 1 ); + + } + else { + + dom.background.style.backgroundImage = ''; + dom.wrapper.classList.remove( 'has-parallax-background' ); + + } + + } + + /** + * Creates a background for the given slide. + * + * @param {HTMLElement} slide + * @param {HTMLElement} container The element that the background + * should be appended to + * @return {HTMLElement} New background div + */ + function createBackground( slide, container ) { + + + // Main slide background element + var element = document.createElement( 'div' ); + element.className = 'slide-background ' + slide.className.replace( /present|past|future/, '' ); + + // Inner background element that wraps images/videos/iframes + var contentElement = document.createElement( 'div' ); + contentElement.className = 'slide-background-content'; + + element.appendChild( contentElement ); + container.appendChild( element ); + + slide.slideBackgroundElement = element; + slide.slideBackgroundContentElement = contentElement; + + // Syncs the background to reflect all current background settings + syncBackground( slide ); + + return element; + + } + + /** + * Renders all of the visual properties of a slide background + * based on the various background attributes. + * + * @param {HTMLElement} slide + */ + function syncBackground( slide ) { + + var element = slide.slideBackgroundElement, + contentElement = slide.slideBackgroundContentElement; + + // Reset the prior background state in case this is not the + // initial sync + slide.classList.remove( 'has-dark-background' ); + slide.classList.remove( 'has-light-background' ); + + element.removeAttribute( 'data-loaded' ); + element.removeAttribute( 'data-background-hash' ); + element.removeAttribute( 'data-background-size' ); + element.removeAttribute( 'data-background-transition' ); + element.style.backgroundColor = ''; + + contentElement.style.backgroundSize = ''; + contentElement.style.backgroundRepeat = ''; + contentElement.style.backgroundPosition = ''; + contentElement.style.backgroundImage = ''; + contentElement.style.opacity = ''; + contentElement.innerHTML = ''; + + var data = { + background: slide.getAttribute( 'data-background' ), + backgroundSize: slide.getAttribute( 'data-background-size' ), + backgroundImage: slide.getAttribute( 'data-background-image' ), + backgroundVideo: slide.getAttribute( 'data-background-video' ), + backgroundIframe: slide.getAttribute( 'data-background-iframe' ), + backgroundColor: slide.getAttribute( 'data-background-color' ), + backgroundRepeat: slide.getAttribute( 'data-background-repeat' ), + backgroundPosition: slide.getAttribute( 'data-background-position' ), + backgroundTransition: slide.getAttribute( 'data-background-transition' ), + backgroundOpacity: slide.getAttribute( 'data-background-opacity' ) + }; + + if( data.background ) { + // Auto-wrap image urls in url(...) + if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#\s]|$)/gi.test( data.background ) ) { + slide.setAttribute( 'data-background-image', data.background ); + } + else { + element.style.background = data.background; + } + } + + // Create a hash for this combination of background settings. + // This is used to determine when two slide backgrounds are + // the same. + if( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo || data.backgroundIframe ) { + element.setAttribute( 'data-background-hash', data.background + + data.backgroundSize + + data.backgroundImage + + data.backgroundVideo + + data.backgroundIframe + + data.backgroundColor + + data.backgroundRepeat + + data.backgroundPosition + + data.backgroundTransition + + data.backgroundOpacity ); + } + + // Additional and optional background properties + if( data.backgroundSize ) element.setAttribute( 'data-background-size', data.backgroundSize ); + if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor; + if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition ); + + // Background image options are set on the content wrapper + if( data.backgroundSize ) contentElement.style.backgroundSize = data.backgroundSize; + if( data.backgroundRepeat ) contentElement.style.backgroundRepeat = data.backgroundRepeat; + if( data.backgroundPosition ) contentElement.style.backgroundPosition = data.backgroundPosition; + if( data.backgroundOpacity ) contentElement.style.opacity = data.backgroundOpacity; + + // If this slide has a background color, we add a class that + // signals if it is light or dark. If the slide has no background + // color, no class will be added + var contrastColor = data.backgroundColor; + + // If no bg color was found, check the computed background + if( !contrastColor ) { + var computedBackgroundStyle = window.getComputedStyle( element ); + if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) { + contrastColor = computedBackgroundStyle.backgroundColor; + } + } + + if( contrastColor ) { + var rgb = colorToRgb( contrastColor ); + + // Ignore fully transparent backgrounds. Some browsers return + // rgba(0,0,0,0) when reading the computed background color of + // an element with no background + if( rgb && rgb.a !== 0 ) { + if( colorBrightness( contrastColor ) < 128 ) { + slide.classList.add( 'has-dark-background' ); + } + else { + slide.classList.add( 'has-light-background' ); + } + } + } + + } + + /** + * Registers a listener to postMessage events, this makes it + * possible to call all reveal.js API methods from another + * window. For example: + * + * revealWindow.postMessage( JSON.stringify({ + * method: 'slide', + * args: [ 2 ] + * }), '*' ); + */ + function setupPostMessage() { + + if( config.postMessage ) { + window.addEventListener( 'message', function ( event ) { + var data = event.data; + + // Make sure we're dealing with JSON + if( typeof data === 'string' && data.charAt( 0 ) === '{' && data.charAt( data.length - 1 ) === '}' ) { + data = JSON.parse( data ); + + // Check if the requested method can be found + if( data.method && typeof Reveal[data.method] === 'function' ) { + Reveal[data.method].apply( Reveal, data.args ); + } + } + }, false ); + } + + } + + /** + * Applies the configuration settings from the config + * object. May be called multiple times. + * + * @param {object} options + */ + function configure( options ) { + + var oldTransition = config.transition; + + // New config options may be passed when this method + // is invoked through the API after initialization + if( typeof options === 'object' ) extend( config, options ); + + // Abort if reveal.js hasn't finished loading, config + // changes will be applied automatically once loading + // finishes + if( loaded === false ) return; + + var numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length; + + // Remove the previously configured transition class + dom.wrapper.classList.remove( oldTransition ); + + // Force linear transition based on browser capabilities + if( features.transforms3d === false ) config.transition = 'linear'; + + dom.wrapper.classList.add( config.transition ); + + dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed ); + dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition ); + + dom.controls.style.display = config.controls ? 'block' : 'none'; + dom.progress.style.display = config.progress ? 'block' : 'none'; + + dom.controls.setAttribute( 'data-controls-layout', config.controlsLayout ); + dom.controls.setAttribute( 'data-controls-back-arrows', config.controlsBackArrows ); + + if( config.shuffle ) { + shuffle(); + } + + if( config.rtl ) { + dom.wrapper.classList.add( 'rtl' ); + } + else { + dom.wrapper.classList.remove( 'rtl' ); + } + + if( config.center ) { + dom.wrapper.classList.add( 'center' ); + } + else { + dom.wrapper.classList.remove( 'center' ); + } + + // Exit the paused mode if it was configured off + if( config.pause === false ) { + resume(); + } + + if( config.showNotes ) { + dom.speakerNotes.setAttribute( 'data-layout', typeof config.showNotes === 'string' ? config.showNotes : 'inline' ); + } + + if( config.mouseWheel ) { + document.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF + document.addEventListener( 'mousewheel', onDocumentMouseScroll, false ); + } + else { + document.removeEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF + document.removeEventListener( 'mousewheel', onDocumentMouseScroll, false ); + } + + // Rolling 3D links + if( config.rollingLinks ) { + enableRollingLinks(); + } + else { + disableRollingLinks(); + } + + // Auto-hide the mouse pointer when its inactive + if( config.hideInactiveCursor ) { + document.addEventListener( 'mousemove', onDocumentCursorActive, false ); + document.addEventListener( 'mousedown', onDocumentCursorActive, false ); + } + else { + showCursor(); + + document.removeEventListener( 'mousemove', onDocumentCursorActive, false ); + document.removeEventListener( 'mousedown', onDocumentCursorActive, false ); + } + + // Iframe link previews + if( config.previewLinks ) { + enablePreviewLinks(); + disablePreviewLinks( '[data-preview-link=false]' ); + } + else { + disablePreviewLinks(); + enablePreviewLinks( '[data-preview-link]:not([data-preview-link=false])' ); + } + + // Remove existing auto-slide controls + if( autoSlidePlayer ) { + autoSlidePlayer.destroy(); + autoSlidePlayer = null; + } + + // Generate auto-slide controls if needed + if( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) { + autoSlidePlayer = new Playback( dom.wrapper, function() { + return Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 ); + } ); + + autoSlidePlayer.on( 'click', onAutoSlidePlayerClick ); + autoSlidePaused = false; + } + + // When fragments are turned off they should be visible + if( config.fragments === false ) { + toArray( dom.slides.querySelectorAll( '.fragment' ) ).forEach( function( element ) { + element.classList.add( 'visible' ); + element.classList.remove( 'current-fragment' ); + } ); + } + + // Slide numbers + var slideNumberDisplay = 'none'; + if( config.slideNumber && !isPrintingPDF() ) { + if( config.showSlideNumber === 'all' ) { + slideNumberDisplay = 'block'; + } + else if( config.showSlideNumber === 'speaker' && isSpeakerNotes() ) { + slideNumberDisplay = 'block'; + } + } + + dom.slideNumber.style.display = slideNumberDisplay; + + // Add the navigation mode to the DOM so we can adjust styling + if( config.navigationMode !== 'default' ) { + dom.wrapper.setAttribute( 'data-navigation-mode', config.navigationMode ); + } + else { + dom.wrapper.removeAttribute( 'data-navigation-mode' ); + } + + // Define our contextual list of keyboard shortcuts + if( config.navigationMode === 'linear' ) { + keyboardShortcuts['→ , ↓ , SPACE , N , L , J'] = 'Next slide'; + keyboardShortcuts['← , ↑ , P , H , K'] = 'Previous slide'; + } + else { + keyboardShortcuts['N , SPACE'] = 'Next slide'; + keyboardShortcuts['P'] = 'Previous slide'; + keyboardShortcuts['← , H'] = 'Navigate left'; + keyboardShortcuts['→ , L'] = 'Navigate right'; + keyboardShortcuts['↑ , K'] = 'Navigate up'; + keyboardShortcuts['↓ , J'] = 'Navigate down'; + } + + keyboardShortcuts['Home , ⌘/CTRL ←'] = 'First slide'; + keyboardShortcuts['End , ⌘/CTRL →'] = 'Last slide'; + keyboardShortcuts['B , .'] = 'Pause'; + keyboardShortcuts['F'] = 'Fullscreen'; + keyboardShortcuts['ESC, O'] = 'Slide overview'; + + sync(); + + } + + /** + * Binds all event listeners. + */ + function addEventListeners() { + + eventsAreBound = true; + + window.addEventListener( 'hashchange', onWindowHashChange, false ); + window.addEventListener( 'resize', onWindowResize, false ); + + if( config.touch ) { + if( 'onpointerdown' in window ) { + // Use W3C pointer events + dom.wrapper.addEventListener( 'pointerdown', onPointerDown, false ); + dom.wrapper.addEventListener( 'pointermove', onPointerMove, false ); + dom.wrapper.addEventListener( 'pointerup', onPointerUp, false ); + } + else if( window.navigator.msPointerEnabled ) { + // IE 10 uses prefixed version of pointer events + dom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false ); + dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false ); + dom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false ); + } + else { + // Fall back to touch events + dom.wrapper.addEventListener( 'touchstart', onTouchStart, false ); + dom.wrapper.addEventListener( 'touchmove', onTouchMove, false ); + dom.wrapper.addEventListener( 'touchend', onTouchEnd, false ); + } + } + + if( config.keyboard ) { + document.addEventListener( 'keydown', onDocumentKeyDown, false ); + document.addEventListener( 'keypress', onDocumentKeyPress, false ); + } + + if( config.progress && dom.progress ) { + dom.progress.addEventListener( 'click', onProgressClicked, false ); + } + + dom.pauseOverlay.addEventListener( 'click', resume, false ); + + if( config.focusBodyOnPageVisibilityChange ) { + var visibilityChange; + + if( 'hidden' in document ) { + visibilityChange = 'visibilitychange'; + } + else if( 'msHidden' in document ) { + visibilityChange = 'msvisibilitychange'; + } + else if( 'webkitHidden' in document ) { + visibilityChange = 'webkitvisibilitychange'; + } + + if( visibilityChange ) { + document.addEventListener( visibilityChange, onPageVisibilityChange, false ); + } + } + + // Listen to both touch and click events, in case the device + // supports both + var pointerEvents = [ 'touchstart', 'click' ]; + + // Only support touch for Android, fixes double navigations in + // stock browser + if( UA.match( /android/gi ) ) { + pointerEvents = [ 'touchstart' ]; + } + + pointerEvents.forEach( function( eventName ) { + dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); + dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); + dom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } ); + dom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } ); + dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); + dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); + } ); + + } + + /** + * Unbinds all event listeners. + */ + function removeEventListeners() { + + eventsAreBound = false; + + document.removeEventListener( 'keydown', onDocumentKeyDown, false ); + document.removeEventListener( 'keypress', onDocumentKeyPress, false ); + window.removeEventListener( 'hashchange', onWindowHashChange, false ); + window.removeEventListener( 'resize', onWindowResize, false ); + + dom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false ); + dom.wrapper.removeEventListener( 'pointermove', onPointerMove, false ); + dom.wrapper.removeEventListener( 'pointerup', onPointerUp, false ); + + dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false ); + dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false ); + dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false ); + + dom.wrapper.removeEventListener( 'touchstart', onTouchStart, false ); + dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false ); + dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false ); + + dom.pauseOverlay.removeEventListener( 'click', resume, false ); + + if ( config.progress && dom.progress ) { + dom.progress.removeEventListener( 'click', onProgressClicked, false ); + } + + [ 'touchstart', 'click' ].forEach( function( eventName ) { + dom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } ); + dom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } ); + dom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } ); + dom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } ); + dom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } ); + dom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } ); + } ); + + } + + /** + * Registers a new plugin with this reveal.js instance. + * + * reveal.js waits for all regisered plugins to initialize + * before considering itself ready, as long as the plugin + * is registered before calling `Reveal.initialize()`. + */ + function registerPlugin( id, plugin ) { + + if( plugins[id] === undefined ) { + plugins[id] = plugin; + + // If a plugin is registered after reveal.js is loaded, + // initialize it right away + if( loaded && typeof plugin.init === 'function' ) { + plugin.init(); + } + } + else { + console.warn( 'reveal.js: "'+ id +'" plugin has already been registered' ); + } + + } + + /** + * Checks if a specific plugin has been registered. + * + * @param {String} id Unique plugin identifier + */ + function hasPlugin( id ) { + + return !!plugins[id]; + + } + + /** + * Returns the specific plugin instance, if a plugin + * with the given ID has been registered. + * + * @param {String} id Unique plugin identifier + */ + function getPlugin( id ) { + + return plugins[id]; + + } + + /** + * Add a custom key binding with optional description to + * be added to the help screen. + */ + function addKeyBinding( binding, callback ) { + + if( typeof binding === 'object' && binding.keyCode ) { + registeredKeyBindings[binding.keyCode] = { + callback: callback, + key: binding.key, + description: binding.description + }; + } + else { + registeredKeyBindings[binding] = { + callback: callback, + key: null, + description: null + }; + } + + } + + /** + * Removes the specified custom key binding. + */ + function removeKeyBinding( keyCode ) { + + delete registeredKeyBindings[keyCode]; + + } + + /** + * Extend object a with the properties of object b. + * If there's a conflict, object b takes precedence. + * + * @param {object} a + * @param {object} b + */ + function extend( a, b ) { + + for( var i in b ) { + a[ i ] = b[ i ]; + } + + return a; + + } + + /** + * Converts the target object to an array. + * + * @param {object} o + * @return {object[]} + */ + function toArray( o ) { + + return Array.prototype.slice.call( o ); + + } + + /** + * Utility for deserializing a value. + * + * @param {*} value + * @return {*} + */ + function deserialize( value ) { + + if( typeof value === 'string' ) { + if( value === 'null' ) return null; + else if( value === 'true' ) return true; + else if( value === 'false' ) return false; + else if( value.match( /^-?[\d\.]+$/ ) ) return parseFloat( value ); + } + + return value; + + } + + /** + * Measures the distance in pixels between point a + * and point b. + * + * @param {object} a point with x/y properties + * @param {object} b point with x/y properties + * + * @return {number} + */ + function distanceBetween( a, b ) { + + var dx = a.x - b.x, + dy = a.y - b.y; + + return Math.sqrt( dx*dx + dy*dy ); + + } + + /** + * Applies a CSS transform to the target element. + * + * @param {HTMLElement} element + * @param {string} transform + */ + function transformElement( element, transform ) { + + element.style.WebkitTransform = transform; + element.style.MozTransform = transform; + element.style.msTransform = transform; + element.style.transform = transform; + + } + + /** + * Applies CSS transforms to the slides container. The container + * is transformed from two separate sources: layout and the overview + * mode. + * + * @param {object} transforms + */ + function transformSlides( transforms ) { + + // Pick up new transforms from arguments + if( typeof transforms.layout === 'string' ) slidesTransform.layout = transforms.layout; + if( typeof transforms.overview === 'string' ) slidesTransform.overview = transforms.overview; + + // Apply the transforms to the slides container + if( slidesTransform.layout ) { + transformElement( dom.slides, slidesTransform.layout + ' ' + slidesTransform.overview ); + } + else { + transformElement( dom.slides, slidesTransform.overview ); + } + + } + + /** + * Injects the given CSS styles into the DOM. + * + * @param {string} value + */ + function injectStyleSheet( value ) { + + var tag = document.createElement( 'style' ); + tag.type = 'text/css'; + if( tag.styleSheet ) { + tag.styleSheet.cssText = value; + } + else { + tag.appendChild( document.createTextNode( value ) ); + } + document.getElementsByTagName( 'head' )[0].appendChild( tag ); + + } + + /** + * Find the closest parent that matches the given + * selector. + * + * @param {HTMLElement} target The child element + * @param {String} selector The CSS selector to match + * the parents against + * + * @return {HTMLElement} The matched parent or null + * if no matching parent was found + */ + function closestParent( target, selector ) { + + var parent = target.parentNode; + + while( parent ) { + + // There's some overhead doing this each time, we don't + // want to rewrite the element prototype but should still + // be enough to feature detect once at startup... + var matchesMethod = parent.matches || parent.matchesSelector || parent.msMatchesSelector; + + // If we find a match, we're all set + if( matchesMethod && matchesMethod.call( parent, selector ) ) { + return parent; + } + + // Keep searching + parent = parent.parentNode; + + } + + return null; + + } + + /** + * Converts various color input formats to an {r:0,g:0,b:0} object. + * + * @param {string} color The string representation of a color + * @example + * colorToRgb('#000'); + * @example + * colorToRgb('#000000'); + * @example + * colorToRgb('rgb(0,0,0)'); + * @example + * colorToRgb('rgba(0,0,0)'); + * + * @return {{r: number, g: number, b: number, [a]: number}|null} + */ + function colorToRgb( color ) { + + var hex3 = color.match( /^#([0-9a-f]{3})$/i ); + if( hex3 && hex3[1] ) { + hex3 = hex3[1]; + return { + r: parseInt( hex3.charAt( 0 ), 16 ) * 0x11, + g: parseInt( hex3.charAt( 1 ), 16 ) * 0x11, + b: parseInt( hex3.charAt( 2 ), 16 ) * 0x11 + }; + } + + var hex6 = color.match( /^#([0-9a-f]{6})$/i ); + if( hex6 && hex6[1] ) { + hex6 = hex6[1]; + return { + r: parseInt( hex6.substr( 0, 2 ), 16 ), + g: parseInt( hex6.substr( 2, 2 ), 16 ), + b: parseInt( hex6.substr( 4, 2 ), 16 ) + }; + } + + var rgb = color.match( /^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i ); + if( rgb ) { + return { + r: parseInt( rgb[1], 10 ), + g: parseInt( rgb[2], 10 ), + b: parseInt( rgb[3], 10 ) + }; + } + + var rgba = color.match( /^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i ); + if( rgba ) { + return { + r: parseInt( rgba[1], 10 ), + g: parseInt( rgba[2], 10 ), + b: parseInt( rgba[3], 10 ), + a: parseFloat( rgba[4] ) + }; + } + + return null; + + } + + /** + * Calculates brightness on a scale of 0-255. + * + * @param {string} color See colorToRgb for supported formats. + * @see {@link colorToRgb} + */ + function colorBrightness( color ) { + + if( typeof color === 'string' ) color = colorToRgb( color ); + + if( color ) { + return ( color.r * 299 + color.g * 587 + color.b * 114 ) / 1000; + } + + return null; + + } + + /** + * Returns the remaining height within the parent of the + * target element. + * + * remaining height = [ configured parent height ] - [ current parent height ] + * + * @param {HTMLElement} element + * @param {number} [height] + */ + function getRemainingHeight( element, height ) { + + height = height || 0; + + if( element ) { + var newHeight, oldHeight = element.style.height; + + // Change the .stretch element height to 0 in order find the height of all + // the other elements + element.style.height = '0px'; + + // In Overview mode, the parent (.slide) height is set of 700px. + // Restore it temporarily to its natural height. + element.parentNode.style.height = 'auto'; + + newHeight = height - element.parentNode.offsetHeight; + + // Restore the old height, just in case + element.style.height = oldHeight + 'px'; + + // Clear the parent (.slide) height. .removeProperty works in IE9+ + element.parentNode.style.removeProperty('height'); + + return newHeight; + } + + return height; + + } + + /** + * Checks if this instance is being used to print a PDF. + */ + function isPrintingPDF() { + + return ( /print-pdf/gi ).test( window.location.search ); + + } + + /** + * Hides the address bar if we're on a mobile device. + */ + function hideAddressBar() { + + if( config.hideAddressBar && isMobileDevice ) { + // Events that should trigger the address bar to hide + window.addEventListener( 'load', removeAddressBar, false ); + window.addEventListener( 'orientationchange', removeAddressBar, false ); + } + + } + + /** + * Causes the address bar to hide on mobile devices, + * more vertical space ftw. + */ + function removeAddressBar() { + + setTimeout( function() { + window.scrollTo( 0, 1 ); + }, 10 ); + + } + + /** + * Dispatches an event of the specified type from the + * reveal DOM element. + */ + function dispatchEvent( type, args ) { + + var event = document.createEvent( 'HTMLEvents', 1, 2 ); + event.initEvent( type, true, true ); + extend( event, args ); + dom.wrapper.dispatchEvent( event ); + + // If we're in an iframe, post each reveal.js event to the + // parent window. Used by the notes plugin + if( config.postMessageEvents && window.parent !== window.self ) { + window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' ); + } + + } + + /** + * Wrap all links in 3D goodness. + */ + function enableRollingLinks() { + + if( features.transforms3d && !( 'msPerspective' in document.body.style ) ) { + var anchors = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' a' ); + + for( var i = 0, len = anchors.length; i < len; i++ ) { + var anchor = anchors[i]; + + if( anchor.textContent && !anchor.querySelector( '*' ) && ( !anchor.className || !anchor.classList.contains( anchor, 'roll' ) ) ) { + var span = document.createElement('span'); + span.setAttribute('data-title', anchor.text); + span.innerHTML = anchor.innerHTML; + + anchor.classList.add( 'roll' ); + anchor.innerHTML = ''; + anchor.appendChild(span); + } + } + } + + } + + /** + * Unwrap all 3D links. + */ + function disableRollingLinks() { + + var anchors = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' a.roll' ); + + for( var i = 0, len = anchors.length; i < len; i++ ) { + var anchor = anchors[i]; + var span = anchor.querySelector( 'span' ); + + if( span ) { + anchor.classList.remove( 'roll' ); + anchor.innerHTML = span.innerHTML; + } + } + + } + + /** + * Bind preview frame links. + * + * @param {string} [selector=a] - selector for anchors + */ + function enablePreviewLinks( selector ) { + + var anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) ); + + anchors.forEach( function( element ) { + if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) { + element.addEventListener( 'click', onPreviewLinkClicked, false ); + } + } ); + + } + + /** + * Unbind preview frame links. + */ + function disablePreviewLinks( selector ) { + + var anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) ); + + anchors.forEach( function( element ) { + if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) { + element.removeEventListener( 'click', onPreviewLinkClicked, false ); + } + } ); + + } + + /** + * Opens a preview window for the target URL. + * + * @param {string} url - url for preview iframe src + */ + function showPreview( url ) { + + closeOverlay(); + + dom.overlay = document.createElement( 'div' ); + dom.overlay.classList.add( 'overlay' ); + dom.overlay.classList.add( 'overlay-preview' ); + dom.wrapper.appendChild( dom.overlay ); + + dom.overlay.innerHTML = [ + '
    ', + '', + '', + '
    ', + '
    ', + '
    ', + '', + '', + 'Unable to load iframe. This is likely due to the site\'s policy (x-frame-options).', + '', + '
    ' + ].join(''); + + dom.overlay.querySelector( 'iframe' ).addEventListener( 'load', function( event ) { + dom.overlay.classList.add( 'loaded' ); + }, false ); + + dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { + closeOverlay(); + event.preventDefault(); + }, false ); + + dom.overlay.querySelector( '.external' ).addEventListener( 'click', function( event ) { + closeOverlay(); + }, false ); + + setTimeout( function() { + dom.overlay.classList.add( 'visible' ); + }, 1 ); + + } + + /** + * Open or close help overlay window. + * + * @param {Boolean} [override] Flag which overrides the + * toggle logic and forcibly sets the desired state. True means + * help is open, false means it's closed. + */ + function toggleHelp( override ){ + + if( typeof override === 'boolean' ) { + override ? showHelp() : closeOverlay(); + } + else { + if( dom.overlay ) { + closeOverlay(); + } + else { + showHelp(); + } + } + } + + /** + * Opens an overlay window with help material. + */ + function showHelp() { + + if( config.help ) { + + closeOverlay(); + + dom.overlay = document.createElement( 'div' ); + dom.overlay.classList.add( 'overlay' ); + dom.overlay.classList.add( 'overlay-help' ); + dom.wrapper.appendChild( dom.overlay ); + + var html = '

    Keyboard Shortcuts


    '; + + html += ''; + for( var key in keyboardShortcuts ) { + html += ''; + } + + // Add custom key bindings that have associated descriptions + for( var binding in registeredKeyBindings ) { + if( registeredKeyBindings[binding].key && registeredKeyBindings[binding].description ) { + html += ''; + } + } + + html += '
    KEYACTION
    ' + key + '' + keyboardShortcuts[ key ] + '
    ' + registeredKeyBindings[binding].key + '' + registeredKeyBindings[binding].description + '
    '; + + dom.overlay.innerHTML = [ + '
    ', + '', + '
    ', + '
    ', + '
    '+ html +'
    ', + '
    ' + ].join(''); + + dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { + closeOverlay(); + event.preventDefault(); + }, false ); + + setTimeout( function() { + dom.overlay.classList.add( 'visible' ); + }, 1 ); + + } + + } + + /** + * Closes any currently open overlay. + */ + function closeOverlay() { + + if( dom.overlay ) { + dom.overlay.parentNode.removeChild( dom.overlay ); + dom.overlay = null; + } + + } + + /** + * Applies JavaScript-controlled layout rules to the + * presentation. + */ + function layout() { + + if( dom.wrapper && !isPrintingPDF() ) { + + if( !config.disableLayout ) { + + // On some mobile devices '100vh' is taller than the visible + // viewport which leads to part of the presentation being + // cut off. To work around this we define our own '--vh' custom + // property where 100x adds up to the correct height. + // + // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ + if( isMobileDevice ) { + document.documentElement.style.setProperty( '--vh', ( window.innerHeight * 0.01 ) + 'px' ); + } + + var size = getComputedSlideSize(); + + var oldScale = scale; + + // Layout the contents of the slides + layoutSlideContents( config.width, config.height ); + + dom.slides.style.width = size.width + 'px'; + dom.slides.style.height = size.height + 'px'; + + // Determine scale of content to fit within available space + scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height ); + + // Respect max/min scale settings + scale = Math.max( scale, config.minScale ); + scale = Math.min( scale, config.maxScale ); + + // Don't apply any scaling styles if scale is 1 + if( scale === 1 ) { + dom.slides.style.zoom = ''; + dom.slides.style.left = ''; + dom.slides.style.top = ''; + dom.slides.style.bottom = ''; + dom.slides.style.right = ''; + transformSlides( { layout: '' } ); + } + else { + // Prefer zoom for scaling up so that content remains crisp. + // Don't use zoom to scale down since that can lead to shifts + // in text layout/line breaks. + if( scale > 1 && features.zoom ) { + dom.slides.style.zoom = scale; + dom.slides.style.left = ''; + dom.slides.style.top = ''; + dom.slides.style.bottom = ''; + dom.slides.style.right = ''; + transformSlides( { layout: '' } ); + } + // Apply scale transform as a fallback + else { + dom.slides.style.zoom = ''; + dom.slides.style.left = '50%'; + dom.slides.style.top = '50%'; + dom.slides.style.bottom = 'auto'; + dom.slides.style.right = 'auto'; + transformSlides( { layout: 'translate(-50%, -50%) scale('+ scale +')' } ); + } + } + + // Select all slides, vertical and horizontal + var slides = toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ); + + for( var i = 0, len = slides.length; i < len; i++ ) { + var slide = slides[ i ]; + + // Don't bother updating invisible slides + if( slide.style.display === 'none' ) { + continue; + } + + if( config.center || slide.classList.contains( 'center' ) ) { + // Vertical stacks are not centred since their section + // children will be + if( slide.classList.contains( 'stack' ) ) { + slide.style.top = 0; + } + else { + slide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px'; + } + } + else { + slide.style.top = ''; + } + + } + + if( oldScale !== scale ) { + dispatchEvent( 'resize', { + 'oldScale': oldScale, + 'scale': scale, + 'size': size + } ); + } + } + + updateProgress(); + updateParallax(); + + if( isOverview() ) { + updateOverview(); + } + + } + + } + + /** + * Applies layout logic to the contents of all slides in + * the presentation. + * + * @param {string|number} width + * @param {string|number} height + */ + function layoutSlideContents( width, height ) { + + // Handle sizing of elements with the 'stretch' class + toArray( dom.slides.querySelectorAll( 'section > .stretch' ) ).forEach( function( element ) { + + // Determine how much vertical space we can use + var remainingHeight = getRemainingHeight( element, height ); + + // Consider the aspect ratio of media elements + if( /(img|video)/gi.test( element.nodeName ) ) { + var nw = element.naturalWidth || element.videoWidth, + nh = element.naturalHeight || element.videoHeight; + + var es = Math.min( width / nw, remainingHeight / nh ); + + element.style.width = ( nw * es ) + 'px'; + element.style.height = ( nh * es ) + 'px'; + + } + else { + element.style.width = width + 'px'; + element.style.height = remainingHeight + 'px'; + } + + } ); + + } + + /** + * Calculates the computed pixel size of our slides. These + * values are based on the width and height configuration + * options. + * + * @param {number} [presentationWidth=dom.wrapper.offsetWidth] + * @param {number} [presentationHeight=dom.wrapper.offsetHeight] + */ + function getComputedSlideSize( presentationWidth, presentationHeight ) { + + var size = { + // Slide size + width: config.width, + height: config.height, + + // Presentation size + presentationWidth: presentationWidth || dom.wrapper.offsetWidth, + presentationHeight: presentationHeight || dom.wrapper.offsetHeight + }; + + // Reduce available space by margin + size.presentationWidth -= ( size.presentationWidth * config.margin ); + size.presentationHeight -= ( size.presentationHeight * config.margin ); + + // Slide width may be a percentage of available width + if( typeof size.width === 'string' && /%$/.test( size.width ) ) { + size.width = parseInt( size.width, 10 ) / 100 * size.presentationWidth; + } + + // Slide height may be a percentage of available height + if( typeof size.height === 'string' && /%$/.test( size.height ) ) { + size.height = parseInt( size.height, 10 ) / 100 * size.presentationHeight; + } + + return size; + + } + + /** + * Stores the vertical index of a stack so that the same + * vertical slide can be selected when navigating to and + * from the stack. + * + * @param {HTMLElement} stack The vertical stack element + * @param {string|number} [v=0] Index to memorize + */ + function setPreviousVerticalIndex( stack, v ) { + + if( typeof stack === 'object' && typeof stack.setAttribute === 'function' ) { + stack.setAttribute( 'data-previous-indexv', v || 0 ); + } + + } + + /** + * Retrieves the vertical index which was stored using + * #setPreviousVerticalIndex() or 0 if no previous index + * exists. + * + * @param {HTMLElement} stack The vertical stack element + */ + function getPreviousVerticalIndex( stack ) { + + if( typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains( 'stack' ) ) { + // Prefer manually defined start-indexv + var attributeName = stack.hasAttribute( 'data-start-indexv' ) ? 'data-start-indexv' : 'data-previous-indexv'; + + return parseInt( stack.getAttribute( attributeName ) || 0, 10 ); + } + + return 0; + + } + + /** + * Displays the overview of slides (quick nav) by scaling + * down and arranging all slide elements. + */ + function activateOverview() { + + // Only proceed if enabled in config + if( config.overview && !isOverview() ) { + + overview = true; + + dom.wrapper.classList.add( 'overview' ); + dom.wrapper.classList.remove( 'overview-deactivating' ); + + if( features.overviewTransitions ) { + setTimeout( function() { + dom.wrapper.classList.add( 'overview-animated' ); + }, 1 ); + } + + // Don't auto-slide while in overview mode + cancelAutoSlide(); + + // Move the backgrounds element into the slide container to + // that the same scaling is applied + dom.slides.appendChild( dom.background ); + + // Clicking on an overview slide navigates to it + toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { + if( !slide.classList.contains( 'stack' ) ) { + slide.addEventListener( 'click', onOverviewSlideClicked, true ); + } + } ); + + // Calculate slide sizes + var margin = 70; + var slideSize = getComputedSlideSize(); + overviewSlideWidth = slideSize.width + margin; + overviewSlideHeight = slideSize.height + margin; + + // Reverse in RTL mode + if( config.rtl ) { + overviewSlideWidth = -overviewSlideWidth; + } + + updateSlidesVisibility(); + layoutOverview(); + updateOverview(); + + layout(); + + // Notify observers of the overview showing + dispatchEvent( 'overviewshown', { + 'indexh': indexh, + 'indexv': indexv, + 'currentSlide': currentSlide + } ); + + } + + } + + /** + * Uses CSS transforms to position all slides in a grid for + * display inside of the overview mode. + */ + function layoutOverview() { + + // Layout slides + toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) { + hslide.setAttribute( 'data-index-h', h ); + transformElement( hslide, 'translate3d(' + ( h * overviewSlideWidth ) + 'px, 0, 0)' ); + + if( hslide.classList.contains( 'stack' ) ) { + + toArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) { + vslide.setAttribute( 'data-index-h', h ); + vslide.setAttribute( 'data-index-v', v ); + + transformElement( vslide, 'translate3d(0, ' + ( v * overviewSlideHeight ) + 'px, 0)' ); + } ); + + } + } ); + + // Layout slide backgrounds + toArray( dom.background.childNodes ).forEach( function( hbackground, h ) { + transformElement( hbackground, 'translate3d(' + ( h * overviewSlideWidth ) + 'px, 0, 0)' ); + + toArray( hbackground.querySelectorAll( '.slide-background' ) ).forEach( function( vbackground, v ) { + transformElement( vbackground, 'translate3d(0, ' + ( v * overviewSlideHeight ) + 'px, 0)' ); + } ); + } ); + + } + + /** + * Moves the overview viewport to the current slides. + * Called each time the current slide changes. + */ + function updateOverview() { + + var vmin = Math.min( window.innerWidth, window.innerHeight ); + var scale = Math.max( vmin / 5, 150 ) / vmin; + + transformSlides( { + overview: [ + 'scale('+ scale +')', + 'translateX('+ ( -indexh * overviewSlideWidth ) +'px)', + 'translateY('+ ( -indexv * overviewSlideHeight ) +'px)' + ].join( ' ' ) + } ); + + } + + /** + * Exits the slide overview and enters the currently + * active slide. + */ + function deactivateOverview() { + + // Only proceed if enabled in config + if( config.overview ) { + + overview = false; + + dom.wrapper.classList.remove( 'overview' ); + dom.wrapper.classList.remove( 'overview-animated' ); + + // Temporarily add a class so that transitions can do different things + // depending on whether they are exiting/entering overview, or just + // moving from slide to slide + dom.wrapper.classList.add( 'overview-deactivating' ); + + setTimeout( function () { + dom.wrapper.classList.remove( 'overview-deactivating' ); + }, 1 ); + + // Move the background element back out + dom.wrapper.appendChild( dom.background ); + + // Clean up changes made to slides + toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { + transformElement( slide, '' ); + + slide.removeEventListener( 'click', onOverviewSlideClicked, true ); + } ); + + // Clean up changes made to backgrounds + toArray( dom.background.querySelectorAll( '.slide-background' ) ).forEach( function( background ) { + transformElement( background, '' ); + } ); + + transformSlides( { overview: '' } ); + + slide( indexh, indexv ); + + layout(); + + cueAutoSlide(); + + // Notify observers of the overview hiding + dispatchEvent( 'overviewhidden', { + 'indexh': indexh, + 'indexv': indexv, + 'currentSlide': currentSlide + } ); + + } + } + + /** + * Toggles the slide overview mode on and off. + * + * @param {Boolean} [override] Flag which overrides the + * toggle logic and forcibly sets the desired state. True means + * overview is open, false means it's closed. + */ + function toggleOverview( override ) { + + if( typeof override === 'boolean' ) { + override ? activateOverview() : deactivateOverview(); + } + else { + isOverview() ? deactivateOverview() : activateOverview(); + } + + } + + /** + * Checks if the overview is currently active. + * + * @return {Boolean} true if the overview is active, + * false otherwise + */ + function isOverview() { + + return overview; + + } + + /** + * Return a hash URL that will resolve to the current slide location. + */ + function locationHash() { + + var url = '/'; + + // Attempt to create a named link based on the slide's ID + var id = currentSlide ? currentSlide.getAttribute( 'id' ) : null; + if( id ) { + id = encodeURIComponent( id ); + } + + var indexf; + if( config.fragmentInURL ) { + indexf = getIndices().f; + } + + // If the current slide has an ID, use that as a named link, + // but we don't support named links with a fragment index + if( typeof id === 'string' && id.length && indexf === undefined ) { + url = '/' + id; + } + // Otherwise use the /h/v index + else { + var hashIndexBase = config.hashOneBasedIndex ? 1 : 0; + if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + hashIndexBase; + if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + hashIndexBase ); + if( indexf !== undefined ) url += '/' + indexf; + } + + return url; + + } + + /** + * Checks if the current or specified slide is vertical + * (nested within another slide). + * + * @param {HTMLElement} [slide=currentSlide] The slide to check + * orientation of + * @return {Boolean} + */ + function isVerticalSlide( slide ) { + + // Prefer slide argument, otherwise use current slide + slide = slide ? slide : currentSlide; + + return slide && slide.parentNode && !!slide.parentNode.nodeName.match( /section/i ); + + } + + /** + * Handling the fullscreen functionality via the fullscreen API + * + * @see http://fullscreen.spec.whatwg.org/ + * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode + */ + function enterFullscreen() { + + var element = document.documentElement; + + // Check which implementation is available + var requestMethod = element.requestFullscreen || + element.webkitRequestFullscreen || + element.webkitRequestFullScreen || + element.mozRequestFullScreen || + element.msRequestFullscreen; + + if( requestMethod ) { + requestMethod.apply( element ); + } + + } + + /** + * Shows the mouse pointer after it has been hidden with + * #hideCursor. + */ + function showCursor() { + + if( cursorHidden ) { + cursorHidden = false; + dom.wrapper.style.cursor = ''; + } + + } + + /** + * Hides the mouse pointer when it's on top of the .reveal + * container. + */ + function hideCursor() { + + if( cursorHidden === false ) { + cursorHidden = true; + dom.wrapper.style.cursor = 'none'; + } + + } + + /** + * Enters the paused mode which fades everything on screen to + * black. + */ + function pause() { + + if( config.pause ) { + var wasPaused = dom.wrapper.classList.contains( 'paused' ); + + cancelAutoSlide(); + dom.wrapper.classList.add( 'paused' ); + + if( wasPaused === false ) { + dispatchEvent( 'paused' ); + } + } + + } + + /** + * Exits from the paused mode. + */ + function resume() { + + var wasPaused = dom.wrapper.classList.contains( 'paused' ); + dom.wrapper.classList.remove( 'paused' ); + + cueAutoSlide(); + + if( wasPaused ) { + dispatchEvent( 'resumed' ); + } + + } + + /** + * Toggles the paused mode on and off. + */ + function togglePause( override ) { + + if( typeof override === 'boolean' ) { + override ? pause() : resume(); + } + else { + isPaused() ? resume() : pause(); + } + + } + + /** + * Checks if we are currently in the paused mode. + * + * @return {Boolean} + */ + function isPaused() { + + return dom.wrapper.classList.contains( 'paused' ); + + } + + /** + * Toggles the auto slide mode on and off. + * + * @param {Boolean} [override] Flag which sets the desired state. + * True means autoplay starts, false means it stops. + */ + + function toggleAutoSlide( override ) { + + if( typeof override === 'boolean' ) { + override ? resumeAutoSlide() : pauseAutoSlide(); + } + + else { + autoSlidePaused ? resumeAutoSlide() : pauseAutoSlide(); + } + + } + + /** + * Checks if the auto slide mode is currently on. + * + * @return {Boolean} + */ + function isAutoSliding() { + + return !!( autoSlide && !autoSlidePaused ); + + } + + /** + * Steps from the current point in the presentation to the + * slide which matches the specified horizontal and vertical + * indices. + * + * @param {number} [h=indexh] Horizontal index of the target slide + * @param {number} [v=indexv] Vertical index of the target slide + * @param {number} [f] Index of a fragment within the + * target slide to activate + * @param {number} [o] Origin for use in multimaster environments + */ + function slide( h, v, f, o ) { + + // Remember where we were at before + previousSlide = currentSlide; + + // Query all horizontal slides in the deck + var horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ); + + // Abort if there are no slides + if( horizontalSlides.length === 0 ) return; + + // If no vertical index is specified and the upcoming slide is a + // stack, resume at its previous vertical index + if( v === undefined && !isOverview() ) { + v = getPreviousVerticalIndex( horizontalSlides[ h ] ); + } + + // If we were on a vertical stack, remember what vertical index + // it was on so we can resume at the same position when returning + if( previousSlide && previousSlide.parentNode && previousSlide.parentNode.classList.contains( 'stack' ) ) { + setPreviousVerticalIndex( previousSlide.parentNode, indexv ); + } + + // Remember the state before this slide + var stateBefore = state.concat(); + + // Reset the state array + state.length = 0; + + var indexhBefore = indexh || 0, + indexvBefore = indexv || 0; + + // Activate and transition to the new slide + indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h ); + indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v ); + + // Update the visibility of slides now that the indices have changed + updateSlidesVisibility(); + + layout(); + + // Update the overview if it's currently active + if( isOverview() ) { + updateOverview(); + } + + // Find the current horizontal slide and any possible vertical slides + // within it + var currentHorizontalSlide = horizontalSlides[ indexh ], + currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' ); + + // Store references to the previous and current slides + currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide; + + // Show fragment, if specified + if( typeof f !== 'undefined' ) { + navigateFragment( f ); + } + + // Dispatch an event if the slide changed + var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore ); + if (!slideChanged) { + // Ensure that the previous slide is never the same as the current + previousSlide = null; + } + + // Solves an edge case where the previous slide maintains the + // 'present' class when navigating between adjacent vertical + // stacks + if( previousSlide && previousSlide !== currentSlide ) { + previousSlide.classList.remove( 'present' ); + previousSlide.setAttribute( 'aria-hidden', 'true' ); + + // Reset all slides upon navigate to home + // Issue: #285 + if ( dom.wrapper.querySelector( HOME_SLIDE_SELECTOR ).classList.contains( 'present' ) ) { + // Launch async task + setTimeout( function () { + var slides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.stack') ), i; + for( i in slides ) { + if( slides[i] ) { + // Reset stack + setPreviousVerticalIndex( slides[i], 0 ); + } + } + }, 0 ); + } + } + + // Apply the new state + stateLoop: for( var i = 0, len = state.length; i < len; i++ ) { + // Check if this state existed on the previous slide. If it + // did, we will avoid adding it repeatedly + for( var j = 0; j < stateBefore.length; j++ ) { + if( stateBefore[j] === state[i] ) { + stateBefore.splice( j, 1 ); + continue stateLoop; + } + } + + document.documentElement.classList.add( state[i] ); + + // Dispatch custom event matching the state's name + dispatchEvent( state[i] ); + } + + // Clean up the remains of the previous state + while( stateBefore.length ) { + document.documentElement.classList.remove( stateBefore.pop() ); + } + + if( slideChanged ) { + dispatchEvent( 'slidechanged', { + 'indexh': indexh, + 'indexv': indexv, + 'previousSlide': previousSlide, + 'currentSlide': currentSlide, + 'origin': o + } ); + } + + // Handle embedded content + if( slideChanged || !previousSlide ) { + stopEmbeddedContent( previousSlide ); + startEmbeddedContent( currentSlide ); + } + + // Announce the current slide contents, for screen readers + dom.statusDiv.textContent = getStatusText( currentSlide ); + + updateControls(); + updateProgress(); + updateBackground(); + updateParallax(); + updateSlideNumber(); + updateNotes(); + updateFragments(); + + // Update the URL hash + writeURL(); + + cueAutoSlide(); + + } + + /** + * Syncs the presentation with the current DOM. Useful + * when new slides or control elements are added or when + * the configuration has changed. + */ + function sync() { + + // Subscribe to input + removeEventListeners(); + addEventListeners(); + + // Force a layout to make sure the current config is accounted for + layout(); + + // Reflect the current autoSlide value + autoSlide = config.autoSlide; + + // Start auto-sliding if it's enabled + cueAutoSlide(); + + // Re-create the slide backgrounds + createBackgrounds(); + + // Write the current hash to the URL + writeURL(); + + sortAllFragments(); + + updateControls(); + updateProgress(); + updateSlideNumber(); + updateSlidesVisibility(); + updateBackground( true ); + updateNotesVisibility(); + updateNotes(); + + formatEmbeddedContent(); + + // Start or stop embedded content depending on global config + if( config.autoPlayMedia === false ) { + stopEmbeddedContent( currentSlide, { unloadIframes: false } ); + } + else { + startEmbeddedContent( currentSlide ); + } + + if( isOverview() ) { + layoutOverview(); + } + + } + + /** + * Updates reveal.js to keep in sync with new slide attributes. For + * example, if you add a new `data-background-image` you can call + * this to have reveal.js render the new background image. + * + * Similar to #sync() but more efficient when you only need to + * refresh a specific slide. + * + * @param {HTMLElement} slide + */ + function syncSlide( slide ) { + + // Default to the current slide + slide = slide || currentSlide; + + syncBackground( slide ); + syncFragments( slide ); + + updateBackground(); + updateNotes(); + + loadSlide( slide ); + + } + + /** + * Formats the fragments on the given slide so that they have + * valid indices. Call this if fragments are changed in the DOM + * after reveal.js has already initialized. + * + * @param {HTMLElement} slide + * @return {Array} a list of the HTML fragments that were synced + */ + function syncFragments( slide ) { + + // Default to the current slide + slide = slide || currentSlide; + + return sortFragments( slide.querySelectorAll( '.fragment' ) ); + + } + + /** + * Resets all vertical slides so that only the first + * is visible. + */ + function resetVerticalSlides() { + + var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + horizontalSlides.forEach( function( horizontalSlide ) { + + var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); + verticalSlides.forEach( function( verticalSlide, y ) { + + if( y > 0 ) { + verticalSlide.classList.remove( 'present' ); + verticalSlide.classList.remove( 'past' ); + verticalSlide.classList.add( 'future' ); + verticalSlide.setAttribute( 'aria-hidden', 'true' ); + } + + } ); + + } ); + + } + + /** + * Sorts and formats all of fragments in the + * presentation. + */ + function sortAllFragments() { + + var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + horizontalSlides.forEach( function( horizontalSlide ) { + + var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); + verticalSlides.forEach( function( verticalSlide, y ) { + + sortFragments( verticalSlide.querySelectorAll( '.fragment' ) ); + + } ); + + if( verticalSlides.length === 0 ) sortFragments( horizontalSlide.querySelectorAll( '.fragment' ) ); + + } ); + + } + + /** + * Randomly shuffles all slides in the deck. + */ + function shuffle() { + + var slides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + + slides.forEach( function( slide ) { + + // Insert this slide next to another random slide. This may + // cause the slide to insert before itself but that's fine. + dom.slides.insertBefore( slide, slides[ Math.floor( Math.random() * slides.length ) ] ); + + } ); + + } + + /** + * Updates one dimension of slides by showing the slide + * with the specified index. + * + * @param {string} selector A CSS selector that will fetch + * the group of slides we are working with + * @param {number} index The index of the slide that should be + * shown + * + * @return {number} The index of the slide that is now shown, + * might differ from the passed in index if it was out of + * bounds. + */ + function updateSlides( selector, index ) { + + // Select all slides and convert the NodeList result to + // an array + var slides = toArray( dom.wrapper.querySelectorAll( selector ) ), + slidesLength = slides.length; + + var printMode = isPrintingPDF(); + + if( slidesLength ) { + + // Should the index loop? + if( config.loop ) { + index %= slidesLength; + + if( index < 0 ) { + index = slidesLength + index; + } + } + + // Enforce max and minimum index bounds + index = Math.max( Math.min( index, slidesLength - 1 ), 0 ); + + for( var i = 0; i < slidesLength; i++ ) { + var element = slides[i]; + + var reverse = config.rtl && !isVerticalSlide( element ); + + element.classList.remove( 'past' ); + element.classList.remove( 'present' ); + element.classList.remove( 'future' ); + + // http://www.w3.org/html/wg/drafts/html/master/editing.html#the-hidden-attribute + element.setAttribute( 'hidden', '' ); + element.setAttribute( 'aria-hidden', 'true' ); + + // If this element contains vertical slides + if( element.querySelector( 'section' ) ) { + element.classList.add( 'stack' ); + } + + // If we're printing static slides, all slides are "present" + if( printMode ) { + element.classList.add( 'present' ); + continue; + } + + if( i < index ) { + // Any element previous to index is given the 'past' class + element.classList.add( reverse ? 'future' : 'past' ); + + if( config.fragments ) { + // Show all fragments in prior slides + toArray( element.querySelectorAll( '.fragment' ) ).forEach( function( fragment ) { + fragment.classList.add( 'visible' ); + fragment.classList.remove( 'current-fragment' ); + } ); + } + } + else if( i > index ) { + // Any element subsequent to index is given the 'future' class + element.classList.add( reverse ? 'past' : 'future' ); + + if( config.fragments ) { + // Hide all fragments in future slides + toArray( element.querySelectorAll( '.fragment.visible' ) ).forEach( function( fragment ) { + fragment.classList.remove( 'visible' ); + fragment.classList.remove( 'current-fragment' ); + } ); + } + } + } + + // Mark the current slide as present + slides[index].classList.add( 'present' ); + slides[index].removeAttribute( 'hidden' ); + slides[index].removeAttribute( 'aria-hidden' ); + + // If this slide has a state associated with it, add it + // onto the current state of the deck + var slideState = slides[index].getAttribute( 'data-state' ); + if( slideState ) { + state = state.concat( slideState.split( ' ' ) ); + } + + } + else { + // Since there are no slides we can't be anywhere beyond the + // zeroth index + index = 0; + } + + return index; + + } + + /** + * Optimization method; hide all slides that are far away + * from the present slide. + */ + function updateSlidesVisibility() { + + // Select all slides and convert the NodeList result to + // an array + var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ), + horizontalSlidesLength = horizontalSlides.length, + distanceX, + distanceY; + + if( horizontalSlidesLength && typeof indexh !== 'undefined' ) { + + // The number of steps away from the present slide that will + // be visible + var viewDistance = isOverview() ? 10 : config.viewDistance; + + // Limit view distance on weaker devices + if( isMobileDevice ) { + viewDistance = isOverview() ? 6 : 2; + } + + // All slides need to be visible when exporting to PDF + if( isPrintingPDF() ) { + viewDistance = Number.MAX_VALUE; + } + + for( var x = 0; x < horizontalSlidesLength; x++ ) { + var horizontalSlide = horizontalSlides[x]; + + var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ), + verticalSlidesLength = verticalSlides.length; + + // Determine how far away this slide is from the present + distanceX = Math.abs( ( indexh || 0 ) - x ) || 0; + + // If the presentation is looped, distance should measure + // 1 between the first and last slides + if( config.loop ) { + distanceX = Math.abs( ( ( indexh || 0 ) - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0; + } + + // Show the horizontal slide if it's within the view distance + if( distanceX < viewDistance ) { + loadSlide( horizontalSlide ); + } + else { + unloadSlide( horizontalSlide ); + } + + if( verticalSlidesLength ) { + + var oy = getPreviousVerticalIndex( horizontalSlide ); + + for( var y = 0; y < verticalSlidesLength; y++ ) { + var verticalSlide = verticalSlides[y]; + + distanceY = x === ( indexh || 0 ) ? Math.abs( ( indexv || 0 ) - y ) : Math.abs( y - oy ); + + if( distanceX + distanceY < viewDistance ) { + loadSlide( verticalSlide ); + } + else { + unloadSlide( verticalSlide ); + } + } + + } + } + + // Flag if there are ANY vertical slides, anywhere in the deck + if( dom.wrapper.querySelectorAll( '.slides>section>section' ).length ) { + dom.wrapper.classList.add( 'has-vertical-slides' ); + } + else { + dom.wrapper.classList.remove( 'has-vertical-slides' ); + } + + // Flag if there are ANY horizontal slides, anywhere in the deck + if( dom.wrapper.querySelectorAll( '.slides>section' ).length > 1 ) { + dom.wrapper.classList.add( 'has-horizontal-slides' ); + } + else { + dom.wrapper.classList.remove( 'has-horizontal-slides' ); + } + + } + + } + + /** + * Pick up notes from the current slide and display them + * to the viewer. + * + * @see {@link config.showNotes} + */ + function updateNotes() { + + if( config.showNotes && dom.speakerNotes && currentSlide && !isPrintingPDF() ) { + + dom.speakerNotes.innerHTML = getSlideNotes() || 'No notes on this slide.'; + + } + + } + + /** + * Updates the visibility of the speaker notes sidebar that + * is used to share annotated slides. The notes sidebar is + * only visible if showNotes is true and there are notes on + * one or more slides in the deck. + */ + function updateNotesVisibility() { + + if( config.showNotes && hasNotes() ) { + dom.wrapper.classList.add( 'show-notes' ); + } + else { + dom.wrapper.classList.remove( 'show-notes' ); + } + + } + + /** + * Checks if there are speaker notes for ANY slide in the + * presentation. + */ + function hasNotes() { + + return dom.slides.querySelectorAll( '[data-notes], aside.notes' ).length > 0; + + } + + /** + * Updates the progress bar to reflect the current slide. + */ + function updateProgress() { + + // Update progress if enabled + if( config.progress && dom.progressbar ) { + + dom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px'; + + } + + } + + + /** + * Updates the slide number to match the current slide. + */ + function updateSlideNumber() { + + // Update slide number if enabled + if( config.slideNumber && dom.slideNumber ) { + + var value; + var format = 'h.v'; + + if( typeof config.slideNumber === 'function' ) { + value = config.slideNumber(); + } + else { + // Check if a custom number format is available + if( typeof config.slideNumber === 'string' ) { + format = config.slideNumber; + } + + // If there are ONLY vertical slides in this deck, always use + // a flattened slide number + if( !/c/.test( format ) && dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length === 1 ) { + format = 'c'; + } + + value = []; + switch( format ) { + case 'c': + value.push( getSlidePastCount() + 1 ); + break; + case 'c/t': + value.push( getSlidePastCount() + 1, '/', getTotalSlides() ); + break; + case 'h/v': + value.push( indexh + 1 ); + if( isVerticalSlide() ) value.push( '/', indexv + 1 ); + break; + default: + value.push( indexh + 1 ); + if( isVerticalSlide() ) value.push( '.', indexv + 1 ); + } + } + + dom.slideNumber.innerHTML = formatSlideNumber( value[0], value[1], value[2] ); + } + + } + + /** + * Applies HTML formatting to a slide number before it's + * written to the DOM. + * + * @param {number} a Current slide + * @param {string} delimiter Character to separate slide numbers + * @param {(number|*)} b Total slides + * @return {string} HTML string fragment + */ + function formatSlideNumber( a, delimiter, b ) { + + var url = '#' + locationHash(); + if( typeof b === 'number' && !isNaN( b ) ) { + return '' + + ''+ a +'' + + ''+ delimiter +'' + + ''+ b +'' + + ''; + } + else { + return '' + + ''+ a +'' + + ''; + } + + } + + /** + * Updates the state of all control/navigation arrows. + */ + function updateControls() { + + var routes = availableRoutes(); + var fragments = availableFragments(); + + // Remove the 'enabled' class from all directions + dom.controlsLeft.concat( dom.controlsRight ) + .concat( dom.controlsUp ) + .concat( dom.controlsDown ) + .concat( dom.controlsPrev ) + .concat( dom.controlsNext ).forEach( function( node ) { + node.classList.remove( 'enabled' ); + node.classList.remove( 'fragmented' ); + + // Set 'disabled' attribute on all directions + node.setAttribute( 'disabled', 'disabled' ); + } ); + + // Add the 'enabled' class to the available routes; remove 'disabled' attribute to enable buttons + if( routes.left ) dom.controlsLeft.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( routes.right ) dom.controlsRight.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( routes.up ) dom.controlsUp.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( routes.down ) dom.controlsDown.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); + + // Prev/next buttons + if( routes.left || routes.up ) dom.controlsPrev.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( routes.right || routes.down ) dom.controlsNext.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); + + // Highlight fragment directions + if( currentSlide ) { + + // Always apply fragment decorator to prev/next buttons + if( fragments.prev ) dom.controlsPrev.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( fragments.next ) dom.controlsNext.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); + + // Apply fragment decorators to directional buttons based on + // what slide axis they are in + if( isVerticalSlide( currentSlide ) ) { + if( fragments.prev ) dom.controlsUp.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( fragments.next ) dom.controlsDown.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); + } + else { + if( fragments.prev ) dom.controlsLeft.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); + if( fragments.next ) dom.controlsRight.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); + } + + } + + if( config.controlsTutorial ) { + + // Highlight control arrows with an animation to ensure + // that the viewer knows how to navigate + if( !hasNavigatedDown && routes.down ) { + dom.controlsDownArrow.classList.add( 'highlight' ); + } + else { + dom.controlsDownArrow.classList.remove( 'highlight' ); + + if( !hasNavigatedRight && routes.right && indexv === 0 ) { + dom.controlsRightArrow.classList.add( 'highlight' ); + } + else { + dom.controlsRightArrow.classList.remove( 'highlight' ); + } + } + + } + + } + + /** + * Updates the background elements to reflect the current + * slide. + * + * @param {boolean} includeAll If true, the backgrounds of + * all vertical slides (not just the present) will be updated. + */ + function updateBackground( includeAll ) { + + var currentBackground = null; + + // Reverse past/future classes when in RTL mode + var horizontalPast = config.rtl ? 'future' : 'past', + horizontalFuture = config.rtl ? 'past' : 'future'; + + // Update the classes of all backgrounds to match the + // states of their slides (past/present/future) + toArray( dom.background.childNodes ).forEach( function( backgroundh, h ) { + + backgroundh.classList.remove( 'past' ); + backgroundh.classList.remove( 'present' ); + backgroundh.classList.remove( 'future' ); + + if( h < indexh ) { + backgroundh.classList.add( horizontalPast ); + } + else if ( h > indexh ) { + backgroundh.classList.add( horizontalFuture ); + } + else { + backgroundh.classList.add( 'present' ); + + // Store a reference to the current background element + currentBackground = backgroundh; + } + + if( includeAll || h === indexh ) { + toArray( backgroundh.querySelectorAll( '.slide-background' ) ).forEach( function( backgroundv, v ) { + + backgroundv.classList.remove( 'past' ); + backgroundv.classList.remove( 'present' ); + backgroundv.classList.remove( 'future' ); + + if( v < indexv ) { + backgroundv.classList.add( 'past' ); + } + else if ( v > indexv ) { + backgroundv.classList.add( 'future' ); + } + else { + backgroundv.classList.add( 'present' ); + + // Only if this is the present horizontal and vertical slide + if( h === indexh ) currentBackground = backgroundv; + } + + } ); + } + + } ); + + // Stop content inside of previous backgrounds + if( previousBackground ) { + + stopEmbeddedContent( previousBackground ); + + } + + // Start content in the current background + if( currentBackground ) { + + startEmbeddedContent( currentBackground ); + + var currentBackgroundContent = currentBackground.querySelector( '.slide-background-content' ); + if( currentBackgroundContent ) { + + var backgroundImageURL = currentBackgroundContent.style.backgroundImage || ''; + + // Restart GIFs (doesn't work in Firefox) + if( /\.gif/i.test( backgroundImageURL ) ) { + currentBackgroundContent.style.backgroundImage = ''; + window.getComputedStyle( currentBackgroundContent ).opacity; + currentBackgroundContent.style.backgroundImage = backgroundImageURL; + } + + } + + // Don't transition between identical backgrounds. This + // prevents unwanted flicker. + var previousBackgroundHash = previousBackground ? previousBackground.getAttribute( 'data-background-hash' ) : null; + var currentBackgroundHash = currentBackground.getAttribute( 'data-background-hash' ); + if( currentBackgroundHash && currentBackgroundHash === previousBackgroundHash && currentBackground !== previousBackground ) { + dom.background.classList.add( 'no-transition' ); + } + + previousBackground = currentBackground; + + } + + // If there's a background brightness flag for this slide, + // bubble it to the .reveal container + if( currentSlide ) { + [ 'has-light-background', 'has-dark-background' ].forEach( function( classToBubble ) { + if( currentSlide.classList.contains( classToBubble ) ) { + dom.wrapper.classList.add( classToBubble ); + } + else { + dom.wrapper.classList.remove( classToBubble ); + } + } ); + } + + // Allow the first background to apply without transition + setTimeout( function() { + dom.background.classList.remove( 'no-transition' ); + }, 1 ); + + } + + /** + * Updates the position of the parallax background based + * on the current slide index. + */ + function updateParallax() { + + if( config.parallaxBackgroundImage ) { + + var horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ), + verticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR ); + + var backgroundSize = dom.background.style.backgroundSize.split( ' ' ), + backgroundWidth, backgroundHeight; + + if( backgroundSize.length === 1 ) { + backgroundWidth = backgroundHeight = parseInt( backgroundSize[0], 10 ); + } + else { + backgroundWidth = parseInt( backgroundSize[0], 10 ); + backgroundHeight = parseInt( backgroundSize[1], 10 ); + } + + var slideWidth = dom.background.offsetWidth, + horizontalSlideCount = horizontalSlides.length, + horizontalOffsetMultiplier, + horizontalOffset; + + if( typeof config.parallaxBackgroundHorizontal === 'number' ) { + horizontalOffsetMultiplier = config.parallaxBackgroundHorizontal; + } + else { + horizontalOffsetMultiplier = horizontalSlideCount > 1 ? ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 ) : 0; + } + + horizontalOffset = horizontalOffsetMultiplier * indexh * -1; + + var slideHeight = dom.background.offsetHeight, + verticalSlideCount = verticalSlides.length, + verticalOffsetMultiplier, + verticalOffset; + + if( typeof config.parallaxBackgroundVertical === 'number' ) { + verticalOffsetMultiplier = config.parallaxBackgroundVertical; + } + else { + verticalOffsetMultiplier = ( backgroundHeight - slideHeight ) / ( verticalSlideCount-1 ); + } + + verticalOffset = verticalSlideCount > 0 ? verticalOffsetMultiplier * indexv : 0; + + dom.background.style.backgroundPosition = horizontalOffset + 'px ' + -verticalOffset + 'px'; + + } + + } + + /** + * Should the given element be preloaded? + * Decides based on local element attributes and global config. + * + * @param {HTMLElement} element + */ + function shouldPreload( element ) { + + // Prefer an explicit global preload setting + var preload = config.preloadIframes; + + // If no global setting is available, fall back on the element's + // own preload setting + if( typeof preload !== 'boolean' ) { + preload = element.hasAttribute( 'data-preload' ); + } + + return preload; + } + + /** + * Called when the given slide is within the configured view + * distance. Shows the slide element and loads any content + * that is set to load lazily (data-src). + * + * @param {HTMLElement} slide Slide to show + */ + function loadSlide( slide, options ) { + + options = options || {}; + + // Show the slide element + slide.style.display = config.display; + + // Media elements with data-src attributes + toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ) ).forEach( function( element ) { + if( element.tagName !== 'IFRAME' || shouldPreload( element ) ) { + element.setAttribute( 'src', element.getAttribute( 'data-src' ) ); + element.setAttribute( 'data-lazy-loaded', '' ); + element.removeAttribute( 'data-src' ); + } + } ); + + // Media elements with children + toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( media ) { + var sources = 0; + + toArray( media.querySelectorAll( 'source[data-src]' ) ).forEach( function( source ) { + source.setAttribute( 'src', source.getAttribute( 'data-src' ) ); + source.removeAttribute( 'data-src' ); + source.setAttribute( 'data-lazy-loaded', '' ); + sources += 1; + } ); + + // If we rewrote sources for this video/audio element, we need + // to manually tell it to load from its new origin + if( sources > 0 ) { + media.load(); + } + } ); + + + // Show the corresponding background element + var background = slide.slideBackgroundElement; + if( background ) { + background.style.display = 'block'; + + var backgroundContent = slide.slideBackgroundContentElement; + + // If the background contains media, load it + if( background.hasAttribute( 'data-loaded' ) === false ) { + background.setAttribute( 'data-loaded', 'true' ); + + var backgroundImage = slide.getAttribute( 'data-background-image' ), + backgroundVideo = slide.getAttribute( 'data-background-video' ), + backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ), + backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ), + backgroundIframe = slide.getAttribute( 'data-background-iframe' ); + + // Images + if( backgroundImage ) { + backgroundContent.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')'; + } + // Videos + else if ( backgroundVideo && !isSpeakerNotes() ) { + var video = document.createElement( 'video' ); + + if( backgroundVideoLoop ) { + video.setAttribute( 'loop', '' ); + } + + if( backgroundVideoMuted ) { + video.muted = true; + } + + // Inline video playback works (at least in Mobile Safari) as + // long as the video is muted and the `playsinline` attribute is + // present + if( isMobileDevice ) { + video.muted = true; + video.autoplay = true; + video.setAttribute( 'playsinline', '' ); + } + + // Support comma separated lists of video sources + backgroundVideo.split( ',' ).forEach( function( source ) { + video.innerHTML += ''; + } ); + + backgroundContent.appendChild( video ); + } + // Iframes + else if( backgroundIframe && options.excludeIframes !== true ) { + var iframe = document.createElement( 'iframe' ); + iframe.setAttribute( 'allowfullscreen', '' ); + iframe.setAttribute( 'mozallowfullscreen', '' ); + iframe.setAttribute( 'webkitallowfullscreen', '' ); + + // Only load autoplaying content when the slide is shown to + // avoid having it play in the background + if( /autoplay=(1|true|yes)/gi.test( backgroundIframe ) ) { + iframe.setAttribute( 'data-src', backgroundIframe ); + } + else { + iframe.setAttribute( 'src', backgroundIframe ); + } + + iframe.style.width = '100%'; + iframe.style.height = '100%'; + iframe.style.maxHeight = '100%'; + iframe.style.maxWidth = '100%'; + + backgroundContent.appendChild( iframe ); + } + } + + } + + } + + /** + * Unloads and hides the given slide. This is called when the + * slide is moved outside of the configured view distance. + * + * @param {HTMLElement} slide + */ + function unloadSlide( slide ) { + + // Hide the slide element + slide.style.display = 'none'; + + // Hide the corresponding background element + var background = getSlideBackground( slide ); + if( background ) { + background.style.display = 'none'; + } + + // Reset lazy-loaded media elements with src attributes + toArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]' ) ).forEach( function( element ) { + element.setAttribute( 'data-src', element.getAttribute( 'src' ) ); + element.removeAttribute( 'src' ); + } ); + + // Reset lazy-loaded media elements with children + toArray( slide.querySelectorAll( 'video[data-lazy-loaded] source[src], audio source[src]' ) ).forEach( function( source ) { + source.setAttribute( 'data-src', source.getAttribute( 'src' ) ); + source.removeAttribute( 'src' ); + } ); + + } + + /** + * Determine what available routes there are for navigation. + * + * @return {{left: boolean, right: boolean, up: boolean, down: boolean}} + */ + function availableRoutes() { + + var horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ), + verticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR ); + + var routes = { + left: indexh > 0, + right: indexh < horizontalSlides.length - 1, + up: indexv > 0, + down: indexv < verticalSlides.length - 1 + }; + + // Looped presentations can always be navigated as long as + // there are slides available + if( config.loop ) { + if( horizontalSlides.length > 1 ) { + routes.left = true; + routes.right = true; + } + + if( verticalSlides.length > 1 ) { + routes.up = true; + routes.down = true; + } + } + + // Reverse horizontal controls for rtl + if( config.rtl ) { + var left = routes.left; + routes.left = routes.right; + routes.right = left; + } + + return routes; + + } + + /** + * Returns an object describing the available fragment + * directions. + * + * @return {{prev: boolean, next: boolean}} + */ + function availableFragments() { + + if( currentSlide && config.fragments ) { + var fragments = currentSlide.querySelectorAll( '.fragment' ); + var hiddenFragments = currentSlide.querySelectorAll( '.fragment:not(.visible)' ); + + return { + prev: fragments.length - hiddenFragments.length > 0, + next: !!hiddenFragments.length + }; + } + else { + return { prev: false, next: false }; + } + + } + + /** + * Enforces origin-specific format rules for embedded media. + */ + function formatEmbeddedContent() { + + var _appendParamToIframeSource = function( sourceAttribute, sourceURL, param ) { + toArray( dom.slides.querySelectorAll( 'iframe['+ sourceAttribute +'*="'+ sourceURL +'"]' ) ).forEach( function( el ) { + var src = el.getAttribute( sourceAttribute ); + if( src && src.indexOf( param ) === -1 ) { + el.setAttribute( sourceAttribute, src + ( !/\?/.test( src ) ? '?' : '&' ) + param ); + } + }); + }; + + // YouTube frames must include "?enablejsapi=1" + _appendParamToIframeSource( 'src', 'youtube.com/embed/', 'enablejsapi=1' ); + _appendParamToIframeSource( 'data-src', 'youtube.com/embed/', 'enablejsapi=1' ); + + // Vimeo frames must include "?api=1" + _appendParamToIframeSource( 'src', 'player.vimeo.com/', 'api=1' ); + _appendParamToIframeSource( 'data-src', 'player.vimeo.com/', 'api=1' ); + + } + + /** + * Start playback of any embedded content inside of + * the given element. + * + * @param {HTMLElement} element + */ + function startEmbeddedContent( element ) { + + if( element && !isSpeakerNotes() ) { + + // Restart GIFs + toArray( element.querySelectorAll( 'img[src$=".gif"]' ) ).forEach( function( el ) { + // Setting the same unchanged source like this was confirmed + // to work in Chrome, FF & Safari + el.setAttribute( 'src', el.getAttribute( 'src' ) ); + } ); + + // HTML5 media elements + toArray( element.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { + if( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) { + return; + } + + // Prefer an explicit global autoplay setting + var autoplay = config.autoPlayMedia; + + // If no global setting is available, fall back on the element's + // own autoplay setting + if( typeof autoplay !== 'boolean' ) { + autoplay = el.hasAttribute( 'data-autoplay' ) || !!closestParent( el, '.slide-background' ); + } + + if( autoplay && typeof el.play === 'function' ) { + + // If the media is ready, start playback + if( el.readyState > 1 ) { + startEmbeddedMedia( { target: el } ); + } + // Mobile devices never fire a loaded event so instead + // of waiting, we initiate playback + else if( isMobileDevice ) { + var promise = el.play(); + + // If autoplay does not work, ensure that the controls are visible so + // that the viewer can start the media on their own + if( promise && typeof promise.catch === 'function' && el.controls === false ) { + promise.catch( function() { + el.controls = true; + + // Once the video does start playing, hide the controls again + el.addEventListener( 'play', function() { + el.controls = false; + } ); + } ); + } + } + // If the media isn't loaded, wait before playing + else { + el.removeEventListener( 'loadeddata', startEmbeddedMedia ); // remove first to avoid dupes + el.addEventListener( 'loadeddata', startEmbeddedMedia ); + } + + } + } ); + + // Normal iframes + toArray( element.querySelectorAll( 'iframe[src]' ) ).forEach( function( el ) { + if( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) { + return; + } + + startEmbeddedIframe( { target: el } ); + } ); + + // Lazy loading iframes + toArray( element.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) { + if( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) { + return; + } + + if( el.getAttribute( 'src' ) !== el.getAttribute( 'data-src' ) ) { + el.removeEventListener( 'load', startEmbeddedIframe ); // remove first to avoid dupes + el.addEventListener( 'load', startEmbeddedIframe ); + el.setAttribute( 'src', el.getAttribute( 'data-src' ) ); + } + } ); + + } + + } + + /** + * Starts playing an embedded video/audio element after + * it has finished loading. + * + * @param {object} event + */ + function startEmbeddedMedia( event ) { + + var isAttachedToDOM = !!closestParent( event.target, 'html' ), + isVisible = !!closestParent( event.target, '.present' ); + + if( isAttachedToDOM && isVisible ) { + event.target.currentTime = 0; + event.target.play(); + } + + event.target.removeEventListener( 'loadeddata', startEmbeddedMedia ); + + } + + /** + * "Starts" the content of an embedded iframe using the + * postMessage API. + * + * @param {object} event + */ + function startEmbeddedIframe( event ) { + + var iframe = event.target; + + if( iframe && iframe.contentWindow ) { + + var isAttachedToDOM = !!closestParent( event.target, 'html' ), + isVisible = !!closestParent( event.target, '.present' ); + + if( isAttachedToDOM && isVisible ) { + + // Prefer an explicit global autoplay setting + var autoplay = config.autoPlayMedia; + + // If no global setting is available, fall back on the element's + // own autoplay setting + if( typeof autoplay !== 'boolean' ) { + autoplay = iframe.hasAttribute( 'data-autoplay' ) || !!closestParent( iframe, '.slide-background' ); + } + + // YouTube postMessage API + if( /youtube\.com\/embed\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) { + iframe.contentWindow.postMessage( '{"event":"command","func":"playVideo","args":""}', '*' ); + } + // Vimeo postMessage API + else if( /player\.vimeo\.com\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) { + iframe.contentWindow.postMessage( '{"method":"play"}', '*' ); + } + // Generic postMessage API + else { + iframe.contentWindow.postMessage( 'slide:start', '*' ); + } + + } + + } + + } + + /** + * Stop playback of any embedded content inside of + * the targeted slide. + * + * @param {HTMLElement} element + */ + function stopEmbeddedContent( element, options ) { + + options = extend( { + // Defaults + unloadIframes: true + }, options || {} ); + + if( element && element.parentNode ) { + // HTML5 media elements + toArray( element.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { + if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { + el.setAttribute('data-paused-by-reveal', ''); + el.pause(); + } + } ); + + // Generic postMessage API for non-lazy loaded iframes + toArray( element.querySelectorAll( 'iframe' ) ).forEach( function( el ) { + if( el.contentWindow ) el.contentWindow.postMessage( 'slide:stop', '*' ); + el.removeEventListener( 'load', startEmbeddedIframe ); + }); + + // YouTube postMessage API + toArray( element.querySelectorAll( 'iframe[src*="youtube.com/embed/"]' ) ).forEach( function( el ) { + if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) { + el.contentWindow.postMessage( '{"event":"command","func":"pauseVideo","args":""}', '*' ); + } + }); + + // Vimeo postMessage API + toArray( element.querySelectorAll( 'iframe[src*="player.vimeo.com/"]' ) ).forEach( function( el ) { + if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) { + el.contentWindow.postMessage( '{"method":"pause"}', '*' ); + } + }); + + if( options.unloadIframes === true ) { + // Unload lazy-loaded iframes + toArray( element.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) { + // Only removing the src doesn't actually unload the frame + // in all browsers (Firefox) so we set it to blank first + el.setAttribute( 'src', 'about:blank' ); + el.removeAttribute( 'src' ); + } ); + } + } + + } + + /** + * Returns the number of past slides. This can be used as a global + * flattened index for slides. + * + * @return {number} Past slide count + */ + function getSlidePastCount() { + + var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + + // The number of past slides + var pastCount = 0; + + // Step through all slides and count the past ones + mainLoop: for( var i = 0; i < horizontalSlides.length; i++ ) { + + var horizontalSlide = horizontalSlides[i]; + var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); + + for( var j = 0; j < verticalSlides.length; j++ ) { + + // Stop as soon as we arrive at the present + if( verticalSlides[j].classList.contains( 'present' ) ) { + break mainLoop; + } + + pastCount++; + + } + + // Stop as soon as we arrive at the present + if( horizontalSlide.classList.contains( 'present' ) ) { + break; + } + + // Don't count the wrapping section for vertical slides + if( horizontalSlide.classList.contains( 'stack' ) === false ) { + pastCount++; + } + + } + + return pastCount; + + } + + /** + * Returns a value ranging from 0-1 that represents + * how far into the presentation we have navigated. + * + * @return {number} + */ + function getProgress() { + + // The number of past and total slides + var totalCount = getTotalSlides(); + var pastCount = getSlidePastCount(); + + if( currentSlide ) { + + var allFragments = currentSlide.querySelectorAll( '.fragment' ); + + // If there are fragments in the current slide those should be + // accounted for in the progress. + if( allFragments.length > 0 ) { + var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' ); + + // This value represents how big a portion of the slide progress + // that is made up by its fragments (0-1) + var fragmentWeight = 0.9; + + // Add fragment progress to the past slide count + pastCount += ( visibleFragments.length / allFragments.length ) * fragmentWeight; + } + + } + + return Math.min( pastCount / ( totalCount - 1 ), 1 ); + + } + + /** + * Checks if this presentation is running inside of the + * speaker notes window. + * + * @return {boolean} + */ + function isSpeakerNotes() { + + return !!window.location.search.match( /receiver/gi ); + + } + + /** + * Reads the current URL (hash) and navigates accordingly. + */ + function readURL() { + + var hash = window.location.hash; + + // Attempt to parse the hash as either an index or name + var bits = hash.slice( 2 ).split( '/' ), + name = hash.replace( /#|\//gi, '' ); + + // If the first bit is not fully numeric and there is a name we + // can assume that this is a named link + if( !/^[0-9]*$/.test( bits[0] ) && name.length ) { + var element; + + // Ensure the named link is a valid HTML ID attribute + try { + element = document.getElementById( decodeURIComponent( name ) ); + } + catch ( error ) { } + + // Ensure that we're not already on a slide with the same name + var isSameNameAsCurrentSlide = currentSlide ? currentSlide.getAttribute( 'id' ) === name : false; + + if( element ) { + // If the slide exists and is not the current slide... + if ( !isSameNameAsCurrentSlide ) { + // ...find the position of the named slide and navigate to it + var indices = Reveal.getIndices(element); + slide(indices.h, indices.v); + } + } + // If the slide doesn't exist, navigate to the current slide + else { + slide( indexh || 0, indexv || 0 ); + } + } + else { + var hashIndexBase = config.hashOneBasedIndex ? 1 : 0; + + // Read the index components of the hash + var h = ( parseInt( bits[0], 10 ) - hashIndexBase ) || 0, + v = ( parseInt( bits[1], 10 ) - hashIndexBase ) || 0, + f; + + if( config.fragmentInURL ) { + f = parseInt( bits[2], 10 ); + if( isNaN( f ) ) { + f = undefined; + } + } + + if( h !== indexh || v !== indexv || f !== undefined ) { + slide( h, v, f ); + } + } + + } + + /** + * Updates the page URL (hash) to reflect the current + * state. + * + * @param {number} delay The time in ms to wait before + * writing the hash + */ + function writeURL( delay ) { + + // Make sure there's never more than one timeout running + clearTimeout( writeURLTimeout ); + + // If a delay is specified, timeout this call + if( typeof delay === 'number' ) { + writeURLTimeout = setTimeout( writeURL, delay ); + } + else if( currentSlide ) { + // If we're configured to push to history OR the history + // API is not avaialble. + if( config.history || !window.history ) { + window.location.hash = locationHash(); + } + // If we're configured to reflect the current slide in the + // URL without pushing to history. + else if( config.hash ) { + window.history.replaceState( null, null, '#' + locationHash() ); + } + // If history and hash are both disabled, a hash may still + // be added to the URL by clicking on a href with a hash + // target. Counter this by always removing the hash. + else { + window.history.replaceState( null, null, window.location.pathname + window.location.search ); + } + } + + } + /** + * Retrieves the h/v location and fragment of the current, + * or specified, slide. + * + * @param {HTMLElement} [slide] If specified, the returned + * index will be for this slide rather than the currently + * active one + * + * @return {{h: number, v: number, f: number}} + */ + function getIndices( slide ) { + + // By default, return the current indices + var h = indexh, + v = indexv, + f; + + // If a slide is specified, return the indices of that slide + if( slide ) { + var isVertical = isVerticalSlide( slide ); + var slideh = isVertical ? slide.parentNode : slide; + + // Select all horizontal slides + var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + + // Now that we know which the horizontal slide is, get its index + h = Math.max( horizontalSlides.indexOf( slideh ), 0 ); + + // Assume we're not vertical + v = undefined; + + // If this is a vertical slide, grab the vertical index + if( isVertical ) { + v = Math.max( toArray( slide.parentNode.querySelectorAll( 'section' ) ).indexOf( slide ), 0 ); + } + } + + if( !slide && currentSlide ) { + var hasFragments = currentSlide.querySelectorAll( '.fragment' ).length > 0; + if( hasFragments ) { + var currentFragment = currentSlide.querySelector( '.current-fragment' ); + if( currentFragment && currentFragment.hasAttribute( 'data-fragment-index' ) ) { + f = parseInt( currentFragment.getAttribute( 'data-fragment-index' ), 10 ); + } + else { + f = currentSlide.querySelectorAll( '.fragment.visible' ).length - 1; + } + } + } + + return { h: h, v: v, f: f }; + + } + + /** + * Retrieves all slides in this presentation. + */ + function getSlides() { + + return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' )); + + } + + /** + * Returns an array of objects where each object represents the + * attributes on its respective slide. + */ + function getSlidesAttributes() { + + return getSlides().map( function( slide ) { + + var attributes = {}; + for( var i = 0; i < slide.attributes.length; i++ ) { + var attribute = slide.attributes[ i ]; + attributes[ attribute.name ] = attribute.value; + } + return attributes; + + } ); + + } + + /** + * Retrieves the total number of slides in this presentation. + * + * @return {number} + */ + function getTotalSlides() { + + return getSlides().length; + + } + + /** + * Returns the slide element matching the specified index. + * + * @return {HTMLElement} + */ + function getSlide( x, y ) { + + var horizontalSlide = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR )[ x ]; + var verticalSlides = horizontalSlide && horizontalSlide.querySelectorAll( 'section' ); + + if( verticalSlides && verticalSlides.length && typeof y === 'number' ) { + return verticalSlides ? verticalSlides[ y ] : undefined; + } + + return horizontalSlide; + + } + + /** + * Returns the background element for the given slide. + * All slides, even the ones with no background properties + * defined, have a background element so as long as the + * index is valid an element will be returned. + * + * @param {mixed} x Horizontal background index OR a slide + * HTML element + * @param {number} y Vertical background index + * @return {(HTMLElement[]|*)} + */ + function getSlideBackground( x, y ) { + + var slide = typeof x === 'number' ? getSlide( x, y ) : x; + if( slide ) { + return slide.slideBackgroundElement; + } + + return undefined; + + } + + /** + * Retrieves the speaker notes from a slide. Notes can be + * defined in two ways: + * 1. As a data-notes attribute on the slide
    + * 2. As an