From c17cf534dbaeebc970bd7776d74b44fb41d33a04 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 29 Mar 2018 16:21:56 +0200 Subject: [PATCH] Standard format --- Gruntfile.js | 30 +++++++++++++++--------------- js/script.js | 28 +++++++++++++--------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index f6badaa..7cc7690 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,6 @@ // Gruntfile -module.exports = function(grunt) { -require('load-grunt-tasks')(grunt); +module.exports = function (grunt) { + require('load-grunt-tasks')(grunt) // Project configuration. grunt.initConfig({ @@ -16,7 +16,7 @@ require('load-grunt-tasks')(grunt); } }, jekyll: { - files: ['index.md', '_includes/*.html', 'filters/*.*', '_layouts/*.*', 'tags/*.*', 'basics/*.*'], + files: ['index.md', '_includes/*.html', 'filters/*.*', '_layouts/*.*', 'tags/*.*', 'basics/*.*'], tasks: ['shell:jekyllBuild'] } }, @@ -24,22 +24,22 @@ require('load-grunt-tasks')(grunt); sass: { dist: { options: { - style: 'expanded', + style: 'compact', sourcemap: 'none' }, files: { - '_site/css/main.css':'_sass/main.scss' + '_site/css/main.css': '_sass/main.scss' } } }, shell: { jekyllServe: { - command: 'jekyll serve --no-watch' + command: 'bundle exec jekyll serve --no-watch' }, jekyllBuild: { - command: 'jekyll build' + command: 'bundle exec jekyll build' } }, @@ -47,7 +47,7 @@ require('load-grunt-tasks')(grunt); options: { map: true, processors: [ - require('autoprefixer-core')({browsers: 'last 2 versions'}) + require('autoprefixer')({browsers: 'last 2 versions'}) ] }, dist: { @@ -61,12 +61,12 @@ require('load-grunt-tasks')(grunt); logConcurrentOutput: true } } - }); + }) - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-contrib-sass'); - grunt.loadNpmTasks('grunt-postcss'); - grunt.loadNpmTasks('grunt-concurrent'); + grunt.loadNpmTasks('grunt-contrib-watch') + grunt.loadNpmTasks('grunt-contrib-sass') + grunt.loadNpmTasks('grunt-postcss') + grunt.loadNpmTasks('grunt-concurrent') - grunt.registerTask('default', ['concurrent']); -}; + grunt.registerTask('default', ['concurrent']) +} diff --git a/js/script.js b/js/script.js index 484d46b..ce9abad 100644 --- a/js/script.js +++ b/js/script.js @@ -1,17 +1,15 @@ -var menuButton = document.querySelector('.menu-button'); -var sidebar = document.querySelector('.sidebar'); -var contentOverlay = document.querySelector('.content__overlay'); +var menuButton = document.querySelector('.menu-button') +var sidebar = document.querySelector('.sidebar') +var contentOverlay = document.querySelector('.content__overlay') -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { + menuButton.addEventListener('click', function () { + sidebar.classList.toggle('sidebar--is-visible') + contentOverlay.classList.toggle('content__overlay--is-active') + }) - menuButton.addEventListener('click', function() { - sidebar.classList.toggle('sidebar--is-visible'); - contentOverlay.classList.toggle('content__overlay--is-active'); - }); - - contentOverlay.addEventListener('click', function() { - sidebar.classList.toggle('sidebar--is-visible'); - contentOverlay.classList.toggle('content__overlay--is-active'); - }); - -}); + contentOverlay.addEventListener('click', function () { + sidebar.classList.toggle('sidebar--is-visible') + contentOverlay.classList.toggle('content__overlay--is-active') + }) +})