From a59903b1ad98b57956e07b8dc24f1ebe8a301e77 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 7 Apr 2018 15:04:13 +0200 Subject: [PATCH] [ALL] setup for 'parcel bundler' --- .babelrc | 5 ++ .gitignore | 7 +- .postcssrc | 6 ++ .../asset => asset}/svg/arrow.down.svg | 0 .../asset => asset}/svg/arrow.down@hover.svg | 0 .../asset => asset}/svg/arrow.left.svg | 0 .../asset => asset}/svg/arrow.left@hover.svg | 0 .../asset => asset}/svg/arrow.right.svg | 0 .../asset => asset}/svg/arrow.right@hover.svg | 0 {public_html/asset => asset}/svg/arrow.up.svg | 0 .../asset => asset}/svg/arrow.up@hover.svg | 0 .../asset => asset}/svg/audio.close.svg | 0 {public_html/asset => asset}/svg/checked.svg | 0 {public_html/asset => asset}/svg/cross.svg | 0 .../asset => asset}/svg/dialog.add.svg | 0 .../asset => asset}/svg/dialog.add@hover.svg | 0 .../asset => asset}/svg/dialog.text.svg | 0 .../svg/dialog.text@active.svg | 0 .../asset => asset}/svg/dialog.voice.svg | 0 .../svg/dialog.voice@active.svg | 0 {public_html/asset => asset}/svg/loader.svg | 0 {public_html/asset => asset}/svg/menu.add.svg | 0 .../asset => asset}/svg/menu.add@hover.svg | 0 .../asset => asset}/svg/menu.group.svg | 0 .../svg/minipopup.category.svg | 0 .../asset => asset}/svg/minipopup.create.svg | 0 .../asset => asset}/svg/minipopup.edit.svg | 0 .../asset => asset}/svg/minipopup.invite.svg | 0 .../asset => asset}/svg/minipopup.leave.svg | 0 .../asset => asset}/svg/minipopup.logout.svg | 0 .../svg/minipopup.password.svg | 0 .../asset => asset}/svg/minipopup.remove.svg | 0 .../svg/minipopup.remove@hover.svg | 0 .../asset => asset}/svg/voice.connected.svg | 0 index.html | 39 ++++++++ package.json | 35 +++----- public_html/index.html | 37 +------- {webpack/scss => scss}/constants.scss | 0 {webpack/scss => scss}/container.scss | 0 {webpack/scss => scss}/dialog.scss | 88 ++++++++++++++++++- {webpack/scss => scss}/global.scss | 0 {webpack/scss => scss}/layout.scss | 0 {webpack/scss => scss}/menu.scss | 0 {webpack/scss => scss}/pop-up.scss | 0 {webpack/scss => scss}/side-menu.scss | 0 webpack/main.js | 10 ++- webpack/page/auth/channel.js | 1 - webpack/page/noauth/register.js | 2 +- webpack/vue/auth/dialog.vue | 88 ------------------- 49 files changed, 159 insertions(+), 159 deletions(-) create mode 100644 .babelrc create mode 100644 .postcssrc rename {public_html/asset => asset}/svg/arrow.down.svg (100%) rename {public_html/asset => asset}/svg/arrow.down@hover.svg (100%) rename {public_html/asset => asset}/svg/arrow.left.svg (100%) rename {public_html/asset => asset}/svg/arrow.left@hover.svg (100%) rename {public_html/asset => asset}/svg/arrow.right.svg (100%) rename {public_html/asset => asset}/svg/arrow.right@hover.svg (100%) rename {public_html/asset => asset}/svg/arrow.up.svg (100%) rename {public_html/asset => asset}/svg/arrow.up@hover.svg (100%) rename {public_html/asset => asset}/svg/audio.close.svg (100%) rename {public_html/asset => asset}/svg/checked.svg (100%) rename {public_html/asset => asset}/svg/cross.svg (100%) rename {public_html/asset => asset}/svg/dialog.add.svg (100%) rename {public_html/asset => asset}/svg/dialog.add@hover.svg (100%) rename {public_html/asset => asset}/svg/dialog.text.svg (100%) rename {public_html/asset => asset}/svg/dialog.text@active.svg (100%) rename {public_html/asset => asset}/svg/dialog.voice.svg (100%) rename {public_html/asset => asset}/svg/dialog.voice@active.svg (100%) rename {public_html/asset => asset}/svg/loader.svg (100%) rename {public_html/asset => asset}/svg/menu.add.svg (100%) rename {public_html/asset => asset}/svg/menu.add@hover.svg (100%) rename {public_html/asset => asset}/svg/menu.group.svg (100%) rename {public_html/asset => asset}/svg/minipopup.category.svg (100%) rename {public_html/asset => asset}/svg/minipopup.create.svg (100%) rename {public_html/asset => asset}/svg/minipopup.edit.svg (100%) rename {public_html/asset => asset}/svg/minipopup.invite.svg (100%) rename {public_html/asset => asset}/svg/minipopup.leave.svg (100%) rename {public_html/asset => asset}/svg/minipopup.logout.svg (100%) rename {public_html/asset => asset}/svg/minipopup.password.svg (100%) rename {public_html/asset => asset}/svg/minipopup.remove.svg (100%) rename {public_html/asset => asset}/svg/minipopup.remove@hover.svg (100%) rename {public_html/asset => asset}/svg/voice.connected.svg (100%) create mode 100644 index.html rename {webpack/scss => scss}/constants.scss (100%) rename {webpack/scss => scss}/container.scss (100%) rename {webpack/scss => scss}/dialog.scss (73%) rename {webpack/scss => scss}/global.scss (100%) rename {webpack/scss => scss}/layout.scss (100%) rename {webpack/scss => scss}/menu.scss (100%) rename {webpack/scss => scss}/pop-up.scss (100%) rename {webpack/scss => scss}/side-menu.scss (100%) diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..6a9be79 --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "env" + ] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 644e6b5..61816df 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .sass-cache *.map /node_modules -/public_html/css -/public_html/js -/package-lock.json \ No newline at end of file +/public_html/* +!/public_htm/.htaccess +/package-lock.json +.cache \ No newline at end of file diff --git a/.postcssrc b/.postcssrc new file mode 100644 index 0000000..e668e3f --- /dev/null +++ b/.postcssrc @@ -0,0 +1,6 @@ +{ + "modules": false, + "plugins": { + "autoprefixer": true + } +} \ No newline at end of file diff --git a/public_html/asset/svg/arrow.down.svg b/asset/svg/arrow.down.svg similarity index 100% rename from public_html/asset/svg/arrow.down.svg rename to asset/svg/arrow.down.svg diff --git a/public_html/asset/svg/arrow.down@hover.svg b/asset/svg/arrow.down@hover.svg similarity index 100% rename from public_html/asset/svg/arrow.down@hover.svg rename to asset/svg/arrow.down@hover.svg diff --git a/public_html/asset/svg/arrow.left.svg b/asset/svg/arrow.left.svg similarity index 100% rename from public_html/asset/svg/arrow.left.svg rename to asset/svg/arrow.left.svg diff --git a/public_html/asset/svg/arrow.left@hover.svg b/asset/svg/arrow.left@hover.svg similarity index 100% rename from public_html/asset/svg/arrow.left@hover.svg rename to asset/svg/arrow.left@hover.svg diff --git a/public_html/asset/svg/arrow.right.svg b/asset/svg/arrow.right.svg similarity index 100% rename from public_html/asset/svg/arrow.right.svg rename to asset/svg/arrow.right.svg diff --git a/public_html/asset/svg/arrow.right@hover.svg b/asset/svg/arrow.right@hover.svg similarity index 100% rename from public_html/asset/svg/arrow.right@hover.svg rename to asset/svg/arrow.right@hover.svg diff --git a/public_html/asset/svg/arrow.up.svg b/asset/svg/arrow.up.svg similarity index 100% rename from public_html/asset/svg/arrow.up.svg rename to asset/svg/arrow.up.svg diff --git a/public_html/asset/svg/arrow.up@hover.svg b/asset/svg/arrow.up@hover.svg similarity index 100% rename from public_html/asset/svg/arrow.up@hover.svg rename to asset/svg/arrow.up@hover.svg diff --git a/public_html/asset/svg/audio.close.svg b/asset/svg/audio.close.svg similarity index 100% rename from public_html/asset/svg/audio.close.svg rename to asset/svg/audio.close.svg diff --git a/public_html/asset/svg/checked.svg b/asset/svg/checked.svg similarity index 100% rename from public_html/asset/svg/checked.svg rename to asset/svg/checked.svg diff --git a/public_html/asset/svg/cross.svg b/asset/svg/cross.svg similarity index 100% rename from public_html/asset/svg/cross.svg rename to asset/svg/cross.svg diff --git a/public_html/asset/svg/dialog.add.svg b/asset/svg/dialog.add.svg similarity index 100% rename from public_html/asset/svg/dialog.add.svg rename to asset/svg/dialog.add.svg diff --git a/public_html/asset/svg/dialog.add@hover.svg b/asset/svg/dialog.add@hover.svg similarity index 100% rename from public_html/asset/svg/dialog.add@hover.svg rename to asset/svg/dialog.add@hover.svg diff --git a/public_html/asset/svg/dialog.text.svg b/asset/svg/dialog.text.svg similarity index 100% rename from public_html/asset/svg/dialog.text.svg rename to asset/svg/dialog.text.svg diff --git a/public_html/asset/svg/dialog.text@active.svg b/asset/svg/dialog.text@active.svg similarity index 100% rename from public_html/asset/svg/dialog.text@active.svg rename to asset/svg/dialog.text@active.svg diff --git a/public_html/asset/svg/dialog.voice.svg b/asset/svg/dialog.voice.svg similarity index 100% rename from public_html/asset/svg/dialog.voice.svg rename to asset/svg/dialog.voice.svg diff --git a/public_html/asset/svg/dialog.voice@active.svg b/asset/svg/dialog.voice@active.svg similarity index 100% rename from public_html/asset/svg/dialog.voice@active.svg rename to asset/svg/dialog.voice@active.svg diff --git a/public_html/asset/svg/loader.svg b/asset/svg/loader.svg similarity index 100% rename from public_html/asset/svg/loader.svg rename to asset/svg/loader.svg diff --git a/public_html/asset/svg/menu.add.svg b/asset/svg/menu.add.svg similarity index 100% rename from public_html/asset/svg/menu.add.svg rename to asset/svg/menu.add.svg diff --git a/public_html/asset/svg/menu.add@hover.svg b/asset/svg/menu.add@hover.svg similarity index 100% rename from public_html/asset/svg/menu.add@hover.svg rename to asset/svg/menu.add@hover.svg diff --git a/public_html/asset/svg/menu.group.svg b/asset/svg/menu.group.svg similarity index 100% rename from public_html/asset/svg/menu.group.svg rename to asset/svg/menu.group.svg diff --git a/public_html/asset/svg/minipopup.category.svg b/asset/svg/minipopup.category.svg similarity index 100% rename from public_html/asset/svg/minipopup.category.svg rename to asset/svg/minipopup.category.svg diff --git a/public_html/asset/svg/minipopup.create.svg b/asset/svg/minipopup.create.svg similarity index 100% rename from public_html/asset/svg/minipopup.create.svg rename to asset/svg/minipopup.create.svg diff --git a/public_html/asset/svg/minipopup.edit.svg b/asset/svg/minipopup.edit.svg similarity index 100% rename from public_html/asset/svg/minipopup.edit.svg rename to asset/svg/minipopup.edit.svg diff --git a/public_html/asset/svg/minipopup.invite.svg b/asset/svg/minipopup.invite.svg similarity index 100% rename from public_html/asset/svg/minipopup.invite.svg rename to asset/svg/minipopup.invite.svg diff --git a/public_html/asset/svg/minipopup.leave.svg b/asset/svg/minipopup.leave.svg similarity index 100% rename from public_html/asset/svg/minipopup.leave.svg rename to asset/svg/minipopup.leave.svg diff --git a/public_html/asset/svg/minipopup.logout.svg b/asset/svg/minipopup.logout.svg similarity index 100% rename from public_html/asset/svg/minipopup.logout.svg rename to asset/svg/minipopup.logout.svg diff --git a/public_html/asset/svg/minipopup.password.svg b/asset/svg/minipopup.password.svg similarity index 100% rename from public_html/asset/svg/minipopup.password.svg rename to asset/svg/minipopup.password.svg diff --git a/public_html/asset/svg/minipopup.remove.svg b/asset/svg/minipopup.remove.svg similarity index 100% rename from public_html/asset/svg/minipopup.remove.svg rename to asset/svg/minipopup.remove.svg diff --git a/public_html/asset/svg/minipopup.remove@hover.svg b/asset/svg/minipopup.remove@hover.svg similarity index 100% rename from public_html/asset/svg/minipopup.remove@hover.svg rename to asset/svg/minipopup.remove@hover.svg diff --git a/public_html/asset/svg/voice.connected.svg b/asset/svg/voice.connected.svg similarity index 100% rename from public_html/asset/svg/voice.connected.svg rename to asset/svg/voice.connected.svg diff --git a/index.html b/index.html new file mode 100644 index 0000000..3d741db --- /dev/null +++ b/index.html @@ -0,0 +1,39 @@ + + + + + Douscord + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index 8ef9806..6e4345f 100644 --- a/package.json +++ b/package.json @@ -6,19 +6,13 @@ "license": "MIT", "private": true, "scripts": { - "bundle:clean": "exit 0", - "bundle:prod": "cross-env NODE_ENV=production webpack --progress --hide-modules", - "bundle:dev": "cross-env NODE_ENV=development webpack --progress --hide-modules", - "bundle:watch": "cross-env NODE_ENV=development webpack --progress --watch --hide-modules", - "scss": "node-sass -r --output-style compressed --output ./public_html/css ./webpack/scss", - "watch-css": "node-sass -w -r --output-style compressed --output ./public_html/css ./webpack/scss", - "dev": "npm run bundle:clean; npm run bundle:dev; npm run watch-css", - "devjs": "npm run bundle:clean; npm run bundle:watch", - "build": "npm run bundle:clean; npm run bundle:prod; npm run scss" + "clean": "rm ./public_html/*.{js,css,html,svg,map}", + "dev": "parcel index.html --out-dir ./public_html", + "build": "parcel build index.html --out-dir ./public_html" }, "dependencies": { - "uglifyjs-webpack-plugin": "^1.2.3", "vue": "^2.5.9", + "vue-hot-reload-api": "^2.3.0", "vue-router": "^2.5.3" }, "browserslist": [ @@ -27,20 +21,11 @@ "not ie <= 8" ], "devDependencies": { - "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", - "cross-env": "^5.0.5", - "babel-preset-env": "^1.6.0", - "babel-preset-stage-3": "^6.24.1", - "css-loader": "^0.28.7", - "extract-text-webpack-plugin": "^3.0.2", - "file-loader": "^1.1.4", - "node-sass": "^4.7.2", - "sass-loader": "^6.0.6", - "vue-loader": "^13.0.5", - "vue-svg-loader": "^0.5.0", - "vue-template-compiler": "^2.5.9", - "webpack": "^3.8.1", - "webpack-dev-server": "^2.9.5" + "@vue/component-compiler-utils": "^1.0.0", + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.6.1", + "node-sass": "^4.8.3", + "parcel-bundler": "^1.7.0", + "vue-template-compiler": "^2.5.16" } } diff --git a/public_html/index.html b/public_html/index.html index 50b42b6..980c2df 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -1,36 +1 @@ - - - - - Douscord - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - \ No newline at end of file + Douscord
\ No newline at end of file diff --git a/webpack/scss/constants.scss b/scss/constants.scss similarity index 100% rename from webpack/scss/constants.scss rename to scss/constants.scss diff --git a/webpack/scss/container.scss b/scss/container.scss similarity index 100% rename from webpack/scss/container.scss rename to scss/container.scss diff --git a/webpack/scss/dialog.scss b/scss/dialog.scss similarity index 73% rename from webpack/scss/dialog.scss rename to scss/dialog.scss index 7ae32aa..f115ae8 100644 --- a/webpack/scss/dialog.scss +++ b/scss/dialog.scss @@ -298,7 +298,7 @@ border-radius: 5px / 5px; - background: url('/asset/svg/audio.close.svg') center center no-repeat; + background: url('../asset/svg/audio.close.svg') center center no-repeat; background-size: auto 60%; transition: background-color .1s ease-in-out; @@ -330,7 +330,7 @@ width: 1.5em; height: 1em; - background: url('/asset/svg/voice.connected.svg') center center no-repeat; + background: url('../asset/svg/voice.connected.svg') center center no-repeat; background-size: auto 85%; } @@ -338,4 +338,88 @@ } } + + + @keyframes scale-up{ + 0%{ transform: scale(0); } + 100%{ transform: scale(1); } + } + + .minipopup{ + display: block; + position: absolute; + top: 0; + left: 0; + width: calc( 100% - 2*1em ); + height: auto; + + margin: .7em 1em; + + border-radius: 5px; + box-shadow: 0 2px 10 0 rgba(0,0,0,.5); + + background-color: #ffffff; + + will-change: transform; + transform-origin: 100% 0; + + animation: scale-up .3s ease-in-out; + + + + overflow: hidden; + + z-index: 100; + + & > span{ + + display: block; + position: relative; + + padding: .7em 1em; + padding-left: 3em; + + background-color: #fff; + background: url('../asset/svg/minipopup.invite.svg') left 1em center no-repeat; + background-size: auto 45%; + + color: #99aab5; + font-size: .85em; + letter-spacing: .05em; + white-space: nowrap; + + cursor: pointer; + + transition: background-color .2s ease-in-out, + color .2s ease-in-out; + + + &[data-icon='create']{ background-image: url('../asset/svg/minipopup.create.svg'); } + &[data-icon='category']{ background-image: url('../asset/svg/minipopup.category.svg'); } + &[data-icon='edit']{ background-image: url('../asset/svg/minipopup.edit.svg'); } + &[data-icon='remove']{ background-image: url('../asset/svg/minipopup.remove.svg'); } + &[data-icon='remove']{ background-image: url('../asset/svg/minipopup.remove.svg'); } + &[data-icon='logout']{ background-image: url('../asset/svg/minipopup.logout.svg'); } + &[data-icon='leave']{ background-image: url('../asset/svg/minipopup.leave.svg'); } + &[data-icon='password']{ background-image: url('../asset/svg/minipopup.password.svg'); } + + &:hover{ background-color: #f9f9f9; color: #737f8d; } + + /* separators */ + /*after*/ &.sa{ border-bottom: 1px solid #f3f3f3; } + /*before*/ &.sb{ border-top: 1px solid #f3f3f3; } + + &.special{ + color: #7289da; + + &:hover{ color: #677bc4; } + } + + &.invalid{ color: #e65835; } + + &.invalid-h:hover{ color: #e65835; } + + } + + } } \ No newline at end of file diff --git a/webpack/scss/global.scss b/scss/global.scss similarity index 100% rename from webpack/scss/global.scss rename to scss/global.scss diff --git a/webpack/scss/layout.scss b/scss/layout.scss similarity index 100% rename from webpack/scss/layout.scss rename to scss/layout.scss diff --git a/webpack/scss/menu.scss b/scss/menu.scss similarity index 100% rename from webpack/scss/menu.scss rename to scss/menu.scss diff --git a/webpack/scss/pop-up.scss b/scss/pop-up.scss similarity index 100% rename from webpack/scss/pop-up.scss rename to scss/pop-up.scss diff --git a/webpack/scss/side-menu.scss b/scss/side-menu.scss similarity index 100% rename from webpack/scss/side-menu.scss rename to scss/side-menu.scss diff --git a/webpack/main.js b/webpack/main.js index dc967b8..a745a84 100644 --- a/webpack/main.js +++ b/webpack/main.js @@ -7,7 +7,6 @@ import noauth_wrapper from './vue/noauth/wrapper.vue' /* (1) Setup: Vue, VueRouter, Authentication, ClientDriver-s */ require('./setup.js'); - /* (2) Set router hooks to load page data before loading content */ gs.get.router.beforeEach((to, from, next) => { @@ -18,10 +17,15 @@ gs.get.router.beforeEach((to, from, next) => { // {2} Get appropriate page location // let auth_folder = (gs.get.authed) ? 'auth' : 'noauth'; let page_file = to.name || gs.get.routes[auth_folder][0].name; + let fullpath = `${auth_folder}/${page_file}`; // {3} Load page script // - require(`./page/${auth_folder}/${page_file}.js`); - // console.log(`./page/${auth_folder}/${page_file}.js`); + if( fullpath === 'noauth/login') + require('./page/noauth/login.js'); + else if( fullpath === 'noauth/register') + require('./page/noauth/register.js'); + else if( fullpath === 'auth/channel') + require('./page/auth/channel.js'); // {4} Let VueRouter do the magic // next(); diff --git a/webpack/page/auth/channel.js b/webpack/page/auth/channel.js index ff0034a..d7b03c4 100644 --- a/webpack/page/auth/channel.js +++ b/webpack/page/auth/channel.js @@ -3,7 +3,6 @@ import ContentController from '../../lib/content-controller' import RoomController from '../../lib/room-controller' import ChannelController from '../../lib/channel-controller' - /* (1) Channel data gathering ---------------------------------------------------------*/ /* (1) Store route params */ diff --git a/webpack/page/noauth/register.js b/webpack/page/noauth/register.js index 4d28c6a..181a53a 100644 --- a/webpack/page/noauth/register.js +++ b/webpack/page/noauth/register.js @@ -80,4 +80,4 @@ gs.get.register.func.press_enter = function(e){ if( e.keyCode === 13 ) this.func.register(); -}.bind(gs.get.register); \ No newline at end of file + }.bind(gs.get.register); \ No newline at end of file diff --git a/webpack/vue/auth/dialog.vue b/webpack/vue/auth/dialog.vue index f41483c..d7c07a2 100644 --- a/webpack/vue/auth/dialog.vue +++ b/webpack/vue/auth/dialog.vue @@ -1,91 +1,3 @@ -