From 0d59b0a5a90d51f74e79207f0daf6a27dc1b3e9a Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Mon, 20 Feb 2023 20:34:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 20 +- public/libs/actions.js | 2 +- public/libs/control.js | 43 +--- public/libs/core.js | 3 - public/libs/events.js | 6 +- public/main.js | 128 ++++-------- public/project/functions.js | 3 - public/styles.css | 40 ++-- src/App2.vue | 16 +- src/plugin/mark.ts | 8 +- src/plugin/uiController.ts | 16 +- src/types/event.d.ts | 2 +- src/types/plugin.d.ts | 3 + src/ui/start.vue | 396 ++++++++++++++++++++++++++++++++++++ 14 files changed, 510 insertions(+), 176 deletions(-) create mode 100644 src/ui/start.vue diff --git a/index.html b/index.html index 99ee08a..3d05e7f 100644 --- a/index.html +++ b/index.html @@ -31,9 +31,12 @@ startImageLogo.onload = function () { startImageBackgroundDiv.style.display = 'block'; var onAnimationEnd = function () { - startImageBackgroundDiv.style.display = 'none'; - startImageLogo.classList.remove("startImageAnimation"); - startImageDiv.classList.remove("startImageDivAnimation"); + if (window.core && core.plugin && core.plugin.startAnimationEnded) { + core.plugin.startAnimationEnded.value = true; + startImageBackgroundDiv.style.display = 'none'; + startImageLogo.classList.remove("startImageAnimation"); + startImageDiv.classList.remove("startImageDivAnimation"); + } } startImageDiv.addEventListener("webkitAnimationEnd", onAnimationEnd); startImageDiv.addEventListener("animationend", onAnimationEnd); @@ -50,7 +53,6 @@

请稍候...

-
@@ -59,16 +61,6 @@

资源即将开始加载

HTML5魔塔游戏平台,享受更多魔塔游戏:
https://h5mota.com/

- - -
-
- 开始游戏 - 载入游戏 - 录像回放 -
-
-

diff --git a/public/libs/actions.js b/public/libs/actions.js index 9f034c4..4392f4e 100644 --- a/public/libs/actions.js +++ b/public/libs/actions.js @@ -1695,7 +1695,7 @@ actions.prototype._clickSL = function (x, y) { if (core.events.recoverEvents(core.status.event.interval)) return; core.ui.closePanel(); delete core.status.tempRoute; - if (!core.isPlaying()) core.showStartAnimate(true); + if (!core.isPlaying()) document.getElementById('start').style.top = '0'; return; } // 删除 diff --git a/public/libs/control.js b/public/libs/control.js index c33d405..31b5783 100644 --- a/public/libs/control.js +++ b/public/libs/control.js @@ -502,18 +502,11 @@ control.prototype.showStartAnimate = function (noAnimate, callback) { }; control.prototype._showStartAnimate_resetDom = function () { - core.dom.startPanel.style.opacity = 1; - core.dom.startPanel.style.display = 'block'; - core.dom.startTop.style.opacity = 1; - core.dom.startTop.style.display = 'block'; - core.dom.startButtonGroup.style.display = 'none'; - core.dom.startButtons.style.display = 'block'; - core.dom.levelChooseButtons.style.display = 'none'; + core.plugin.loaded.value = true; core.status.played = false; + core.dom.gameGroup.style.display = 'none'; core.clearStatus(); core.clearMap('all'); - core.dom.musicBtn.style.display = 'block'; - core.setMusicBtn(); // 重置音量 core.events.setVolume(1, 0); core.updateStatusBar(); @@ -521,9 +514,7 @@ control.prototype._showStartAnimate_resetDom = function () { control.prototype._showStartAnimate_finished = function (start, callback) { core.dom.startTop.style.display = 'none'; - core.dom.startButtonGroup.style.display = 'block'; main.selectedButton = null; - main.selectButton(0); if (start) core.startGame(); if (callback) callback(); }; @@ -2561,6 +2552,10 @@ control.prototype._doSL_load = function (id, callback) { core.saves.autosave.now, 1 )[0]; + if (!main.replayChecking) { + core.plugin.startOpened.value = false; + core.plugin.loaded.value = false; + } if (core.isPlaying() && !core.status.gameOver) { core.control.autosave(0); core.saves.autosave.now -= 1; @@ -2575,6 +2570,10 @@ control.prototype._doSL_load = function (id, callback) { id == 'autoSave' ? id : 'save' + id, null, function (data) { + if (!main.replayChecking) { + core.plugin.startOpened.value = false; + core.plugin.loaded.value = false; + } if (id == 'autoSave' && data != null) { core.saves.autosave.data = data; if (!(core.saves.autosave.data instanceof Array)) { @@ -3696,14 +3695,7 @@ control.prototype.resumeBgm = function (resumeTime) { this.setMusicBtn(); }; -control.prototype.setMusicBtn = function () { - if (core.musicStatus.bgmStatus) - core.dom.musicBtn.src = - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABWVBMVEX///9iYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmL///8AAAC5ubn+/v6xsbEtLS0MDAxmZmZoaGhvb2/c3Nzd3d38/Pz9/f0oKCgpKSl0dHR1dXW6urrb29v7+/v09PTv7+/39/cgICACAgImJibh4eGFhYWGhoaHh4eOjo5paWm7u7vDw8PMzMwyMjI7OztAQEDe3t5FRUVMTEzj4+Pl5eXm5ubp6enr6+tcXFzi4uL19fVeXl74+PgjIyNkZGQGBgaSkpKYmJiampqenp4DAwMwMDBnZ2cICAivr68eHh63t7cLCwsSEhLw8PBhYWEUFBQVFRXNzc3Pz8/Z2dna2toaGhqkpKSlpaWpqamrq6tFOUNAAAAAc3RSTlMAAwQFBhUWGxwkJSYyO0dISVBRUmpvj5CSk5SVoaOlpqiysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyA0IuUgAAAVdJREFUeF5NkVVbw0AQRTcQrLR4IIEGcidJoaUuQHF3d3d3+P/CkuxCzss8nG++mbnDBJXhNt2CpbeFK1kQpSEKidlc8S9qdATRa6UIdQMoxEpDA0Ov3wUAPfW+qLWACydNv9zMrzkJwPK6FB3oHyOfXfuNxvoBQ+GmBYinhHB77TmiVBxoYUw1AYcEq332AS8OYKosAuTT0nza9uU2USYPRJgGxEiSOFywJ3mNARozgBJJzkfLvfu8JgGDWcC9FEsjWzR+y80gYDEAA8QZ3N6kmP1Fs3fEASB7pob7Hh+Wz5L0ci17Or05J7bH6B6dZv05XWK3rG+myV05Ert592Qo55sPuoIr7hEZHHtieIPWy0RU9DLwc3Mnck/vi8/E8XNrDWQtEVnL/ySKMrv0jPwPp870fprcyYifmiEmqGpHkI5q9ofSFIUk2qiwIGpEMyxYhhZRRcMPz89RJ2s9W8wAAAAASUVORK5CYII='; - else - core.dom.musicBtn.src = - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABYlBMVEX///9iYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmL////8/PwAAABmZmZoaGihoaGioqKxsbG5ubnb29vc3Nzd3d3h4eHi4uL9/f3+/v4tLS1nZ2d0dHSUlJSenp66uroMDAz7+/spKSkoKCgUFBRpaWkVFRVvb291dXU7OzuVlZWYmJhkZGQgICAjIyOkpKQCAgK3t7cGBgbv7++pqamrq6seHh4mJiZhYWGamprp6enr6+saGhpeXl7j4+Pl5eXm5uZKSkrw8PD09PT19fW7u7vDw8PMzMwICAgwMDAyMjILCwtAQECGhoaHh4eBgYGFhYUSEhJXV1dZWVlcXFyOjo6SkpLNzc339/fPz8/Z2dna2tqTk5OlpaWxOPeTAAAAdnRSTlMAAwQFBhUWGxwkJSYyO0dISVBRUmpvj5CSk5SVoaOlpqiysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyNuo+uwAAAWJJREFUeF5NkmV34zAQReUm7WbTuJBNunY3bvXGDjNTkZkZlpn5/9eR5FPfbzr3jGb0RkwRiMQMDm7EIgHmRxtLwMOaHHoQjwz4MUKeCM8AWMrmd7u7f/aXAMyOShHiQD1n04DtN5e5FMBFlSauIsm585dKi4CpuSYKJIv1tBDVmvOSqJgEoowFLSBHaQh10XHWiCgHWEGmAw2blPrvOK/KRJUGoLM4kCVSKrWz7HwgoiwQZyaQJ0+9PvxV23BNATAZB25IqX9b3+jTW9fcApwB6NLgUD5NY3mPXnwmFwBezff1ztzRFzTp94FXMy36HDuCa2RafdnnmZqtL818Gl9/qNnEeyrUk2aTPiKj3qMyWBVi/YSuWq5qiwxkbtX3vYWzdz/l8M0k8ERlvViiB1Ygslb7SbVtJezncj+Cx5bYaeGuonZqhZlieAp+no74/s5EAh6JcY35Cepxk4ObcT3IJPe/1lKsDpFCFQAAAABJRU5ErkJggg=='; -}; +control.prototype.setMusicBtn = function () {}; ////// 更改背景音乐的播放 ////// control.prototype.triggerBgm = function () { @@ -4199,10 +4191,6 @@ control.prototype._resize_gameGroup = function (obj) { var startBackground = core.domStyle.isVertical ? main.styles.startVerticalBackground || main.styles.startBackground : main.styles.startBackground; - if (main.dom.startBackground.getAttribute('__src__') != startBackground) { - main.dom.startBackground.setAttribute('__src__', startBackground); - main.dom.startBackground.src = startBackground; - } var gameGroup = core.dom.gameGroup; var totalWidth, totalHeight; @@ -4238,15 +4226,6 @@ control.prototype._resize_gameGroup = function (obj) { floorMsgGroup.style.fontSize = 16 * core.domStyle.scale + 'px'; // startPanel core.dom.startPanel.style.fontSize = 16 * core.domStyle.scale + 'px'; - // musicBtn - if (core.domStyle.isVertical || core.domStyle.scale < 1) { - core.dom.musicBtn.style.right = core.dom.musicBtn.style.bottom = '3px'; - } else { - core.dom.musicBtn.style.right = - (obj.clientWidth - totalWidth) / 2 + 'px'; - core.dom.musicBtn.style.bottom = - (obj.clientHeight - totalHeight) / 2 - 27 + 'px'; - } }; control.prototype._resize_canvas = function (obj) { diff --git a/public/libs/core.js b/public/libs/core.js index 6713c0a..d025a18 100644 --- a/public/libs/core.js +++ b/public/libs/core.js @@ -312,8 +312,6 @@ core.prototype.init = function (coreData, callback) { core._afterLoadResources(callback); }); }); - core.dom.musicBtn.style.display = 'block'; - core.setMusicBtn(); }; core.prototype._init_flags = function () { @@ -331,7 +329,6 @@ core.prototype._init_flags = function () { core.dom.versionLabel.innerText = core.firstData.version; core.dom.logoLabel.innerText = core.firstData.title; document.title = core.firstData.title + ' - HTML5魔塔'; - document.getElementById('startLogo').innerText = core.firstData.title; (core.firstData.shops || []).forEach(function (t) { core.initStatus.shops[t.id] = t; }); diff --git a/public/libs/events.js b/public/libs/events.js index d18ec8a..b40f6a5 100644 --- a/public/libs/events.js +++ b/public/libs/events.js @@ -23,9 +23,10 @@ events.prototype.resetGame = function (hero, hard, floorId, maps, values) { ////// 游戏开始事件 ////// events.prototype.startGame = function (hard, seed, route, callback) { - main.dom.levelChooseButtons.style.display = 'none'; - main.dom.startButtonGroup.style.display = 'none'; hard = hard || ''; + core.dom.gameGroup.style.display = 'block'; + core.plugin.startOpened.value = false; + core.plugin.loaded.value = false; if (main.mode != 'play') return; @@ -310,6 +311,7 @@ events.prototype._gameOver_askRate = function (ending) { ////// 重新开始游戏;此函数将回到标题页面 ////// events.prototype.restart = function () { + core.hideStatusBar(); core.showStartAnimate(); core.playBgm(main.startBgm); }; diff --git a/public/main.js b/public/main.js index dc54216..2dc8a26 100644 --- a/public/main.js +++ b/public/main.js @@ -29,9 +29,6 @@ function main() { startTopProgressBar: document.getElementById('startTopProgressBar'), startTopProgress: document.getElementById('startTopProgress'), startTopLoadTips: document.getElementById('startTopLoadTips'), - startBackground: document.getElementById('startBackground'), - startLogo: document.getElementById('startLogo'), - startButtonGroup: document.getElementById('startButtonGroup'), floorMsgGroup: document.getElementById('floorMsgGroup'), logoLabel: document.getElementById('logoLabel'), versionLabel: document.getElementById('versionLabel'), @@ -239,22 +236,20 @@ main.prototype.init = function (mode, callback) { var mainData = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main; for (var ii in mainData) main[ii] = mainData[ii]; - main.dom.startLogo.style = main.styles.startLogoStyle; - main.dom.startButtonGroup.style = main.styles.startButtonsStyle; - main.levelChoose = main.levelChoose || []; - main.levelChoose.forEach(function (value) { - var span = document.createElement('span'); - span.setAttribute('class', 'startButton'); - span.innerText = value.title || ''; - span.id = value.name; - (function (span, str_) { - span.onclick = function () { - core.events.startGame(str_); - }; - })(span, value.name || ''); - main.dom.levelChooseButtons.appendChild(span); - }); - main.createOnChoiceAnimation(); + // main.levelChoose = main.levelChoose || []; + // main.levelChoose.forEach(function (value) { + // var span = document.createElement('span'); + // span.setAttribute('class', 'startButton'); + // span.innerText = value.title || ''; + // span.id = value.name; + // (function (span, str_) { + // span.onclick = function () { + // core.events.startGame(str_); + // }; + // })(span, value.name || ''); + // main.dom.levelChooseButtons.appendChild(span); + // }); + main.importFonts(main.fonts); main.loadJs('libs', main.loadList, function () { @@ -491,30 +486,6 @@ main.prototype.createOnChoiceAnimation = function () { } }; -////// 选项 ////// -main.prototype.selectButton = function (index) { - var select = function (children) { - index = (index + children.length) % children.length; - for (var i = 0; i < children.length; ++i) { - children[i].classList.remove('onChoiceAnimate'); - } - children[index].classList.add('onChoiceAnimate'); - if (main.selectedButton == index) { - children[index].click(); - } else { - main.selectedButton = index; - } - }; - - if (core.dom.startPanel.style.display != 'block') return; - - if (main.dom.startButtons.style.display == 'block') { - select(main.dom.startButtons.children); - } else if (main.dom.levelChooseButtons.style.display == 'block') { - select(main.dom.levelChooseButtons.children); - } -}; - ////// 创建字体 ////// main.prototype.importFonts = function (fonts) { if (!(fonts instanceof Array) || fonts.length == 0) return; @@ -610,21 +581,6 @@ main.prototype.listen = function () { } }; - [main.dom.startButtons, main.dom.levelChooseButtons].forEach(function ( - dom - ) { - dom.onmousemove = function (e) { - for (var i = 0; i < dom.children.length; ++i) { - if ( - dom.children[i] == e.target && - i != (main.selectedButton || 0) - ) { - main.selectButton(i); - } - } - }; - }); - ////// 开始选择时 ////// main.dom.body.onselectstart = function () { return false; @@ -932,38 +888,38 @@ main.prototype.listen = function () { }; ////// 点击“开始游戏”时 ////// - main.dom.playGame.onclick = function () { - main.dom.startButtons.style.display = 'none'; - main.core.control.checkBgm(); + // main.dom.playGame.onclick = function () { + // main.dom.startButtons.style.display = 'none'; + // main.core.control.checkBgm(); - if (main.levelChoose.length == 0) { - core.events.startGame(''); - } else { - main.dom.levelChooseButtons.style.display = 'block'; - main.selectedButton = null; - main.selectButton(0); - } - }; + // if (main.levelChoose.length == 0) { + // core.events.startGame(''); + // } else { + // main.dom.levelChooseButtons.style.display = 'block'; + // main.selectedButton = null; + // main.selectButton(0); + // } + // }; - ////// 点击“载入游戏”时 ////// - main.dom.loadGame.onclick = function () { - main.core.control.checkBgm(); - main.core.load(); - }; + // ////// 点击“载入游戏”时 ////// + // main.dom.loadGame.onclick = function () { + // main.core.control.checkBgm(); + // main.core.load(); + // }; - ////// 点击“录像回放”时 ////// - main.dom.replayGame.onclick = function () { - main.core.control.checkBgm(); - main.core.chooseReplayFile(); - }; + // ////// 点击“录像回放”时 ////// + // main.dom.replayGame.onclick = function () { + // main.core.control.checkBgm(); + // main.core.chooseReplayFile(); + // }; - main.dom.musicBtn.onclick = function () { - try { - if (main.core) main.core.triggerBgm(); - } catch (ee) { - console.error(ee); - } - }; + // main.dom.musicBtn.onclick = function () { + // try { + // if (main.core) main.core.triggerBgm(); + // } catch (ee) { + // console.error(ee); + // } + // }; window.onblur = function () { if (main.core && main.core.control) { diff --git a/public/project/functions.js b/public/project/functions.js index de37930..82e87bb 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -49,9 +49,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { if (core.hasFlag('hideStatusBar')) core.hideStatusBar(core.hasFlag('showToolbox')); else core.showStatusBar(); - // 隐藏右下角的音乐按钮 - core.dom.musicBtn.style.display = 'none'; - core.dom.enlargeBtn.style.display = 'none'; if (main.mode === 'play' && !main.replayChecking) { core.splitArea(); core.resetFlagSettings(); diff --git a/public/styles.css b/public/styles.css index 5ea4e24..6963d0c 100644 --- a/public/styles.css +++ b/public/styles.css @@ -35,9 +35,9 @@ body { } #musicBtn { - position: fixed; + position: absolute; bottom: 3px; - right: 3px; + right: -20%; cursor: pointer; z-index: 400; display: none; @@ -107,6 +107,7 @@ body { transform: translate(-50%, -50%); z-index: 260; object-fit: cover; + filter: sepia(30%) contrast(70%); } #startLogo { @@ -152,24 +153,17 @@ body { display: none; z-index: 310; bottom: 0; - margin-bottom: 5%; - left: 50%; + margin-bottom: 7%; + left: 30%; transform: translateX(-50%); padding: 15px 25px; - /* default value */ - background-image: linear-gradient( - to bottom, - rgba(76, 73, 255, 0.7), - rgba(106, 40, 145, 0.7) - ); - border: #ffffff 1px solid; - caret-color: #ffd700; - border-radius: 10px; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4), 0px 0px 1px rgba(255, 255, 255, 0.3); } #playGame { + position: relative; + left: 10%; color: transparent; background-image: linear-gradient( to bottom, @@ -181,6 +175,8 @@ body { } #loadGame { + position: relative; + left: 5%; color: transparent; background-image: linear-gradient( to bottom, @@ -192,6 +188,8 @@ body { } #replayGame { + position: relative; + color: transparent; background-image: linear-gradient( to bottom, @@ -210,14 +208,6 @@ body { display: none; } -#easy { - background-image: linear-gradient( - to bottom, - rgb(255, 255, 255), - rgb(87, 255, 72) - ); -} - span#hard { background-image: linear-gradient( to bottom, @@ -247,10 +237,6 @@ span#hard { transform: scale(1); } -.startButton:hover { - transform: scale(1.2); -} - .onChoiceAnimate { animation: onChoice 2s ease-in-out 0s infinite normal none running; } @@ -604,8 +590,8 @@ p#name { } .startImageDivAnimation { - -webkit-animation: startImageDivDisappear 2s ease-in-out 5s alternate 1; - animation: startImageDivDisappear 2s ease-in-out 5s alternate 1; + -webkit-animation: startImageDivDisappear 2s ease-in-out 3s alternate 1; + animation: startImageDivDisappear 2s ease-in-out 3s alternate 1; } @-webkit-keyframes startImageDivDisappear { diff --git a/src/App2.vue b/src/App2.vue index 0c97afd..388c503 100644 --- a/src/App2.vue +++ b/src/App2.vue @@ -1,5 +1,6 @@