Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
add Welcome Page
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkame committed May 16, 2020
1 parent 4e240fa commit 65c5b8d
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"pug-loader": "^2.4.0",
"pug-plain-loader": "^1.0.0",
"vue": "^2.6.11",
"vue-carousel": "^0.18.0",
"vue-moveable": "^1.8.1"
},
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion public/preload.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { desktopCapturer, contextBridge, ipcRenderer} = require("electron");
const {app, desktopCapturer, contextBridge, ipcRenderer} = require("electron");
contextBridge.exposeInMainWorld(
"electronApi", {
async requestDesktopCapture() {
Expand All @@ -8,6 +8,9 @@ contextBridge.exposeInMainWorld(
})
return sources
},
startMainApp() {
ipcRenderer.send("start-main-app")
}
},
);

Expand Down
17 changes: 17 additions & 0 deletions public/welcome.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>小窓さん</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
110 changes: 110 additions & 0 deletions src/Welcome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<template lang="pug">
#welcome
.slider
.tips Tips
carousel(
per-page="1",
autoplay="true",
autoplayHoverPause="false",
autoplayTimeout="6000",
speed="1000",
loop="true"
paginationActiveColor="#efefef",
paginationColor="#000000"
)
slide
.slide-contents
p PDFファイルをドラッグ&ドロップで表示できます
slide
.slide-contents
p Ctrl+Dでお絵かきモードに入れます
slide
.slide-contents
p 画面下部にカーソルを合わせるとカメラの切り替えができます
.options
h1 小窓さんはオンライン会議支援ツールです
ul
li 表示するつもりがなかった資料
li メール通知
li チャット通知

p 間違って配信してしまったことはありませんか?
p
| このアプリを画面共有することによって
br
| ワイプつき画面を簡単に共有できます。
br
| 通知を巻き込むことはありません。
br
| 共有したい資料のみ表示します。

p 小窓さんはOSSで開発されています。


#start.btn.btn-default.btn-large(@click="start") 利用をスタート

</template>

<script>
import { Carousel, Slide } from 'vue-carousel';
export default {
name: 'Welcome',
components: {
Carousel,
Slide
},
methods: {
start(){
window.electronApi.startMainApp()
}
}
}
</script>

<style scoped>
.tips {
position: absolute;
font-size: 2em;
left: 10px;
color: white;
}
.slider {
background: rgba(0, 0, 0, 0.8);
}
.slider .slide-contents {
color: white;
text-align: center;
padding:30% 10%;
display: block;
}
.slider,.options{
width: 50%;
height: 100%;
float: left;
position: relative;
}
.options {
padding: 50px;
}
.options h1 {
font-size: 1.3em;
}
html,body{
width: 100%;
height: 100%;
}
#welcome {
height: 100%;
width: 100%;
}
#start {
position: absolute;
right: 30px;
bottom: 10px;
width: 140px;
}
</style>
41 changes: 38 additions & 3 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import {app, BrowserWindow, protocol, globalShortcut} from 'electron'
import {app, BrowserWindow, protocol, globalShortcut, ipcMain} from 'electron'
import {createProtocol,} from 'vue-cli-plugin-electron-builder/lib'
import fs from 'fs'
import path from 'path'
Expand All @@ -16,6 +16,34 @@ let win
// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([{scheme: 'app', privileges: {secure: true, standard: true}}])


function createWelcomeWindow() {
win = new BrowserWindow({
width: 1024, height: 576,webPreferences: {
nodeIntegration: false,
contextIsolation:true,
preload: __static + '/preload.js',
},

preload: __static + '/preload.js',
})
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode

win.loadURL(process.env.WEBPACK_DEV_SERVER_URL+'welcome')
if (!process.env.IS_TEST) win.webContents.openDevTools()
} else {
createProtocol('app')
// Load the index.html when not in development
win.loadURL('app://./welcome.html')
}
win.on('closed', () => {
win = null
})
win.on


}
function createWindow() {
// Create the browser window.

Expand Down Expand Up @@ -60,6 +88,12 @@ function createWindow() {


}
ipcMain.on('start-main-app', () => {
if (win) {
win.close()
}
createWindow()
})

// Quit when all windows are closed.
app.on('window-all-closed', () => {
Expand All @@ -74,7 +108,7 @@ app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow()
createWelcomeWindow()
}
})

Expand All @@ -96,9 +130,10 @@ app.on('ready', async () => {
// }

}
createWindow()
createWelcomeWindow()
})


// Exit cleanly on request from parent process in development mode.
if (isDevelopment) {
if (process.platform === 'win32') {
Expand Down
2 changes: 1 addition & 1 deletion src/components/WebTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
span.icon.icon-cw
button.btn.btn-large.btn-default(@click="loadStop", v-if="loading")
span.icon.icon-cancel
form(@submit="loadURL")
form(@submit="loadURL", style="width:100%")
input.form-control(v-model="current_address")
webview(:src='tab.url', )

Expand Down
11 changes: 11 additions & 0 deletions src/welcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Vue from 'vue'
import Welcome from './Welcome.vue'

import 'photon/dist/css/photon.css'
import './assets/style.css'
import './assets/moveable.css'
Vue.config.productionTip = false

new Vue({
render: h => h(Welcome),
}).$mount('#app')
6 changes: 6 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
pages: {
index: 'src/main.js',
welcome: 'src/welcome.js'
}
}
36 changes: 35 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3371,6 +3371,11 @@ dom-serializer@0:
domelementtype "^2.0.1"
entities "^2.0.0"

dom-walk@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84"
integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==

domain-browser@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
Expand Down Expand Up @@ -4438,6 +4443,14 @@ global-tunnel-ng@^2.7.1:
npm-conf "^1.1.3"
tunnel "^0.0.6"

global@^4.3.2:
version "4.4.0"
resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406"
integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==
dependencies:
min-document "^2.19.0"
process "^0.11.10"

globals@^11.1.0:
version "11.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
Expand Down Expand Up @@ -5950,6 +5963,13 @@ mimic-response@^1.0.0, mimic-response@^1.0.1:
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==

min-document@^2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685"
integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=
dependencies:
dom-walk "^0.1.0"

mini-css-extract-plugin@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
Expand Down Expand Up @@ -7613,6 +7633,11 @@ regenerator-runtime@^0.11.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==

regenerator-runtime@^0.12.1:
version "0.12.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de"
integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==

regenerator-runtime@^0.13.4:
version "0.13.5"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
Expand Down Expand Up @@ -9245,6 +9270,15 @@ void-elements@^2.0.1:
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"
integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=

vue-carousel@^0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/vue-carousel/-/vue-carousel-0.18.0.tgz#478dfcad3abe2ee44c227020b6e60fb8484dc9f1"
integrity sha512-a2zxh7QJioDxNMguqcuJ7TPbfgK5bGDaAXIia7NWxPAWsEvNE4ZtHgsGu40L5Aha4uyjmNKXvleB14QAXFoKig==
dependencies:
global "^4.3.2"
regenerator-runtime "^0.12.1"
vue "^2.5.17"

vue-cli-plugin-electron-builder@^2.0.0-beta.6:
version "2.0.0-beta.6"
resolved "https://registry.yarnpkg.com/vue-cli-plugin-electron-builder/-/vue-cli-plugin-electron-builder-2.0.0-beta.6.tgz#cac6b79895b133f882d397166b43e92142a34202"
Expand Down Expand Up @@ -9325,7 +9359,7 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==

vue@^2.6.11:
vue@^2.5.17, vue@^2.6.11:
version "2.6.11"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"
integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==
Expand Down

0 comments on commit 65c5b8d

Please sign in to comment.