Convert Figma logo to code with AI

ciar4n logoimagehover.css

Pure CSS Image Hover Effect Library

1,801
234
1,801
7

Top Related Projects

8,433

CSS3 Animations with special effects

29,203

A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.

JavaScript, SCSS, Sass, Less, and Stylus helpers for rendering high-resolution image variants

This repo is archived. Thanks!

Some inspiration and modern ideas for subtle hover effects.

1,689

Vivify is free CSS animation library.

Quick Overview

Imagehover.css is a pure CSS library that provides hover effects for images. It offers a collection of visually appealing transitions and transformations that can be easily applied to images on websites, enhancing user interaction and visual appeal without the need for JavaScript.

Pros

  • Easy to implement with minimal code required
  • Lightweight and performant, as it's pure CSS
  • Offers a wide variety of hover effects
  • Compatible with modern browsers and responsive design

Cons

  • Limited customization options without modifying the source CSS
  • Some effects may not work well on touch devices
  • Older browsers may not support all effects
  • Overuse of effects can lead to a cluttered or overwhelming user interface

Code Examples

  1. Basic image hover effect:
<figure class="imghvr-fade">
  <img src="path/to/image.jpg">
  <figcaption>
    Hover Content
  </figcaption>
</figure>
  1. Slide effect with custom background color:
<figure class="imghvr-slide-up" style="background-color: #2266a5;">
  <img src="path/to/image.jpg">
  <figcaption>
    <h3>Title</h3>
    <p>Description text</p>
  </figcaption>
</figure>
  1. Zoom effect with a link:
<figure class="imghvr-zoom-out">
  <img src="path/to/image.jpg">
  <figcaption>
    <h3>Click me!</h3>
  </figcaption>
  <a href="https://example.com"></a>
</figure>

Getting Started

  1. Include the CSS file in your HTML:
<link rel="stylesheet" href="https://unpkg.com/imagehover.css@2.0.0/css/imagehover.min.css">
  1. Add the appropriate class to your image container:
<figure class="imghvr-fade">
  <img src="path/to/your/image.jpg">
  <figcaption>
    Your hover content here
  </figcaption>
</figure>
  1. Customize the content and styling as needed. Refer to the documentation for available effects and options.

Competitor Comparisons

8,433

CSS3 Animations with special effects

Pros of Magic

  • Offers a wider variety of CSS animations and effects beyond just image hovers
  • Includes animations for entrances, exits, and attention-seeking effects
  • Provides more customization options and animation variations

Cons of Magic

  • Larger file size due to the broader range of animations
  • May require more effort to implement specific image hover effects
  • Less focused on image-specific interactions compared to ImageHover.css

Code Comparison

ImageHover.css:

.imghvr-fade figcaption {
  opacity: 0;
}
.imghvr-fade:hover figcaption {
  opacity: 1;
}

Magic:

.magictime {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
}
.puffIn {
  animation-name: puffIn;
}

ImageHover.css focuses specifically on image hover effects with simpler CSS, while Magic provides a broader range of animations with more complex keyframe definitions. ImageHover.css is more straightforward for implementing image-specific hover effects, whereas Magic offers greater versatility for various animation needs across different elements.

29,203

A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.

Pros of Hover

  • More comprehensive, offering a wider variety of hover effects
  • Includes both CSS and Sass versions for flexibility
  • Supports 2D transforms, transitions, and animations

Cons of Hover

  • Larger file size due to more extensive features
  • May require more customization to achieve specific effects
  • Some effects might be considered outdated or overused

Code Comparison

Imagehover.css:

.imghvr-fade figcaption {
  opacity: 0;
}
.imghvr-fade:hover figcaption {
  opacity: 1;
}

Hover:

.hvr-grow {
  transform: translateZ(0);
  transition-duration: 0.3s;
}
.hvr-grow:hover {
  transform: scale(1.1);
}

