akkoma-fe/src/components/flash/flash.vue

85 lines
1.5 KiB
Vue
Raw Normal View History

<template>
2021-04-11 21:00:23 +00:00
<div class="Flash">
<div
2021-04-12 21:08:17 +00:00
v-if="player === true || player === 'hidden'"
ref="container"
2021-04-11 21:00:23 +00:00
class="player"
:class="{ hidden: player === 'hidden' }"
/>
<button
2021-04-12 21:08:17 +00:00
v-if="player !== true"
2021-04-11 21:00:23 +00:00
class="button-unstyled placeholder"
2021-04-11 21:07:28 +00:00
@click="openPlayer"
2021-04-11 21:00:23 +00:00
>
2021-04-11 21:07:28 +00:00
<span
v-if="player === 'hidden'"
class="label"
>
2021-04-11 21:00:23 +00:00
{{ $t('general.loading') }}
</span>
2021-04-12 21:08:17 +00:00
<span
v-if="player === 'error'"
class="label"
>
{{ $t('general.flash_fail') }}
</span>
2021-04-11 21:07:28 +00:00
<span
v-else
class="label"
>
2021-04-12 21:08:17 +00:00
<p>
{{ $t('general.flash_content') }}
</p>
<p>
<FAIcon icon="exclamation-triangle" />
{{ $t('general.flash_security') }}
</p>
2021-04-11 21:00:23 +00:00
</span>
</button>
2021-04-11 21:07:28 +00:00
</div>
</template>
<script src="./flash.js"></script>
<style lang="scss">
@import '../../_variables.scss';
.Flash {
display: inline-block;
2021-04-11 21:00:23 +00:00
width: 100%;
height: 100%;
2021-04-11 21:00:23 +00:00
position: relative;
.player {
height: 100%;
width: 100%;
}
.placeholder {
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg);
color: var(--link);
}
2021-04-11 21:00:23 +00:00
.hider {
top: 0;
}
2021-04-12 21:08:17 +00:00
.label {
text-align: center;
flex: 1 1 0;
line-height: 1.2;
white-space: normal;
word-wrap: normal;
}
2021-04-11 21:00:23 +00:00
.hidden {
display: none;
visibility: 'hidden';
}
}
</style>