mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
bulma-ify DoorMapEditor
This commit is contained in:
parent
95c4c2e5ff
commit
d387aceedd
1 changed files with 30 additions and 36 deletions
|
@ -1,7 +1,28 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container">
|
<div class="box">
|
||||||
<img ref="background" src="@/assets/adventskalender.jpg" />
|
<p class="title is-4">Türchen bearbeiten</p>
|
||||||
<RectPad id="rectpad" />
|
|
||||||
|
<div class="tabs is-centered">
|
||||||
|
<ul>
|
||||||
|
<li class="is-active"><a>Platzieren</a></li>
|
||||||
|
<li><a>Ordnen</a></li>
|
||||||
|
<li><a>Überprüfen</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section v-if="step === 0">
|
||||||
|
<div class="content">
|
||||||
|
<ul>
|
||||||
|
<li>Linksklick + Ziehen: Neues Türchen erstellen</li>
|
||||||
|
<li>Rechtsklick + Ziehen: Türchen verschieben</li>
|
||||||
|
<li>Doppel- oder Mittelklick: Türchen löschen</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<figure class="image">
|
||||||
|
<img src="@/assets/adventskalender.jpg" />
|
||||||
|
<RectPad />
|
||||||
|
</figure>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -15,46 +36,19 @@ import RectPad from "./rects/RectPad.vue";
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class CalendarImage extends Vue {
|
export default class CalendarImage extends Vue {
|
||||||
private resize_observer?: ResizeObserver;
|
private step = 0;
|
||||||
|
|
||||||
declare $refs: {
|
|
||||||
container: HTMLDivElement;
|
|
||||||
background: HTMLImageElement;
|
|
||||||
};
|
|
||||||
|
|
||||||
private on_resize() {
|
|
||||||
this.$refs.container.style.height =
|
|
||||||
this.$refs.background.offsetHeight + "px";
|
|
||||||
}
|
|
||||||
|
|
||||||
public mounted() {
|
|
||||||
this.resize_observer = new ResizeObserver(this.on_resize);
|
|
||||||
this.resize_observer.observe(this.$refs.background);
|
|
||||||
}
|
|
||||||
|
|
||||||
public unmounted() {
|
|
||||||
if (this.resize_observer instanceof ResizeObserver) {
|
|
||||||
this.resize_observer.disconnect();
|
|
||||||
delete this.resize_observer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
div {
|
figure {
|
||||||
position: relative;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
img {
|
img + * {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
left: 0;
|
||||||
width: 100%;
|
top: 0;
|
||||||
}
|
z-index: 99;
|
||||||
|
|
||||||
#rectpad {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in a new issue