diff --git a/Sudoku.html b/Sudoku.html index e838cc8..b05600e 100644 --- a/Sudoku.html +++ b/Sudoku.html @@ -6,26 +6,26 @@ :root { /*Warna Utama*/ --primary-color: dodgerblue; - + /*Warna Latar Belakang*/ --bg-color: whitesmoke; - + /*Warna Papan*/ --board-bg: white; - + /* Warna Garis */ --border-color: lightgray; --thick-border: darkslategray; - + /*Warna Teks*/ --text-color: black; - + /*Warna Sorot Angka Sama*/ - --same-highlight: lightblue; - + --same-highlight: lightblue; + /*Warna Kotak Terpilih*/ --selected-border: blue; - + /*Warna Error/Salah*/ --error-bg: pink; --error-text: red; @@ -57,93 +57,313 @@ animation: fadeIn 0.3s ease-in-out; } - .screen.active { display: flex; } + .screen.active { + display: flex; + } @keyframes fadeIn { - from { opacity: 0; transform: translateY(10px); } - to { opacity: 1; transform: translateY(0); } + from { + opacity: 0; + transform: translateY(10px); + } + + to { + opacity: 1; + transform: translateY(0); + } } /*MENU & LEVEL STYLES*/ - .logo-img { width: 120px; height: 120px; border-radius: 20px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } - .app-title { font-size: 32px; font-weight: bold; color: darkslategray; margin-bottom: 40px; } - - .btn-main { - background-color: var(--primary-color); - color: white; - font-size: 18px; - font-weight: bold; - padding: 15px 0; - width: 250px; - border: none; - border-radius: 30px; - cursor: pointer; - box-shadow: 0 4px 10px lightgray; - transition: 0.2s; - margin-bottom: 15px; - text-align: center; + .logo-img { + width: 120px; + height: 120px; + border-radius: 20px; + margin-bottom: 15px; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); + } + + .app-title { + font-size: 32px; + font-weight: bold; + color: darkslategray; + margin-bottom: 40px; + } + + .btn-main { + background-color: var(--primary-color); + color: white; + font-size: 18px; + font-weight: bold; + padding: 15px 0; + width: 250px; + border: none; + border-radius: 30px; + cursor: pointer; + box-shadow: 0 4px 10px lightgray; + transition: 0.2s; + margin-bottom: 15px; + text-align: center; + } + + .btn-main:hover { + transform: scale(1.05); + } + + .level-title { + font-size: 24px; + margin-bottom: 30px; + color: black; + } + + .btn-level { + width: 250px; + padding: 15px; + margin-bottom: 15px; + border: none; + border-radius: 15px; + font-size: 18px; + font-weight: bold; + color: white; + cursor: pointer; + transition: 0.2s; + box-shadow: 0 4px 6px lightgray; + } + + .btn-level:hover { + transform: translateY(-3px); } - .btn-main:hover { transform: scale(1.05); } - .level-title { font-size: 24px; margin-bottom: 30px; color: black; } - .btn-level { width: 250px; padding: 15px; margin-bottom: 15px; border: none; border-radius: 15px; font-size: 18px; font-weight: bold; color: white; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 6px lightgray; } - .btn-level:hover { transform: translateY(-3px); } - /*Warna Tombol Level menggunakan HURUF*/ - .lvl-easy { background-color: limegreen; } - .lvl-medium { background-color: dodgerblue; } - .lvl-hard { background-color: red; } - - .btn-cancel { margin-top: 20px; background: none; border: 2px solid gray; color: gray; padding: 10px 40px; border-radius: 20px; cursor: pointer; font-weight: bold; } + .lvl-easy { + background-color: limegreen; + } + + .lvl-medium { + background-color: dodgerblue; + } + + .lvl-hard { + background-color: red; + } + + .btn-cancel { + margin-top: 20px; + background: none; + border: 2px solid gray; + color: gray; + padding: 10px 40px; + border-radius: 20px; + cursor: pointer; + font-weight: bold; + } /*GAME STYLES*/ - .game-header { width: 100%; max-width: 380px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 10px; box-sizing: border-box; } - .btn-back-icon { background: none; border: none; font-size: 28px; cursor: pointer; color: dimgray; padding: 0; } - #difficulty-label { font-size: 18px; font-weight: bold; color: var(--primary-color); text-transform: uppercase; letter-spacing: 1px; } + .game-header { + width: 100%; + max-width: 380px; + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + padding: 0 10px; + box-sizing: border-box; + } + + .btn-back-icon { + background: none; + border: none; + font-size: 28px; + cursor: pointer; + color: dimgray; + padding: 0; + } + + #difficulty-label { + font-size: 18px; + font-weight: bold; + color: var(--primary-color); + text-transform: uppercase; + letter-spacing: 1px; + } + + #board-container { + box-shadow: 0 4px 15px lightgray; + border-radius: 8px; + overflow: hidden; + margin-bottom: 20px; + } + + #board { + width: 350px; + height: 350px; + background-color: var(--board-bg); + border: 2px solid var(--thick-border); + display: flex; + flex-wrap: wrap; + } + + .tile { + width: 38.4px; + height: 38.4px; + border: 1px solid var(--border-color); + font-size: 20px; + font-weight: 500; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + user-select: none; + box-sizing: border-box; + } - #board-container { box-shadow: 0 4px 15px lightgray; border-radius: 8px; overflow: hidden; margin-bottom: 20px; } - #board { width: 350px; height: 350px; background-color: var(--board-bg); border: 2px solid var(--thick-border); display: flex; flex-wrap: wrap; } - - .tile { width: 38.4px; height: 38.4px; border: 1px solid var(--border-color); font-size: 20px; font-weight: 500; display: flex; justify-content: center; align-items: center; cursor: pointer; user-select: none; box-sizing: border-box; } - /*Garis Tebal menggunakan warna darkslategray*/ - .tile-border-right { border-right: 2px solid var(--thick-border); } - .tile-border-bottom { border-bottom: 2px solid var(--thick-border); } - - .tile-start { color: black; background-color: whitesmoke; cursor: default; font-weight: bold; } - .tile-user { color: var(--primary-color); } - .tile-highlight-same { background-color: var(--same-highlight) !important; } - .tile-selected { border: 3px solid var(--selected-border) !important; z-index: 10; } - .tile-error { background-color: var(--error-bg) !important; color: var(--error-text) !important; } + .tile-border-right { + border-right: 2px solid var(--thick-border); + } + + .tile-border-bottom { + border-bottom: 2px solid var(--thick-border); + } + + .tile-start { + color: black; + background-color: whitesmoke; + cursor: default; + font-weight: bold; + } + + .tile-user { + color: var(--primary-color); + } + + .tile-highlight-same { + background-color: var(--same-highlight) !important; + } + + .tile-selected { + border: 3px solid var(--selected-border) !important; + z-index: 10; + } + + .tile-error { + background-color: var(--error-bg) !important; + color: var(--error-text) !important; + } /*Numpad & Tools*/ - #numpad-row { display: flex; flex-wrap: nowrap; justify-content: space-between; width: 100%; max-width: 350px; gap: 5px; } - .number { flex: 1; height: 55px; border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; background-color: white; color: var(--primary-color); box-shadow: 0 2px 5px lightgray; transition: transform 0.1s; } - .number:active { transform: scale(0.95); background-color: aliceblue; } - .main-num { font-size: 22px; font-weight: bold; } - .count-num { font-size: 10px; color: gray; margin-top: 2px; } - .hidden-key { opacity: 0; pointer-events: none; } + #numpad-row { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + width: 100%; + max-width: 350px; + gap: 5px; + } + + .number { + flex: 1; + height: 55px; + border-radius: 8px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + cursor: pointer; + background-color: white; + color: var(--primary-color); + box-shadow: 0 2px 5px lightgray; + transition: transform 0.1s; + } + + .number:active { + transform: scale(0.95); + background-color: aliceblue; + } + + .main-num { + font-size: 22px; + font-weight: bold; + } + + .count-num { + font-size: 10px; + color: gray; + margin-top: 2px; + } + + .hidden-key { + opacity: 0; + pointer-events: none; + } + + #tools-row { + margin-top: 15px; + width: 100%; + max-width: 350px; + display: flex; + justify-content: center; + gap: 15px; + } + + .tool-btn { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 20px; + border-radius: 30px; + font-weight: bold; + font-size: 14px; + cursor: pointer; + border: 1px solid lightgray; + background-color: white; + box-shadow: 0 2px 4px lightgray; + transition: 0.2s; + flex: 1; + } + + .tool-btn:active { + transform: scale(0.95); + } - #tools-row { margin-top: 15px; width: 100%; max-width: 350px; display: flex; justify-content: center; gap: 15px; } - .tool-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 30px; font-weight: bold; font-size: 14px; cursor: pointer; border: 1px solid lightgray; background-color: white; box-shadow: 0 2px 4px lightgray; transition: 0.2s; flex: 1; } - .tool-btn:active { transform: scale(0.95); } - /*Tombol Hapus*/ - .btn-delete { color: red; border-color: pink; } - - /*Tombol Bantuan*/ - .btn-hint { color: darkorange; border-color: orange; } + .btn-delete { + color: red; + border-color: pink; + } - #game-msg { height: 25px; color: green; font-weight: bold; margin-bottom: 10px; font-size: 16px; text-align: center;} + /*Tombol Bantuan*/ + .btn-hint { + color: darkorange; + border-color: orange; + } + + /* Style untuk tombol disabled (ketika bantuan habis) */ + .btn-disabled { + background-color: lightgray !important; + color: gray !important; + border-color: darkgray !important; + cursor: not-allowed; + box-shadow: none; + } + + #game-msg { + height: 25px; + color: green; + font-weight: bold; + margin-bottom: 10px; + font-size: 16px; + text-align: center; + } /*FITUR MENANG*/ #win-controls { - display: none; + display: none; margin-top: 15px; width: 100%; justify-content: center; } - + .btn-play-again { background-color: var(--primary-color); color: white; @@ -156,15 +376,25 @@ box-shadow: 0 4px 10px lightgray; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); } - .btn-play-again:hover { background-color: deepskyblue; } - @keyframes popIn { - from { transform: scale(0); opacity: 0; } - to { transform: scale(1); opacity: 1; } + .btn-play-again:hover { + background-color: deepskyblue; } + @keyframes popIn { + from { + transform: scale(0); + opacity: 0; + } + + to { + transform: scale(1); + opacity: 1; + } + } +