diff --git a/client/src/assets/css/colors.scss b/client/src/assets/css/colors.scss index eee40b1..8145a20 100644 --- a/client/src/assets/css/colors.scss +++ b/client/src/assets/css/colors.scss @@ -33,7 +33,6 @@ $button-disabled-background-color: #006080; $button-disabled-text-color: #102028; $button-disabled-border: 4px solid #004060; - // Topbar $topbar-background-color: #006898; $topbar-separator-color: #ffffff; @@ -42,12 +41,23 @@ $topbar-separator-color: #ffffff; $alert-background-color: #A06060; $alert-border: 2px solid #F0A0A0; +// Quote +$quote-background-color: #ffff88; +$quote-border: none; +$quote-text-color: #384048; +$quote-new-background-color: none; +$quote-new-border: 5px dashed #ffffff; +$quote-new-text-color: #ffffff; + +// Quote Button +$quote-button-background-color: #00a0e0; +$quote-button-text-color: #000000; +$quote-button-border: none; +$quote-button-hover-background-color: $button-hover-background-color; +$quote-button-hover-text-color: $quote-button-text-color; +$quote-button-hover-border: none; + // Engine Debug $debug-background-color: lighten($background-primary-color, 10%); $debug-border: none; $debug-text-color: $text-primary-color; - -// Quote -$quote-background-color: #ffff88; -$quote-border: none; -$quote-text-color: #384048; \ No newline at end of file diff --git a/client/src/components/CollectQuotes.vue b/client/src/components/CollectQuotes.vue index 9dd4ff3..4880b0d 100644 --- a/client/src/components/CollectQuotes.vue +++ b/client/src/components/CollectQuotes.vue @@ -1,6 +1,7 @@ @@ -8,7 +9,6 @@ import useEngine from '@/composables/useEngine' const engine = useEngine() const quotes = await engine.getQuotes() -console.log(quotes) \ No newline at end of file + diff --git a/client/src/components/QuoteCardActionButton.vue b/client/src/components/QuoteCardActionButton.vue new file mode 100644 index 0000000..2382605 --- /dev/null +++ b/client/src/components/QuoteCardActionButton.vue @@ -0,0 +1,30 @@ + + + \ No newline at end of file diff --git a/client/src/components/QuoteCardNew.vue b/client/src/components/QuoteCardNew.vue new file mode 100644 index 0000000..f7ddb88 --- /dev/null +++ b/client/src/components/QuoteCardNew.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/client/src/components/TopBar.vue b/client/src/components/TopBar.vue index 62dad09..fb531e7 100644 --- a/client/src/components/TopBar.vue +++ b/client/src/components/TopBar.vue @@ -50,6 +50,7 @@ const actionLogout = async () => { font-size: 16px; font-family: $font-primary; font-weight: bold; + cursor: default; } &__username, diff --git a/client/src/composables/engine/getQuotes.ts b/client/src/composables/engine/getQuotes.ts deleted file mode 100644 index 2ce9cc9..0000000 --- a/client/src/composables/engine/getQuotes.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Quotes } from '@/composables/engine.d' -import { useUserinfoStore } from "@/stores/UserinfoStore" - -export async function getQuotes(): Promise { - const userInfoStore = useUserinfoStore() - const response = await this.callApi('/api/getQuotes', { - g: userInfoStore.gameId, - }) - - return response.quotes -} diff --git a/client/src/composables/engine/quotes.ts b/client/src/composables/engine/quotes.ts new file mode 100644 index 0000000..75eb3d4 --- /dev/null +++ b/client/src/composables/engine/quotes.ts @@ -0,0 +1,28 @@ +import type { Quotes } from '@/composables/engine.d' +import { useUserinfoStore } from "@/stores/UserinfoStore" + +export async function getQuotes(): Promise { + const userInfoStore = useUserinfoStore() + const response = await this.callApi('/api/getQuotes', { + g: userInfoStore.gameId, + }) + + return response.quotes +} + +export async function deleteQuote(id: string): Promise { + const userInfoStore = useUserinfoStore() + await this.callApi('/api/removeQuote', { + g: userInfoStore.gameId, + id, + }) +} + +export async function saveQuote(id: string, quote: string): Promise { + const userInfoStore = useUserinfoStore() + await this.callApi('/api/saveQuote', { + g: userInfoStore.gameId, + id, + quote, + }) +} diff --git a/client/src/composables/useEngine.ts b/client/src/composables/useEngine.ts index a4a30da..a048264 100644 --- a/client/src/composables/useEngine.ts +++ b/client/src/composables/useEngine.ts @@ -2,7 +2,7 @@ import { Ref, ref } from 'vue' import { callApi, QueryParams } from '@/composables/engine/callApi' import { start, stop } from '@/composables/engine/startStop' import { fetchUpdate } from '@/composables/engine/fetchUpdate' -import { getQuotes } from '@/composables/engine/getQuotes' +import { getQuotes, deleteQuote, createQuote, saveQuote } from '@/composables/engine/quotes' import type { Quotes } from '@/composables/engine.d' interface EngineContext { @@ -23,6 +23,9 @@ export interface useEngine { stop(): void fetchUpdate(): void getQuotes(): Promise + createQuote(quote: string): Promise + saveQuote(id: string, quote: string): Promise + deleteQuote(id: string): Promise } export default (): useEngine => { @@ -45,5 +48,8 @@ export default (): useEngine => { stop: () => stop.apply(context), fetchUpdate: () => fetchUpdate.apply(context), getQuotes: () => getQuotes.apply(context), + createQuote: (quote: string) => saveQuote.apply(context, [':new:', quote]), + saveQuote: (id: string, quote: string) => saveQuote.apply(context, [id, quote]), + deleteQuote: (id) => deleteQuote.apply(context, [id]), } } \ No newline at end of file