Last change
on this file since 35772 was 35756, checked in by cstephen, 3 years ago |
Allow direct input to be copied to the clipboard
|
File size:
2.4 KB
|
Line | |
---|
1 | <template>
|
---|
2 | <div class="root">
|
---|
3 | <div class="app-bar theme-primary">
|
---|
4 | <div class="app-bar-content">
|
---|
5 | <span class="heading1">{{ translations.get("Title") }}</span>
|
---|
6 |
|
---|
7 | <toggle-button class="theme-primary-l1" v-model="showInfo" :reverseState="true">
|
---|
8 | <span class="material-icons mdi-l">info</span>
|
---|
9 | </toggle-button>
|
---|
10 | </div>
|
---|
11 |
|
---|
12 | <div v-if="showInfo" class="paper" v-html="translations.get('Description')" />
|
---|
13 | </div>
|
---|
14 |
|
---|
15 | <div class="paper content">
|
---|
16 | <tab-bar :tabs="tabs" v-model="selectedTab" />
|
---|
17 | <hr class="divider" />
|
---|
18 |
|
---|
19 | <div class="inner-content" v-if="selectedTab === 'direct'">
|
---|
20 | <direct-input />
|
---|
21 | </div>
|
---|
22 | <div class="inner-content" v-if="selectedTab === 'file'">
|
---|
23 | <file-input />
|
---|
24 | </div>
|
---|
25 | </div>
|
---|
26 | </div>
|
---|
27 |
|
---|
28 | <snackbar ref="snackBar" />
|
---|
29 | </template>
|
---|
30 |
|
---|
31 | <style lang="scss">
|
---|
32 | html, body, #app {
|
---|
33 | height: 100%;
|
---|
34 | }
|
---|
35 |
|
---|
36 | .root {
|
---|
37 | display: flex;
|
---|
38 | flex-direction: column;
|
---|
39 | height: 100%;
|
---|
40 | }
|
---|
41 |
|
---|
42 | .app-bar {
|
---|
43 | display: flex;
|
---|
44 | flex-direction: column;
|
---|
45 | gap: 1em;
|
---|
46 |
|
---|
47 | background-color: var(--bg-color);
|
---|
48 | color: var(--fg-color);
|
---|
49 | box-shadow: 0px 0px 4px 3px #6d6d6d;
|
---|
50 |
|
---|
51 | padding: 1em;
|
---|
52 | margin-bottom: 1em;
|
---|
53 | }
|
---|
54 |
|
---|
55 | .app-bar-content {
|
---|
56 | display: flex;
|
---|
57 | align-items: center;
|
---|
58 | gap: 1em;
|
---|
59 |
|
---|
60 | width: 100%;
|
---|
61 |
|
---|
62 | & :first-child {
|
---|
63 | flex-grow: 1;
|
---|
64 | }
|
---|
65 | }
|
---|
66 |
|
---|
67 | .content {
|
---|
68 | padding: 0;
|
---|
69 | margin: 1em;
|
---|
70 | flex-grow: 1;
|
---|
71 | }
|
---|
72 |
|
---|
73 | .inner-content {
|
---|
74 | padding: 1em;
|
---|
75 | }
|
---|
76 | </style>
|
---|
77 |
|
---|
78 | <script>
|
---|
79 | import { mapState } from "vuex";
|
---|
80 | import DirectInput from "./components/DirectInput.vue"
|
---|
81 | import FileInput from "./components/FileInput.vue"
|
---|
82 | import Snackbar, { SnackController } from "./components/Snackbar.vue"
|
---|
83 | import TabBar from "./components/TabBar.vue"
|
---|
84 |
|
---|
85 | export default {
|
---|
86 | name: "App",
|
---|
87 | components: {
|
---|
88 | DirectInput,
|
---|
89 | FileInput,
|
---|
90 | Snackbar,
|
---|
91 | TabBar
|
---|
92 | },
|
---|
93 | data() {
|
---|
94 | return {
|
---|
95 | selectedTab: "direct",
|
---|
96 | showInfo: false
|
---|
97 | }
|
---|
98 | },
|
---|
99 | computed: {
|
---|
100 | tabs() {
|
---|
101 | return [
|
---|
102 | { label: this.translations.get("DirectInput"), value: "direct" },
|
---|
103 | { label: this.translations.get("FileInput"), value: "file" }
|
---|
104 | ]
|
---|
105 | },
|
---|
106 | ...mapState({
|
---|
107 | translations: state => state.translations
|
---|
108 | })
|
---|
109 | },
|
---|
110 | mounted() {
|
---|
111 | SnackController.setBar(this.$refs.snackBar);
|
---|
112 | }
|
---|
113 | }
|
---|
114 | </script>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.