diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..f737d71 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,95 @@ +const gulp = require('gulp') +const babel = require('gulp-babel') +//const sourcemaps = require('gulp-sourcemaps') +const browserSync = require('browser-sync') +const del = require('del') +const plumber = require('gulp-plumber') +const autoprefixer = require('gulp-autoprefixer') +const cssnano = require('gulp-cssnano') +const htmlreplace = require('gulp-html-replace') +const concat = require('gulp-concat') +const uglify = require('gulp-uglify') +const rename = require('gulp-rename') + +const paths = { + src: { + 'root': './statik/', + 'js': './statik/scripts/', + 'css': './statik/styles/' + }, + dist: { + 'root': './dist/', + 'js': './dist/scripts/', + 'css': './dist/styles/' + } +} + +gulp.task('clean', () => del(`${paths.dist.root}**/*`) ) + +gulp.task('copy', ['clean'], () => { + return gulp.src([ + `${paths.src.root}**/*`, + `!${paths.src.css}**/*.css`, + `!${paths.src.js}**/*.js`, + ], {"base": paths.src.root}) + .pipe(gulp.dest(paths.dist.root)) +}) + +gulp.task('css', () => { +return gulp.src(`${paths.src.css}**/*.css`) + .pipe(plumber()) + .pipe(concat('main.min.css')) + .pipe(autoprefixer()) + .pipe(cssnano()) + .pipe(gulp.dest(paths.dist.css)) +}) + +const minifyJs = (filename) => { + return gulp.src(`${paths.src.js}${filename}.js`) + .pipe(plumber()) + .pipe(babel()) + .pipe(uglify()) + .pipe(rename(`${filename}.min.js`)) + .pipe(gulp.dest(paths.dist.js)) +} + +gulp.task('js:vendor', () => { + return minifyJs('vendor') +}) +gulp.task('js:app', () => { + return minifyJs('app') +}) + +gulp.task('htmlreplace', () => { + return gulp.src(`${paths.src.root}**/*.html`) + .pipe(htmlreplace({ + 'css': '/styles/main.min.css', + 'js-vendor': '/scripts/vendors.min.js', + 'js-app': '/scripts/app.min.js' + })) + .pipe(gulp.dest(paths.dist.root)); +}) + +gulp.task('server', () => { + console.log('server') + + browserSync.init({ + server: { + baseDir: paths.src.root + } + }) + + gulp.watch([ + `${paths.src.root}**/*` + ]).on('change', browserSync.reload) +}) + +gulp.task('build', ['copy'], () => { + gulp.start('js:vendor', 'js:app', 'css', 'htmlreplace') +}) + +gulp.task('default', ['server'], () => { + console.log('server is running...') +}) + + diff --git a/package.json b/package.json index 1d8da8b..e137c3b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,9 @@ ], "scripts": { "lint": "eslint src/**/*.js", - "start": "node src/index.js" + "start": "gulp", + "build": "gulp build", + "gulp": "gulp" }, "repository": { "type": "git", @@ -24,9 +26,24 @@ }, "dependencies": {}, "devDependencies": { + "babel-core": "6.26.3", + "babel-preset-env": "1.7.0", + "browser-sync": "2.24.6", + "del": "3.0.0", "eslint": "5.0.1", "eslint-config-prettier": "2.9.0", "eslint-plugin-prettier": "2.6.2", + "gulp": "3.9.1", + "gulp-autoprefixer": "5.0.0", + "gulp-babel": "7.0.1", + "gulp-concat": "2.6.1", + "gulp-cssnano": "2.1.3", + "gulp-html-replace": "1.6.2", + "gulp-imagemin": "4.1.0", + "gulp-plumber": "1.2.0", + "gulp-rename": "1.4.0", + "gulp-sourcemaps": "2.6.4", + "gulp-uglify": "3.0.1", "prettier": "1.13.7" }, "license": "MIT" diff --git a/statik/fonts/open-sans-v15-latin-600.woff b/statik/fonts/open-sans-v15-latin-600.woff new file mode 100644 index 0000000..5a604b3 Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-600.woff differ diff --git a/statik/fonts/open-sans-v15-latin-600.woff2 b/statik/fonts/open-sans-v15-latin-600.woff2 new file mode 100644 index 0000000..a0965b7 Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-600.woff2 differ diff --git a/statik/fonts/open-sans-v15-latin-700.woff b/statik/fonts/open-sans-v15-latin-700.woff new file mode 100644 index 0000000..2523e95 Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-700.woff differ diff --git a/statik/fonts/open-sans-v15-latin-700.woff2 b/statik/fonts/open-sans-v15-latin-700.woff2 new file mode 100644 index 0000000..2b04b15 Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-700.woff2 differ diff --git a/statik/fonts/open-sans-v15-latin-800.woff b/statik/fonts/open-sans-v15-latin-800.woff new file mode 100644 index 0000000..41ae788 Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-800.woff differ diff --git a/statik/fonts/open-sans-v15-latin-800.woff2 b/statik/fonts/open-sans-v15-latin-800.woff2 new file mode 100644 index 0000000..53188bc Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-800.woff2 differ diff --git a/statik/fonts/open-sans-v15-latin-regular.woff b/statik/fonts/open-sans-v15-latin-regular.woff new file mode 100644 index 0000000..e495e6f Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-regular.woff differ diff --git a/statik/fonts/open-sans-v15-latin-regular.woff2 b/statik/fonts/open-sans-v15-latin-regular.woff2 new file mode 100644 index 0000000..c8050c2 Binary files /dev/null and b/statik/fonts/open-sans-v15-latin-regular.woff2 differ diff --git a/statik/images/favicon.ico b/statik/images/favicon.ico new file mode 100644 index 0000000..ae493d9 Binary files /dev/null and b/statik/images/favicon.ico differ diff --git a/statik/images/logo.png b/statik/images/logo.png new file mode 100644 index 0000000..bb42929 Binary files /dev/null and b/statik/images/logo.png differ diff --git a/statik/index.html b/statik/index.html new file mode 100644 index 0000000..28b69f5 --- /dev/null +++ b/statik/index.html @@ -0,0 +1,98 @@ + + + + + + + + + Statik Starter Kit + + + + + + + + + + +
+ + +
+