Both libraries provide simple, easy-to-use classes for adding hover effects to elements. Imagehover.css focuses specifically on image hover effects, while Hover offers a broader range of hover effects for various HTML elements.

Imagehover.css uses a more concise naming convention and is tailored for image-based hover effects. Hover, on the other hand, provides a wider array of effects that can be applied to different types of elements, not just images.

The code examples demonstrate the difference in approach: Imagehover.css uses opacity for a fade effect, while Hover utilizes transforms for a growth effect. This illustrates the broader scope of Hover compared to the more focused approach of Imagehover.css.

JavaScript, SCSS, Sass, Less, and Stylus helpers for rendering high-resolution image variants

Pros of Retinajs

  • Focuses on optimizing images for high-resolution displays
  • Lightweight and easy to implement
  • Automatically handles image swapping for retina displays

Cons of Retinajs

  • Limited to image optimization, doesn't provide hover effects
  • Requires preparing multiple image versions for different resolutions
  • May not be necessary for all projects, especially those without high-res images

Code Comparison

Imagehover.css:

.imghvr-fade figcaption {
  opacity: 0;
}
.imghvr-fade:hover figcaption {
  opacity: 1;
}

Retinajs:

retinajs();
// Or with options
retinajs( {
  check_mime_type: true,
  force_original_dimensions: false
} );

Summary

Imagehover.css and Retinajs serve different purposes. Imagehover.css provides CSS-based hover effects for images, while Retinajs focuses on optimizing images for high-resolution displays. Imagehover.css offers a wide range of hover effects without requiring additional image assets, making it ideal for creating interactive image galleries. Retinajs, on the other hand, is better suited for projects that need to serve high-quality images on retina displays, but it requires preparing multiple image versions. The choice between the two depends on the specific needs of your project, whether you prioritize visual effects or image optimization for high-resolution screens.

This repo is archived. Thanks!

Pros of Effeckt.css

  • Offers a wider range of effects beyond image hover, including modals, buttons, and list items
  • Provides JavaScript enhancements for more complex animations and interactions
  • Includes a demo page for easy visualization of available effects

Cons of Effeckt.css

  • Less focused on image hover effects specifically
  • Requires more setup and dependencies due to its broader scope
  • May have a steeper learning curve for developers new to CSS animations

Code Comparison

Imagehover.css:

.imghvr-fade figcaption {
  opacity: 0;
}
.imghvr-fade:hover figcaption {
  opacity: 1;
}

Effeckt.css:

.effeckt-caption-1 figcaption {
  bottom: 0;
  opacity: 0;
  transform: translateY(100%);
}
.effeckt-caption-1:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

Both libraries use similar CSS techniques for creating hover effects, but Effeckt.css tends to include more complex transformations and transitions. Imagehover.css focuses specifically on image hover effects, while Effeckt.css covers a broader range of UI animations. Developers should choose based on their specific needs and the scope of their project.

Some inspiration and modern ideas for subtle hover effects.

Pros of HoverEffectIdeas

  • More diverse and creative hover effects, including 3D transformations and advanced animations
  • Includes interactive demos and explanations for each effect
  • Offers a wider range of customization options for developers

Cons of HoverEffectIdeas

  • Requires more complex CSS and JavaScript code, potentially increasing load times
  • May not be as easily implementable for beginners compared to imagehover.css
  • Some effects might not be suitable for all types of images or layouts

Code Comparison

imagehover.css:

.imghvr-fade figcaption {
  opacity: 0;
}
.imghvr-fade:hover figcaption {
  opacity: 1;
}

HoverEffectIdeas:

.grid figure img {
  -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
  transition: opacity 0.35s, transform 0.35s;
  -webkit-transform: scale(1.12);
  transform: scale(1.12);
}
.grid figure:hover img {
  opacity: 0.5;
  -webkit-transform: scale(1);
  transform: scale(1);
}

The code comparison shows that HoverEffectIdeas uses more advanced CSS properties and transformations, while imagehover.css focuses on simpler opacity changes. This reflects the overall difference in complexity and customization options between the two repositories.

