Skip to content

Commit 313ee39

Browse files
committed
feat: invert
1 parent 937dbc1 commit 313ee39

File tree

3 files changed

+70
-70
lines changed

3 files changed

+70
-70
lines changed

src/components/VueCommand.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ defineExpose({
501501
<style lang="scss">
502502
.vue-command,
503503
.vue-command--invert {
504+
font-family: 'Fira Code', monospace;
504505
505506
@mixin clearfix() {
506507
@@ -554,8 +555,6 @@ defineExpose({
554555
margin: 0;
555556
white-space: pre-line;
556557
line-height: 1.33;
557-
font-size: 1rem;
558-
font-family: monospace;
559558
height: 100%;
560559
561560
/* Provide reasonable default values */
@@ -571,8 +570,8 @@ defineExpose({
571570
border: none;
572571
outline: none;
573572
flex: 1;
574-
width: 100%;
575573
font-size: 1rem;
574+
width: 100%;
576575
resize: none;
577576
overflow: hidden;
578577
}

src/components/VueCommandQuery.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,18 @@ defineExpose({
228228
.vue-command__query--invert {
229229
display: flex;
230230
231+
input::placeholder,
232+
input {
233+
font: 1rem monospace;
234+
}
235+
231236
.vue-command__query__input,
232237
.vue-command__query__input--invert {
233238
border: none;
234239
outline: none;
235240
flex: 1;
236241
width: 100%;
237-
font-family: monospace;
238-
font-size: 1rem;
242+
239243
}
240244
241245
.vue-command__query__prompt,
@@ -248,8 +252,6 @@ defineExpose({
248252
.vue-command {
249253
.vue-command__query {
250254
.vue-command__query__input {
251-
background: none;
252-
253255
&::placeholder {
254256
color: rgba(255, 255, 255, 0.5);
255257
}
@@ -260,8 +262,6 @@ defineExpose({
260262
.vue-command--invert {
261263
.vue-command__query--invert {
262264
.vue-command__query__input--invert {
263-
background: none;
264-
265265
&::placeholder {
266266
color: rgba(0, 0, 0, 0.5);
267267
}

src/hosted/App.vue

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
<template>
22
<main>
3-
<h1><a href="https://github.com/ndabAP/vue-command">vue-command</a></h1>
4-
<p>A fully working, most feature-rich Vue.js terminal emulator. Now with Vue.js 3 support!</p>
5-
6-
<vue-command
7-
v-model:history="history"
8-
v-model:query="query"
9-
:commands="commands"
10-
:prompt="prompt"
11-
help-text="Type in help"
12-
:invert="invert"
13-
show-help>
14-
</vue-command>
15-
<pre>
16-
<code>
17-
$ npm install --save vue-command
18-
</code>
19-
</pre>
3+
<div>
4+
<vue-command
5+
v-model:history="history"
6+
v-model:query="query"
7+
:commands="commands"
8+
:prompt="prompt"
9+
help-text="Type in help"
10+
:invert="invert"
11+
show-help>
12+
</vue-command>
13+
</div>
2014
</main>
2115
</template>
2216

@@ -33,7 +27,7 @@ import {
3327
import NanoEditor from '@/hosted/NanoEditor.vue'
3428
import ChuckNorris from '@/hosted/ChuckNorris.vue'
3529
36-
const PROMPT = '~$'
30+
const PROMPT = 'neil@moon~$'
3731
3832
export default {
3933
components: {
@@ -94,59 +88,66 @@ export default {
9488

9589
<style lang="scss">
9690
body {
97-
font-family: sans-serif;
98-
display: grid;
99-
place-items: center;
100-
margin: 0;
91+
color: #fff;
92+
background: #000;
10193
10294
main {
103-
max-width: 400px;
104-
105-
.vue-command,
106-
.vue-command--invert {
107-
::-webkit-scrollbar {
108-
width: 6px;
95+
position: absolute;
96+
left: 50%;
97+
top: 50%;
98+
-webkit-transform: translate(-50%, -50%);
99+
transform: translate(-50%, -50%);
100+
101+
div {
102+
103+
.vue-command,
104+
.vue-command--invert {
105+
width: 450px;
106+
107+
::-webkit-scrollbar {
108+
width: 6px;
109+
}
110+
111+
.vue-command__bar,
112+
.vue-command__bar--invert {
113+
border-top-right-radius: 5px;
114+
border-top-left-radius: 5px;
115+
}
116+
117+
.vue-command__history,
118+
.vue-command__history--invert {
119+
height: 260px;
120+
border-bottom-right-radius: 5px;
121+
border-bottom-left-radius: 5px;
122+
}
109123
}
110124
111-
.vue-command__bar,
112-
.vue-command__bar--invert {
113-
border-top-right-radius: 5px;
114-
border-top-left-radius: 5px;
115-
}
125+
.vue-command {
126+
::-webkit-scrollbar-track {
127+
background: #252525;
128+
}
116129
117-
.vue-command__history,
118-
.vue-command__history--invert {
119-
height: 260px;
120-
border-bottom-right-radius: 5px;
121-
border-bottom-left-radius: 5px;
122-
}
123-
}
130+
::-webkit-scrollbar-thumb {
131+
background: #f1f1f1;
132+
}
124133
125-
.vue-command {
126-
::-webkit-scrollbar-track {
127-
background: #252525;
134+
::-webkit-scrollbar-thumb:hover {
135+
background: #333;
136+
}
128137
}
129138
130-
::-webkit-scrollbar-thumb {
131-
background: #f1f1f1;
132-
}
139+
.vue-command--invert {
140+
::-webkit-scrollbar-track {
141+
background: #dadada;
142+
}
133143
134-
::-webkit-scrollbar-thumb:hover {
135-
background: #333;
136-
}
137-
}
138-
139-
.vue-command--invert {
140-
::-webkit-scrollbar-track {
141-
background: #dadada;
142-
}
143-
144-
::-webkit-scrollbar-thumb {
145-
background: #0e0e0e;
146-
}
144+
::-webkit-scrollbar-thumb {
145+
background: #0e0e0e;
146+
}
147147
148-
::-webkit-scrollbar-thumb:hover {
149-
background: #cccccc;
148+
::-webkit-scrollbar-thumb:hover {
149+
background: #cccccc;
150+
}
150151
}
151152
}
152153
}

0 commit comments

Comments
 (0)