Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>Shine image on hover pure CSS animation</h1>
<p>The image needs a wrapper so you can apply the <code>::before</code> psuedo element, then with a few lines of CSS, you have a nice shine.</p>
<p>This will work when the user hovers or focuses on the wrapper (useful for images inside links).</p>

<div class="image-wrapper shine">
	<img src="https://images.unsplash.com/photo-1561688961-7588856fe6ee?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" alt="Image here, hover me and watch me shine!" />
</div>
              
            
!

CSS

              
                .image-wrapper {
	height: 12rem;
	width: 12rem;
	border-radius: 6px;
	background-color: #ccc;
	display: flex;
	align-items: center;
	text-align: center;
	line-height: 1.6;

	img {
		height: auto;
		max-width: 100%;
	}
}

.shine {
	position: relative;
	overflow: hidden;

	&::before {
		background: linear-gradient(
			to right,
			fade_out(#fff, 1) 0%,
			fade_out(#fff, 0.7) 100%
		);
		content: "";
		display: block;
		height: 100%;
		left: -75%;
		position: absolute;
		top: 0;
		transform: skewX(-25deg);
		width: 50%;
		z-index: 2;
	}

	&:hover,
	&:focus {
		&::before {
			animation: shine 0.85s;
		}
	}

	@keyframes shine {
		100% {
			left: 125%;
		}
	}
}

// Ignore the below CSS

body {
	font-family: sans-serif;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
}

              
            
!

JS

              
                // https://jackdomleo.dev

              
            
!
999px

Console