Added project

This commit is contained in:
Benjamyn Love 2020-05-02 06:31:49 -04:00
parent b8410e382e
commit e630027bf9
22 changed files with 12842 additions and 0 deletions

3
.browserslistrc Normal file
View File

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

19
.eslintrc.js Normal file
View File

@ -0,0 +1,19 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'eslint:recommended',
'@vue/prettier',
'plugin:prettier/recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

4
.prettierrc.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
singleQuote: true,
semi: false
}

3
babel.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset']
}

12244
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "paste-ui",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.4",
"vue": "^2.6.11",
"vue-router": "^3.1.6",
"vuex": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-eslint": "~4.3.0",
"@vue/cli-plugin-router": "~4.3.0",
"@vue/cli-plugin-vuex": "~4.3.0",
"@vue/cli-service": "~4.3.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2",
"prettier": "^1.19.1",
"vue-template-compiler": "^2.6.11"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

21
public/index.html Normal file
View File

@ -0,0 +1,21 @@
<!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><%= htmlWebpackPlugin.options.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>

71
src/App.vue Normal file
View File

@ -0,0 +1,71 @@
<template>
<div id="app">
<div id="nav"><router-link to="/">Paste</router-link></div>
<router-view />
</div>
</template>
<style>
* {
background-color: #2a2a2a;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* text-align: center; */
color: azure;
}
#nav {
padding-left: 5%;
padding-bottom: 10px;
}
#nav a {
font-weight: bold;
color: azure;
font-size: 2em;
font-style: italic;
font-weight: bold;
text-decoration: black;
}
#nav a.router-link-exact-active {
color: azure;
}
.w-full {
width: 100%;
}
.w-90 {
padding-left: 5%;
padding-right: 5%;
}
textarea {
height: 90vh;
border-color: #727272;
border-width: 1px;
box-shadow: 1px 2px 3px #727272;
resize: none;
color: azure;
background-color: #2a2a2a;
}
::-webkit-scrollbar {
width: 4px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}
</style>

BIN
src/assets/images/btn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,130 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br />
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
>vue-cli documentation</a
>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
target="_blank"
rel="noopener"
>router</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
target="_blank"
rel="noopener"
>vuex</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a
>
</li>
</ul>
<h3>Essential Links</h3>
<ul>
<li>
<a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
</li>
<li>
<a href="https://forum.vuejs.org" target="_blank" rel="noopener"
>Forum</a
>
</li>
<li>
<a href="https://chat.vuejs.org" target="_blank" rel="noopener"
>Community Chat</a
>
</li>
<li>
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
>Twitter</a
>
</li>
<li>
<a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
</li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li>
<a href="https://router.vuejs.org" target="_blank" rel="noopener"
>vue-router</a
>
</li>
<li>
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-devtools#vue-devtools"
target="_blank"
rel="noopener"
>vue-devtools</a
>
</li>
<li>
<a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
>vue-loader</a
>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
rel="noopener"
>awesome-vue</a
>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@ -0,0 +1,16 @@
<template>
<div></div>
</template>
<script>
export default {
data() {
return {
name: 'pasteText',
value: ''
}
}
}
</script>
<style></style>

12
src/main.js Normal file
View File

@ -0,0 +1,12 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

32
src/router/index.js Normal file
View File

