Skip to content

Commit 972fddc

Browse files
committed
better .gitignore
1 parent d621d79 commit 972fddc

7 files changed

Lines changed: 85 additions & 25 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ dist/*
1818
**/*.pyc
1919

2020
bun.lockb
21+
*.mjs

src/components/CommandLineInterface.vue

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1-
<!-- src/components/CommandLineInterface.vue -->
1+
<script setup lang="ts">
2+
import VueCommand, { createStdout } from "vue-command";
3+
import "vue-command/dist/vue-command.css";
4+
import { useMainStore } from '../store';
5+
import LoginPanel from './LoginPanel.vue';
6+
import DebugPanel from './DebugPanel.vue';
7+
8+
const mainStore = useMainStore();
9+
10+
const commands = {
11+
"help": () => createStdout("Available commands: hello, login, debug"),
12+
"login": () => {
13+
mainStore.toggleLogin();
14+
return createStdout("Login interface activated.");
15+
},
16+
"hello": () => createStdout("Hello world! #wip"),
17+
"debug": () => {
18+
mainStore.toggleDebugPanel();
19+
return createStdout("Debug panel activated.");
20+
},
21+
};
22+
</script>
23+
224
<template>
325
<div class="cli-container">
4-
<vue-command :commands="commands" :hide-buttons="true" :show-help="true" :cursor-position="0" :is-fullscreen="true">
26+
<vue-command :commands="commands" :hide-buttons="true" :show-help="true" :cursor-position="0" :is-fullscreen="true">
527
<template #title>Command Line Interface v0.1 -- type "help" for instructions</template>
628
<template #prompt>
729
<span class="prompt">
@@ -14,31 +36,12 @@
1436
<template #help-text>asdfasdf</template>
1537
<template #invert>true</template>
1638
<template #font></template>
17-
1839
</vue-command>
40+
<LoginPanel v-if="mainStore.showLogin" />
41+
<DebugPanel v-if="mainStore.showDebugPanel" />
1942
</div>
2043
</template>
2144

22-
<script lang="ts">
23-
// https://github.com/ndabAP/vue-command
24-
import VueCommand, { createStdout } from "vue-command";
25-
import "vue-command/dist/vue-command.css";
26-
27-
export default {
28-
components: {
29-
VueCommand,
30-
},
31-
32-
data: () => ({
33-
commands: {
34-
"help": () => createStdout("Available commands: hello, login"),
35-
"login": () => createStdout("Login not available (coming soon!)"),
36-
"hello": () => createStdout("Hello world! #wip"),
37-
},
38-
}),
39-
};
40-
</script>
41-
4245
<style scoped>
4346
.cli-container {
4447
/* Adjust the border-radius as needed */

src/components/CookieBanner.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import useCookies from '../useCookies';
1414
import { defineComponent, getCurrentInstance } from 'vue';
1515
import { useMainStore } from '../store';
1616
17-
1817
export default defineComponent({
1918
setup() {
2019
const instance = getCurrentInstance();

src/components/DebugPanel.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- src/components/DebugPanel.vue -->
2+
<template>
3+
<div class="debug-panel">
4+
<pre>{{ state }}</pre>
5+
<button @click="resetCookieConsent">Reset Cookie Consent</button>
6+
</div>
7+
</template>
8+
9+
<script setup lang="ts">
10+
import { useMainStore } from '../store';
11+
12+
const mainStore = useMainStore();
13+
const state = mainStore.$state;
14+
15+
const resetCookieConsent = () => {
16+
mainStore.resetCookieConsent();
17+
};
18+
</script>
19+
20+
<style scoped>
21+
.debug-panel {
22+
/* Add your styles for the debug panel here */
23+
}
24+
</style>
25+

src/components/LoginPanel.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- src/components/LoginPanel.vue -->
2+
<template>
3+
<div class="login-buttons">
4+
<button>Sign in with Google</button>
5+
<button>Sign in with Facebook</button>
6+
<!-- More buttons as needed -->
7+
</div>
8+
</template>
9+
10+
<script setup lang="ts">
11+
// Add any script logic if needed
12+
</script>
13+
14+
<style scoped>
15+
.login-buttons {
16+
/* Add your styles for the login buttons here */
17+
}
18+
</style>
19+

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ app
2626
})
2727
.provide('gtag', app.config.globalProperties.$gtag)
2828
.mount('#app')
29+

src/store.js renamed to src/store.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export const useMainStore = defineStore('main', {
55
state: () => ({
66
count: 0,
77
// cookieConsent: null // null, 'accepted', or 'rejected'
8-
cookieConsent: localStorage.getItem('cookieConsent')
8+
cookieConsent: localStorage.getItem('cookieConsent'),
9+
showLogin: false,
10+
showDebugPanel: false,
911
}),
1012
actions: {
1113
increment() {
@@ -14,6 +16,16 @@ export const useMainStore = defineStore('main', {
1416
setCookieConsent(value) {
1517
this.cookieConsent = value
1618
localStorage.setItem('cookieConsent', value)
19+
},
20+
resetCookieConsent() {
21+
this.cookieConsent = null;
22+
localStorage.removeItem('cookieConsent');
23+
},
24+
toggleLogin(show) {
25+
this.showLogin = !this.showLogin;
26+
},
27+
toggleDebugPanel(show) {
28+
this.showDebugPanel = !this.showDebugPanel;
1729
}
1830
},
1931
getters: {

0 commit comments

Comments
 (0)