-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
97 lines (82 loc) · 1.77 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
<template>
<div id="app">
<CLI ref="cli" />
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import CLI from './components/CLI.vue'
export default defineComponent({
components: {
CLI
},
mounted() {
document.addEventListener('keydown', this.onKeyDown)
},
onUnmounted() {
document.removeEventListener('keydown', this.onKeyDown)
},
methods: {
refs(): any {
return this.$refs;
},
onKeyDown() {
this.refs().cli.focus();
let element = document.documentElement;
let bottom = element.scrollHeight - element.clientHeight;
window.scroll(0, bottom);
},
}
});
</script>
<style>
:root {
--color-default: rgba(0, 0, 0, 0);
--color-font-main: rgba(255, 255, 255, .85);
---color-bg-main: #222;
}
* {
padding: 0;
margin: 0;
/* scrollbar */
-ms-overflow-style: none; /* IE, Edge */
scrollbar-width: none; /* Firefox */
}
html, body {
background-color: var(---color-bg-main);
}
::-webkit-scrollbar { /* Chrome, Safari */
display:none;
}
button, input, optgroup, select, textarea {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
/* vertical-align: middle; */
color: inherit;
font: inherit;
border: 0;
background: var(--color-default);
outline: 0;
border-radius: 0;
text-align: inherit;
}
::-moz-selection { /* Code for Firefox */
color: var(---color-bg-main);
background: var(--color-font-main);
}
::selection {
color: var(---color-bg-main);
background: var(--color-font-main);
}
a {
color: #4293b9;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: var(--color-font-main);
font-family: 'Roboto Mono', monospace;
}
</style>