@ -0,0 +1,32 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import ViewPaste from '../views/ViewPaste.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/view',
redirect: { name: 'Home' }
},
{
path: '/view/:id',
name: 'view-paste',
component: ViewPaste,
props: true
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router

25
src/services/getPaste.js Normal file
View File

@ -0,0 +1,25 @@
function getPaste(id) {
let URL = 'https://api.lovelynet.net/'
// let args = '/?raw=true'
let domain = URL + id
let request = new XMLHttpRequest()
return new Promise(function(resolve, reject) {
request.onreadystatechange = function() {
if (request.readyState !== 4) return
if (request.status >= 200 && request.status <= 300) {
resolve(request.responseText)
} else {
reject({
status: request.status,
statusText: request.statusText
})
}
}
request.open('GET', domain, true)
request.send()
})
}
module.exports = getPaste

View File

@ -0,0 +1,24 @@
function sendPaste(pastes) {
console.log(JSON.stringify(pastes))
let domain = 'https://api.lovelynet.net/'
let request = new XMLHttpRequest()
return new Promise(function(resolve, reject) {
request.onreadystatechange = function() {
if (request.readyState !== 4) return
if (request.status >= 200 && request.status <= 300) {
resolve(request.responseText)
} else {
reject({
status: request.status,
statusText: request.statusText
})
}
}
request.open('POST', domain, true)
request.setRequestHeader('Content-Type', 'application/json')
request.send(pastes)
})
}
module.exports = sendPaste

11
src/store/index.js Normal file
View File

@ -0,0 +1,11 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {},
mutations: {},
actions: {},
modules: {}
})

60
src/views/Home.vue Normal file
View File

@ -0,0 +1,60 @@
<template>
<div class="home w-90 flex flex-horizontal-center">
<a v-if="url" :href="url">{{ url }}</a>
<textarea class="w-full" @input="updateValue" :value="value"></textarea>
<button @click="sendPaste(value)">Submit</button>
</div>
</template>
<script>
// import pasteText from '@/components/pasteText.vue'
// @ is an alias to /src
import sendPaste from '@/services/sendPastes.js'
export default {
data() {
return {
value: '',
url: ''
}
},
methods: {
updateValue(event) {
this.value = event.target.value
},
sendPaste(value) {
let data = JSON.stringify({ paste: value })
sendPaste(data)
.then(resp => {
let id = resp
this.url = window.location.href + 'view/' + id
})
.catch(error => {
console.log(error)
})
}
}
}
</script>
<style scoped>
button {
padding-left: 10px;
padding-right: 10px;
margin-top: 1px;
max-width: 7em;
height: 2em;
float: right;
color: azure;
font-size: 1em;
text-align: center;
line-height: 10px;
border-width: 0px;
background-image: url('~@/assets/images/btn.png');
background-repeat: no-repeat;
background-size: cover;
border-radius: 11px;
}
a {
padding: 10px;
}
</style>

33
src/views/ViewPaste.vue Normal file
View File

@ -0,0 +1,33 @@
<template>
<div class="home w-90 flex flex-horizontal-center">
<textarea readonly class="w-full" :value="text"></textarea>
</div>
</template>
<script>
import getPaste from '@/services/getPaste'
export default {
data() {
return {
text: '',
id: this.$route.params.id
}
},
methods: {
getPasteFromID(id) {
getPaste(id)
.then(posts => {
this.text = posts
})
.catch(error => {
console.log(error)
})
}
},
mounted: function() {
this.getPasteFromID(this.id)
}
}
</script>
<style scoped></style>

79
text.txt Normal file
View File

@ -0,0 +1,79 @@
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# switch panes using Alt-arrow without prefix
#bind -n M-Left select-pane -L
#bind -n M-Right select-pane -R
#bind -n M-Up select-pane -U
#bind -n M-Down select-pane -D
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
#######################
#### DESIGN CHANGES ###
#######################
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# modes
setw -g clock-mode-colour colour5
setw -g mode-attr bold
setw -g mode-fg colour1
setw -g mode-bg colour18
# panes
set -g pane-border-bg colour0
set -g pane-border-fg colour19
set -g pane-active-border-bg colour0
set -g pane-active-border-fg colour9
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-bg colour18
set -g status-fg colour137
set -g status-attr dim
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour19,bold] %d/%m #[fg=colour233,bg=colour8,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-fg colour1
setw -g window-status-current-bg colour19
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
setw -g window-status-fg colour9
setw -g window-status-bg colour18
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1
# messages
#set -g message-attr bold
#set -g message-fg colour232
#set -g message-bg colour16