ed
This commit is contained in:
parent
4f7a53e4a7
commit
10de5a6c76
33 changed files with 2124 additions and 0 deletions
4
resources/[tools]/dialog/web/.browserslistrc
Normal file
4
resources/[tools]/dialog/web/.browserslistrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
not ie 11
|
5
resources/[tools]/dialog/web/.editorconfig
Normal file
5
resources/[tools]/dialog/web/.editorconfig
Normal file
|
@ -0,0 +1,5 @@
|
|||
[*.{js,jsx,ts,tsx,vue}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
22
resources/[tools]/dialog/web/.gitignore
vendored
Normal file
22
resources/[tools]/dialog/web/.gitignore
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
44
resources/[tools]/dialog/web/README.md
Normal file
44
resources/[tools]/dialog/web/README.md
Normal file
|
@ -0,0 +1,44 @@
|
|||
# default
|
||||
|
||||
## Project setup
|
||||
|
||||
```
|
||||
# yarn
|
||||
yarn
|
||||
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
|
||||
```
|
||||
# yarn
|
||||
yarn dev
|
||||
|
||||
# npm
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
|
||||
```
|
||||
# yarn
|
||||
yarn build
|
||||
|
||||
# npm
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
|
||||
See [Configuration Reference](https://vitejs.dev/config/).
|
5
resources/[tools]/dialog/web/dist/assets/index-8c3f21c3.js
vendored
Normal file
5
resources/[tools]/dialog/web/dist/assets/index-8c3f21c3.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
resources/[tools]/dialog/web/dist/assets/index-a3506647.css
vendored
Normal file
5
resources/[tools]/dialog/web/dist/assets/index-a3506647.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-48d3eec6.woff
vendored
Normal file
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-48d3eec6.woff
vendored
Normal file
Binary file not shown.
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-861aea05.eot
vendored
Normal file
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-861aea05.eot
vendored
Normal file
Binary file not shown.
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-bd725a7a.ttf
vendored
Normal file
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-bd725a7a.ttf
vendored
Normal file
Binary file not shown.
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-e52d60f6.woff2
vendored
Normal file
BIN
resources/[tools]/dialog/web/dist/assets/materialdesignicons-webfont-e52d60f6.woff2
vendored
Normal file
Binary file not shown.
1
resources/[tools]/dialog/web/dist/assets/webfontloader-523643f5.js
vendored
Normal file
1
resources/[tools]/dialog/web/dist/assets/webfontloader-523643f5.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
resources/[tools]/dialog/web/dist/favicon.ico
vendored
Normal file
BIN
resources/[tools]/dialog/web/dist/favicon.ico
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
18
resources/[tools]/dialog/web/dist/index.html
vendored
Normal file
18
resources/[tools]/dialog/web/dist/index.html
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="./favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Welcome to Vuetify 3</title>
|
||||
<script type="module" crossorigin src="./assets/index-8c3f21c3.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index-a3506647.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
16
resources/[tools]/dialog/web/index.html
Normal file
16
resources/[tools]/dialog/web/index.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Welcome to Vuetify 3</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
19
resources/[tools]/dialog/web/jsconfig.json
Normal file
19
resources/[tools]/dialog/web/jsconfig.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
1141
resources/[tools]/dialog/web/package-lock.json
generated
Normal file
1141
resources/[tools]/dialog/web/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
22
resources/[tools]/dialog/web/package.json
Normal file
22
resources/[tools]/dialog/web/package.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "web",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdi/font": "7.0.96",
|
||||
"roboto-fontface": "*",
|
||||
"vue": "^3.2.0",
|
||||
"vuetify": "^3.0.0",
|
||||
"webfontloader": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"sass": "^1.69.7",
|
||||
"vite": "^4.2.0",
|
||||
"vite-plugin-vuetify": "^1.0.0"
|
||||
}
|
||||
}
|
BIN
resources/[tools]/dialog/web/public/favicon.ico
Normal file
BIN
resources/[tools]/dialog/web/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
165
resources/[tools]/dialog/web/src/App.vue
Normal file
165
resources/[tools]/dialog/web/src/App.vue
Normal file
|
@ -0,0 +1,165 @@
|
|||
<template>
|
||||
<v-app style="background: transparent!important;">
|
||||
<v-fade-transition>
|
||||
<div class="dialog-bg" v-if="show">
|
||||
<v-card color="bg" class="card ">
|
||||
<v-card-title class="title">
|
||||
<div>
|
||||
<span class="font-weight-bold mr-2">
|
||||
{{ data.firstname }}
|
||||
</span>
|
||||
<span class="font-weight-light">
|
||||
{{ data.lastname }}
|
||||
</span>
|
||||
</div>
|
||||
<div style="flex-grow: 1;">
|
||||
|
||||
</div>
|
||||
<div class="note" v-if="data.rep">
|
||||
{{ data.rep }} Rep
|
||||
</div>
|
||||
<div class="note" v-if="data.type">
|
||||
{{ data.type }}
|
||||
</div>
|
||||
</v-card-title>
|
||||
<div class="text-dialog">
|
||||
<div class="text bg-grey-darken-4 rounded">
|
||||
{{ data.text }}
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<div class="button" v-for="(item, index) in data.buttons" @keyup.index="click(item)" @click="click(item)">
|
||||
<div class="number">
|
||||
<p>
|
||||
{{ index+1 }}
|
||||
</p>
|
||||
</div>
|
||||
{{ item.text }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
</v-fade-transition>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
},
|
||||
data: () => ({
|
||||
show: false,
|
||||
data: {
|
||||
firstname: 'John',
|
||||
lastname: 'Doe',
|
||||
text: 'Lorem ipsum dolor sit amet',
|
||||
type: '',
|
||||
rep: '',
|
||||
buttons: [
|
||||
{ text: 'Lorem ipsum dolor sit amet' }
|
||||
]
|
||||
}
|
||||
}),
|
||||
|
||||
methods: {
|
||||
click(data){
|
||||
post('click', data, (resp) => {
|
||||
if (resp == 'close') {
|
||||
this.show = false;
|
||||
this.data = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.escapeListener = window.addEventListener("keyup", (event) => {
|
||||
if (!this.show) {
|
||||
return
|
||||
}
|
||||
if (event.keyCode || 49 && event.keyCode || 51 && event.keyCode || 52 && event.keyCode || 53) {
|
||||
if ( this.data.buttons[event.keyCode - 49] ) {
|
||||
this.click(this.data.buttons[event.keyCode - 49])
|
||||
}
|
||||
}
|
||||
});
|
||||
this.messageListener = window.addEventListener("message", (event) => {
|
||||
const item = event.data || event.detail; //'detail' is for debugging via browsers
|
||||
if (item.type == 'New') {
|
||||
this.data = item.data
|
||||
this.show = true
|
||||
} else if (item.type == 'Continue') {
|
||||
this.data.text = item.data.text
|
||||
this.data.buttons = item.data.buttons
|
||||
} else if (item.type == 'Set') {
|
||||
this.data = item.data
|
||||
this.show = true
|
||||
} else if (item.type == 'Close') {
|
||||
this.show = false;
|
||||
this.data = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
const resource = 'dialog';
|
||||
|
||||
const post = (event, data, cb) => {
|
||||
if (event) {
|
||||
fetch(`https://${resource}/${event}`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=UTF-8",
|
||||
},
|
||||
body: JSON.stringify(data || {}),
|
||||
})
|
||||
.then((resp) => resp.json())
|
||||
.then((resp) => {
|
||||
if (cb) {
|
||||
cb(resp);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
html {
|
||||
overflow: hidden!important;
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: light !important;
|
||||
}
|
||||
|
||||
#app {
|
||||
background: transparent!important;
|
||||
background-color: transparent!important;
|
||||
}
|
||||
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #888;
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #555;
|
||||
}
|
||||
|
||||
</style>
|
BIN
resources/[tools]/dialog/web/src/assets/logo.png
Normal file
BIN
resources/[tools]/dialog/web/src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
6
resources/[tools]/dialog/web/src/assets/logo.svg
Normal file
6
resources/[tools]/dialog/web/src/assets/logo.svg
Normal file
|
@ -0,0 +1,6 @@
|
|||
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M261.126 140.65L164.624 307.732L256.001 466L377.028 256.5L498.001 47H315.192L261.126 140.65Z" fill="#1697F6"/>
|
||||
<path d="M135.027 256.5L141.365 267.518L231.64 111.178L268.731 47H256H14L135.027 256.5Z" fill="#AEDDFF"/>
|
||||
<path d="M315.191 47C360.935 197.446 256 466 256 466L164.624 307.732L315.191 47Z" fill="#1867C0"/>
|
||||
<path d="M268.731 47C76.0026 47 141.366 267.518 141.366 267.518L268.731 47Z" fill="#7BC6FF"/>
|
||||
</svg>
|
After Width: | Height: | Size: 526 B |
68
resources/[tools]/dialog/web/src/assets/styles/style.scss
Normal file
68
resources/[tools]/dialog/web/src/assets/styles/style.scss
Normal file
|
@ -0,0 +1,68 @@
|
|||
|
||||
.dialog-bg {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: radial-gradient(circle, rgba(133,133,133,0) 41%, rgba(1,214,193,0.3491771708683473) 100%);
|
||||
}
|
||||
|
||||
.card {
|
||||
position: absolute!important;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin: auto !important;
|
||||
width: fit-content;
|
||||
bottom: 10vh;
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.note {
|
||||
margin-left: 10px;
|
||||
height: fit-content;
|
||||
font-size: 15px;
|
||||
background-color: rgba(0, 255, 255, 0.681);
|
||||
border-radius: 5px;
|
||||
color: #0e0e0e;
|
||||
padding: 8px;
|
||||
line-height: 6px;
|
||||
}
|
||||
}
|
||||
.text-dialog {
|
||||
margin: 2px 10px 10px 10px;
|
||||
.text {
|
||||
width: 610px;
|
||||
padding: 5px 10px;
|
||||
margin-bottom: 10px;
|
||||
background: radial-gradient(circle, rgb(58, 58, 58) 0%, rgb(36, 36, 36) 100%);
|
||||
}
|
||||
.buttons {
|
||||
display: grid;
|
||||
grid-template-columns: 302px 302px;
|
||||
grid-row: auto auto;
|
||||
grid-column-gap: 7px;
|
||||
grid-row-gap: 7px;
|
||||
.button {
|
||||
display: flex;
|
||||
padding: 3px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
align-items: center;
|
||||
background-color: rgb(36, 36, 36);
|
||||
.number {
|
||||
margin-right: 8px;
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
border-radius: 4px;
|
||||
background-color: rgb(0, 255, 255);
|
||||
p {
|
||||
color: #414041;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
23
resources/[tools]/dialog/web/src/main.js
Normal file
23
resources/[tools]/dialog/web/src/main.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* main.js
|
||||
*
|
||||
* Bootstraps Vuetify and other plugins then mounts the App`
|
||||
*/
|
||||
|
||||
// Components
|
||||
|
||||
import './assets/styles/style.scss'
|
||||
|
||||
import App from './App.vue'
|
||||
|
||||
// Composables
|
||||
import { createApp } from 'vue'
|
||||
|
||||
// Plugins
|
||||
import { registerPlugins } from '@/plugins'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
registerPlugins(app)
|
||||
|
||||
app.mount('#app')
|
14
resources/[tools]/dialog/web/src/plugins/index.js
Normal file
14
resources/[tools]/dialog/web/src/plugins/index.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* plugins/index.js
|
||||
*
|
||||
* Automatically included in `./src/main.js`
|
||||
*/
|
||||
|
||||
// Plugins
|
||||
import { loadFonts } from './webfontloader'
|
||||
import vuetify from './vuetify'
|
||||
|
||||
export function registerPlugins (app) {
|
||||
loadFonts()
|
||||
app.use(vuetify)
|
||||
}
|
28
resources/[tools]/dialog/web/src/plugins/vuetify.js
Normal file
28
resources/[tools]/dialog/web/src/plugins/vuetify.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* plugins/vuetify.js
|
||||
*
|
||||
* Framework documentation: https://vuetifyjs.com`
|
||||
*/
|
||||
|
||||
// Styles
|
||||
import '@mdi/font/css/materialdesignicons.css'
|
||||
import 'vuetify/styles'
|
||||
|
||||
// Composables
|
||||
import { createVuetify } from 'vuetify'
|
||||
|
||||
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
||||
export default createVuetify({
|
||||
theme: {
|
||||
defaultTheme: 'dark',
|
||||
themes: {
|
||||
dark: {
|
||||
colors: {
|
||||
primary: '#1867C0',
|
||||
secondary: '#5CBBF6',
|
||||
bg: '#121212'
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
15
resources/[tools]/dialog/web/src/plugins/webfontloader.js
Normal file
15
resources/[tools]/dialog/web/src/plugins/webfontloader.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* plugins/webfontloader.js
|
||||
*
|
||||
* webfontloader documentation: https://github.com/typekit/webfontloader
|
||||
*/
|
||||
|
||||
export async function loadFonts () {
|
||||
const webFontLoader = await import(/* webpackChunkName: "webfontloader" */'webfontloader')
|
||||
|
||||
webFontLoader.load({
|
||||
google: {
|
||||
families: ['Roboto:100,300,400,500,700,900&display=swap'],
|
||||
},
|
||||
})
|
||||
}
|
42
resources/[tools]/dialog/web/vite.config.js
Normal file
42
resources/[tools]/dialog/web/vite.config.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Plugins
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
|
||||
// Utilities
|
||||
import { defineConfig } from 'vite'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue({
|
||||
template: { transformAssetUrls }
|
||||
}),
|
||||
// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
|
||||
vuetify({
|
||||
autoImport: true,
|
||||
}),
|
||||
],
|
||||
define: { 'process.env': {} },
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
},
|
||||
extensions: [
|
||||
'.js',
|
||||
'.json',
|
||||
'.jsx',
|
||||
'.mjs',
|
||||
'.ts',
|
||||
'.tsx',
|
||||
'.vue',
|
||||
],
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
build: {
|
||||
outDir: "./dist",
|
||||
},
|
||||
base: "",
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue