aboutsummaryrefslogtreecommitdiff
path: root/src/components/update_notification/update_notification.scss
blob: 594f4c6b0e2c74b836ec661d75bcd2f77c24acd6 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
@import 'src/_variables.scss';
.UpdateNotification {
  overflow: hidden;
}
.UpdateNotificationModal {
  --__top-fringe: 18em; // how much pleroma-tan should stick her head above
  --__bottom-fringe: 80em; // just reserving as much as we can, number is mostly irrelevant
  --__right-fringe: 8em;

  font-size: 15px;
  /* Explanation:
   * Modal is positioned vertically centered.
   * 100vh - 100% = Distance between modal's top+bottom boundaries and screen
   * (100vh - 100%) / 2 = Distance between bottom (or top) boundary and screen
   * + 10% - we move modal completely off-screen, it's top boundary touches
   *   bottom of the screen
   * - 50px - leaving tiny amount of space so that titlebar + tiny amount of modal is visible
   */
  position: relative;
  transition: transform;
  transition-timing-function: ease-in-out;
  transition-duration: 500ms;

  .text {
    width: 40em;
    padding-left: 1em;
  }

  @media all and (max-width: 800px) {
    /* For mobile, the modal takes 100% of the available screen.
    This ensures the minimized modal is always 50px above the browser bottom bar regardless of whether or not it is visible.
   */
    width: 100vw;
  }

  @media all and (max-height: 600px) {
    display: none;
  }

  .content {
    overflow: hidden;
    margin-top: calc(-1 * var(--__top-fringe));
    margin-bottom: calc(-1 * var(--__bottom-fringe));
    margin-right: calc(-1 * var(--__right-fringe));
  }

  .panel-body {
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: var(--border, $fallback--border);
  }

  .panel-footer {
    z-index: 22;
    position: relative;
    border-width: 0;
    grid-template-columns: auto;
  }

  .pleroma-tan {
    object-fit: cover;
    object-position: top;
    transition: position, left, right, top, bottom, max-width, max-height;
    transition-timing-function: ease-in-out;
    transition-duration: 500ms;
    width: 25em;
    float: right;
    z-index: 20;
    position: relative;
    shape-margin: 0.5em;
  }

  .spacer-top {
    min-height: var(--__top-fringe);
  }

  .spacer-bottom {
    min-height: var(--__bottom-fringe);
  }

  .extra-info {
    transition: max-height, padding, height;
    transition-timing-function: ease-in-out;
    transition-duration: 500ms;
    max-height: auto;
    height: auto;
  }

  &.-peek {
    transform: translateY(calc(((100vh - 100%) / 2)));

    .pleroma-tan {
      float: right;
      z-index: 10;
      shape-image-threshold: 0.7;
    }

    .extra-info {
      max-height: 0;
      height: 0;
      display: none;
      overflow: hidden;
    }
  }
}