Browse Source

Add intro video

Jeremy Thomas 7 years ago
parent
commit
1210e65f83

+ 1 - 0
docs/_includes/footer.html

@@ -111,6 +111,7 @@
 <script src="{{ site.url }}/lib/main.js"></script>
 <script src="{{ site.url }}/lib/main.js"></script>
 
 
 {% if page.route == 'index' %}
 {% if page.route == 'index' %}
+  <script src="https://player.vimeo.com/api/player.js"></script>
   <script type="text/javascript" src="{{ site.url }}/lib/index.js"></script>
   <script type="text/javascript" src="{{ site.url }}/lib/index.js"></script>
 {% endif %}
 {% endif %}
 
 

File diff suppressed because it is too large
+ 2 - 3
docs/_includes/index/intro.html


+ 5 - 3
docs/_javascript/index.js

@@ -2,11 +2,13 @@ document.addEventListener('DOMContentLoaded', () => {
 
 
   // Intro
   // Intro
 
 
-  const introVimeo = document.getElementById('introVimeo');
+  const introVideo = document.getElementById('introVideo');
+  const introIframe = document.getElementById('introIframe');
+  const introPlayer = new Vimeo.Player(introIframe);
   const npmClipboard = new Clipboard('#npmCopy');
   const npmClipboard = new Clipboard('#npmCopy');
 
 
-  introVimeo.addEventListener('load', () => {
-    introVimeo.parentNode.parentNode.classList.add('has-loaded');
+  introPlayer.ready().then(function() {
+    introVideo.classList.add('has-loaded');
   });
   });
 
 
   npmClipboard.on('success', function(e) {
   npmClipboard.on('success', function(e) {

+ 20 - 3
docs/_sass/index.sass

@@ -11,6 +11,8 @@
 
 
 .intro-ghbtns
 .intro-ghbtns
   height: 30px
   height: 30px
+  margin-bottom: 24px
+  // margin-bottom: 46px
 
 
 .intro-npm
 .intro-npm
   background: $black-ter
   background: $black-ter
@@ -79,7 +81,7 @@
 
 
 .intro-spinner,
 .intro-spinner,
 .intro-shadow
 .intro-shadow
-  animation-duration: 1000ms
+  animation-duration: 500ms
   animation-easing-function: ease-out
   animation-easing-function: ease-out
   animation-fill-mode: both
   animation-fill-mode: both
   transform-origin: center
   transform-origin: center
@@ -107,8 +109,7 @@
 
 
 .intro-shadow
 .intro-shadow
   +overlay
   +overlay
-  background-color: #43647b
-  background-image: url("/images/index/vimeo-placeholder.jpg")
+  background-color: #776e70
   background-position: center center
   background-position: center center
   background-repeat: no-repeat
   background-repeat: no-repeat
   background-size: cover
   background-size: cover
@@ -118,6 +119,7 @@
 .intro-iframe
 .intro-iframe
   opacity: 0
   opacity: 0
   padding-top: 52.8125%
   padding-top: 52.8125%
+  // padding-top: 56.25%
   position: relative
   position: relative
   transition-duration: 500ms
   transition-duration: 500ms
   transition-property: opacity
   transition-property: opacity
@@ -128,6 +130,21 @@
     top: 0
     top: 0
     width: 100%
     width: 100%
 
 
+.intro-author
+  color: $text-light
+  font-size: $size-small
+  margin-top: 1rem
+  text-align: center
+  a
+    color: $text-strong
+    &:hover
+      text-decoration: underline
+  span
+    opacity: 0.5
+    transition: 100ms opacity
+    &:hover
+      opacity: 1
+
 +mobile
 +mobile
   .intro-buttons
   .intro-buttons
     .button
     .button

File diff suppressed because it is too large
+ 235 - 86
docs/css/bulma-docs.css


BIN
docs/images/index/vimeo-placeholder-bis.jpg


BIN
docs/images/index/vimeo-placeholder.jpg


+ 5 - 3
docs/lib/index.js

@@ -4,11 +4,13 @@ document.addEventListener('DOMContentLoaded', function () {
 
 
   // Intro
   // Intro
 
 
-  var introVimeo = document.getElementById('introVimeo');
+  var introVideo = document.getElementById('introVideo');
+  var introIframe = document.getElementById('introIframe');
+  var introPlayer = new Vimeo.Player(introIframe);
   var npmClipboard = new Clipboard('#npmCopy');
   var npmClipboard = new Clipboard('#npmCopy');
 
 
-  introVimeo.addEventListener('load', function () {
-    introVimeo.parentNode.parentNode.classList.add('has-loaded');
+  introPlayer.ready().then(function () {
+    introVideo.classList.add('has-loaded');
   });
   });
 
 
   npmClipboard.on('success', function (e) {
   npmClipboard.on('success', function (e) {

Some files were not shown because too many files changed in this diff