Custom game: suwak rozmiaru 5-80

This commit is contained in:
2026-02-08 16:33:26 +01:00
parent 40a6725bf1
commit 3316532cbc
2 changed files with 59 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ const errorMsg = ref('');
const confirm = () => { const confirm = () => {
const size = parseInt(customSize.value); const size = parseInt(customSize.value);
if (isNaN(size) || size < 5 || size > 100) { if (isNaN(size) || size < 5 || size > 80) {
errorMsg.value = t('custom.sizeError'); errorMsg.value = t('custom.sizeError');
return; return;
} }
@@ -29,13 +29,18 @@ const confirm = () => {
<p>{{ t('custom.prompt') }}</p> <p>{{ t('custom.prompt') }}</p>
<div class="input-group"> <div class="input-group">
<div class="range-value">{{ customSize }}</div>
<input <input
type="number" type="range"
v-model="customSize" v-model="customSize"
min="5" min="5"
max="100" max="80"
@keyup.enter="confirm" step="1"
/> />
<div class="range-scale">
<span>5</span>
<span>80</span>
</div>
</div> </div>
<p v-if="errorMsg" class="error">{{ errorMsg }}</p> <p v-if="errorMsg" class="error">{{ errorMsg }}</p>
@@ -89,23 +94,61 @@ p {
.input-group { .input-group {
margin-bottom: 20px; margin-bottom: 20px;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
} }
input { .range-value {
min-width: 64px;
padding: 6px 12px;
border-radius: 999px;
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.3);
border: 1px solid var(--glass-border); border: 1px solid var(--glass-border);
color: #fff; color: #fff;
padding: 10px; font-size: 1.1rem;
font-size: 1.2rem;
border-radius: 8px;
width: 100px;
text-align: center; text-align: center;
} }
input:focus { input[type="range"] {
-webkit-appearance: none;
width: min(300px, 70vw);
height: 8px;
border-radius: 999px;
background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
outline: none; outline: none;
border-color: var(--accent-cyan); border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 0 10px rgba(0, 242, 255, 0.3); box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 22px;
height: 22px;
border-radius: 50%;
background: #fff;
border: 2px solid var(--accent-cyan);
box-shadow: 0 0 12px rgba(0, 242, 255, 0.5);
cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
width: 22px;
height: 22px;
border-radius: 50%;
background: #fff;
border: 2px solid var(--accent-cyan);
box-shadow: 0 0 12px rgba(0, 242, 255, 0.5);
cursor: pointer;
}
.range-scale {
width: min(300px, 70vw);
display: flex;
justify-content: space-between;
color: rgba(255, 255, 255, 0.7);
font-size: 0.85rem;
} }
.error { .error {

View File

@@ -32,10 +32,10 @@ const messages = {
'guide.waiting': 'Oczekiwanie...', 'guide.waiting': 'Oczekiwanie...',
'guide.solved': 'Rozwiązane!', 'guide.solved': 'Rozwiązane!',
'custom.title': 'GRA WŁASNA', 'custom.title': 'GRA WŁASNA',
'custom.prompt': 'Wprowadź rozmiar siatki (5 - 100):', 'custom.prompt': 'Wprowadź rozmiar siatki (5 - 80):',
'custom.cancel': 'Anuluj', 'custom.cancel': 'Anuluj',
'custom.start': 'Start', 'custom.start': 'Start',
'custom.sizeError': 'Rozmiar musi być między 5 a 100!', 'custom.sizeError': 'Rozmiar musi być między 5 a 80!',
'win.title': 'GRATULACJE!', 'win.title': 'GRATULACJE!',
'win.message': 'Rozwiązałeś zagadkę!', 'win.message': 'Rozwiązałeś zagadkę!',
'win.time': 'Czas:', 'win.time': 'Czas:',
@@ -65,10 +65,10 @@ const messages = {
'guide.waiting': 'Waiting...', 'guide.waiting': 'Waiting...',
'guide.solved': 'Solved!', 'guide.solved': 'Solved!',
'custom.title': 'CUSTOM GAME', 'custom.title': 'CUSTOM GAME',
'custom.prompt': 'Enter grid size (5 - 100):', 'custom.prompt': 'Enter grid size (5 - 80):',
'custom.cancel': 'Cancel', 'custom.cancel': 'Cancel',
'custom.start': 'Start', 'custom.start': 'Start',
'custom.sizeError': 'Size must be between 5 and 100!', 'custom.sizeError': 'Size must be between 5 and 80!',
'win.title': 'CONGRATULATIONS!', 'win.title': 'CONGRATULATIONS!',
'win.message': 'You solved the puzzle!', 'win.message': 'You solved the puzzle!',
'win.time': 'Time:', 'win.time': 'Time:',