Skip to content

Commit 081a387

Browse files
hoandevvCopilot
andcommitted
feat: Enhance viewport settings and improve styling for better responsiveness and usability
Co-authored-by: Copilot <copilot@github.com>
1 parent 9764c45 commit 081a387

1 file changed

Lines changed: 56 additions & 4 deletions

File tree

index.html

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="vi">
33
<head>
44
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes, viewport-fit=cover">
6+
<meta name="apple-mobile-web-app-capable" content="yes">
7+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
8+
<meta name="theme-color" content="#0d0f14">
69
<title>Convolution 2D Calculator</title>
710
<link rel="preconnect" href="https://fonts.googleapis.com">
811
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
@@ -81,6 +84,8 @@
8184
z-index: 1;
8285
max-width: 960px;
8386
margin: 0 auto;
87+
width: 100%;
88+
overflow-x: hidden;
8489
}
8590

8691
.theme-toggle {
@@ -99,6 +104,10 @@
99104
display: flex;
100105
align-items: center;
101106
gap: 6px;
107+
min-height: 44px;
108+
min-width: 44px;
109+
touch-action: manipulation;
110+
-webkit-touch-callout: none;
102111
}
103112

104113
.theme-toggle:hover {
@@ -282,6 +291,10 @@
282291
.matrix-grid {
283292
display: grid;
284293
gap: 5px;
294+
overflow-x: auto;
295+
overflow-y: hidden;
296+
-webkit-overflow-scrolling: touch;
297+
padding-bottom: 4px;
285298
}
286299

287300
.matrix-grid input[type=number] {
@@ -294,10 +307,13 @@
294307
border-radius: 6px;
295308
padding: 8px 4px;
296309
width: 100%;
297-
min-width: 0;
310+
min-width: 44px;
311+
min-height: 44px;
312+
height: 44px;
298313
outline: none;
299314
transition: border-color 0.2s, background 0.2s;
300315
-moz-appearance: textfield;
316+
flex-shrink: 0;
301317
}
302318

303319
.matrix-grid input[type=number]::-webkit-inner-spin-button,
@@ -307,6 +323,8 @@
307323
.matrix-grid input[type=number]:focus {
308324
border-color: var(--accent);
309325
background: var(--accent-dim2);
326+
outline: 2px solid var(--accent);
327+
outline-offset: -4px;
310328
}
311329

312330
.btn-calc {
@@ -328,6 +346,10 @@
328346
max-width: 360px;
329347
margin: 1.75rem auto 0;
330348
transition: opacity 0.2s, transform 0.15s, background 0.3s;
349+
min-height: 44px;
350+
touch-action: manipulation;
351+
-webkit-touch-callout: none;
352+
user-select: none;
331353
}
332354

333355
.btn-calc:hover { opacity: 0.9; }
@@ -359,7 +381,9 @@
359381
gap: 5px;
360382
width: 100%;
361383
overflow-x: auto;
384+
overflow-y: hidden;
362385
padding-bottom: 2px;
386+
-webkit-overflow-scrolling: touch;
363387
}
364388

365389
.out-cell {
@@ -373,11 +397,14 @@
373397
color: var(--accent);
374398
cursor: pointer;
375399
transition: all 0.2s;
376-
min-width: 0;
400+
min-width: 44px;
377401
min-height: 38px;
378402
display: flex;
379403
align-items: center;
380404
justify-content: center;
405+
flex-shrink: 0;
406+
-webkit-touch-callout: none;
407+
user-select: none;
381408
}
382409

383410
.out-cell:hover, .out-cell.active {
@@ -396,6 +423,8 @@
396423
padding: 1rem 1.2rem;
397424
transition: border-color 0.2s, background 0.2s;
398425
cursor: default;
426+
touch-action: manipulation;
427+
-webkit-tap-highlight-color: transparent;
399428
}
400429

401430
.step-card.active {
@@ -531,6 +560,9 @@
531560
gap: 3px;
532561
}
533562
.matrix-grid input[type=number] {
563+
min-width: 40px;
564+
min-height: 40px;
565+
height: 40px;
534566
padding: 6px 3px;
535567
font-size: 0.85rem;
536568
}
@@ -576,22 +608,30 @@
576608
font-size: 0.7rem;
577609
padding: 4px 8px;
578610
min-width: 50px;
611+
touch-action: manipulation;
579612
}
580613
.btn-ghost {
581614
font-size: 0.65rem;
582615
padding: 4px 8px;
616+
-webkit-touch-callout: none;
617+
touch-action: manipulation;
583618
}
584619
.btn-calc {
585620
padding: 0.8rem 1.5rem;
586621
font-size: 0.8rem;
587622
max-width: 100%;
588623
margin: 1rem auto 0;
624+
-webkit-touch-callout: none;
625+
touch-action: manipulation;
589626
}
590627
.matrix-grid {
591628
gap: 2px;
592629
}
593630
.matrix-grid input[type=number] {
594-
padding: 5px 2px;
631+
min-width: 36px;
632+
min-height: 36px;
633+
height: 36px;
634+
padding: 4px 2px;
595635
font-size: 0.8rem;
596636
}
597637
.result-grid {
@@ -611,6 +651,8 @@
611651
.detail-box {
612652
font-size: 0.65rem;
613653
padding: 6px 8px;
654+
overflow-x: auto;
655+
-webkit-overflow-scrolling: touch;
614656
}
615657
.step-result {
616658
font-size: 0.8rem;
@@ -649,6 +691,16 @@
649691
padding: 0.7rem 1rem;
650692
font-size: 0.75rem;
651693
}
694+
.matrix-grid {
695+
gap: 2px;
696+
}
697+
.matrix-grid input[type=number] {
698+
min-width: 32px;
699+
min-height: 32px;
700+
height: 32px;
701+
padding: 3px 1px;
702+
font-size: 0.75rem;
703+
}
652704
}
653705

654706
footer {

0 commit comments

Comments
 (0)