Statik

+

Many stacks. One place.

+
+
+ +
+
+

Welcome

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque luctus nec ligula at vehicula. Cras dapibus pellentesque + neque. Aliquam convallis nunc a purus sodales, ut maximus lectus scelerisque. Morbi a malesuada velit, ut tincidunt + sapien. Fusce placerat tellus a ullamcorper faucibus. +

+
+ +
+

Features

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque luctus nec ligula at vehicula. Cras dapibus pellentesque + neque. Aliquam convallis nunc a purus sodales, ut maximus lectus scelerisque. Morbi a malesuada velit, ut tincidunt + sapien. Fusce placerat tellus a ullamcorper faucibus. +

+
+
+ + + + + + + + + + + + + diff --git a/src/index.js b/statik/index.js similarity index 100% rename from src/index.js rename to statik/index.js diff --git a/statik/scripts/app.js b/statik/scripts/app.js new file mode 100644 index 0000000..30a0473 --- /dev/null +++ b/statik/scripts/app.js @@ -0,0 +1,7 @@ +// import '../styles/app.css'; + +// import '../images/logo.png'; +// import '../images/favicon.ico'; + +console.log('App is running...'); + diff --git a/statik/scripts/vendor.js b/statik/scripts/vendor.js new file mode 100644 index 0000000..b677548 --- /dev/null +++ b/statik/scripts/vendor.js @@ -0,0 +1,4 @@ +// import 'normalize.css'; +// import '../styles/fonts.css'; + +console.log('Vendor is running...'); diff --git a/statik/styles/app.css b/statik/styles/app.css new file mode 100644 index 0000000..8481ff7 --- /dev/null +++ b/statik/styles/app.css @@ -0,0 +1,142 @@ +:root { + --electromagnetic: #2f3640; + --hint-of-pensive: #dcdde1; + --lynx-white: #f5f6fa; + --pico-void: #192a56; + --rise-n-shine: #fbc531; + --text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8); +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +body { + background-color: var(--lynx-white); + border-top: 4px solid var(--rise-n-shine); + color: var(--electromagnetic); + font-family: 'Open Sans', sans-serif; + font-size: 16px; + line-height: 1.5; +} + +h1, +h2, +p { + font-weight: 400; + margin: 0; + max-width: 80ch; + padding: 0; +} + +p { + margin: 1rem 0; +} + +a { + text-decoration: none; +} + +.header { + background-color: var(--pico-void); +} + +.navbar { + align-items: center; + display: flex; + justify-content: space-between; + margin: 0 auto; + max-width: 1200px; + padding: 1rem; +} + +.navbar__brand { + align-items: center; + color: var(--lynx-white); + display: flex; +} + +.navbar__brand img { + margin-right: 1rem; +} + +.navbar__brand span { + font-size: 1.5rem; +} + +.navbar__social { + align-items: center; + display: flex; + list-style: none; + margin: 0; + padding: 0; +} + +.navbar__social li { + margin-left: 1rem; +} + +.navbar__social a { + display: block; +} + +.navbar__social svg { + fill: var(--hint-of-pensive); + transition: fill 200ms; + width: 1.5rem; +} + +.navbar__social a:hover svg { + fill: var(--lynx-white); +} + +.hero { + padding: 1rem; + text-align: center; +} + +.hero h1 { + color: var(--lynx-white); + font-size: 3rem; + font-weight: 700; + text-shadow: var(--text-shadow); +} + +.hero h2 { + color: var(--lynx-white); + font-size: 2rem; + padding: 1rem; + text-shadow: var(--text-shadow); +} + +.main { + display: grid; + grid-gap: 2rem; + grid-template-columns: repeat(2, 1fr); + margin: 0 auto; + max-width: 1200px; + padding: 2rem 1rem; +} + +.section h2 { + font-size: 1.5rem; + font-weight: 600; +} + +@media (max-width: 768px) { + .main { + grid-template-columns: repeat(1, 1fr); + } +} + +@media (max-width: 576px) { + .hero h1 { + font-size: 2.5rem; + } + + .hero h2 { + font-size: 1.5rem; + } +} diff --git a/statik/styles/fonts.css b/statik/styles/fonts.css new file mode 100644 index 0000000..a6d500e --- /dev/null +++ b/statik/styles/fonts.css @@ -0,0 +1,35 @@ +/* open-sans-regular - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/open-sans-v15-latin-regular.woff2') format('woff2'), + url('../fonts/open-sans-v15-latin-regular.woff') format('woff'); +} + +/* open-sans-600 - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 600; + src: url('../fonts/open-sans-v15-latin-600.woff2') format('woff2'), + url('../fonts/open-sans-v15-latin-600.woff') format('woff'); +} + +/* open-sans-700 - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: url('../fonts/open-sans-v15-latin-700.woff2') format('woff2'), + url('../fonts/open-sans-v15-latin-700.woff') format('woff'); +} + +/* open-sans-800 - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 800; + src: url('../fonts/open-sans-v15-latin-800.woff2') format('woff2'), + url('../fonts/open-sans-v15-latin-800.woff') format('woff'); +} diff --git a/statik/styles/normalize.css b/statik/styles/normalize.css new file mode 100644 index 0000000..47b010e --- /dev/null +++ b/statik/styles/normalize.css @@ -0,0 +1,341 @@ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +}