|
| 1 | +<template> |
| 2 | + <div class="feature-alerts"> |
| 3 | + <FeatureTitle |
| 4 | + title="Алерты" |
| 5 | + description="Получайте уведомления о проблемах в ПО на почту, в Telegram или Slack" |
| 6 | + centered |
| 7 | + /> |
| 8 | + |
| 9 | + <div ref="elementRef" class="tg-message" :class="{ 'tg-message--visible': isVisible }"> |
| 10 | + <div class="tg-message__avatar"> |
| 11 | + <img src="~/assets/images/hawk-logo.png" aria-hidden="true"> |
| 12 | + </div> |
| 13 | + |
| 14 | + <div class="tg-message__content"> |
| 15 | + <div class="tg-message__title"> |
| 16 | + Hawk |
| 17 | + </div> |
| 18 | + |
| 19 | + <span class="tg-message__text"> |
| 20 | + null is not an object (evaluating 'e.payload') |
| 21 | + </span> |
| 22 | + |
| 23 | + <div class="tg-message__code"> |
| 24 | + <pre>11: const e = event; |
| 25 | +12:→ payload = e.payload; |
| 26 | +13: if (payload.user.isPaid)</pre> |
| 27 | + </div> |
| 28 | + |
| 29 | + <span class="tg-message__text"> |
| 30 | + <span class="tg-message__link">View Details</span> |
| 31 | + | Hawk Web [Prod] | 5 new |
| 32 | + </span> |
| 33 | + <span class="tg-message__time"> |
| 34 | + 17:09 |
| 35 | + </span> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + </div> |
| 39 | +</template> |
| 40 | + |
| 41 | +<script lang="ts" setup> |
| 42 | +import { useIntersectionObserver } from '~/composables/useIntersectionObserver'; |
| 43 | +
|
| 44 | +const { isVisible, elementRef } = useIntersectionObserver({ |
| 45 | + threshold: 0.3, |
| 46 | + rootMargin: '0px 0px -50px 0px', |
| 47 | +}); |
| 48 | +</script> |
| 49 | + |
| 50 | +<style lang="pcss"> |
| 51 | +.feature-alerts { |
| 52 | + --padding: var(--layout-paddings-horisontal); |
| 53 | +
|
| 54 | + padding: 35px var(--padding) var(--padding) var(--padding); |
| 55 | + background-image: url('~/assets/images/alerts-bg.png'); |
| 56 | + background-size: 150%; |
| 57 | + height: 100%; |
| 58 | + display: flex; |
| 59 | + flex-direction: column; |
| 60 | + justify-content: space-between; |
| 61 | +} |
| 62 | +
|
| 63 | +/* Animation keyframes for message appearance */ |
| 64 | +@keyframes messageSlideIn { |
| 65 | + from { |
| 66 | + opacity: 0; |
| 67 | + transform: translateY(50px) scaleX(0.8); |
| 68 | + } |
| 69 | + to { |
| 70 | + opacity: 1; |
| 71 | + transform: none; |
| 72 | + } |
| 73 | +} |
| 74 | +
|
| 75 | +.tg-message { |
| 76 | + display: flex; |
| 77 | + flex-direction: row; |
| 78 | + gap: 12px; |
| 79 | + opacity: 0; |
| 80 | + transform: translateY(50px) scaleX(0.8); |
| 81 | + will-change: transform, opacity; |
| 82 | +
|
| 83 | + &--visible { |
| 84 | + animation: messageSlideIn 0.4s cubic-bezier(.25,1.3,.86,1.07) forwards; |
| 85 | + } |
| 86 | +
|
| 87 | + &__avatar { |
| 88 | + width: 40px; |
| 89 | + height: 40px; |
| 90 | + flex-shrink: 0; |
| 91 | + align-self: flex-end; |
| 92 | + border-radius: 50%; |
| 93 | + overflow: hidden; |
| 94 | + background-color: var(--color-bg-third); |
| 95 | + display: flex; |
| 96 | + align-items: center; |
| 97 | + justify-content: center; |
| 98 | + background-color: #595D6F; |
| 99 | +
|
| 100 | + img { |
| 101 | + width: 66%; |
| 102 | + transform: translateX(1px); |
| 103 | +
|
| 104 | + @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { |
| 105 | + transform: none; |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | +
|
| 110 | + &__content { |
| 111 | + position: relative; |
| 112 | + display: flex; |
| 113 | + flex-direction: column; |
| 114 | + gap: 3px; |
| 115 | + background-color: var(--color-bg-secondary); |
| 116 | + border-radius: 10px; |
| 117 | + padding: 10px 14px 20px 14px; |
| 118 | + font-size: 12px; |
| 119 | + color: var(--color-text-main); |
| 120 | + border: 1px solid #222222; |
| 121 | +
|
| 122 | + /* Add rounded outer bubble corner at left-bottom */ |
| 123 | + &::before { |
| 124 | + content: ''; |
| 125 | + position: absolute; |
| 126 | + left: -10px; |
| 127 | + bottom: -1.8px; |
| 128 | + width: 16.2px; |
| 129 | + height: 16.83px; |
| 130 | + background-image: url('~/assets/images/tg-message-corner.png'); |
| 131 | + background-size: 100%; |
| 132 | + background-repeat: no-repeat; |
| 133 | + background-position: center; |
| 134 | +
|
| 135 | + @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { |
| 136 | + left: -10.5px; |
| 137 | + } |
| 138 | + } |
| 139 | + } |
| 140 | +
|
| 141 | + &__title { |
| 142 | + color: #AC60FD; |
| 143 | + font-weight: 800; |
| 144 | + } |
| 145 | +
|
| 146 | + &__code { |
| 147 | + font-size: 12px; |
| 148 | + color: var(--color-text-third); |
| 149 | + font-family: var(--font-mono); |
| 150 | + background-color: #171717; |
| 151 | + padding: 3px 6px; |
| 152 | + border-radius: 4px; |
| 153 | + margin: 4px 0; |
| 154 | + } |
| 155 | +
|
| 156 | + &__link { |
| 157 | + color: #3184E2; |
| 158 | + text-decoration: underline; |
| 159 | + } |
| 160 | +
|
| 161 | + &__time { |
| 162 | + color: var(--color-text-third); |
| 163 | + font-style: italic; |
| 164 | + font-size: 11px; |
| 165 | + position: absolute; |
| 166 | + right: 14px; |
| 167 | + bottom: 4px; |
| 168 | + } |
| 169 | +} |
| 170 | +</style> |
0 commit comments