feat: adicionando scripts e dependências

This commit is contained in:
Ana Carolina Duarte Cavalcante 2022-11-15 16:05:47 -03:00
parent d711b59f8d
commit 114d928dea
7 changed files with 7725 additions and 23 deletions

View File

@ -1,14 +1,65 @@
const {src,dest,watch} = require("gulp"); const { src, dest, watch, parallel } = require("gulp");
const sass = require("gulp-sass")(require("sass")); const sass = require("gulp-sass")(require("sass"));
const browserify = require("browserify");
const babelify = require("babelify");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
const uglify = require("gulp-uglify");
const connect = require("gulp-connect");
function styles() { const paths = {
return src("src/styles/main.scss") html: {
.pipe(sass({ outputStyle: "compressed" }).on("error", sass.logError)) all: "src/templates/**/*.html",
.pipe(dest("dist")); },
styles: {
all: "src/styles/**/*.scss",
main: "src/styles/main.scss",
},
scripts: {
all: "src/scripts/**/*.js",
main: "src/scripts/app.js",
},
output: "dist",
};
function server() {
connect.server({
root: "dist",
livereload: true,
port: 3000,
});
} }
function sentinel() { function sentinel() {
watch("src/styles/**/*.scss", { ignoreInitial: false }, styles); watch(paths.html.all, { ignoreInitial: false }, html);
watch(paths.styles.all, { ignoreInitial: false }, styles);
watch(paths.scripts.all, { ignoreInitial: false }, scripts);
} }
exports.sentinel = sentinel; function html() {
return src(paths.html.all).pipe(dest(paths.output));
}
function styles() {
return src(paths.styles.main)
.pipe(sass({ outputStyle: "compressed" }).on("error", sass.logError))
.pipe(dest(paths.output))
.pipe(connect.reload());
}
function scripts() {
return browserify(paths.scripts.main)
.transform(
babelify.configure({
presets: ["@babel/preset-env"],
})
)
.bundle()
.pipe(source("bundle.js"))
.pipe(buffer())
.pipe(uglify())
.pipe(dest(paths.output))
.pipe(connect.reload());
}
exports.default = parallel(server, sentinel);

7610
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"dev": "gulp sentinel" "dev": "gulp"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -14,8 +14,16 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-connect": "^5.7.0",
"gulp-sass": "^5.1.0", "gulp-sass": "^5.1.0",
"sass": "^1.56.1" "gulp-uglify": "^3.0.2",
"sass": "^1.56.1",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
} }
} }

5
src/scripts/app.js Normal file
View File

@ -0,0 +1,5 @@
import {Form} from "./components/form";
document.addEventListener("DOMContentLoaded",function(){
new Form();
});

View File

@ -0,0 +1,7 @@
export class Form {
constructor() {}
selectors() {}
events() {}
}

View File

@ -1,7 +1,22 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
input,
textarea {
border-radius: 8px;
}
.form-container {
max-width: 780px;
.form-inputs { .form-inputs {
display: flex; display: flex;
width: 100%;
.input-image-container {
.input-image-content {
width: 32%;
height: 212px;
border: 2px solid $input-image-border-color;
}
}
.form-input-descricao { .form-input-descricao {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -9,12 +24,17 @@
width: 79%; width: 79%;
height: 56px; height: 56px;
} }
.input-descricao {
width: 417px;
height: 136px;
}
.input-descricao, .input-descricao,
.input-titulo { .input-titulo {
padding: 10px 16px; padding: 10px 16px;
} }
} }
} }
}
textarea::placeholder, textarea::placeholder,
textarea, textarea,
@ -27,3 +47,6 @@ input,
letter-spacing: 0.15px; letter-spacing: 0.15px;
font-family: "Roboto", sans-serif; font-family: "Roboto", sans-serif;
} }
// width: 328px;
// height: 56px;

View File

@ -10,7 +10,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com"/> <link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet"/> <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="../dist/main.css"/> <link rel="stylesheet" href="main.css"/>
</head> </head>
<body> <body>
@ -34,6 +34,6 @@
</form> </form>
</section> </section>
</main> </main>
<script src="bundle.js"></script>
</body> </body>
</html> </html>