1,689

Vivify is free CSS animation library.

Pros of vivify

  • Offers a wider variety of animation effects, including entrances, exits, and attention-seekers
  • Animations can be applied to any HTML element, not just images
  • Includes both CSS and SCSS versions for flexibility in implementation

Cons of vivify

  • Lacks specific focus on image hover effects, which imagehover.css specializes in
  • May require more customization to achieve desired image hover effects
  • Larger file size due to the broader range of animations included

Code Comparison

imagehover.css:

.imghvr-fade figcaption {
  opacity: 0;
}
.imghvr-fade:hover figcaption {
  opacity: 1;
}

vivify:

.vivify.fadeIn {
  animation-name: fadeIn;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

Both libraries use CSS animations to achieve effects, but imagehover.css focuses specifically on image hover transitions, while vivify provides a more general-purpose animation framework. imagehover.css uses the :hover pseudo-class for triggering effects, whereas vivify relies on class names and keyframe animations for broader applicability.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

imagehover.css

A Scaleable & Light Image Hover CSS Library

Imagehover.css is a lovingly crafted CSS library allowing you to easily implement scaleable image hover effects. Choose from over 40 hover effect classes from a CSS library weighing in at a minified size of only 19KB.

Check out all the hover effects here!

NPM

npm install imagehover.css

CDN

https://cdnjs.cloudflare.com/ajax/libs/imagehover.css/2.0.0/css/imagehover.min.css

Basic Usage

  1. Include the stylesheet on your document's <head>
<head>
  <link rel="stylesheet" href="css/imagehover.min.css">
</head>
  1. Place the following markup in to your HTML document
<figure class="imghvr-fade">
  <img src="#">
  <figcaption>
    // Hover Content
  </figcaption>
</figure>
  1. Edit the URL to your image and add your hover content. Then simply set the imagehover.css class of your choice to the containing figure element. In the example above this has been set to 'imghvr-fade'. A full list of hover effects and their classes can be found here!.

Adding a Link

To link your image, add an empty <a> tag just after the figcaption element.

<figure class="imghvr-fade">
  <img src="#">
  <figcaption>
    // Hover Content
  </figcaption>
  <a href="http://www.imagehover.io"></a>
</figure>

SASS

.scss source files are available if you use Sass as your CSS precompiler. It’s customizable and modular.

Customizing variables

Imagehover.css provides a _custom.scss file for easy overriding of default variables in /scss/_variables.scss. Copy and paste relevant lines from there into the _custom.scss file, modify the values, and recompile your Sass to change our default values. Be sure to remove the !default flag from override values.

For example, to change out the background-color and color for the <figcaption>, you'd do the following:

// Imagehover.css overrides
//
// Copy variables from `_variables.scss` to this file to override default values without modifying source files.

$figcaption-bg:  #1a480a; // Green
$text-color:     #9C3636; // Red

Variable List

You can find and customize these variables in the _variables.scss file.

VariableValuesDescription
$image-bg#2266a5 (default), or any valid CSS color valueSpecifies the background-color for the image.
$figcaption-bg#135796 (default), or any valid CSS color valueSpecifies the background-color for the figcaption element.
$figcaption-padding30px (default), or any length or percentageSets the padding on the figcaption element.
$text-color#ffffff (default), or any valid CSS color valueSets the text color for the figcaption element and any child <h*> elements.
$border-color#ffffff (default), or any valid CSS color valueSets the text border-color for ...
$border-margin5px (default), or any valid length...
$border-width4px (default), or any valid length...
$transition-duration0.35s (default), or any valid time valueSets the transition duration for the animation.
$shift-distance10px (default), or any valid length...

Browser Support

ChromeFirefoxEdgeIESafariOpera
Latest ✔Latest ✔Latest ✔11+ ✔Latest ✔Latest ✔

NPM DownloadsLast 30 Days