Commit 78be044d authored by abourmau's avatar abourmau
Browse files

v1

parents
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": [
"airbnb-base"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"no-console":"off"
}
}
node_modules/
\ No newline at end of file
# starter_gulp_lpmiaw_v1
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
\ No newline at end of file
@charset "UTF-8";*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%}body{font-size:1.4rem}a,a:hover,a:visited{color:#fff;text-decoration:none}img{max-width:100%;height:auto;vertical-align:middle}.presentation{height:100vh;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.presentation h1{font-size:8rem;padding-bottom:10rem}
\ No newline at end of file
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Gulp Starter Kit</title><link rel="stylesheet" href="assets/css/reset.css"><link rel="stylesheet" href="assets/css/styles.css"></head><body><!-- Starter--><section class="presentation"><h1>Starter Gulp - LP MIAW</h1><img src="assets/img/ecole_web.png" alt="ecole du web"></section><!--fin starter--></body></html>
\ No newline at end of file
// plugins
const gulp = require('gulp');
const del = require('del');
const htmlmin = require('gulp-htmlmin');
const minifyCss = require('gulp-clean-css');
const plumber = require('gulp-plumber');
const imagemin = require('gulp-imagemin');
const autoprefixer = require('gulp-autoprefixer');
const browsersync = require('browser-sync').create();
const sass = require('gulp-sass');
const distFolder = './dist/';
const srcFolder = './src/';
const paths = {
css: {
src: './src/assets/css/**/*.css',
dest: './dist/assets/css/',
},
scss: {
src: './src/assets/scss/**/*.scss',
dest: './src/assets/css/',
},
html: {
src: './src/**/*.html',
dest: './dist/',
},
img: {
src: './src/assets/img/**/*',
dest: './dist/assets/img/',
},
font: {
src: './src/assets/font/**/*',
dest: './dist/assets/font/',
},
};
function browserSyncDev() {
browsersync.init({
server: {
baseDir: srcFolder,
},
port: 3000,
});
}
function browserSync() {
browsersync.init({
server: {
baseDir: distFolder,
},
port: 3000,
});
}
// clean dist
function clear() {
return del([distFolder]);
}
function html() {
return (
gulp
.src(paths.html.src, { since: gulp.lastRun(html) })
.pipe(plumber())
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest(paths.html.dest))
.pipe(browsersync.stream())
);
}
function scss() {
return (
gulp
.src(paths.scss.src)
.pipe(sass({ outputStyle: 'compact' }).on('error', sass.logError))
.pipe(gulp.dest(paths.scss.dest))
.pipe(browsersync.stream())
);
}
function css() {
return (
gulp
.src(paths.css.src, { since: gulp.lastRun(css) })
.pipe(plumber())
.pipe(autoprefixer())
.pipe(minifyCss())
.pipe(gulp.dest(paths.css.dest))
.pipe(browsersync.stream())
);
}
function images() {
return (
gulp
.src(paths.img.src)
.pipe(plumber())
.pipe(imagemin())
.pipe(gulp.dest(paths.img.dest))
.pipe(browsersync.stream())
);
}
function watchFiles() {
// Ecoute ce qui se passe sur paths.css.src, et lance la fonction css s'il y a des modifs
gulp.watch(paths.scss.src, scss);
gulp.watch(paths.css.src, css);
gulp.watch(paths.html.src, html);
gulp.watch(paths.img.src, images);
}
function watch() {
gulp.watch(paths.scss.src, scss);
gulp.watch(paths.css.src, css);
gulp.watch(paths.html.src, html);
}
function font() {
return (
gulp
.src(paths.font.src, { since: gulp.lastRun(font) })
.pipe(plumber())
.pipe(gulp.dest(paths.font.dest))
.pipe(browsersync.stream())
);
}
const serie = gulp.series(clear, html, scss, css, images, font);
const build = gulp.series(serie, gulp.parallel(watchFiles, browserSync));
const dev = gulp.series(gulp.series(scss, css, html), gulp.parallel(watch, browserSyncDev));
// exports
exports.sass = sass;
exports.clear = clear;
exports.build = build;
exports.dev = dev;
exports.default = dev;
This diff is collapsed.
{
"name": "starter_gulp_lpmiaw_v1",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gitlab.univ-lr.fr:abourmau/starter_gulp_lpmiaw_v1.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"del": "^5.1.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.3.2",
"@typescript-eslint/parser": "^2.3.2",
"browser-sync": "^2.26.7",
"eslint": "^6.5.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.0",
"gulp-clean-css": "^4.2.0",
"gulp-htmlmin": "^5.0.1",
"gulp-imagemin": "^6.1.0",
"gulp-plumber": "^1.2.1",
"gulp-sass": "^4.0.2"
},
"browserslist": [
"last 2 version",
"IE 10"
]
}
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
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,
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, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
@charset "UTF-8";
/* Regles generales */
*, *:after, *:before { box-sizing: border-box; }
html { font-size: 62.5%; }
body { font-size: 1.4rem; /* 14px par défaut */ /*font-family: 'Noto sans', sans-serif;*/ }
a, a:hover, a:visited { /* ATTENTION LES LIENS SONT BLANC DANS CE MODELE*/ color: #FFF; text-decoration: none; }
img { max-width: 100%; height: auto; vertical-align: middle; }
/*******************************/
/* Starter: Prsentation */
/*****************************/
.presentation { height: 100vh; display: flex; justify-content: center; flex-direction: column; align-items: center; }
.presentation h1 { font-size: 8rem; padding-bottom: 10rem; }
/********************/
/* HEADER: */
/******************/
/* Regles generales */
*, *:after, *:before {
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
body {
font-size: 1.4rem; /* 14px par défaut */
/*font-family: 'Noto sans', sans-serif;*/
}
a, a:hover, a:visited{ /* ATTENTION LES LIENS SONT BLANC DANS CE MODELE*/
color: #FFF;
text-decoration: none;
}
img{
max-width:100%;
height: auto;
vertical-align: middle;
}
/*******************************/
/* Starter: Prsentation */
/*****************************/
.presentation{
height: 100vh;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.presentation h1{
font-size: 8rem;
padding-bottom: 10rem;
}
/********************/
/* HEADER: */
/******************/
@import 'mixins';
@import 'color';
@import 'base';
@import 'starter';
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Gulp Starter Kit</title>
<link rel="stylesheet" href="assets/css/reset.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>
<body>
<!-- Starter-->
<section class="presentation">
<h1>Starter Gulp - LP MIAW</h1>
<img src="assets/img/ecole_web.png" alt="ecole du web">
</section>
<!--fin starter-->
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment