123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490 |
- <!--
- 描述: 闪动云
- 作者: Jack Chen
- 日期: 2020-05-02
- -->
- <template>
- <div class="wrap-container sn-container">
- <div class="sn-content">
- <div class="sn-title">闪动云</div>
- <div class="sn-body">
- <div class="wrap-container cloud">
- <div class="pd-main-left">
- <div class="yun-container">
- <div class="yun-tree"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- <div class="line-fs"></div>
- </div>
- <div id="yunText" class="yun-text">
- <div
- :id="`yunText-${index + 1}`"
- :class="{ 'span-flash': number == index }"
- v-for="(item, index) in arrData"
- :key="index"
- >
- <span :title="item.title">{{ item.title }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: `flashCloud`,
- data() {
- return {
- number: 0,
- arrData: [
- {
- title: `JavaScript`,
- },
- {
- title: `Vue.js`,
- },
- {
- title: `React.js`,
- },
- {
- title: `Node.js`,
- },
- {
- title: `Angular`,
- },
- {
- title: `HTML5`,
- },
- {
- title: `CSS3`,
- },
- {
- title: `jQuery`,
- },
- {
- title: `Typescript`,
- },
- {
- title: `Bootstrap`,
- },
- {
- title: `WebApp`,
- },
- {
- title: `小程序`,
- },
- {
- title: `HTTP`,
- },
- {
- title: `Sass/Less`,
- },
- {
- title: `Webpack`,
- },
- {
- title: `ES6`,
- },
- ],
- }
- },
- mounted() {
- let len = 5
- this.timer = setInterval(() => {
- this.number = parseInt(Math.random() * 15, 10)
- if (len == 0) {
- len = 5
- return this.arrData.sort(() => Math.random() - 0.5)
- } else {
- len--
- }
- }, 2000)
- },
- methods: {},
- beforeDestroy() {
- clearInterval(this.timer)
- },
- }
- </script>
- <style lang="scss" scoped>
- .sn-container {
- left: 512px;
- top: 1978px;
- width: 432px;
- height: 400px;
- .cloud {
- left: 55px;
- top: 0;
- width: 80%;
- height: 100%;
- }
- .pd-main-left {
- position: relative;
- width: 310px;
- height: 335px;
- .yun-container {
- width: 100%;
- height: 100%;
- > div {
- &:nth-child(2) {
- height: 90%;
- -webkit-animation-duration: 2s;
- -moz-animation-duration: 2s;
- -o-animation-duration: 2s;
- animation-duration: 2s;
- -webkit-animation-delay: 1.5s;
- -moz-animation-delay: 1.5s;
- -o-animation-delay: 1.5s;
- animation-delay: 1.5s;
- bottom: 0;
- left: 51px;
- }
- &:nth-child(3) {
- height: 100%;
- -webkit-animation-duration: 3s;
- -moz-animation-duration: 3s;
- -o-animation-duration: 3s;
- animation-duration: 3s;
- -webkit-animation-delay: 0s;
- -moz-animation-delay: 0s;
- -o-animation-delay: 0s;
- animation-delay: 0s;
- bottom: 32px;
- left: 89px;
- }
- &:nth-child(4) {
- height: 100%;
- -webkit-animation-duration: 2.5s;
- -moz-animation-duration: 2.5s;
- -o-animation-duration: 2.5s;
- animation-duration: 2.5s;
- -webkit-animation-delay: 1s;
- -moz-animation-delay: 1s;
- -o-animation-delay: 1s;
- animation-delay: 1s;
- bottom: 3px;
- left: 179px;
- -webkit-filter: hue-rotate(180deg);
- filter: hue-rotate(180deg);
- }
- &:nth-child(5) {
- height: 90%;
- -webkit-animation-duration: 2s;
- -moz-animation-duration: 2s;
- -o-animation-duration: 2s;
- animation-duration: 2s;
- -webkit-animation-delay: 2s;
- -moz-animation-delay: 2s;
- -o-animation-delay: 2s;
- animation-delay: 2s;
- bottom: 42px;
- left: 229px;
- }
- &:nth-child(6) {
- height: 100%;
- -webkit-animation-duration: 2.5s;
- -moz-animation-duration: 2.5s;
- -o-animation-duration: 2.5s;
- animation-duration: 2.5s;
- -webkit-animation-delay: 0.5s;
- -moz-animation-delay: 0.5s;
- -o-animation-delay: 0.5s;
- animation-delay: 0.5s;
- bottom: 11px;
- right: 48px;
- }
- &:nth-child(7) {
- height: 90%;
- -webkit-animation-duration: 3s;
- -moz-animation-duration: 3s;
- -o-animation-duration: 3s;
- animation-duration: 3s;
- -webkit-animation-delay: 2.5s;
- -moz-animation-delay: 2.5s;
- -o-animation-delay: 2.5s;
- animation-delay: 2.5s;
- bottom: -22px;
- right: 174px;
- -webkit-filter: hue-rotate(180deg);
- filter: hue-rotate(180deg);
- }
- &:nth-child(8) {
- height: 90%;
- -webkit-animation-duration: 3s;
- -moz-animation-duration: 3s;
- -o-animation-duration: 3s;
- animation-duration: 3s;
- -webkit-animation-delay: 1.5s;
- -moz-animation-delay: 1.5s;
- -o-animation-delay: 1.5s;
- animation-delay: 1.5s;
- bottom: -22px;
- right: 100px;
- }
- &:nth-child(9) {
- height: 100%;
- -webkit-animation-duration: 2.5s;
- -moz-animation-duration: 2.5s;
- -o-animation-duration: 2.5s;
- animation-duration: 2.5s;
- -webkit-animation-delay: 2s;
- -moz-animation-delay: 2s;
- -o-animation-delay: 2s;
- animation-delay: 2s;
- bottom: -10px;
- right: 220px;
- }
- &:nth-child(10) {
- height: 95%;
- -webkit-animation-duration: 2s;
- -moz-animation-duration: 2s;
- -o-animation-duration: 2s;
- animation-duration: 2s;
- -webkit-animation-delay: 1s;
- -moz-animation-delay: 1s;
- -o-animation-delay: 1s;
- animation-delay: 1s;
- bottom: -41px;
- right: 182px;
- }
- }
- background: url(../../assets/img/pd-main-left-bg-2.png) no-repeat 50% 50%;
- .yun-tree {
- width: 100%;
- height: 100%;
- background: url(../../assets/img/pd-main-left-bg-tree.png) no-repeat 50%
- bottom;
- mix-blend-mode: screen;
- }
- .line-fs {
- width: 14px;
- height: 100%;
- background-image: url(../../assets/img/line-fs.png);
- background-repeat: no-repeat;
- background-position: 50% 150%;
- position: absolute;
- z-index: -1;
- -webkit-animation: fs 3s cubic-bezier(1, 0, 0.6, 0.6) infinite;
- -moz-animation: fs 3s cubic-bezier(1, 0, 0.6, 0.6) infinite;
- -o-animation: fs 3s cubic-bezier(1, 0, 0.6, 0.6) infinite;
- animation: fs 3s cubic-bezier(1, 0, 0.6, 0.6) infinite;
- }
- }
- .yun-text {
- position: absolute;
- width: 318px;
- height: 195px;
- top: 0;
- left: 50%;
- margin-left: -161px;
- z-index: 2;
- .span-flash {
- color: #00f6ff;
- font-size: 12px;
- -webkit-animation-name: yun-flash;
- -moz-animation-name: yun-flash;
- -o-animation-name: yun-flash;
- animation-name: yun-flash;
- -webkit-animation-duration: 1s;
- -moz-animation-duration: 1s;
- -o-animation-duration: 1s;
- animation-duration: 1s;
- -webkit-animation-iteration-count: 1;
- -moz-animation-iteration-count: 1;
- -o-animation-iteration-count: 1;
- animation-iteration-count: 1;
- }
- div {
- position: absolute;
- white-space: nowrap;
- overflow: hidden;
- -o-text-overflow: ellipsis;
- text-overflow: ellipsis;
- width: 70px;
- height: 36px;
- line-height: 36px;
- word-wrap: break-word;
- word-break: break-all;
- opacity: 0.8;
- color: #00f6ff;
- span {
- font-size: 12px;
- cursor: pointer;
- }
- &:nth-child(1) {
- top: 84px;
- left: 26px;
- }
- &:nth-child(2) {
- top: 13px;
- left: 157px;
- }
- &:nth-child(3) {
- top: 105px;
- left: 35px;
- }
- &:nth-child(4) {
- top: 38px;
- left: 89px;
- }
- &:nth-child(5) {
- top: 43px;
- left: 178px;
- }
- &:nth-child(6) {
- top: 76px;
- left: 227px;
- }
- &:nth-child(7) {
- top: 63px;
- left: 66px;
- }
- &:nth-child(8) {
- top: 156px;
- left: 43px;
- }
- &:nth-child(9) {
- top: 130px;
- left: 16px;
- }
- &:nth-child(10) {
- top: 93px;
- left: 128px;
- }
- &:nth-child(11) {
- top: 106px;
- left: 241px;
- }
- &:nth-child(12) {
- top: 121px;
- left: 112px;
- }
- &:nth-child(13) {
- top: 67px;
- left: 153px;
- }
- &:nth-child(14) {
- top: 157px;
- left: 207px;
- }
- &:nth-child(15) {
- top: 132px;
- left: 206px;
- }
- &:nth-child(16) {
- top: 150px;
- left: 117px;
- }
- }
- }
- }
- }
- @-webkit-keyframes fs {
- 0% {
- background-position: 50% 150%;
- }
- 50% {
- background-position: 50% -132%;
- }
- 100% {
- background-position: 50% -264%;
- opacity: 0;
- }
- }
- @-moz-keyframes fs {
- 0% {
- background-position: 50% 150%;
- }
- 50% {
- background-position: 50% -132%;
- }
- 100% {
- background-position: 50% -264%;
- opacity: 0;
- }
- }
- @-o-keyframes fs {
- 0% {
- background-position: 50% 150%;
- }
- 50% {
- background-position: 50% -132%;
- }
- 100% {
- background-position: 50% -264%;
- opacity: 0;
- }
- }
- @keyframes fs {
- 0% {
- background-position: 50% 150%;
- }
- 50% {
- background-position: 50% -132%;
- }
- 100% {
- background-position: 50% -264%;
- opacity: 0;
- }
- }
- @-webkit-keyframes yun-flash {
- from,
- 50%,
- to {
- opacity: 1;
- }
- 25%,
- 75% {
- opacity: 0;
- }
- }
- @-moz-keyframes yun-flash {
- from,
- 50%,
- to {
- opacity: 1;
- }
- 25%,
- 75% {
- opacity: 0;
- }
- }
- @-o-keyframes yun-flash {
- from,
- 50%,
- to {
- opacity: 1;
- }
- 25%,
- 75% {
- opacity: 0;
- }
- }
- @keyframes yun-flash {
- from,
- 50%,
- to {
- opacity: 1;
- }
- 25%,
- 75% {
- opacity: 0;
- }
- }
- </style>
|