Skip to content

Commit 633595e

Browse files
Hover Grayscale Effect - CSS (#79)
* Hover Grayscale Effect - CSS * Hover Grayscale Effect - CSS
1 parent 21c1695 commit 633595e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

public/data/css.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,35 @@
243243
],
244244
"tags": ["css", "hover", "glow", "effects"],
245245
"author": "dostonnabotov"
246+
},
247+
{
248+
"title": "Hover to Reveal Color",
249+
"description": "A card with an image that transitions from grayscale to full color on hover.",
250+
"code": [
251+
".card {",
252+
" height: 300px;",
253+
" width: 200px;",
254+
" border-radius: 5px;",
255+
" overflow: hidden;",
256+
"}",
257+
"",
258+
".card img{",
259+
" height: 100%;",
260+
" width: 100%;",
261+
" object-fit: cover;",
262+
" filter: grayscale(100%);",
263+
" transition: all 0.3s;",
264+
" transition-duration: 200ms;",
265+
" cursor: pointer;",
266+
"}",
267+
"",
268+
".card:hover img {",
269+
" filter: grayscale(0%);",
270+
" scale: 1.05;",
271+
"} "
272+
],
273+
"tags": ["css", "hover", "image", "effects"],
274+
"author": "Haider-Mukhtar"
246275
}
247276
]
248277
}

0 commit comments

Comments
 (0)