diff --git a/package.json b/package.json index acefa20..33e545e 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Gobelins DataViz", "main": "index.js", "scripts": { - "dev": "webpack-dev-server --inline --hot --quiet", - "build": "export NODE_ENV=production && webpack --progress --hide-modules", + "start": "gulp", + "build": "export NODE_ENV=production && gulp build", "deploy": "yarn build && gh-pages -d dist" }, "dependencies": { diff --git a/src/app.vue b/src/app.vue index 452ded3..212b95f 100644 --- a/src/app.vue +++ b/src/app.vue @@ -57,13 +57,13 @@ diff --git a/src/components/Intro.vue b/src/components/Intro.vue index bc24d46..c81dbb2 100644 --- a/src/components/Intro.vue +++ b/src/components/Intro.vue @@ -50,6 +50,30 @@ animation-iteration-count: 1; } + .play-intro{ + position: absolute; + z-index: 1110; + color: white; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-family: 'cpcompanyregular' sans-serif; + text-transform: uppercase; + color: #8c8c8c; + -webkit-transition: 0.35s; + transition: 0.35s; + text-decoration: none; + font-size: 12px; + vertical-align: middle; + padding-top: 35px; + letter-spacing: 2px; + cursor:pointer; + } + .play-intro:hover{ + color:#999999; + letter-spacing: 2.2px; + } + @keyframes wobbleright { 16.65% { @@ -78,6 +102,7 @@
Passer l'intro
+Play Intro
@@ -86,6 +111,11 @@ import $ from 'jquery'; import videojs from 'video.js'; export default { + data() { + return { + playing: false, + }; + }, ready() { let videoRatio = 16 / 9; let screenWidth = $(this.$el).width(); @@ -96,39 +126,45 @@ export default { // Fit height vidHeight = screenHeight; vidTop = 0; - vidWidth = vidHeight * (videoRatio); - vidLeft = (screenWidth - vidWidth)/2; + vidWidth = vidHeight * videoRatio; + vidLeft = (screenWidth - vidWidth) / 2; } else { // Fit width vidWidth = screenWidth; vidLeft = 0; - vidHeight = vidWidth * (1/videoRatio); - vidTop = (screenHeight - vidHeight)/2; + vidHeight = vidWidth * (1 / videoRatio); + vidTop = (screenHeight - vidHeight) / 2; } - $(this.$el).find('.intro-video').css({ - width: vidWidth, - height: vidHeight, - marginLeft: vidLeft, - marginTop: vidTop - }); + $(this.$el) + .find('.intro-video') + .css({ + width: vidWidth, + height: vidHeight, + marginLeft: vidLeft, + marginTop: vidTop, + }); var that = this; - videojs("video-intro", { - "autoplay": true, - "preload": "auto", - "width": vidWidth, - "height": vidHeight - //"poster": "http://video-js.zencoder.com/oceans-clip.png" - }, function () { - // Player (this) is initialized and ready. - that.player = this; - that.player.play(); - that.$dispatch('loader-off'); - that.player.on('ended', function() { - that.$dispatch('intro-end'); - }); - }); + videojs( + 'video-intro', + { + autoplay: false, + preload: 'auto', + width: vidWidth, + height: vidHeight, + //"poster": "http://video-js.zencoder.com/oceans-clip.png" + }, + function() { + // Player (this) is initialized and ready. + that.player = this; + // that.player.play(); + that.$dispatch('loader-off'); + that.player.on('ended', function() { + that.$dispatch('intro-end'); + }); + } + ); }, methods: { skipIntro() { @@ -136,17 +172,22 @@ export default { this.player.pause(); }, 300); this.$dispatch('intro-end'); - } + }, + playIntro() { + this.player.play(); + this.playing = true; + this.$dispatch('intro-start'); + }, }, events: { - 'sound-status': function (sound) { + 'sound-status': function(sound) { console.log(this.player); if (sound) { this.player.volume(0); } else { this.player.volume(1); } - } - } -} + }, + }, +}; diff --git a/webpack.config.js b/webpack.config.js index d535280..ce6c84f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ 'use strict'; var webpack = require('webpack'); -var path = require("path"); +var path = require('path'); var config = require('./config'); @@ -12,35 +12,35 @@ var webpackConfig = { output: { path: path.join(__dirname, config.out), publicPath: config.publicPath, - filename: config.outFile + filename: config.outFile, }, module: { loaders: [ { test: /\.vue$/, - loader: 'vue' + loader: 'vue', }, { test: /src\/(three|modules)\/.*(\.js)$/, - loader: 'babel' + loader: 'babel', }, { test: /src\/styles\/.*(\.scss)$/, - loader: 'sass' + loader: 'sass', }, { // edit this for additional asset file types test: /\.(png|jpg|gif|svg|eot|woff2|woff|ttf)$/, - loader: 'file?name=[name].[ext]?[hash]' - } - ] + loader: 'file?name=[name].[ext]?[hash]', + }, + ], }, // example: if you wish to apply custom babel options // instead of using vue-loader's default: babel: { presets: ['es2015', 'stage-0'], - plugins: ['transform-runtime'] - } -} + plugins: ['transform-runtime'], + }, +}; -module.exports = webpackConfig +module.exports = webpackConfig;