Colorscheme and Layout optimizations

This commit is contained in:
Jörn-Michael Miehe 2023-09-14 13:54:23 +00:00
parent 0498a722b1
commit 6b28c08fb9
6 changed files with 63 additions and 34 deletions

View file

@ -5,12 +5,9 @@
<h2 class="subtitle has-text-centered">Der Gelöt</h2> <h2 class="subtitle has-text-centered">Der Gelöt</h2>
</section> </section>
<section v-if="is_admin" class="section"> <section class="section">
<AdminView /> <AdminView v-if="is_admin" />
</section> <UserView v-else />
<section v-else class="section">
<UserView />
</section> </section>
<section class="section"> <section class="section">

View file

@ -31,7 +31,7 @@
<BulmaButton <BulmaButton
v-for="(day_part, index) in day_parts" v-for="(day_part, index) in day_parts"
:key="`btn-${index}`" :key="`btn-${index}`"
class="tag button is-primary" class="tag button is-info"
icon="fa-solid fa-door-open" icon="fa-solid fa-door-open"
:text="`${day_part.day}`" :text="`${day_part.day}`"
@click.left="door_click(day_part.day)" @click.left="door_click(day_part.day)"

View file

@ -1,20 +1,28 @@
<template> <template>
<BulmaDrawer header="Türchen bearbeiten" @open="on_open"> <BulmaDrawer header="Türchen bearbeiten" @open="on_open">
<div class="is-flex is-align-items-center is-justify-content-space-between"> <nav class="level mb-0">
<BulmaButton <div class="level-item">
:disabled="current_step === 0" <BulmaButton
class="is-link" :disabled="current_step === 0"
@click="current_step--" class="is-link"
icon="fa-solid fa-backward" @click="current_step--"
/> icon="fa-solid fa-backward"
<BulmaBreadcrumbs :steps="steps" v-model="current_step" class="mb-0" /> />
<BulmaButton </div>
:disabled="current_step === 2"
class="is-link" <div class="level-item">
@click="current_step++" <BulmaBreadcrumbs :steps="steps" v-model="current_step" class="mb-0" />
icon="fa-solid fa-forward" </div>
/>
</div> <div class="level-item">
<BulmaButton
:disabled="current_step === 2"
class="is-link"
@click="current_step++"
icon="fa-solid fa-forward"
/>
</div>
</nav>
<DoorPlacer v-if="current_step === 0" v-model:doors="doors" /> <DoorPlacer v-if="current_step === 0" v-model:doors="doors" />
<DoorChooser v-if="current_step === 1" v-model:doors="doors" /> <DoorChooser v-if="current_step === 1" v-model:doors="doors" />

View file

@ -1,9 +1,16 @@
<template> <template>
<button class="button"> <button class="button">
<span v-if="icon !== undefined" class="icon"> <slot v-if="text === undefined" name="default">
<font-awesome-icon :icon="icon" :beat-fade="busy" /> <font-awesome-icon :icon="icon" :beat-fade="busy" />
</span> </slot>
<span v-if="text !== ''">{{ text }}</span> <template v-else>
<span v-if="icon !== undefined" class="icon">
<slot name="default">
<font-awesome-icon :icon="icon" :beat-fade="busy" />
</slot>
</span>
<span>{{ text }}</span>
</template>
</button> </button>
</template> </template>
@ -18,7 +25,7 @@ import { Options, Vue } from "vue-class-component";
}, },
text: { text: {
type: String, type: String,
default: "", required: false,
}, },
busy: { busy: {
type: Boolean, type: Boolean,
@ -28,7 +35,7 @@ import { Options, Vue } from "vue-class-component";
}) })
export default class extends Vue { export default class extends Vue {
public icon?: string; public icon?: string;
public text!: string; public text?: string;
public busy!: boolean; public busy!: boolean;
} }
</script> </script>

View file

@ -4,12 +4,12 @@
<p class="card-header-title" @click="toggle">{{ header }}</p> <p class="card-header-title" @click="toggle">{{ header }}</p>
<p v-if="refreshable" class="card-header-icon px-0"> <p v-if="refreshable" class="card-header-icon px-0">
<button class="tag button icon is-info" @click="refresh"> <BulmaButton class="tag icon is-primary" @click="refresh">
<font-awesome-icon <font-awesome-icon
icon="fa-solid fa-arrows-rotate" icon="fa-solid fa-arrows-rotate"
:spin="is_open && loading" :spin="is_open && loading"
/> />
</button> </BulmaButton>
</p> </p>
<button class="card-header-icon" @click="toggle"> <button class="card-header-icon" @click="toggle">
@ -23,7 +23,7 @@
<template v-if="is_open"> <template v-if="is_open">
<div v-if="loading" class="card-content"> <div v-if="loading" class="card-content">
<progress class="progress is-info" max="100" /> <progress class="progress is-primary" max="100" />
</div> </div>
<div <div
v-else-if="failed" v-else-if="failed"
@ -41,13 +41,18 @@
<script lang="ts"> <script lang="ts">
import { Options, Vue } from "vue-class-component"; import { Options, Vue } from "vue-class-component";
export enum DrawerState { import BulmaButton from "./Button.vue";
enum DrawerState {
Loading, Loading,
Ready, Ready,
Failed, Failed,
} }
@Options({ @Options({
components: {
BulmaButton,
},
props: { props: {
header: String, header: String,
refreshable: { refreshable: {

View file

@ -1,14 +1,19 @@
<template> <template>
<slot v-if="show" name="default" /> <slot v-if="show" name="default" />
<span v-else>***</span> <span v-else>***</span>
<button :class="`tag button icon is-${button_class} ml-2`" @click="on_click"> <BulmaButton
<font-awesome-icon :icon="`fa-solid fa-${button_icon}`" /> :class="`tag icon is-${button_class} ml-2`"
</button> :icon="`fa-solid fa-${button_icon}`"
:busy="busy"
@click="on_click"
/>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Options, Vue } from "vue-class-component"; import { Options, Vue } from "vue-class-component";
import BulmaButton from "./Button.vue";
enum ClickState { enum ClickState {
Green = 0, Green = 0,
Yellow = 1, Yellow = 1,
@ -16,6 +21,9 @@ enum ClickState {
} }
@Options({ @Options({
components: {
BulmaButton,
},
emits: ["load"], emits: ["load"],
}) })
export default class extends Vue { export default class extends Vue {
@ -34,6 +42,10 @@ export default class extends Vue {
return this.state === ClickState.Red; return this.state === ClickState.Red;
} }
public get busy(): boolean {
return this.state === ClickState.Yellow;
}
public get button_class(): string { public get button_class(): string {
switch (this.state) { switch (this.state) {
case ClickState.Red: case ClickState.Red: