mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
toggle door visibility
This commit is contained in:
parent
b3a4a20f16
commit
70d3489a29
2 changed files with 26 additions and 3 deletions
|
@ -2,9 +2,21 @@
|
||||||
<MultiModal @handle="modal_handle" />
|
<MultiModal @handle="modal_handle" />
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
<figcaption class="has-text-primary-dark">
|
<div class="level is-mobile mb-2">
|
||||||
{{ figure_caption }}
|
<div class="level-left">
|
||||||
</figcaption>
|
<figcaption class="level-item has-text-primary-dark">
|
||||||
|
{{ figure_caption }}
|
||||||
|
</figcaption>
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<BulmaButton
|
||||||
|
class="level-item tag is-link"
|
||||||
|
text="Türchen anzeigen"
|
||||||
|
:icon="'fa-solid fa-toggle-' + (show_doors ? 'on' : 'off')"
|
||||||
|
@click.left="show_doors = !show_doors"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="image is-unselectable">
|
<div class="image is-unselectable">
|
||||||
<img :src="$advent22.api_url('user/background_image')" />
|
<img :src="$advent22.api_url('user/background_image')" />
|
||||||
<ThouCanvas>
|
<ThouCanvas>
|
||||||
|
@ -12,6 +24,7 @@
|
||||||
v-for="(door, index) in doors"
|
v-for="(door, index) in doors"
|
||||||
:key="`door-${index}`"
|
:key="`door-${index}`"
|
||||||
:door="door"
|
:door="door"
|
||||||
|
:visible="show_doors"
|
||||||
@doorClick="door_click"
|
@doorClick="door_click"
|
||||||
@doorSuccess="door_success"
|
@doorSuccess="door_success"
|
||||||
@doorFailure="door_failure"
|
@doorFailure="door_failure"
|
||||||
|
@ -30,12 +43,14 @@ import { Door } from "@/lib/door";
|
||||||
import { Options, Vue } from "vue-class-component";
|
import { Options, Vue } from "vue-class-component";
|
||||||
|
|
||||||
import MultiModal from "./MultiModal.vue";
|
import MultiModal from "./MultiModal.vue";
|
||||||
|
import BulmaButton from "./bulma/Button.vue";
|
||||||
import CalendarDoor from "./calendar/CalendarDoor.vue";
|
import CalendarDoor from "./calendar/CalendarDoor.vue";
|
||||||
import ThouCanvas from "./calendar/ThouCanvas.vue";
|
import ThouCanvas from "./calendar/ThouCanvas.vue";
|
||||||
|
|
||||||
@Options({
|
@Options({
|
||||||
components: {
|
components: {
|
||||||
MultiModal,
|
MultiModal,
|
||||||
|
BulmaButton,
|
||||||
ThouCanvas,
|
ThouCanvas,
|
||||||
CalendarDoor,
|
CalendarDoor,
|
||||||
},
|
},
|
||||||
|
@ -47,6 +62,7 @@ export default class extends Vue {
|
||||||
public readonly doors!: Door[];
|
public readonly doors!: Door[];
|
||||||
private readonly idle_caption = "Finde die Türchen auf dem Adventskalender!";
|
private readonly idle_caption = "Finde die Türchen auf dem Adventskalender!";
|
||||||
|
|
||||||
|
public show_doors = false;
|
||||||
private multi_modal?: MultiModal;
|
private multi_modal?: MultiModal;
|
||||||
public figure_caption = this.idle_caption;
|
public figure_caption = this.idle_caption;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<SVGRect
|
<SVGRect
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
|
:variant="visible ? 'primary' : undefined"
|
||||||
:rectangle="door.position"
|
:rectangle="door.position"
|
||||||
@click.left="on_click"
|
@click.left="on_click"
|
||||||
>
|
>
|
||||||
|
<div class="has-text-danger">{{ door.day }}</div>
|
||||||
</SVGRect>
|
</SVGRect>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -19,11 +21,16 @@ import SVGRect from "./SVGRect.vue";
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
door: Door,
|
door: Door,
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ["doorClick", "doorSuccess", "doorFailure"],
|
emits: ["doorClick", "doorSuccess", "doorFailure"],
|
||||||
})
|
})
|
||||||
export default class extends Vue {
|
export default class extends Vue {
|
||||||
public door!: Door;
|
public door!: Door;
|
||||||
|
public visible!: boolean;
|
||||||
|
|
||||||
public on_click() {
|
public on_click() {
|
||||||
this.$emit("doorClick");
|
this.$emit("doorClick");
|
||||||
|
|
Loading…
Reference in a new issue