Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LaunchedBerry07/c0f3c46cd88da9811ee8bea38c4f5e75 to your computer and use it in GitHub Desktop.
Save LaunchedBerry07/c0f3c46cd88da9811ee8bea38c4f5e75 to your computer and use it in GitHub Desktop.
5 Very Simple Hover Effects
div(class="grid")
div(class="title")
h1 5 Very Simple Hover Effects
mixin example(title, number, className)
.grid__section
h2= title
h3= number
button(class="btn", class=className) Button
+example('Dashed Border', '1', 'btn-1 btn--transparent')
+example('Rounded Border', '2', 'btn-2 btn--transparent')
+example('Show Border', '3', 'btn-3')
+example('Transparent + Shadow', '4', 'btn-4')
+example('Transform + Shadow', '5', 'btn-5')
@import url('https://fonts.googleapis.com/css?family=Poppins:900');
$primary: #f50057;
* {
font-family: 'Poppins', sans-serif;
font-weight: 900;
}
.grid {
padding: 0 50px;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 50px;
&__section {
padding: 50px 25px;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-between;
@media screen and (max-width: 800px) {
grid-column: 1 / span 3;
}
h2 {
margin: 0 0 25px;
font-size: 30px;
line-height: 1.25;
}
h3 {
position: absolute;
font-size: 350px;
top: -100px;
right: -50px;
margin: 0;
z-index: -1;
color: whitesmoke;
}
}
}
.title {
grid-column: 1 / span 3;
text-align: center;
padding: 50px 0;
background: whitesmoke;
h1 {
margin: 0;
font-size: 50px;
color: $primary;
}
}
.btn {
padding: 15px 30px;
font-size: 20px;
font-weight: 900;
color: #fff;
background-color: $primary;
border: 2px solid $primary;
cursor: pointer;
width: max-content;
transition: 0.25s ease;
&-1:hover {
border-style: dashed;
}
&-2:hover {
border-radius: 25px;
}
&-3:hover {
color: $primary;
background-color: transparent;
}
&-4:hover {
box-shadow: 0 6px 18px 0 rgba(#000, 0.1);
color: $primary;
border-color: transparent;
background-color: transparent;
}
&-5:hover {
box-shadow: 0 6px 18px 0 rgba(#000, 0.1);
transform: translateY(-6px);
}
&--transparent {
color: $primary;
background-color: transparent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment