This repository was archived by the owner on Feb 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.vue
186 lines (179 loc) · 4.33 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<template>
<div class="d-flex m-0 container-fluid">
<reply-drag v-if="quickReply" :posx="posx" :posy="posy" :replyContent="replyContent"/>
<mobile-board-list class="w-100 d-block d-sm-none position-fixed" style="z-index:99999;" />
<div style="position: fixed; bottom: 2rem; right: 2rem; z-index:9999999" class="d-sm-none">
<radial-menu class="bg-chan-light font-chan-red" :size="60" :item-size="40" :radius="120" :angle-restriction="100">
<radial-menu-item class="bg-chan-light" v-for="(item, index) in mobileItems()" :key="item+index" @click="() => handleClick(item)">
<span :class="item.icon"> </span>
</radial-menu-item>
</radial-menu>
</div>
<div class="row vh-100">
<div class="col-2 d-sm-inline d-none px-0 position-fixed w-100 overflow-auto" v-if="!getComfy">
<nav-bar/>
</div>
</div>
<div class="row w-100 ml-4 justify-content-end">
<div class="px-0" :class="getComfy?'col':'col col-sm-10'">
<top-links class="d-none d-sm-block"/>
<keep-alive>
<router-view class="mt-4 mt-sm-0 pt-4 pt-sm-0" />
</keep-alive>
</div>
</div>
</div>
</template>
<script>
/* eslint-disable */
import {RadialMenu, RadialMenuItem} from 'vue-radial-menu'
import {mapGetters, mapActions} from 'vuex'
import TopLinks from './components/TopLinks.vue'
import NavBar from './views/NavBar.vue'
import MobileBoardList from './components/navbar/MobileBoardList.vue'
import ReplyDrag from './components/board/ReplyDrag.vue'
import {eBus} from './components/EventBus.js'
import web3 from './contract/Web3Connect.js'
export default {
data(){
return{
lastClicked: null,
items: [{name: 'account', icon: 'fal fa-user-circle', login: 'yes'}, {name: 'votes', icon: 'fal fa-box-ballot', login: 'yes'}, {name: 'settings', icon: 'fal fa-tools', login: 'no'}, {name: 'help', icon: 'fal fa-question-circle', login: 'no'}, {name: 'index', icon: 'fal fa-home-alt', login: 'no'}],
posx: null,
posy: null,
quickReply: false,
replyContent: ''
}
},
components: {
NavBar,
TopLinks,
RadialMenu,
RadialMenuItem,
MobileBoardList,
ReplyDrag
},
computed: {
...mapGetters([
'getTheme',
'getCustomCss',
'getGrab',
'getLogin',
'getComfy',
'getCustomGate',
'getCustomNode',
'getCustomPort',
'getCustomProto',
'getIpfsNode',
'getIpfsPort',
'getIpfsProto'
]),
theme(){
return this.getTheme+'.css'
}
},
methods: {
...mapActions([
'setLogin',
'setLogout'
]),
async login(){
const accounts = await web3.eth.getAccounts().catch(() => {
alert('ETH Authorization failed')
this.setLogout()
})
if(accounts){
this.setLogin()
const account = accounts[0]
this.setAccount = account
}
},
handleClick(item){
this.$router.push({name: item.name})
},
mobileItems(){
if(!this.getLogin){
return this.items.filter(a => a.login == 'no')
} else {
return this.items
}
}
},
head: {
link(){
if(this.getTheme != 'Custom'){
return [
{
rel: 'stylesheet',
name: 'theme',
href: require(`@/assets/css/${this.getTheme}.css`)
}
]
}
},
style(){
if(this.getTheme == 'Custom'){
return [
{
type: 'text/css',
inner: `${this.getCustomCss}`
}
]
}
},
meta(){
if(this.getGrab){
return [
{
name: 'theme-color',
content: '#880000'
}
]
} else {
return [
{
name: 'theme-color',
content: '#34345c'
}
]
}
}
},
mounted(){
let style = [
'background: linear-gradient(#009245, #006837)',
'color: white',
'display: block',
'line-height: 40px',
'text-align: center',
'font-weight: bold'
].join(';');
/* eslint-disable-next-line */
console.log('%c fuck de popo lmao ', style);
if(this.getLogin){
this.setLogout()
this.login()
}
/* EventBus habbedigs below */
eBus.$on('closeReply', () => {
this.quickReply = false
})
eBus.$on('openReply', n => {
if(!this.quickReply){
this.quickReply = true
this.posx = n.posx
this.posy = n.posy
this.replyContent = n.id
}
})
eBus.$on('login', () => {
this.login()
})
}
};
</script>
<style>
/* a[href*="//"]:not([href*="localhost"]):after {
content: '\2197';
} */
</style>