Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ACNH UI inspired hover effects for buttons and inputs #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ h2 {
}

input {
border: 0px solid white;
border: 4px solid white;
border-radius: 40px;
padding: 8px 16px;
font-size: 1.25rem;
Expand All @@ -189,10 +189,26 @@ input[type=number]:not(:placeholder-shown) {
color: #0AB5CD;
}

@keyframes hoverBackground {
from { background-position: 0px 0; }
to { background-position: 28px 0; }
}

input[type=number]:placeholder-shown:hover, .input__radio-buttons input[type="radio"]:not(:checked)+label:hover, .reset-button:hover {
background-size: 28px;
animation-name: hoverBackground;
animation-timing-function: linear;
animation-duration: 1s;
animation-play-state: running;
animation-iteration-count: infinite;
}

input[type=number]:placeholder-shown:hover {
cursor: pointer;
transform: scale(1.1);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05), 0 3px 6px rgba(0, 0, 0, 0.09);
border: 4px solid #d9d9d9;
background-image: repeating-linear-gradient(-45deg, #f3f3f3 0 9px, #d9d9d9 9px 20px);
}

input[type=number]:focus {
Expand Down Expand Up @@ -246,6 +262,7 @@ input[type=number] {
opacity: 1;
border: none;
border-radius: 40px;
border: 4px solid #F3F3F3;
background: #F3F3F3;
padding: 8px 16px;
font-size: 1.25rem;
Expand All @@ -257,13 +274,17 @@ input[type=number] {

.input__radio-buttons input[type="radio"]:not(:checked)+label:hover {
cursor: pointer;
background: #F5F8FF;
background-color: #078899;
background-image: repeating-linear-gradient(-45deg, #0ab5cd 0 9px, #078899 9px 20px);
border-color: #078899;
color: #fff;
transform: scale(1.1);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05), 0 3px 6px rgba(0, 0, 0, 0.09);
}

.input__radio-buttons input[type="radio"]:checked+label {
background: #0AB5CD;
border-color: #0AB5CD;
color: #FFF;
}

Expand All @@ -286,6 +307,8 @@ input[type=number] {
cursor: pointer;
opacity: 1;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05), 0 3px 6px rgba(0, 0, 0, 0.09);
color: #fff;
background-image: repeating-linear-gradient(-45deg, #cd0a0a 0 9px, #970707 9px 20px);
}


Expand Down