@yoannchb/cattract
Version:
Animate anything just like it was attracted by the cursor
119 lines (103 loc) • 1.96 kB
CSS
* {
box-sizing: border-box;
font-family: Arial, sans-serif;
padding: 0;
margin: 0;
}
body {
background-color: #121212;
color: #eee;
}
button {
border: none;
background-color: #0093e9;
cursor: pointer;
border-radius: 99rem;
}
.main-section {
min-height: 100vh;
display: flex;
}
.presentation {
position: sticky;
top: 0;
flex: 50% 1 1;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
padding: 5rem;
gap: 1rem;
}
.title {
color: #0093e9;
font-size: 5rem;
}
.github-btn-link {
padding: 1rem 0rem;
background-color: #0093e9;
background-image: linear-gradient(160deg, #0093e9 0%, #80d0c7 100%);
text-decoration: none;
color: #eee;
border-radius: 99rem;
width: 12.5rem;
text-align: center;
}
.examples {
flex: 50% 1 1;
display: flex;
flex-wrap: wrap;
padding: 1rem;
align-items: center;
}
.example-block {
position: relative;
flex-grow: 1;
width: clamp(15rem, 15rem, 100%);
height: 20rem;
background-color: transparent;
border: thin dashed #0093e9;
display: flex;
justify-content: center;
align-items: center;
}
.example-block button {
color: #eee;
padding: 0.5rem 0.8rem;
cursor: initial;
}
details > summary {
list-style: none;
text-align: end;
cursor: pointer;
margin-bottom: 0.5rem;
}
details > summary::-webkit-details-marker {
display: none;
}
details {
position: absolute;
top: 1rem;
right: 1rem;
height: 100%;
overflow-y: auto;
z-index: 999;
}
.overlay-code {
background-color: #121212;
max-height: 100%;
overflow-y: auto;
}
@media (max-width: 1024px) {
.main-section {
flex-direction: column;
height: auto;
}
.presentation {
position: initial;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
}