Box.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class="l-flex--col c-box">
  3. <div class="c-box__border--left" />
  4. <div class="c-box__border--right" />
  5. <div class="l-flex__fill l-flex--col c-box__main has-bg">
  6. <div
  7. v-if="title"
  8. class="l-flex__none c-box__header l-flex--row"
  9. >
  10. <div class="u-bold l-flex__fill">{{ title }}</div>
  11. <div class="header__decoration">
  12. <div class="decoration__bg" />
  13. <div class="decoration__bg--under" />
  14. </div>
  15. <div class="header__rects l-flex--row">
  16. <div class="header__rect l-flex__fill" />
  17. <div class="header__rect l-flex__fill" />
  18. <div class="header__rect l-flex__fill" />
  19. </div>
  20. </div>
  21. <div class="l-flex__fill l-flex--col has-content-padding">
  22. <slot />
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'Box',
  30. props: {
  31. title: {
  32. type: String,
  33. default: ''
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .c-box {
  40. position: relative;
  41. height: 100%;
  42. width: 100%;
  43. color: #fff;
  44. border: 1px solid rgba(#fff, 0.3);
  45. &__border {
  46. &--left {
  47. left: 0;
  48. position: absolute;
  49. height: 100%;
  50. width: 4px;
  51. background-image: linear-gradient(
  52. to bottom,
  53. #fff 0,
  54. #fff 16px,
  55. transparent 16px,
  56. transparent 24px,
  57. #2956f0 24px,
  58. #2956f0 40px,
  59. #2956f0 56px,
  60. transparent 56px,
  61. transparent 64px,
  62. #fff 64px,
  63. #fff 80px,
  64. transparent 80px,
  65. transparent calc(100% - 16px),
  66. #fff calc(100% - 16px),
  67. #fff 100%
  68. );
  69. }
  70. &--right {
  71. right: 0;
  72. position: absolute;
  73. height: 100%;
  74. width: 4px;
  75. background-image: linear-gradient(
  76. to bottom,
  77. #fff 0,
  78. #fff 16px,
  79. transparent 16px,
  80. transparent calc(100% - 16px),
  81. #fff calc(100% - 16px),
  82. #fff 100%
  83. );
  84. }
  85. }
  86. &__main {
  87. background-color: rgba(#1d274b, 0.85);
  88. overflow: hidden;
  89. }
  90. &__header {
  91. margin: 0 24px 20px;
  92. position: relative;
  93. height: 80px;
  94. line-height: 80px;
  95. font-size: 38px;
  96. border-bottom: 1px solid rgba(#fff, 0.1);
  97. }
  98. .header__decoration {
  99. position: relative;
  100. width: 160px;
  101. height: 8px;
  102. .decoration__bg {
  103. width: 100%;
  104. height: 100%;
  105. background: linear-gradient(
  106. 270deg,
  107. rgba(34, 51, 108, 0) 0%,
  108. #22336c 100%
  109. );
  110. }
  111. .decoration__bg--under {
  112. position: absolute;
  113. width: 100%;
  114. height: 100%;
  115. top: 0;
  116. background: repeating-linear-gradient(
  117. 120deg,
  118. rgba(#1d274b, 0.85),
  119. rgba(#1d274b, 0.85) 4px,
  120. transparent 4px,
  121. transparent 8px
  122. );
  123. }
  124. }
  125. .header__rect {
  126. width: 16px;
  127. height: 8px;
  128. &:nth-child(1) {
  129. background-color: #8ca6ff;
  130. }
  131. &:nth-child(2) {
  132. margin-left: 4px;
  133. }
  134. background-color: #5279ff;
  135. &:nth-child(3) {
  136. margin-left: 4px;
  137. background-color: #2556ff;
  138. }
  139. }
  140. }
  141. .has-content-padding {
  142. padding: 0 24px 24px;
  143. }
  144. </style>