| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <style>
- .bg-box {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- }
- .bg-box .close {
- position: fixed;
- top: 15px;
- right: 15px;
- z-index: 997;
- width: 36px;
- }
- .bg-box .bg {
- height: 100%;
- width: 100%;
- position: fixed;
- z-index: 996;
- top: 0;
- left: 0;
- }
- .bg-box .entry {
- position: absolute;
- z-index: 997;
- width: 120px;
- padding: 1rem 1rem;
- color: #222;
- background-color: #d6982e;
- margin: 0 auto;
- top: 40rem;
- right: 0;
- left: 0;
- border-radius: 20px;
- font-weight: bold;
- font-size: 16px;
- }
- .bubbly-button {
- font-family: 'Helvetica', 'Arial', sans-serif;
- display: inline-block;
- font-size: 1em;
- padding: 1em 2em;
- margin-top: 100px;
- margin-bottom: 60px;
- -webkit-appearance: none;
- appearance: none;
- background-color: #d6982e;
- color: #fff;
- border-radius: 4px;
- border: none;
- cursor: pointer;
- position: relative;
- transition: transform ease-in 0.1s, box-shadow ease-in 0.25s;
- box-shadow: 0 2px 25px rgb(255, 89, 0);
- }
- .bubbly-button:focus {
- outline: 0;
- }
- .bubbly-button:before, .bubbly-button:after {
- position: absolute;
- content: '';
- display: block;
- width: 140%;
- height: 100%;
- left: -20%;
- z-index: -1000;
- transition: all ease-in-out 0.5s;
- background-repeat: no-repeat;
- }
- .bubbly-button:before {
- display: none;
- top: -75%;
- background-image: radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, transparent 20%, #d6982e 20%, transparent 30%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, transparent 10%, #d6982e 15%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%);
- background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%, 10% 10%, 18% 18%;
- }
- .bubbly-button:after {
- display: none;
- bottom: -75%;
- background-image: radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, transparent 10%, #d6982e 15%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%), radial-gradient(circle, #d6982e 20%, transparent 20%);
- background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 10% 10%, 20% 20%;
- }
- .bubbly-button:active {
- transform: scale(0.9);
- background-color: #d6982e;
- box-shadow: 0 2px 25px rgb(255, 89, 0);
- }
- .bubbly-button.animate:before {
- display: block;
- animation: topBubbles ease-in-out 0.75s forwards;
- }
- .bubbly-button.animate:after {
- display: block;
- animation: bottomBubbles ease-in-out 0.75s forwards;
- }
- @keyframes topBubbles {
- 0% {
- background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%, 40% 90%, 55% 90%, 70% 90%;
- }
- 50% {
- background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%, 50% 50%, 65% 20%, 90% 30%;
- }
- 100% {
- background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%, 50% 40%, 65% 10%, 90% 20%;
- background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
- }
- }
- @keyframes bottomBubbles {
- 0% {
- background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%, 70% -10%, 70% 0%;
- }
- 50% {
- background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%, 105% 0%;
- }
- 100% {
- background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%, 110% 10%;
- background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
- }
- }
- </style>
- <div class="bg-box">
- <img id="close" class="close" onclick="switchVoice()" style="display: none;" src="__CDN__/assets/shop/img/index/voice-close.png" alt="">
- <img id="open" class="close" onclick="switchVoice()" src="__CDN__/assets/shop/img/index/voice.png" alt="">
- <img id="bg" class="bg" style="display: none;" src="__CDN__/assets/shop/img/index/run.jpg" alt="">
- <audio id="audio" src="__CDN__/assets/shop/mp3/bgmusic.mp3" autoplay controls style="display: none;"></audio>
- <button id="entry" class="entry bubbly-button" style="display: none;" onClick="entry()">进入</button>
- </div>
- <script src="__CDN__/assets/shop/js/jquery.min.js"></script>
- <script type="text/javascript">
- $(function () {
- var loadRun = sessionStorage.getItem('cha.loadRun')
- loadRun = typeof (loadRun) != 'undefined' && loadRun != null ? loadRun : false;
- console.log(loadRun)
- if (!loadRun) {
- $("#app").hide();
- $("#bg").show();
- $("#entry").show();
- // guiRun();
- }else{
- switchVoice();
- //$(".p5Canvas").hide();
- }
- // 按钮效果
- var classname = document.getElementsByClassName("bubbly-button");
- for (var i = 0; i < classname.length; i++) {
- classname[i].addEventListener('click', animateButton, false);
- }
- })
- /**
- * 按钮事件
- */
- function animateButton(e) {
- e.preventDefault;
- e.target.classList.remove('animate');
- e.target.classList.add('animate');
- setTimeout(function(){
- e.target.classList.remove('animate');
- },700);
- }
- /**
- * 控制声音
- */
- function switchVoice(){
- var audio = document.getElementById('audio');
- if (audio.paused) {
- $(audio).attr('controls', true);
- audio.play();
- $("#open").show();
- $("#close").hide();
- $(".p5Canvas").hide();
- } else {
- $(audio).removeAttr('controls');
- audio.pause();
- $("#open").hide();
- $("#close").show();
- $(".p5Canvas").show();
- }
- }
- /**
- * 进入
- */
- function entry() {
- var audio = document.getElementById('audio');
- if (audio.paused) {
- $("")
- $(audio).attr('controls', true);
- audio.play();
- } else {
- $(audio).removeAttr('controls');
- audio.pause();
- }
- //return false;
- sessionStorage.setItem('cha.loadRun', true)
- setTimeout(function(){
- $("#bg").hide(200);
- $("#app").show();
- $("#entry").hide();
- }, 800)
- }
- </script>
|