ThreadPostNotification.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <transition name='slide-fade'>
  3. <div class='thread_post_notification' @click='$emit("goToPost")'>
  4. <span class='thread_post_notification__close' @click.stop='$emit("close")'></span>
  5. <div class='thread_post_notification__header_bar'>
  6. <span class='thread_post_notification__username'>{{post.username}}</span>
  7. replied &nbsp;&middot;&nbsp; click to view
  8. </div>
  9. <div class='thread_post_notification__content'>{{post.content | stripTags | truncate(150)}}</div>
  10. </div>
  11. </transition>
  12. </template>
  13. <style lang='scss' scoped>
  14. @import '../assets/scss/variables.scss';
  15. .slide-fade-enter-active, .slide-fade-leave-active {
  16. transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
  17. }
  18. .slide-fade-enter, .slide-fade-leave-to {
  19. transform: translateX(25rem);
  20. opacity: 0;
  21. }
  22. .thread_post_notification {
  23. position: fixed;
  24. bottom: 2.5rem;
  25. cursor: default;
  26. overflow: hidden;
  27. right: 2.5rem;
  28. width: 20rem;
  29. height: 5rem;
  30. background-color: #fff;
  31. z-index: 3;
  32. transition: background-color 0.2s;
  33. border-radius: 0.25rem;
  34. box-shadow: 0 0 0.5rem 1px rgba(175, 175, 175, 0.3), 0 0.2rem 0.3rem 0px rgba(175, 175, 175, 0.15);
  35. &:hover {
  36. background-color: lighten($color__lightgray--primary, 2.75%);
  37. }
  38. @at-root #{&}__header_bar {
  39. width: 100%;
  40. font-size: 0.9rem;
  41. margin-top: 0.5rem;
  42. margin-left: 0.75rem;
  43. color: $color__text--secondary;
  44. }
  45. @at-root #{&}__username, #{&}__date {
  46. color: $color__text--primary;
  47. }
  48. @at-root #{&}__content {
  49. padding: 0.75rem;
  50. padding-top: 0.5rem;
  51. }
  52. @at-root #{&}__close {
  53. position: absolute;
  54. right: 0.5rem;
  55. top: 0.5rem;
  56. cursor: pointer;
  57. border-radius: 100%;
  58. background-color: $color__lightgray--primary;
  59. transition: background-color 0.2s;
  60. width: 1rem;
  61. height: 1rem;
  62. @include user-select(none);
  63. &:hover {
  64. background-color: $color__lightgray--darker;
  65. }
  66. &::after {
  67. content: '\d7';
  68. position: relative;
  69. left: 0.2rem;
  70. top: -0.15rem;
  71. }
  72. }
  73. }
  74. </style>
  75. <script>
  76. export default {
  77. name: 'ThreadPostNotification',
  78. props: ['post']
  79. }
  80. </script>