| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <div
- class="l-flex--col c-box"
- :class="{ fullscreen }"
- >
- <div class="c-box__border--left" />
- <div class="c-box__border--right" />
- <div class="l-flex__fill l-flex--col c-box__main has-bg">
- <div
- v-if="title"
- class="l-flex__none c-box__header l-flex--row"
- >
- <div class="u-bold l-flex__fill">{{ title }}</div>
- <div class="header__decoration">
- <div class="decoration__bg" />
- <div class="decoration__bg--under" />
- </div>
- <i
- v-if="canFullScreen"
- class="c-box__button has-bg u-pointer"
- @click.stop="onToggle"
- />
- <div
- v-else
- class="header__rects l-flex--row"
- >
- <div class="header__rect l-flex__fill" />
- <div class="header__rect l-flex__fill" />
- <div class="header__rect l-flex__fill" />
- </div>
- </div>
- <div class="l-flex__fill l-flex--col has-content-padding">
- <slot />
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: 'Box',
- props: {
- title: {
- type: String,
- default: ''
- },
- fullscreen: {
- type: [Boolean, String],
- default: false
- },
- canFullScreen: {
- type: [Boolean, String],
- default: false
- }
- },
- methods: {
- onToggle () {
- this.$emit('fullscreenChange', !this.fullscreen)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .c-box {
- position: relative;
- height: 100%;
- width: 100%;
- color: #fff;
- border: 1px solid rgba(#fff, 0.3);
- &__border {
- &--left {
- left: 0;
- position: absolute;
- height: 100%;
- width: 2px;
- background-image: linear-gradient(
- to bottom,
- #fff 0,
- #fff 8px,
- transparent 8px,
- transparent 12px,
- #2956f0 16px,
- #2956f0 24px,
- #2956f0 32px,
- transparent 36px,
- transparent 42px,
- #fff 42px,
- #fff 50px,
- transparent 50px,
- transparent calc(100% - 8px),
- #fff calc(100% - 8px),
- #fff 100%
- );
- }
- &--right {
- right: 0;
- position: absolute;
- height: 100%;
- width: 2px;
- background-image: linear-gradient(
- to bottom,
- #fff 0,
- #fff 8px,
- transparent 8px,
- transparent calc(100% - 8px),
- #fff calc(100% - 8px),
- #fff 100%
- );
- }
- }
- &.fullscreen {
- position: absolute;
- width: 1592px;
- height: 964px;
- top: 50%;
- left: 50%;
- border-bottom: none;
- transform: translate(-50%, -50%);
- overflow: visible;
- z-index: 999;
- &::before {
- content: "";
- position: absolute;
- top: -58px;
- left: -164px;
- width: 1920px;
- height: 1080px;
- background-color: rgba(#000, 0.85);
- z-index: -1;
- }
- .c-box__border--left {
- background-image: linear-gradient(
- to bottom,
- #fff 0,
- #fff 8px,
- transparent 8px,
- transparent 12px,
- #2956f0 16px,
- #2956f0 30px,
- #2956f0 44px,
- transparent 48px,
- transparent 54px,
- #fff 54px,
- #fff 62px,
- transparent 62px,
- transparent calc(100% - 8px),
- #fff calc(100% - 8px),
- #fff 100%
- );
- }
- .header__decoration {
- margin-right: 20px;
- }
- .c-box {
- &__main {
- background-color: rgba(#1d274b, 0.85);
- overflow: hidden;
- font-size: 28px;
- }
- &__header {
- padding: 0 16px;
- position: relative;
- height: 52px;
- line-height: 70px;
- font-size: 28px;
- }
- &__button {
- top: 6px;
- right: 10px;
- width: 20px;
- height: 20px;
- background-image: url("~@/assets/icon_narrow.png");
- }
- }
- }
- &__main {
- background-color: rgba(#1d274b, 0.85);
- overflow: hidden;
- }
- &__header {
- margin: 0 16px 10px;
- position: relative;
- height: 40px;
- line-height: 40px;
- font-size: 18px;
- border-bottom: 1px solid rgba(#fff, 0.1);
- }
- .header__decoration {
- position: relative;
- width: 160px;
- height: 8px;
- .decoration__bg {
- width: 100%;
- height: 100%;
- background: linear-gradient(
- 270deg,
- rgba(34, 51, 108, 0) 0%,
- #22336c 100%
- );
- }
- .decoration__bg--under {
- position: absolute;
- width: 100%;
- height: 100%;
- top: 0;
- background: repeating-linear-gradient(
- 120deg,
- rgba(#1d274b, 0.85),
- rgba(#1d274b, 0.85) 4px,
- transparent 4px,
- transparent 8px
- );
- }
- }
- .header__rect {
- width: 16px;
- height: 8px;
- &:nth-child(1) {
- background-color: #8ca6ff;
- }
- &:nth-child(2) {
- margin-left: 4px;
- }
- background-color: #5279ff;
- &:nth-child(3) {
- margin-left: 4px;
- background-color: #2556ff;
- }
- }
- &__button {
- width: 12px;
- height: 12px;
- background-image: url("~@/assets/icon_enlarge.png");
- }
- }
- .has-content-padding {
- padding: 0 16px 16px;
- }
- </style>
|