start new ui

This commit is contained in:
wodka 2019-09-02 00:19:38 +02:00
parent 32cb5ecf0c
commit 0d1ebbabfb
20 changed files with 9407 additions and 0 deletions

13
ui/.editorconfig Normal file
View File

@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

23
ui/.eslintrc.js Normal file
View File

@ -0,0 +1,23 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'plugin:prettier/recommended',
'prettier',
'prettier/vue'
],
plugins: [
'prettier'
],
// add your custom rules here
rules: {
}
}

84
ui/.gitignore vendored Normal file
View File

@ -0,0 +1,84 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE
.idea
# Service worker
sw.*

4
ui/.prettierrc Normal file
View File

@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}

26
ui/README.md Normal file
View File

@ -0,0 +1,26 @@
# OhMyForm
> Opensource alternative to TypeForm
## Design
https://github.com/ohmyform/ohmyform/issues/13
## Build Setup
``` bash
# install dependencies
$ yarn install
# serve with hot reload at localhost:3000
$ yarn run dev
# build for production and launch server
$ yarn run build
$ yarn start
# generate static project
$ yarn run generate
```
For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).

37
ui/assets/css/base.scss Normal file
View File

@ -0,0 +1,37 @@
$accent: #fae596;
$primary: #3fb0ac;
html {
font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, 'Helvetica Neue', Arial, sans-serif;
font-size: 16px;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}
.btn-primary {
color: #fff;
background-color: $primary;
border-color: $primary;
&:hover {
color: #fff;
background-color: darken($primary, 10%);
border-color: darken($primary, 10%);
}
&:not(:disabled):not(.disabled):active {
color: #fff;
background-color: darken($primary, 10%);
border-color: darken($primary, 10%);
}
&:not(:disabled):not(.disabled):active:focus,
&:focus {
box-shadow: 0 0 0 0.2rem transparentize($primary, 0.5);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

5
ui/layouts/admin.vue Normal file
View File

@ -0,0 +1,5 @@
<template>
<div>
<nuxt />
</div>
</template>

5
ui/layouts/default.vue Normal file
View File

@ -0,0 +1,5 @@
<template>
<div>
<nuxt />
</div>
</template>

46
ui/layouts/screen.vue Normal file
View File

@ -0,0 +1,46 @@
<template>
<div class="screen">
<div class="content">
<nuxt />
</div>
<div class="footer">
<nuxt-link to="/login">Login</nuxt-link>
<nuxt-link to="/register">Register</nuxt-link>
<nuxt-link to="/admin">Manage</nuxt-link>
<a href="https://ohmyform.com">OhMyForm</a>
</div>
</div>
</template>
<style lang="scss" scoped>
.screen {
min-height: 100vh;
background: #173e43;
display: flex;
flex-direction: column;
.content {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.footer {
height: 40px;
text-align: center;
a {
color: #dddfd4;
padding-right: 16px;
padding-left: 16px;
&:hover {
color: #fae596;
}
}
}
}
</style>

75
ui/nuxt.config.js Normal file
View File

@ -0,0 +1,75 @@
import pkg from './package'
export default {
mode: 'spa',
/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [{ rel: 'icon', type: 'image/png', href: '/favicon.png' }]
},
server: {
port: 3100
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [
'@/assets/css/base.scss'
],
/*
** Plugins to load before mounting the App
*/
plugins: [],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
// Doc: https://bootstrap-vue.js.org/docs/
'bootstrap-vue/nuxt'
],
/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
}
}

42
ui/package.json Normal file
View File

@ -0,0 +1,42 @@
{
"name": "OhMyForm",
"version": "1.0.0",
"description": "Opensource alternative to TypeForm",
"author": "Michael Schramm",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
},
"dependencies": {
"@nuxtjs/axios": "^5.3.6",
"bootstrap": "^4.1.3",
"bootstrap-vue": "^2.0.0-rc.11",
"cross-env": "^5.2.0",
"node-sass": "^4.12.0",
"nuxt": "^2.4.0",
"sass-loader": "^8.0.0"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^0.0.1",
"babel-eslint": "^10.0.1",
"eslint": "^5.15.1",
"eslint-config-prettier": "^4.1.0",
"eslint-config-standard": ">=12.0.0",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-jest": ">=22.3.0",
"eslint-plugin-node": ">=8.0.1",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.2",
"nodemon": "^1.18.9",
"prettier": "^1.16.4"
}
}

5
ui/pages/admin/index.vue Normal file
View File

@ -0,0 +1,5 @@
<template>
<div>
ADMIN
</div>
</template>

5
ui/pages/forms/_.vue Normal file
View File

@ -0,0 +1,5 @@
<template>
<div>
FORM
</div>
</template>

17
ui/pages/index.vue Normal file
View File

@ -0,0 +1,17 @@
<template>
<div>
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
</div>
</template>
<script>
export default {
layout: 'screen'
}
</script>
<style lang="scss" scoped>
img {
max-width: 80%;
}
</style>

62
ui/pages/login.vue Normal file
View File

@ -0,0 +1,62 @@
<template>
<div>
<img src="../assets/img/logo_white_small.png" alt="OhMyForm" />
<b-form class="box" @submit="submit">
<b-form-group label-for="username">
<b-form-input
id="username"
v-model="name"
trim
placeholder="Username or Email"
></b-form-input>
</b-form-group>
<b-form-group label-for="password">
<b-form-input
id="password"
v-model="name"
type="password"
placeholder="Password"
trim
></b-form-input>
</b-form-group>
<b-button type="submit" block variant="primary">Login</b-button>
<nuxt-link to="/recover" class="recover">Forgot your password?</nuxt-link>
</b-form>
</div>
</template>
<script>
export default {
layout: 'screen',
data() {
return {
username: '',
password: ''
}
},
methods: {
submit() {
// TODO
}
}
}
</script>
<style lang="scss" scoped>
img {
max-width: 80%;
width: 300px;
}
.box {
margin-top: 60px;
}
.recover {
display: block;
padding-top: 15px;
color: #fff;
font-size: 14px;
}
</style>

BIN
ui/static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

0
ui/store/index.js Normal file
View File

8958
ui/yarn.lock Normal file

File diff suppressed because it is too large Load Diff