Compare commits
7 Commits
6706d60086
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
f87af4fa7e
|
|||
|
980715c72f
|
|||
|
81b243bd85
|
|||
|
4320b46e37
|
|||
|
b2738f6923
|
|||
|
7730d72315
|
|||
|
56ed3b5c13
|
@@ -30,6 +30,10 @@ body {
|
||||
background-color: #25292d;
|
||||
}
|
||||
|
||||
#statsTable th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#matrixCard {
|
||||
background-image: radial-gradient(#222, #25292d);
|
||||
}
|
||||
@@ -43,11 +47,6 @@ body {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#statsTable td,
|
||||
#statsModal td {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td#timeCell {
|
||||
min-width: 10ch;
|
||||
}
|
||||
@@ -274,20 +273,22 @@ tr.cleared-line-animation {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#statsModal th {
|
||||
#statsModal td {
|
||||
padding-left: 0;
|
||||
padding-right: 0.5rem;
|
||||
padding-bottom: 0.2rem;
|
||||
border-left: 0.5rem solid transparent;
|
||||
border-right: 0;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
#statsModal td {
|
||||
#statsModal th {
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0;
|
||||
padding-bottom: 0.2rem;
|
||||
border-left: 0;
|
||||
border-right: 0.5rem solid transparent;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#statsModal tr:last-child th,
|
||||
|
||||
@@ -70,6 +70,7 @@ body {
|
||||
|
||||
#matrixCard {
|
||||
background-image: none;
|
||||
transform-origin: bottom;
|
||||
}
|
||||
|
||||
#screenRow .card > * {
|
||||
@@ -326,6 +327,12 @@ td.trail-animation::after {
|
||||
animation: trail-animation ease-out 0.3s;
|
||||
}
|
||||
|
||||
@keyframes hard-dropped-table-animation {
|
||||
50% {
|
||||
transform: translateY(10px) rotateX(-3deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes locked-animation {
|
||||
from {
|
||||
--h: 0deg;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:root {
|
||||
--cell-size: 30px;
|
||||
--sprite-size: round(100% / 11, 1px);
|
||||
--skin-url: url(https://you.have.fail/ed/at/tetrioplus/data/content/skin/Haley%20Halcyon/tetrio_gameboy_plus.svg);
|
||||
--skin-url: url(tetrio-skin/a_forest.png);
|
||||
}
|
||||
|
||||
tr.matrix td:not(.mino) {
|
||||
|
||||
BIN
css/tetrio-skin/415652c2.jpg
Normal file
BIN
css/tetrio-skin/415652c2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
BIN
css/tetrio-skin/a_forest.png
Normal file
BIN
css/tetrio-skin/a_forest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
BIN
css/tetrio-skin/a_forest2.png
Normal file
BIN
css/tetrio-skin/a_forest2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
149
index.html
149
index.html
@@ -12,8 +12,9 @@
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />
|
||||
<link rel="stylesheet" href="css/_select2-dark.css">
|
||||
<link rel="stylesheet" href="css/_common.css">
|
||||
<link rel="stylesheet" href="css/jstris-skin.css" title="Thème sélectionné" id="selectedStyleSheet">
|
||||
<link rel="alternate stylesheet" href="css/jstris-skin.css" title="Sample...">
|
||||
<link rel="stylesheet" href="css/tetrio-skin.css" title="Thème sélectionné" id="selectedStyleSheet">
|
||||
<link rel="alternate stylesheet" href="css/tetrio-skin.css" title="Sample Tetr.io...">
|
||||
<link rel="alternate stylesheet" href="css/jstris-skin.css" title="Sample JStris...">
|
||||
<link rel="alternate stylesheet" href="css/classic.css" title="Classique">
|
||||
<link rel="alternate stylesheet" href="css/neo-classic.css" title="Néo-classique">
|
||||
<link rel="alternate stylesheet" href="css/electro.css" title="Électro">
|
||||
@@ -21,7 +22,7 @@
|
||||
<link rel="alternate stylesheet" href="css/heavy-metal.css" title="Heavy metal">
|
||||
<link rel="alternate stylesheet" href="css/jazz.css" title="Jazz">
|
||||
<link rel="alternate stylesheet" href="css/old-school.css" title="Old School">
|
||||
<link rel="alternate stylesheet" href="css/stereo.css" title="Stéréo (3D)">
|
||||
<link rel="alternate stylesheet" href="css/stereo.css" title="3D">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/js/select2.min.js"></script>
|
||||
@@ -79,8 +80,8 @@
|
||||
<label for="stylesheetSelect" class="col-2 col-form-label">Thème</label>
|
||||
<div class="col-4">
|
||||
<select name="stylesheet" id="stylesheetSelect" class="form-select">
|
||||
<option value="css/jstris-skin.css" selected>Sample JStris...</option>
|
||||
<option value="css/tetrio-skin.css">Sample Tetr.io...</option>
|
||||
<option value="css/tetrio-skin.css" selected>Sample Tetr.io...</option>
|
||||
<option value="css/jstris-skin.css">Sample JStris...</option>
|
||||
<option value="css/classic.css">Classique</option>
|
||||
<option value="css/neo-classic.css">Néo-classique</option>
|
||||
<option value="css/synthwave.css">Synthwave</option>
|
||||
@@ -88,17 +89,19 @@
|
||||
<option value="css/heavy-metal.css">Heavy metal</option>
|
||||
<option value="css/jazz.css">Jazz</option>
|
||||
<option value="css/old-school.css">Old School</option>
|
||||
<option value="css/stereo.css">Stéréo (3D)</option>
|
||||
<option value="css/stereo.css">3D</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<select name="skinURL" id="skinURLSelect" class="form-select"
|
||||
oninput="document.documentElement.style.setProperty('--skin-url', `url(${this.value})`)">
|
||||
oninput="document.documentElement.style.setProperty('--skin-url', `url(${this.value})`)">
|
||||
</select>
|
||||
</div>
|
||||
<label for="skinURLSelect" class="col-2 col-form-label">Sample</label>
|
||||
<label for="sfxVolumeRange" class="col-2 col-form-label">Volume</label>
|
||||
<div class="col-4 d-flex align-items-baseline"><input name="sfxVolumeRange" id="sfxVolumeRange" class="form-range" type="range" min="0" max="1" step="any" value="0.7"></div>
|
||||
<label for="sfxVolumeRange" class="col-2 col-form-label"><abbr title="Auteur des effets sonores : 25Pi25">Volume</abbr></label>
|
||||
<div class="col-4 d-flex align-items-baseline">
|
||||
<input name="sfxVolumeRange" id="sfxVolumeRange" class="form-range" type="range" min="0" max="1" step="any" value="0.7">
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="form-check form-switch text-start">
|
||||
<input id="fullscreenCheckbox" type="checkbox" role="switch" class="form-check-input" tabindex="0">
|
||||
@@ -140,11 +143,11 @@
|
||||
</div>
|
||||
<div class="card shadow">
|
||||
<table id="statsTable" class="table mb-0">
|
||||
<tr class="card-header fw-bold text-uppercase"><th>Score</th><td id="scoreCell">0</td> </tr>
|
||||
<tr><th>Meilleur<br/>score</th><td id="highScoreCell"><script>document.write(Number(localStorage["highScore"]) || 0)</script></td></tr>
|
||||
<tr><th>Niveau</th><td id="levelCell">0</td> </tr>
|
||||
<tr><th>But</th> <td id="goalCell">0</td> </tr>
|
||||
<tr><th>Temps</th> <td id="timeCell">00:00:00</td></tr>
|
||||
<tr class="card-header fw-bold text-uppercase"><td>Score</td><th id="scoreCell">0</th> </tr>
|
||||
<tr><td>Meilleur<br/>score</td><th id="highScoreCell"><script>document.write(Number(localStorage["highScore"]) || 0)</script></th></tr>
|
||||
<tr><td>Niveau</td><th id="levelCell">0</th> </tr>
|
||||
<tr><td>But</td> <th id="goalCell">0</th> </tr>
|
||||
<tr><td>Temps</td> <th id="timeCell">00:00:00</th></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,11 +226,16 @@
|
||||
</div>
|
||||
<div class="modal-body p-0">
|
||||
<table class="table mb-0">
|
||||
<tr><th>Score</th> <td id="statsModalScoreCell"></td> <th>Quatuors</th> <td id="statsModalNbQuatuors"></td> </tr>
|
||||
<tr><th>Meilleur score</th><td id="statsModalHighScoreCell"></td> <th>Pirouettes</th> <td id="statsModalNbTSpin"></td> </tr>
|
||||
<tr><th>Temps</th> <td id="statsModalTimeCell"></td> <th>Plus long combo</th> <td id="statsModalMaxCombo"></td> </tr>
|
||||
<tr><th>Niveau</th> <td id="statsModalLevelCell"></td> <th>Plus long bout à bout</th><td id="statsModalMaxB2B"></td> </tr>
|
||||
<tr><th>Lignes</th> <td id="statsModaltotalClearedLines"></td><th>Lignes par minute</th> <td id="statsModaltotalClearedLinesPM"></td></tr>
|
||||
<tr><td>Score</td> <th id="statsModalScoreCell"></th> </tr>
|
||||
<tr><td>Meilleur score</td> <th id="statsModalHighScoreCell"></th> </tr>
|
||||
<tr><td>Niveau</td> <th id="statsModalLevelCell"></th> </tr>
|
||||
<tr><td>Temps</td> <th id="statsModalTimeCell"></th> </tr>
|
||||
<tr><td>Lignes</td> <th id="statsModaltotalClearedLines"></th> </tr>
|
||||
<tr><td>Lignes par minute</td> <th id="statsModaltotalClearedLinesPM"><htd></tr>
|
||||
<tr><td>Quatuors</td> <th id="statsModalNbQuatuors"></th> </tr>
|
||||
<tr><td>Pirouettes</td> <th id="statsModalNbTSpin"></th> </tr>
|
||||
<tr><td>Plus long combo</td> <th id="statsModalMaxCombo"></th> </tr>
|
||||
<tr><td>Plus long bout à bout</td><th id="statsModalMaxB2B"></th> </tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -247,58 +255,57 @@
|
||||
<img src="favicons/T-0.png"/><img src="favicons/T-1.png"/><img src="favicons/T-2.png"/><img src="favicons/T-3.png"/>
|
||||
<img src="favicons/Z-0.png"/><img src="favicons/Z-1.png"/><img src="favicons/Z-2.png"/><img src="favicons/Z-3.png"/>
|
||||
|
||||
<audio id = "btb_1" src = "snd/btb_1.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "btb_2" src = "snd/btb_2.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "btb_3" src = "snd/btb_3.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "btb_break" src = "snd/btb_break.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "clearbtb" src = "snd/clearbtb.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "clearline" src = "snd/clearline.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "clearquad" src = "snd/clearquad.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "clearspin" src = "snd/clearspin.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "combo_1_power" src = "snd/combo_1_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_1" src = "snd/combo_1.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_10_power" src = "snd/combo_10_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_10" src = "snd/combo_10.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_11_power" src = "snd/combo_11_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_11" src = "snd/combo_11.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_12_power" src = "snd/combo_12_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_12" src = "snd/combo_12.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_13_power" src = "snd/combo_13_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_13" src = "snd/combo_13.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_14_power" src = "snd/combo_14_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_14" src = "snd/combo_14.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_15_power" src = "snd/combo_15_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_15" src = "snd/combo_15.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_16_power" src = "snd/combo_16_power.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "combo_16" src = "snd/combo_16.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "combo_2_power" src = "snd/combo_2_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_2" src = "snd/combo_2.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_3_power" src = "snd/combo_3_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_3" src = "snd/combo_3.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_4_power" src = "snd/combo_4_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_4" src = "snd/combo_4.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_5_power" src = "snd/combo_5_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_5" src = "snd/combo_5.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_6_power" src = "snd/combo_6_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_6" src = "snd/combo_6.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_7_power" src = "snd/combo_7_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_7" src = "snd/combo_7.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_8_power" src = "snd/combo_8_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_8" src = "snd/combo_8.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_9_power" src = "snd/combo_9_power.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combo_9" src = "snd/combo_9.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "combobreak" src = "snd/combobreak.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "floor" src = "snd/floor.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "harddrop" src = "snd/harddrop.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "hit" src = "snd/hit.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "hold" src = "snd/hold.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "hyperalert" src = "snd/hyperalert.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "menuconfirm" src = "snd/menuconfirm.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "menuhover" src = "snd/menuhover.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "move" src = "snd/move.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "rotate" src = "snd/rotate.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id = "shatter" src = "snd/shatter.mp3" preload = "auto" type = "audio/mp3"></audio>
|
||||
<audio id = "spin" src = "snd/spin.ogg" preload = "auto" type = "audio/ogg"></audio>
|
||||
<audio id="btb_1" src="snd/btb_1.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="btb_2" src="snd/btb_2.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="btb_3" src="snd/btb_3.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="btb_break" src="snd/btb_break.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="clearbtb" src="snd/clearbtb.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="clearline" src="snd/clearline.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="clearquad" src="snd/clearquad.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="clearspin" src="snd/clearspin.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="combo_1_power" src="snd/combo_1_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_1" src="snd/combo_1.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_10_power" src="snd/combo_10_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_10" src="snd/combo_10.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_11_power" src="snd/combo_11_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_11" src="snd/combo_11.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_12_power" src="snd/combo_12_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_12" src="snd/combo_12.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_13_power" src="snd/combo_13_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_13" src="snd/combo_13.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_14_power" src="snd/combo_14_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_14" src="snd/combo_14.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_15_power" src="snd/combo_15_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_15" src="snd/combo_15.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_16_power" src="snd/combo_16_power.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="combo_16" src="snd/combo_16.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="combo_2_power" src="snd/combo_2_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_2" src="snd/combo_2.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_3_power" src="snd/combo_3_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_3" src="snd/combo_3.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_4_power" src="snd/combo_4_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_4" src="snd/combo_4.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_5_power" src="snd/combo_5_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_5" src="snd/combo_5.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_6_power" src="snd/combo_6_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_6" src="snd/combo_6.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_7_power" src="snd/combo_7_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_7" src="snd/combo_7.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_8_power" src="snd/combo_8_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_8" src="snd/combo_8.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_9_power" src="snd/combo_9_power.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combo_9" src="snd/combo_9.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="combobreak" src="snd/combobreak.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="floor" src="snd/floor.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="gameover" src="snd/topout.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="harddrop" src="snd/harddrop.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="hit" src="snd/hit.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="hold" src="snd/hold.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="menuconfirm" src="snd/menuconfirm.mp3" preload="auto" type="audio/mp3"></audio>
|
||||
<audio id="menuhover" src="snd/menuhover.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="move" src="snd/move.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="rotate" src="snd/rotate.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
<audio id="spin" src="snd/spin.ogg" preload="auto" type="audio/ogg"></audio>
|
||||
</span>
|
||||
|
||||
<script src="js/game_logic.js" language="Javascript" type="text/javascript"></script>
|
||||
|
||||
95
js/app.js
95
js/app.js
@@ -254,6 +254,7 @@ function gameOver() {
|
||||
playing = false;
|
||||
|
||||
stats.show();
|
||||
playSound(gameover)
|
||||
}
|
||||
|
||||
window.onbeforeunload = function (event) {
|
||||
@@ -322,7 +323,6 @@ sceneDiv.onwheel = function (event) {
|
||||
screenRow.style.setProperty('--tZ', tZ + 'px');
|
||||
};
|
||||
|
||||
const ImageURLPattern = /^(https?:\/\/.*\.(?:png|jpg|jpeg|gif|bmp|webp|svg))$/i
|
||||
$.fn.select2.defaults.set("templateResult", (state) =>
|
||||
state.id
|
||||
? $(`<img class="preview" src="${state.id}" title="${state.text}" loading="lazy"/>`)
|
||||
@@ -330,12 +330,12 @@ $.fn.select2.defaults.set("templateResult", (state) =>
|
||||
)
|
||||
$.fn.select2.defaults.set("templateSelection", (state) =>
|
||||
state.id
|
||||
? $(`
|
||||
? $(`
|
||||
<table class="minoes-table preview" style="--skin-url: url(${state.id});">
|
||||
<tr><td class="Z mino"></td><td class="O mino"></td><td class="T mino"></td><td class="I mino"></td></tr>
|
||||
</table>
|
||||
`)
|
||||
: state.text
|
||||
: state.text
|
||||
)
|
||||
$.fn.select2.defaults.set("theme", "bootstrap-5")
|
||||
$.fn.select2.defaults.set("selectionCssClass", 'form-select')
|
||||
@@ -345,7 +345,7 @@ $.fn.select2.defaults.set("placeholder", "URL de l'image")
|
||||
$.fn.select2.defaults.set("tags", true)
|
||||
$.fn.select2.defaults.set("createTag", function (params) {
|
||||
const url = encodeURI(params.term);
|
||||
if (ImageURLPattern.test(url)) {
|
||||
if (/^(https?:\/\/.*\.(?:png|jpg|jpeg|gif|bmp|webp|svg))$/i.test(url)) {
|
||||
return {
|
||||
id: url,
|
||||
text: 'Source externe',
|
||||
@@ -356,13 +356,57 @@ $.fn.select2.defaults.set("createTag", function (params) {
|
||||
|
||||
stylesheetSelect.oninput = function (event) {
|
||||
selectedStyleSheet.href = this.value;
|
||||
|
||||
$("#skinURLSelect").empty();
|
||||
|
||||
var skinURL = skinURLSelect.value
|
||||
|
||||
switch (this.value) {
|
||||
case 'css/jstris-skin.css':
|
||||
skinURLSelect.disabled = false;
|
||||
case 'css/tetrio-skin.css':
|
||||
localStorage[skinURLSelect.name] = skinURLSelect.value
|
||||
skinURLSelect.name = "tetrioSkinURL"
|
||||
$("#skinURLSelect").empty();
|
||||
const baseURL = "https://you.have.fail/tetrioplus/data"
|
||||
fetch(`${baseURL}/data.json`)
|
||||
.then((resp) => resp.json())
|
||||
.then((json) => {
|
||||
json = json.filter((item) => (item.type == "skin" && item.format == "tetrioraster" && /\.(?:png|jpg|jpeg|gif|bmp|webp|svg)$/i.test(item.path)))
|
||||
const groups = Map.groupBy(json, (skin) => skin.author)
|
||||
var data = groups.entries().map(([author, skins]) => {
|
||||
return {
|
||||
text: author,
|
||||
children: skins.map((skin) => {
|
||||
return {
|
||||
id: `${baseURL}/${encodeURI(skin.path)}`,
|
||||
text: skin.description? `${skin.name}\n${skin.description}` : `${skin.name}`
|
||||
}
|
||||
})
|
||||
}
|
||||
}).toArray()
|
||||
data.push({
|
||||
text: "AdrienMalin",
|
||||
children: [{
|
||||
id: `${document.location.href}/css/tetrio-skin/a_forest.png`,
|
||||
text: "A forest"
|
||||
}]
|
||||
})
|
||||
data.sort((group1, group2) => group1.text > group2.text)
|
||||
|
||||
skinURLSelect.disabled = false;
|
||||
$('#skinURLSelect').select2({data: data})
|
||||
if (skinURL = localStorage['tetrioSkinURL']) {
|
||||
if ($('#skinURLSelect').find(`option[value='${skinURL}']`).length) {
|
||||
$('#skinURLSelect').val(skinURL).trigger('change');
|
||||
} else {
|
||||
var option = new Option('Sample sauvegardé', skinURL);
|
||||
$('#skinURLSelect').append(option).trigger('change');
|
||||
}
|
||||
skinURLSelect.oninput();
|
||||
}
|
||||
})
|
||||
break;
|
||||
|
||||
case 'css/jstris-skin.css':
|
||||
localStorage[skinURLSelect.name] = skinURLSelect.value
|
||||
skinURLSelect.name = "jstrisSkinURL"
|
||||
$("#skinURLSelect").empty();
|
||||
fetch('https://konsola5.github.io/jstris-customization-database/jstrisCustomizationDatabase.json')
|
||||
.then(response => response.json())
|
||||
.then(json => {
|
||||
@@ -372,35 +416,26 @@ stylesheetSelect.oninput = function (event) {
|
||||
text: group,
|
||||
children: json[group].map(skin => ({
|
||||
id: skin.link,
|
||||
text: `${skin.name} (${skin.author})`,
|
||||
text: `${skin.name} by ${skin.author}`,
|
||||
})),
|
||||
};
|
||||
data.push(groupData);
|
||||
}
|
||||
|
||||
$('#skinURLSelect').select2({data: data});
|
||||
skinURLSelect.disabled = false;
|
||||
$('#skinURLSelect').select2({data: data})
|
||||
if (skinURL = localStorage['jstrisSkinURL']) {
|
||||
if ($('#skinURLSelect').find(`option[value='${skinURL}']`).length) {
|
||||
$('#skinURLSelect').val(skinURL).trigger('change');
|
||||
} else {
|
||||
var option = new Option('Sample sauvegardé', skinURL);
|
||||
$('#skinURLSelect').append(option).trigger('change');
|
||||
}
|
||||
skinURLSelect.oninput();
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'css/tetrio-skin.css':
|
||||
skinURLSelect.disabled = false;
|
||||
|
||||
fetch("https://you.have.fail/tetrioplus/data/data.json")
|
||||
.then((resp) => resp.json())
|
||||
.then((json) => {
|
||||
const data = json
|
||||
.filter((item) => (item.type == "skin" && item.format == "tetrioraster"))
|
||||
.map((skin) => {
|
||||
return {
|
||||
id: encodeURI(`https://you.have.fail/tetrioplus/data/${skin.path}`),
|
||||
text:`${skin.name} (${skin.author})\n${skin.description}`
|
||||
}
|
||||
})
|
||||
.filter((option) => ImageURLPattern.test(option.id))
|
||||
$('#skinURLSelect').select2({data: data});
|
||||
})
|
||||
break;
|
||||
|
||||
default:
|
||||
skinURLSelect.disabled = true;
|
||||
break;
|
||||
|
||||
@@ -37,20 +37,6 @@ class Settings {
|
||||
if (element.name in localStorage) element.value = localStorage[element.name];
|
||||
});
|
||||
stylesheetSelect.oninput();
|
||||
if (localStorage['skinURL']) {
|
||||
if ($('#skinURLSelect').find("option[value='" + localStorage['skinURL'] + "']").length) {
|
||||
$('#skinURLSelect').val(localStorage['skinURL']).trigger('change');
|
||||
} else {
|
||||
var option = new Option(
|
||||
'Source externe',
|
||||
localStorage['skinURL'],
|
||||
true,
|
||||
true,
|
||||
);
|
||||
$('#skinURLSelect').append(option).trigger('change');
|
||||
}
|
||||
skinURLSelect.oninput();
|
||||
}
|
||||
}
|
||||
|
||||
save() {
|
||||
@@ -316,21 +302,25 @@ class Stats {
|
||||
}
|
||||
|
||||
// Sounds
|
||||
if (clearedLines == 4 || (tSpin && clearedLines)) {
|
||||
if (this.b2b >= 1) switch(this.b2b) {
|
||||
if (sfxVolumeRange.value) {
|
||||
if (clearedLines == 4 || (tSpin && clearedLines)) switch(this.b2b) {
|
||||
case -1:
|
||||
case 0: playSound(clearbtb); break
|
||||
case 1: playSound(btb_1); break
|
||||
case 2: playSound(btb_2); break
|
||||
default: playSound(btb_3)
|
||||
} else if (this.combo >= 1) switch(this.combo) {
|
||||
case 1: playSound(combo_1_power); break
|
||||
case 2: playSound(combo_2_power); break
|
||||
case 3: playSound(combo_3_power); break
|
||||
case 4: playSound(combo_4_power); break
|
||||
case 5: playSound(combo_5_power); break
|
||||
case 6: playSound(combo_6_power); break
|
||||
case 7: playSound(combo_7_power); break
|
||||
case 8: playSound(combo_8_power); break
|
||||
case 9: playSound(combo_9_power); break
|
||||
} else if (tSpin) switch(this.combo) {
|
||||
case -1: playSound(spin); break
|
||||
case 0: playSound(clearspin); break
|
||||
case 1: playSound(combo_1_power); break
|
||||
case 2: playSound(combo_2_power); break
|
||||
case 3: playSound(combo_3_power); break
|
||||
case 4: playSound(combo_4_power); break
|
||||
case 5: playSound(combo_5_power); break
|
||||
case 6: playSound(combo_6_power); break
|
||||
case 7: playSound(combo_7_power); break
|
||||
case 8: playSound(combo_8_power); break
|
||||
case 9: playSound(combo_9_power); break
|
||||
case 10: playSound(combo_10_power); break
|
||||
case 11: playSound(combo_11_power); break
|
||||
case 12: playSound(combo_12_power); break
|
||||
@@ -338,29 +328,27 @@ class Stats {
|
||||
case 14: playSound(combo_14_power); break
|
||||
case 15: playSound(combo_15_power); break
|
||||
default: playSound(combo_16_power)
|
||||
} else if (clearedLines == 4) playSound(clearbtb);
|
||||
else playSound(clearspin);
|
||||
} else if (this.combo >= 1) switch(this.combo) {
|
||||
case 1: playSound(combo_1); break
|
||||
case 2: playSound(combo_2); break
|
||||
case 3: playSound(combo_3); break
|
||||
case 4: playSound(combo_4); break
|
||||
case 5: playSound(combo_5); break
|
||||
case 6: playSound(combo_6); break
|
||||
case 7: playSound(combo_7); break
|
||||
case 8: playSound(combo_8); break
|
||||
case 9: playSound(combo_9); break
|
||||
case 10: playSound(combo_10); break
|
||||
case 11: playSound(combo_11); break
|
||||
case 12: playSound(combo_12); break
|
||||
case 13: playSound(combo_13); break
|
||||
case 14: playSound(combo_14); break
|
||||
case 15: playSound(combo_15); break
|
||||
default: playSound(combo_16)
|
||||
} else if (tSpin) {
|
||||
if (clearedLines) playSound(clearspin);
|
||||
else playSound(spin);
|
||||
} else if (clearedLines) playSound(clearline);
|
||||
} else switch(this.combo) {
|
||||
case -1: break;
|
||||
case 0: playSound(clearline); break
|
||||
case 1: playSound(combo_1); break
|
||||
case 2: playSound(combo_2); break
|
||||
case 3: playSound(combo_3); break
|
||||
case 4: playSound(combo_4); break
|
||||
case 5: playSound(combo_5); break
|
||||
case 6: playSound(combo_6); break
|
||||
case 7: playSound(combo_7); break
|
||||
case 8: playSound(combo_8); break
|
||||
case 9: playSound(combo_9); break
|
||||
case 10: playSound(combo_10); break
|
||||
case 11: playSound(combo_11); break
|
||||
case 12: playSound(combo_12); break
|
||||
case 13: playSound(combo_13); break
|
||||
case 14: playSound(combo_14); break
|
||||
case 15: playSound(combo_15); break
|
||||
default: playSound(combo_16)
|
||||
}
|
||||
}
|
||||
|
||||
this.goal -= awardedLineClears;
|
||||
if (this.goal <= 0) this.level++;
|
||||
@@ -397,6 +385,6 @@ Stats.prototype.timeFormat = new Intl.DateTimeFormat('fr-FR', {
|
||||
|
||||
function playSound(sound, note = 0) {
|
||||
sound.currentTime = 0;
|
||||
sound.playbackRate = Math.pow(5 / 4, note);
|
||||
sound.playbackRate = note? Math.pow(5 / 4, note): 1;
|
||||
sound.play();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user