Skip to content

Instantly share code, notes, and snippets.

@csssecrets
csssecrets / dabblet.css
Last active December 13, 2021 02:21
Diamond images — via transforms
/**
* Diamond images — via transforms
*/
.diamond {
width: 250px;
height: 250px;
transform: rotate(45deg);
overflow: hidden;
margin: 100px;
@csssecrets
csssecrets / dabblet.css
Last active September 29, 2021 20:45
Scrolling hints
/**
* Scrolling hints
*/
ul {
display: inline-block;
overflow: auto;
width: 7.2em;
height: 7em;
border: 1px solid silver;
@csssecrets
csssecrets / dabblet.css
Last active September 28, 2021 21:23
Extending the hit area — with generated content
/**
* Extending the hit area — with generated content
*/
button {
position: relative;
padding: .3em .5em;
background: #58a;
border-radius: 50%;
border: 1px solid rgba(0,0,0,.3);
@csssecrets
csssecrets / dabblet.css
Last active July 31, 2023 01:14 — forked from LeaVerou/dabblet.css
Interactive image comparison - with CSS resize
/**
* Interactive image comparison - with CSS resize
*/
.image-slider {
position:relative;
display: inline-block;
}
.image-slider > div {
@csssecrets
csssecrets / dabblet.css
Created July 31, 2014 21:24
Hyphenation
/**
* Hyphenation
*/
width: 8.7em;
font: 180%/1.4 Baskerville, serif;
text-align: justify;
hyphens: auto;
@csssecrets
csssecrets / dabblet.css
Last active October 3, 2021 17:46
Frame-by-frame animations
/**
* Frame-by-frame animations
*/
@keyframes loader {
to { background-position: -800px 0; }
}
.loader {
width: 100px; height: 100px;
@csssecrets
csssecrets / dabblet.css
Created September 29, 2014 04:58
Blinking
/**
* Blinking
*/
@keyframes blink-1 { 50% { color: transparent } }
@keyframes blink-2 { to { color: transparent } }
p {
padding: 1em;
background: gold;
@csssecrets
csssecrets / dabblet.css
Created October 6, 2014 01:38
Typing animation
/**
* Typing animation
*/
@keyframes typing {
from { width: 0 }
}
@keyframes caret {
50% { border-right-color: transparent; }
@csssecrets
csssecrets / dabblet.css
Created October 6, 2014 09:35
Smooth state animations
/**
* Smooth state animations
* Photo credits: https://www.flickr.com/photos/employtheskinnyboy/3904743709
*/
@keyframes panoramic {
to { background-position: 100% 0; }
}
.panoramic {
@csssecrets
csssecrets / dabblet.css
Last active October 10, 2021 15:26
Animation along a circular path - Solution 1
/**
* Animation along a circular path - Solution 1
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.avatar {
animation: spin 3s infinite linear;