123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542 |
- <template>
- <transition appear name="custom-classes-transition" leave-active-class="animated fadeOut faster">
- <div v-if="show" class="scene-loading" :class="{ small: small, default: thumbStyle }" @touchmove.prevent >
- <div class="content">
- <div :style="`transform:translateZ(0) scale(${small});`">
- <div v-for="item in 3" :key="item" :class="`brick brick-${item} ${enter ? 'enter' : ''}`">
- <div class="brick-top face"></div>
- <div class="brick-bottom face"></div>
- <div class="brick-left face"></div>
- <div class="brick-right face"></div>
- <div class="brick-front face"></div>
- <div class="brick-back face"></div>
- </div>
- </div>
- <div :class="`logo`" v-show="metadata.num">
- <div>
- <div v-if="loadingLogoFile" class="logo-main" :style="{ 'background-image': `url(${loadingLogoFile})` }"></div>
- <div v-else>
- <i class="iconfont icon-hengbiaoCN"></i>
- </div>
- </div>
- </div>
- <div class="copy-right" v-if="!loadingLogoFile">
- <span>四维时代提供技术支持</span>
- </div>
- </div>
- </div>
- </transition>
- </template>
- <script setup>
- import { ref, watch, computed, onMounted, defineProps } from 'vue'
- import { useStore } from 'vuex'
- import { useApp } from '@/app'
- const props = defineProps({
- small: {
- type: Boolean,
- default: false,
- },
- thumb: {
- type: Boolean,
- default: false,
- },
- })
- const store = useStore()
- const progres = ref(0)
- const enter = ref(false)
- const thumb = ref(null)
- const thumbStyle = ref(null)
- const show = ref(true)
- const metadata = computed(() => store.getters['scene/metadata'])
- const loadingLogoFile = computed(() => store.getters['scene/loadingLogoFile'])
- onMounted(() => {
- enter.value = true
- })
- if (props.thumb) {
- useApp().then(app => {
- app.Scene.on('ready', () => {
- show.value = false
- })
- app.store.on('metadata', metadata => {
- if (metadata.entry) {
- thumb.value = app.resource.getUserResourceURL('thumb-2k.jpg')
- } else {
- thumb.value = require('@/assets/images/loading.jpg')
- thumbStyle.value = 'default'
- }
- })
- })
- }
- </script>
- <style lang="scss" scoped>
- @use "sass:math";
- // $brick-width: 15px;
- // $brick-height: 5px;
- .scene-loading {
- $brick-width: 30px;
- $brick-height: 10px;
- display: table;
- table-layout: fixed;
- height: 100%;
- width: 100%;
- z-index: 100;
- &.thumb {
- position: fixed;
- left: 0;
- top: 0;
- background-repeat: no-repeat;
- background-position: center center;
- background-size: cover;
- z-index: 5000;
- &.default {
- background-position: right center;
- }
- }
- * {
- opacity: 1 !important;
- }
- .content {
- width: 100%;
- height: 100%;
- display: table-cell;
- text-align: center;
- vertical-align: middle;
- .all {
- perspective: 100px;
- text-align: center;
- display: inline-block;
- }
- .brick {
- text-align: center;
- position: relative;
- width: $brick-width;
- height: $brick-height;
- transform-style: preserve-3d;
- transform-origin: math.div($brick-width, 2) math.div($brick-height, 2);
- margin: 0 auto math.div($brick-width, 12);
- }
- .brick-1 {
- animation: rorate 2s 1s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(30px);
- }
- .brick-2 {
- animation: rorate 2s 0.75s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(20px);
- }
- .brick-3 {
- animation: rorate 2s 0.5s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(10px);
- }
- .face {
- width: $brick-width;
- height: $brick-height;
- overflow: hidden;
- position: absolute;
- background: rgba(255, 255, 255, 0.4);
- opacity: 0;
- }
- .brick.enter {
- transition: 0.5s all;
- transform: rotateX(-30deg) rotateY(45deg);
- .face {
- transition: 0.5s all;
- opacity: 1;
- }
- }
- .brick-2 {
- .face {
- background: rgba(255, 255, 255, 0.3);
- }
- .brick-front,
- .brick-back {
- background: rgba(255, 255, 255, 0.4);
- }
- }
- .brick-3 {
- .face {
- background: rgba(255, 255, 255, 0.2);
- }
- .brick-front,
- .brick-back {
- background: rgba(255, 255, 255, 0.1);
- }
- }
- .brick-front {
- transform: translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.6);
- }
- .brick-top {
- width: $brick-width;
- height: $brick-width;
- transform: rotateX(90deg) translate3d(0, 0, math.div($brick-width, 2));
- background-color: rgba(255, 255, 255, 0.8);
- }
- .brick-bottom {
- width: $brick-width;
- height: $brick-width;
- transform: rotateX(-90deg) translate3d(0, 0, math.div(-$brick-height, 2));
- background-color: rgba(255, 255, 255, 0.8);
- }
- .brick-left {
- transform: rotateY(-90deg) translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.5);
- }
- .brick-right {
- transform: rotateY(90deg) translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.5);
- }
- .brick-back {
- transform: rotateY(180deg) translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.6);
- }
- }
- .logo {
- width: 100%;
- // height: 48px;
- color: #fff;
- font-size: 16px;
- text-align: center;
- // margin-top: 12px;
- opacity: 0;
- // visibility: hidden;
- &.enter {
- animation: logo-enter 0.5s forwards;
- visibility: initial;
- }
- .logo-main {
- // width: 100%;
- // height: 80px;
- width: 140px;
- height: 70px;
- position: absolute;
- left: 50%;
- top: 80%;
- transform: translateX(-50%) translateY(-50%);
- }
- div {
- margin: 0 auto;
- width: 100%;
- height: 100%;
- position: relative;
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center center;
- min-height: 70px;
- }
- i {
- position: absolute;
- left: 50%;
- top: 65%;
- transform: translateX(-50%) translateY(-50%);
- font-size: 148px;
- }
- }
- .copy-right {
- color: rgba(255, 255, 255, 0.6);
- opacity: 0.5;
- position: absolute;
- left: 50%;
- bottom: 30px;
- transform: translateX(-50%);
- line-height: 30px;
- height: 48px;
- white-space: nowrap;
- span {
- white-space: nowrap;
- }
- }
- }
- .small {
- $brick-width: 12px;
- $brick-height: 4px;
- display: table;
- table-layout: fixed;
- // pointer-events: none;
- // position: absolute;
- // left: 50%;
- // top: 50%;
- // transform: translate(-50%, -50%);
- height: 100%;
- width: 100%;
- // background-color: rgba(0, 0, 0, 0.45);
- z-index: 100;
- * {
- opacity: 1 !important;
- }
- .content {
- width: 100%;
- height: 100%;
- display: table-cell;
- text-align: center;
- vertical-align: middle;
- .all {
- perspective: 100px;
- text-align: center;
- display: inline-block;
- }
- .brick {
- text-align: center;
- position: relative;
- width: $brick-width;
- height: $brick-height;
- transform-style: preserve-3d;
- transform-origin: math.div($brick-width, 2) math.div($brick-height, 2);
- margin: 0 auto math.div($brick-width, 12);
- }
- .brick-1 {
- animation: rorate 2s 1s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(30px);
- }
- .brick-2 {
- animation: rorate 2s 0.75s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(20px);
- }
- .brick-3 {
- animation: rorate 2s 0.5s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(10px);
- }
- .face {
- width: $brick-width;
- height: $brick-height;
- overflow: hidden;
- position: absolute;
- background: rgba(255, 255, 255, 0.4);
- opacity: 0;
- }
- .brick.enter {
- transition: 0.5s all;
- transform: rotateX(-30deg) rotateY(45deg);
- .face {
- transition: 0.5s all;
- opacity: 1;
- }
- }
- .brick-2 {
- .face {
- background: rgba(255, 255, 255, 0.3);
- }
- .brick-front,
- .brick-back {
- background: rgba(255, 255, 255, 0.4);
- }
- }
- .brick-3 {
- .face {
- background: rgba(255, 255, 255, 0.2);
- }
- .brick-front,
- .brick-back {
- background: rgba(255, 255, 255, 0.1);
- }
- }
- .brick-front {
- transform: translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.6);
- }
- .brick-top {
- width: $brick-width;
- height: $brick-width;
- transform: rotateX(90deg) translate3d(0, 0, math.div($brick-width, 2));
- background-color: rgba(255, 255, 255, 0.8);
- }
- .brick-bottom {
- width: $brick-width;
- height: $brick-width;
- transform: rotateX(-90deg) translate3d(0, 0, math.div(-$brick-height, 2));
- background-color: rgba(255, 255, 255, 0.8);
- }
- .brick-left {
- transform: rotateY(-90deg) translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.5);
- }
- .brick-right {
- transform: rotateY(90deg) translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.5);
- }
- .brick-back {
- transform: rotateY(180deg) translate3d(0, 0, math.div($brick-width, 2));
- background: rgba(255, 255, 255, 0.6);
- }
- }
- .logo {
- width: 100%;
- // height: 48px;
- color: #fff;
- font-size: 16px;
- text-align: center;
- // margin-top: 12px;
- opacity: 0;
- // visibility: hidden;
- &.enter {
- animation: logo-enter 0.5s forwards;
- visibility: initial;
- }
- .logo-main {
- // width: 100%;
- // height: 80px;
- width: 70px;
- height: 35px;
- position: absolute;
- left: 50%;
- top: 80%;
- transform: translateX(-50%) translateY(-50%);
- }
- div {
- margin: 0 auto;
- width: 100%;
- height: 100%;
- position: relative;
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center center;
- min-height: 35px;
- }
- i {
- position: absolute;
- left: 50%;
- top: 65%;
- transform: translateX(-50%) translateY(-50%);
- font-size: 74px;
- }
- }
- .logo-bottom {
- width: 100%;
- height: 48px;
- color: #fff;
- font-size: 16px;
- position: absolute;
- bottom: 42px;
- left: 0;
- div {
- margin: 0 auto;
- width: 100%;
- height: 100%;
- position: relative;
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center center;
- }
- i {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translateX(-50%) translateY(-50%);
- font-size: 140px;
- }
- }
- }
- [show-mode='mobile'],
- [edit-mode='mobile'] {
- $brick-width: 24px;
- $brick-height: 8px;
- .content {
- .brick {
- width: $brick-width;
- height: $brick-height;
- transform-origin: math.div($brick-width, 2) math.div($brick-height, 2);
- margin: 0 auto math.div($brick-width, 12);
- &.enter {
- transition: 0.5s all;
- transform: rotateX(-30deg) rotateY(45deg);
- .face {
- transition: 0.5s all;
- opacity: 1;
- }
- }
- }
- .brick-1 {
- animation: rorate 2s 1s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(30px);
- }
- .brick-2 {
- animation: rorate 2s 0.75s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(20px);
- }
- .brick-3 {
- animation: rorate 2s 0.5s infinite linear;
- transform: rotateX(-30deg) rotateY(45deg) translateZ(10px);
- }
- .face {
- width: $brick-width;
- height: $brick-height;
- }
- .brick-front {
- transform: translate3d(0, 0, math.div($brick-width, 2));
- }
- .brick-top {
- width: $brick-width;
- height: $brick-width;
- transform: rotateX(90deg) translate3d(0, 0, math.div($brick-width, 2));
- }
- .brick-bottom {
- width: $brick-width;
- height: $brick-width;
- transform: rotateX(-90deg) translate3d(0, 0, math.div(-$brick-height, 2));
- }
- .brick-left {
- transform: rotateY(-90deg) translate3d(0, 0, math.div($brick-width, 2));
- }
- .brick-right {
- transform: rotateY(90deg) translate3d(0, 0, math.div($brick-width, 2));
- }
- .brick-back {
- transform: rotateY(180deg) translate3d(0, 0, math.div($brick-width, 2));
- }
- }
- .logo {
- margin-top: 5px;
- .logo-main {
- margin-top: 15px;
- }
- i {
- font-size: 100px;
- }
- }
- // .bottom-intro {
- // div {
- // height: 36px;
- // }
- // }
- .logo-bottom {
- bottom: 0.7rem;
- i {
- font-size: 75px;
- }
- div {
- height: 36px;
- }
- }
- }
- @keyframes logo-enter {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- @keyframes rorate {
- 0% {
- transform: rotateX(-30deg) rotateY(-45deg);
- }
- 50% {
- transform: rotateX(-30deg) rotateY(-315deg);
- }
- 100% {
- transform: rotateX(-30deg) rotateY(-315deg);
- }
- }
- </style>
|