Commit 3b72d7a1 authored by KesaubeEire's avatar KesaubeEire

feat: 添加显示作弊面板

parent 8cd4c72a
<script>
import Card from './components/card.svelte';
import { SvelteToast, toast } from '@zerodevx/svelte-toast';
import { _category, _detailWindow, _env, _tagTrans, _detailPics, _config, _timer } from './stores';
import { _category, _cheatWindow, _cheatHint, _detailWindow, _env, _tagTrans, _detailPics, _config, _timer } from './stores';
import { fade } from 'svelte/transition';
import { debounceImmediate } from './utils';
import MedalWrap from './components/MedalWrap.svelte';
......@@ -395,6 +395,21 @@
<MedalItemDetail pics={$_detailPics} />
</MedalWrap>
<!-- FIXME: 在 closeCallBack 中必须把 trigger 指向的变量手动 false 掉, 不然 bug-->
<MedalWrap
id="cheat"
period={0}
trigger={$_cheatWindow}
contentTrigger={$_cheatHint}
closeCallBack={() => {
$_cheatWindow = false;
}}
>
<div class="carousel w-full h-60">
{$_cheatHint}
</div>
</MedalWrap>
<!-- NOTE: 游戏卡片主渲染区 -->
{#if List.length}
<div class="cardContainer justify-evenly gap-4 my-3" transition:fade={{ delay: 0, duration: 300 }}>
......
<svg xmlns="http://www.w3.org/2000/svg"
version="1.0"
viewBox="0 0 512 512"
preserveAspectRatio="xMidYMid meet">
<g id="outer"
transform="translate(0,512) scale(0.1,-0.1)"
fill="#000"
stroke="none">
<path
d="M2678 5103 c-9 -10 -18 -24 -20 -32 -2 -8 -18 -41 -35 -74 -18 -32 -33 -63 -33 -67 0 -5 -9 -29 -20 -54 -11 -26 -19 -47 -19 -49 0 -1 -18 -40 -40 -86 -23 -47 -41 -90 -41 -96 0 -35 -106 -75 -199 -75 -47 0 -50 2 -117 75 -38 41 -73 84 -78 95 -5 11 -14 20 -21 20 -6 0 -17 11 -23 24 -6 14 -27 42 -46 63 -20 21 -50 56 -66 77 -64 83 -117 103 -176 67 -17 -10 -41 -22 -55 -26 -13 -4 -51 -20 -84 -35 -33 -15 -80 -36 -103 -46 -24 -11 -76 -35 -115 -54 l-72 -35 3 -70 c2 -60 32 -279 60 -435 11 -66 4 -83 -63 -140 -77 -65 -77 -65 -104 -80 -23 -12 -86 -6 -106 10 -5 4 -33 12 -60 18 -28 6 -64 16 -80 23 -17 7 -36 13 -44 15 -8 1 -59 17 -114 34 -54 18 -108 33 -120 35 -12 1 -29 6 -38 9 -21 9 -109 -76 -109 -104 0 -5 -8 -18 -18 -28 -20 -20 -82 -110 -82 -119 0 -3 -15 -24 -33 -47 -19 -23 -37 -48 -40 -56 -4 -8 -16 -28 -26 -45 -23 -35 -26 -68 -8 -87 7 -7 27 -31 44 -54 18 -22 49 -58 70 -80 21 -22 67 -72 103 -113 36 -41 72 -81 81 -90 51 -50 52 -115 7 -241 -26 -73 -40 -97 -59 -106 -40 -19 -156 -54 -178 -54 -11 0 -22 -4 -25 -9 -4 -5 -30 -12 -59 -16 -28 -4 -56 -11 -62 -15 -5 -4 -30 -11 -55 -15 -25 -4 -54 -12 -65 -19 -11 -6 -36 -15 -55 -21 -56 -17 -61 -40 -66 -268 -4 -264 -2 -285 43 -304 19 -8 60 -19 91 -24 32 -6 62 -15 68 -20 6 -5 27 -11 47 -13 21 -3 52 -11 70 -19 17 -8 66 -22 107 -32 123 -29 137 -37 150 -87 6 -24 15 -51 21 -61 13 -24 30 -100 36 -162 l4 -50 -78 -90 c-97 -111 -143 -163 -209 -234 -28 -31 -57 -67 -64 -80 -13 -26 -6 -83 13 -103 7 -7 23 -33 36 -58 13 -25 37 -61 53 -81 15 -20 28 -42 28 -47 0 -6 10 -23 23 -39 13 -15 34 -46 46 -69 31 -55 69 -77 118 -68 21 4 47 13 58 20 11 7 41 16 68 19 26 4 47 11 47 15 0 4 19 10 43 14 23 4 65 15 92 26 128 48 192 59 213 38 7 -7 12 -10 12 -7 0 6 106 -89 172 -154 39 -38 47 -52 42 -72 -3 -13 -7 -41 -8 -62 -2 -21 -8 -56 -14 -78 -6 -22 -11 -49 -10 -60 0 -11 -7 -60 -16 -110 -20 -109 -29 -226 -19 -240 4 -5 24 -18 43 -28 19 -11 46 -25 60 -32 50 -26 145 -69 145 -65 0 2 27 -10 60 -27 33 -17 82 -38 108 -47 l48 -15 46 47 c47 48 151 169 234 271 67 82 115 122 142 116 12 -2 47 -7 77 -10 59 -5 148 -19 192 -30 19 -5 32 -19 47 -55 12 -27 25 -52 31 -55 5 -3 17 -33 26 -65 9 -33 21 -60 25 -60 5 0 9 -7 9 -15 0 -8 4 -23 10 -33 5 -9 21 -44 35 -77 15 -33 31 -69 37 -80 7 -11 18 -33 26 -49 l15 -29 136 6 c129 6 249 22 340 47 33 9 44 18 57 48 8 20 17 55 19 77 2 22 10 87 18 145 22 144 31 223 29 233 -5 16 22 82 42 104 10 12 35 28 55 34 20 7 47 19 61 29 14 9 50 25 81 37 51 18 59 18 85 5 16 -8 34 -21 42 -28 7 -8 19 -14 27 -14 7 0 36 -18 64 -40 28 -22 53 -40 55 -40 3 0 26 -15 51 -33 26 -17 54 -37 63 -42 10 -6 43 -27 75 -48 66 -43 91 -46 134 -14 53 39 314 282 341 318 9 12 8 26 -7 67 -28 77 -45 112 -53 112 -5 0 -8 5 -8 12 0 6 -11 34 -24 62 -72 153 -96 206 -96 212 0 4 -7 15 -15 24 -8 9 -16 29 -17 44 -2 22 -36 52 -213 184 -115 87 -215 161 -222 165 -7 5 -21 -1 -33 -13 -11 -11 -17 -20 -14 -20 27 0 -220 -249 -311 -315 -31 -22 -64 -47 -74 -55 -10 -8 -54 -33 -97 -55 -44 -22 -81 -42 -84 -46 -3 -3 -27 -13 -55 -23 -27 -11 -55 -22 -60 -27 -10 -7 -100 -32 -185 -49 -25 -6 -54 -14 -65 -19 -23 -11 -283 -34 -295 -26 -7 4 -128 15 -185 17 -11 0 -65 12 -120 25 -55 14 -107 26 -115 28 -8 1 -37 12 -63 24 -27 11 -53 21 -58 21 -11 0 -139 65 -221 112 -75 44 -194 136 -241 187 -21 22 -41 41 -45 41 -5 0 -21 18 -38 40 -16 22 -45 59 -66 81 -20 22 -42 53 -48 70 -7 16 -17 29 -22 29 -5 0 -23 29 -39 65 -16 36 -33 65 -37 65 -4 0 -16 24 -27 53 -10 28 -23 58 -29 66 -6 8 -17 35 -24 60 -25 88 -52 186 -52 194 0 4 321 7 713 7 l712 0 323 157 c177 87 322 160 322 163 0 3 -145 76 -322 163 l-323 157 -709 0 -708 0 5 38 c2 20 18 76 35 123 31 88 34 95 71 164 12 22 31 60 43 85 12 25 30 54 40 64 10 11 18 25 18 32 0 7 4 14 8 16 5 2 26 28 49 58 64 88 232 250 302 291 20 12 45 30 56 40 31 27 267 146 306 154 19 4 48 13 64 20 81 33 174 49 394 64 88 6 143 6 162 -1 16 -5 35 -8 43 -5 7 3 32 1 55 -4 23 -5 63 -11 88 -14 25 -3 51 -9 57 -14 6 -4 32 -11 57 -15 26 -4 55 -13 65 -21 11 -8 27 -15 37 -15 9 0 41 -12 70 -26 28 -14 60 -27 70 -29 30 -7 247 -147 301 -194 75 -67 222 -222 245 -260 7 -10 71 41 248 197 186 164 243 221 261 256 12 26 22 48 22 51 0 3 27 58 60 122 33 65 60 125 60 133 0 9 4 20 9 25 6 6 17 27 25 47 l16 36 -43 45 c-60 64 -347 307 -375 318 -13 5 -29 9 -36 9 -14 0 -208 -120 -230 -143 -7 -7 -32 -21 -55 -31 -22 -11 -41 -23 -41 -27 0 -5 -19 -18 -42 -30 -24 -12 -53 -30 -65 -42 -25 -22 -70 -26 -106 -10 -12 6 -37 16 -54 23 -71 27 -84 48 -105 171 -10 63 -25 170 -33 239 -16 151 -28 210 -46 221 -14 8 -121 30 -179 35 -19 2 -41 6 -50 10 -23 9 -135 24 -235 30 -79 5 -92 4 -107 -13z m303 -179 c31 -8 73 -14 93 -14 45 0 52 -14 61 -120 4 -47 14 -123 22 -170 8 -47 19 -114 24 -149 5 -35 13 -70 17 -77 21 -37 106 -112 144 -128 24 -10 50 -22 59 -26 9 -5 44 -14 78 -21 79 -17 150 -3 217 42 27 18 67 45 89 60 22 14 54 33 70 42 17 8 39 24 50 34 11 10 43 33 71 50 l51 31 119 -100 c65 -55 123 -104 128 -108 5 -6 -16 -61 -54 -137 -34 -70 -70 -143 -79 -161 -9 -19 -85 -95 -173 -173 l-158 -140 -63 63 c-86 85 -112 108 -177 153 -30 21 -73 51 -94 67 -21 15 -43 28 -48 28 -5 0 -31 16 -59 35 -28 19 -58 35 -66 35 -7 0 -31 9 -52 20 -82 41 -275 97 -411 119 -119 19 -287 24 -390 11 -52 -6 -132 -15 -178 -20 -46 -5 -88 -13 -95 -18 -7 -5 -33 -13 -59 -16 -26 -4 -50 -11 -53 -16 -3 -4 -28 -13 -55 -20 -97 -23 -397 -192 -482 -271 -198 -184 -308 -317 -393 -474 -70 -131 -73 -137 -95 -204 -10 -31 -28 -83 -40 -116 -32 -86 -33 -199 -3 -241 13 -17 35 -40 50 -50 27 -18 64 -19 753 -24 l725 -5 148 -75 c81 -41 147 -77 147 -80 0 -3 -66 -39 -147 -80 l-148 -75 -730 -5 c-703 -5 -731 -6 -756 -24 -86 -66 -89 -166 -13 -394 14 -42 29 -81 33 -87 4 -5 16 -32 26 -60 10 -27 23 -57 30 -65 7 -8 23 -35 35 -60 42 -83 186 -266 283 -358 58 -56 240 -202 251 -202 3 0 29 -14 58 -32 64 -38 154 -82 188 -93 14 -4 48 -18 75 -31 63 -29 285 -80 385 -88 41 -4 104 -9 140 -12 72 -6 381 19 402 32 7 5 36 14 63 21 111 25 143 35 210 63 60 25 140 64 244 119 14 8 53 35 86 60 33 25 75 56 93 68 18 13 77 68 131 123 l98 100 127 -96 c70 -52 129 -103 132 -112 3 -9 10 -24 15 -32 5 -8 16 -31 25 -50 8 -19 23 -53 33 -75 68 -143 81 -173 81 -179 0 -5 9 -20 19 -35 l20 -27 -62 -56 c-141 -126 -161 -143 -169 -140 -5 1 -63 39 -128 85 -117 80 -151 101 -235 149 -51 28 -163 31 -210 5 -16 -9 -36 -17 -44 -17 -8 0 -33 -11 -55 -24 -23 -13 -58 -29 -79 -36 -45 -14 -134 -100 -143 -138 -4 -15 -11 -32 -16 -38 -5 -7 -15 -70 -24 -140 -19 -167 -43 -317 -52 -326 -4 -4 -56 -14 -117 -22 -60 -9 -120 -19 -132 -22 -17 -5 -24 -1 -29 12 -4 11 -14 37 -24 59 -10 22 -26 58 -35 80 -10 22 -26 58 -36 81 -11 22 -19 47 -19 56 0 8 -8 26 -19 39 -10 13 -27 44 -38 69 -31 71 -74 106 -152 124 -161 38 -326 53 -389 37 -47 -13 -123 -83 -237 -220 -38 -46 -88 -105 -110 -130 l-40 -46 -45 22 c-25 13 -81 39 -125 59 -44 20 -81 38 -83 39 -4 3 30 200 48 280 16 74 22 210 11 250 -11 43 -71 109 -200 225 -136 122 -212 127 -491 36 -197 -64 -195 -65 -252 19 -26 39 -59 89 -72 113 l-25 44 47 56 c26 31 66 77 89 102 98 106 164 186 180 219 25 53 20 174 -12 281 -15 47 -32 106 -40 132 -33 117 -67 135 -467 244 l-98 27 0 142 c0 137 1 142 23 153 12 7 90 29 172 51 83 21 164 44 180 50 17 6 49 16 72 21 28 7 57 25 86 54 38 38 49 60 85 170 44 133 49 172 31 258 -14 64 -28 92 -69 138 -17 19 -59 66 -93 104 -34 39 -81 90 -104 114 -24 25 -43 50 -43 57 0 7 16 33 35 58 19 25 35 49 35 53 0 9 103 144 110 144 3 0 58 -18 123 -40 65 -22 135 -42 155 -46 20 -4 42 -10 47 -14 10 -7 80 -24 139 -33 82 -13 203 57 332 191 43 46 62 130 46 216 -6 33 -18 111 -27 171 -9 61 -20 129 -26 152 -13 61 -13 63 29 79 37 15 80 35 177 79 81 37 90 38 108 12 8 -13 28 -37 44 -53 15 -16 55 -63 88 -104 33 -41 92 -107 131 -146 66 -66 76 -72 131 -82 102 -18 280 13 342 59 39 29 75 75 86 109 4 14 25 62 47 108 22 46 48 104 57 130 9 26 27 66 40 90 l22 43 67 -6 c37 -4 92 -13 123 -21z"
/>
</g>
<g id="inner"
transform="translate(0,512) scale(0.1,-0.1)"
fill="#069"
stroke="none">
<path
d="M2769 4908 c-13 -24 -31 -64 -40 -90 -9 -26 -35 -84 -57 -130 -22 -46 -43 -94 -47 -108 -11 -34 -47 -80 -86 -109 -62 -46 -240 -77 -342 -59 -55 10 -65 16 -131 82 -39 39 -98 105 -131 146 -33 41 -73 88 -88 104 -16 16 -36 40 -44 53 -18 26 -27 25 -108 -12 -97 -44 -140 -64 -177 -79 -42 -16 -42 -18 -29 -79 6 -23 17 -91 26 -152 9 -60 21 -138 27 -171 16 -86 -3 -170 -46 -216 -129 -134 -250 -204 -332 -191 -59 9 -129 26 -139 33 -5 4 -27 10 -47 14 -20 4 -90 24 -155 46 -65 22 -120 40 -123 40 -7 0 -110 -135 -110 -144 0 -4 -16 -28 -35 -53 -19 -25 -35 -51 -35 -58 0 -7 19 -32 43 -57 23 -24 70 -75 104 -114 34 -38 76 -85 93 -104 41 -46 55 -74 69 -138 18 -86 13 -125 -31 -258 -36 -110 -47 -132 -85 -170 -29 -29 -58 -47 -86 -54 -23 -5 -55 -15 -72 -21 -16 -6 -97 -29 -180 -50 -82 -22 -160 -44 -172 -51 -22 -11 -23 -16 -23 -153 l0 -142 98 -27 c400 -109 434 -127 467 -244 8 -26 25 -85 40 -132 32 -107 37 -228 12 -281 -16 -33 -82 -113 -180 -219 -23 -25 -63 -71 -89 -102 l-47 -56 25 -44 c13 -24 46 -74 72 -113 57 -84 55 -83 252 -19 279 91 355 86 491 -36 129 -116 189 -182 200 -225 11 -40 5 -176 -11 -250 -18 -80 -52 -277 -48 -280 2 -1 39 -19 83 -39 44 -20 100 -46 125 -59 l45 -22 40 46 c22 25 72 84 110 130 114 137 190 207 237 220 63 16 228 1 389 -37 78 -18 121 -53 152 -124 11 -25 28 -56 38 -69 11 -13 19 -31 19 -39 0 -9 8 -34 19 -56 10 -23 26 -59 36 -81 9 -22 25 -58 35 -80 10 -22 20 -48 24 -59 5 -13 12 -17 29 -12 12 3 72 13 132 22 61 8 113 18 117 22 9 9 33 159 52 326 9 70 19 133 24 140 5 6 12 23 16 38 9 38 98 124 143 138 21 7 56 23 79 36 22 13 47 24 55 24 8 0 28 8 44 17 47 26 159 23 210 -5 84 -48 118 -69 235 -149 65 -46 123 -84 128 -85 8 -3 28 14 169 140 l62 56 -20 27 c-10 15 -19 30 -19 35 0 6 -13 36 -81 179 -10 22 -25 56 -33 75 -9 19 -20 42 -25 50 -5 8 -12 23 -15 32 -3 9 -62 60 -132 112 l-127 96 -98 -100 c-54 -55 -113 -110 -131 -123 -18 -12 -60 -43 -93 -68 -33 -25 -72 -52 -86 -60 -104 -55 -184 -94 -244 -119 -67 -28 -99 -38 -210 -63 -27 -7 -56 -16 -63 -21 -21 -13 -330 -38 -402 -32 -36 3 -99 8 -140 12 -100 8 -322 59 -385 88 -27 13 -61 27 -75 31 -34 11 -124 55 -188 93 -29 18 -55 32 -58 32 -11 0 -193 146 -251 202 -97 92 -241 275 -283 358 -12 25 -28 52 -35 60 -7 8 -20 38 -30 65 -10 28 -22 55 -26 60 -4 6 -19 45 -33 87 -76 228 -73 328 13 394 25 18 53 19 756 24 l730 5 148 75 c81 41 147 77 147 80 0 3 -66 39 -147 80 l-148 75 -725 5 c-689 5 -726 6 -753 24 -15 10 -37 33 -50 50 -30 42 -29 155 3 241 12 33 30 85 40 116 22 67 25 73 95 204 85 157 195 290 393 474 85 79 385 248 482 271 27 7 52 16 55 20 3 5 27 12 53 16 26 3 52 11 59 16 7 5 49 13 95 18 46 5 126 14 178 20 103 13 271 8 390 -11 136 -22 329 -78 411 -119 21 -11 45 -20 52 -20 8 0 38 -16 66 -35 28 -19 54 -35 59 -35 5 0 27 -13 48 -28 21 -16 64 -46 94 -67 65 -45 91 -68 177 -153 l63 -63 158 140 c88 78 164 154 173 173 9 18 45 91 79 161 38 76 59 131 54 137 -5 4 -63 53 -128 108 l-119 100 -51 -31 c-28 -17 -60 -40 -71 -50 -11 -10 -33 -26 -50 -34 -16 -9 -48 -28 -70 -42 -22 -15 -62 -42 -89 -60 -67 -45 -138 -59 -217 -42 -34 7 -69 16 -78 21 -9 4 -35 16 -59 26 -38 16 -123 91 -144 128 -4 7 -12 42 -17 77 -5 35 -16 102 -24 149 -8 47 -18 123 -22 170 -9 106 -16 120 -61 120 -20 0 -62 6 -93 14 -31 8 -86 17 -123 21 l-67 6 -22 -43z"
/>
</g>
</svg>
\ No newline at end of file
......@@ -5,6 +5,12 @@
import { fade } from 'svelte/transition';
/**Modal id*/
export let id = 'globalModal';
/**过渡渐变时间*/
export let period = 500;
/**开关面板 trigger*/
export let trigger;
/**关闭面板回调函数*/
......@@ -15,9 +21,9 @@
</script>
<!-- NOTE: 游戏详情预览模态框 -->
<dialog id="globalModal" class="modal focus:outline-none">
<dialog {id} class="modal focus:outline-none">
{#if trigger}
<div class="globalModal max-[1024px]:w-[98vw] max-[1024px]:max-w-[98vw]" transition:fade={{ delay: 0, duration: 500 }}>
<div class="_customModal max-[1024px]:w-[98vw] max-[1024px]:max-w-[98vw]" transition:fade={{ delay: 0, duration: period }}>
<!-- |-- NOTE: 按钮退出详情 -->
<form method="dialog">
<button
......
<script>
import { toast } from '@zerodevx/svelte-toast';
import { _env, _category, _detailPics, _detailWindow, _tagTrans, _config } from '../stores';
import { _env, _category, _detailPics, _detailWindow, _tagTrans, _config, _cheatHint, _cheatWindow } from '../stores';
import ICON_CE from '../assets/icon_CheatEngine.svg';
/**父属性: 所有信息*/
export let info;
......@@ -67,7 +68,7 @@
// 延迟切换到第一张
location.replace(`#${$_detailPics[0]}0`);
}, 500);
}, 300);
});
}
......@@ -88,6 +89,14 @@
toast.push(`${id} ${title.substring(0, 5)}${title.length > 5 ? '...' : ''} 报错:\t[${err.toString()}]`);
});
}
// ------------
function getHint() {
console.log(info.hint);
$_cheatWindow = true;
$_cheatHint = info.hint;
}
</script>
<div class="card w-80 bg-primary text-primary-content shadow-xl overflow-hidden">
......@@ -126,17 +135,37 @@
</figure>
<div class="card-body justify-between">
<h2 class="card-title block text-lg">
<!-- NOTE: 游戏类别(title) -->
{#if $_config.card_showCateGoryTitle}
<div
class="badge badge-secondary m-auto cursor-pointer hover:badge-neutral"
style="height: inherit;line-height: inherit;"
on:click={p_searchCategory(category)}
on:keypress={() => {}}
<div class="inline-flex items-center justify-center translate-y-[-1px] rounded-box overflow-hidden align-middle">
<!-- NOTE: 游戏类别(title) -->
{#if $_config.card_showCateGoryTitle}
<span
class="
h-6 mt-0 badge badge-secondary rounded-l-box rounded-r-none
m-auto px-[6px] cursor-pointer hover:bg-neutral hover:text-neutral-content hover:badge-outline text-sm
inline-flex items-center justify-center"
on:click={p_searchCategory(category)}
on:keypress={() => {}}
>
{language ?? '示例'}
</span>
{/if}
<button
class="
w-6 h-6 mt-0 badge badge-accent rounded-r-box rounded-l-none
m-auto p-0 cursor-pointer translate-y-[0px] hover:bg-secondary
inline-flex items-center justify-center tooltip tooltip-left"
data-tip="作弊"
on:click={() => {
getHint();
// TODO: 作弊
}}
onclick="cheat.showModal()"
>
{language ?? '示例'}
</div>
{/if}
<img class="w-4 h-4" src={ICON_CE} alt="icon_ce" />
</button>
</div>
<!-- NOTE: 游戏名称 -->
<a class="hover:link" href={folder} target="_blank">
{#if title}
......@@ -189,6 +218,6 @@
<style>
.card-body {
--padding-card: 1rem;
--padding-card: 0.8rem;
}
</style>
......@@ -69,4 +69,10 @@ export const _tagTrans = persistStore('_tagTrans', {});
export const _detailWindow = writable(false);
/** 刷新后消失: 详情图片显示窗口 */
export const _detailPics = writable([]);
\ No newline at end of file
export const _detailPics = writable([]);
/** trigger: 作弊显示窗口 */
export const _cheatWindow = writable(false);
/** 刷新后消失: 作弊显示窗口 */
export const _cheatHint = writable("");
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment