aboutsummaryrefslogtreecommitdiff
path: root/src/components/flash/flash.vue
blob: 95f71950936014ac34a014311ecee421141febc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
  <div class="Flash">
    <div
      v-if="player === true || player === 'hidden'"
      ref="container"
      class="player"
      :class="{ hidden: player === 'hidden' }"
    />
    <button
      v-if="player !== true"
      class="button-unstyled placeholder"
      @click="openPlayer"
    >
      <span
        v-if="player === 'hidden'"
        class="label"
      >
        {{ $t('general.loading') }}
      </span>
      <span
        v-if="player === 'error'"
        class="label"
      >
        {{ $t('general.flash_fail') }}
      </span>
      <span
        v-else
        class="label"
      >
        <p>
          {{ $t('general.flash_content') }}
        </p>
        <p>
          <FAIcon icon="exclamation-triangle" />
          {{ $t('general.flash_security') }}
        </p>
      </span>
    </button>
  </div>
</template>

<script src="./flash.js"></script>

<style lang="scss">
@import '../../_variables.scss';
.Flash {
  display: inline-block;
  width: 100%;
  height: 100%;
  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);
  }

  .hider {
    top: 0;
  }

  .label {
    text-align: center;
    flex: 1 1 0;
    line-height: 1.2;
    white-space: normal;
    word-wrap: normal;
  }

  .hidden {
    display: none;
    visibility: 'hidden';
  }
}
</style>