Skip to content

Commit

Permalink
fix: Improve overall user interaction
Browse files Browse the repository at this point in the history
- image set draggable to false
- texts set selectable to false
  • Loading branch information
khantzawphyo committed May 15, 2024
1 parent 8bf1d3a commit 4fd6676
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ h1.title {
font-size: 48px;
}

.prevent-select {
-webkit-user-select: none;
/* Safari */
-ms-user-select: none;
/* IE 10 and IE 11 */
user-select: none;
/* Standard syntax */
}

.game-header {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -131,12 +140,12 @@ h1.title {
width: 150px;
height: 150px;
transition: all 0.5s ease;
background: rgba(255, 255, 255, 0.2);
background: rgba(255, 255, 255, 0.25);
border-radius: 16px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border: 1px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(2.5px);
-webkit-backdrop-filter: blur(2.5px);
border: 1.5px solid rgba(255, 255, 255, 0.79);
}

.btn-choice:hover {
Expand Down Expand Up @@ -286,4 +295,4 @@ footer {
padding: 8px 16px;
font-size: 14px;
}
}
}
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script src="https://kit.fontawesome.com/5786aab587.js" crossorigin="anonymous"></script>
</head>

<body>
<body class="prevent-select">
<!-- HEADER -->
<header>
<h1 class="title">Rock Paper Scissors</h1>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h1 class="game-info">Choose your weapon</h1>
<!-- MODAL -->
<div class="modal hidden">
<div class="modal-card">
<img class="modal-emoji" src="" alt="Emoji">
<img class="modal-emoji" src="" alt="Emoji" draggable="false">
<p class="modal-message"></p>
<button class="btn-restart">Play Again</button>
</div>
Expand Down

0 comments on commit 4fd6676

Please sign in to comment.