Apple TV style hover
How do I make an apple tv style hover?
Inspired by the new Apple TV UI and the fun rotation effect.. What is a apple tv style hover? How do you make a apple tv style hover? This script and codes were developed by Rosh Jutherford on 04 September 2022, Sunday.
Apple TV style hover - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Apple TV style hover</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel='stylesheet prefetch' href='css/https___codepen_io_the_ru.css'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html { background: #e9e9e4; -webkit-font-smoothing: antialiased;
}
/*section*/.top-movies { font-size: 0; background: #bfd5e0; background: radial-gradient( 400px at 50%, #d9dbd8 0%, #bfd5e0 100% ); padding: 45px 0; box-shadow: inset 0 -5px 8px 0 rgba( 0, 0, 0, 0.05 ); // Borrowed from https://css-tricks.com/i-left-my-system-fonts-in-san-francisco/: font-family: system, -apple-system, ".SFNSDisplay-Regular", HelveticaNeue, LucidaGrande;
}
/*h1*/.top-movies__title { font-size: 22px; color: #444e50; margin: 0 0 14px; text-shadow: 0 2px 1px rgba( 255, 255, 255, 0.1 );
}
.section-content { width: 94%; margin: 0 auto; @include breakpoint( 1022px ) { width: 100%; max-width: 960px; }
}
/*article*/.card { box-shadow: 0 3px 3px 0 rgba( 0, 0, 0, 0.3 ); position: relative; width: 150px; margin: 0 auto; transition: box-shadow 0.15s ease-out, transform 0.25s ease; perspective: 500px; perspective-origin: 50% 50%; transform-style: preserve-3d; &:hover { transform: scale( 1.1 ); box-shadow: none; } &.hover--ending { transition: box-shadow 0.5s ease; } @include breakpoint( 540px ) { display: inline-block; } + .card { margin: 45px auto 0; @include breakpoint( 540px ) { margin: 0 0 0 25px; } }
}
/*span*/.highlight { display: block; position: absolute; width: 100px; height: 100px; top: 0; right: 0; opacity: 0; z-index: 3; transition: opacity 0.25s ease; background: radial-gradient( 60px at 50%, rgba( 255, 255, 255, 0.13 ) 0%, rgba( 255, 255, 255, 0 ) 100% );
}
/*a*/.card__link { display: block; position: relative; width: 150px; height: 228px; overflow: hidden; transform-origin: center center; transform-style: preserve-3d;
}
/*img*/.card__image { position: absolute; width: 100%; height: 100%; top: 0; left: 0; object-fit: cover;
}
/*h2*/.card__title { font-size: 14px; width: 100%; height: 24px; line-height: 24px; text-align: center; color: #FFFFFF; position: absolute; left: 0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity 0.15s ease-in; text-shadow: 0 2px 2px rgba( 0, 0, 0, 0.06 ); /*article*/.card:hover & { opacity: 0.8; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <section class="top-movies"> <div class="section-content"> <h1 class='top-movies__title'>Top Movies</h1> <article class="card"> <a href="#" class="card__link"> <span class="highlight"></span> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/images.jpeg" alt="Mad Max: Fury Road" class="card__image" /> </a> <h2 class='card__title'>Mad Max: Fury Road</h2> </article> <article class="card"> <a href="#" class="card__link"> <span class="highlight"></span> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/images_(1).jpeg" alt="Avengers: Age of Ultron" class="card__image" /> </a> <h2 class='card__title'>Avengers: Age of Ultron</h2> </article> <article class="card"> <a href="#" class="card__link"> <span class="highlight"></span> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/images_(2).jpeg" alt="Furious 7" class="card__image" /> </a> <h2 class='card__title'>Furious 7</h2> </article> </div>
</section> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Apple TV style hover - Script Codes CSS Codes
html { background: #e9e9e4; -webkit-font-smoothing: antialiased;
}
/*section*/.top-movies { font-size: 0; background: #bfd5e0; background: radial-gradient( 400px at 50%, #d9dbd8 0%, #bfd5e0 100% ); padding: 45px 0; box-shadow: inset 0 -5px 8px 0 rgba( 0, 0, 0, 0.05 ); // Borrowed from https://css-tricks.com/i-left-my-system-fonts-in-san-francisco/: font-family: system, -apple-system, ".SFNSDisplay-Regular", HelveticaNeue, LucidaGrande;
}
/*h1*/.top-movies__title { font-size: 22px; color: #444e50; margin: 0 0 14px; text-shadow: 0 2px 1px rgba( 255, 255, 255, 0.1 );
}
.section-content { width: 94%; margin: 0 auto; @include breakpoint( 1022px ) { width: 100%; max-width: 960px; }
}
/*article*/.card { box-shadow: 0 3px 3px 0 rgba( 0, 0, 0, 0.3 ); position: relative; width: 150px; margin: 0 auto; transition: box-shadow 0.15s ease-out, transform 0.25s ease; perspective: 500px; perspective-origin: 50% 50%; transform-style: preserve-3d; &:hover { transform: scale( 1.1 ); box-shadow: none; } &.hover--ending { transition: box-shadow 0.5s ease; } @include breakpoint( 540px ) { display: inline-block; } + .card { margin: 45px auto 0; @include breakpoint( 540px ) { margin: 0 0 0 25px; } }
}
/*span*/.highlight { display: block; position: absolute; width: 100px; height: 100px; top: 0; right: 0; opacity: 0; z-index: 3; transition: opacity 0.25s ease; background: radial-gradient( 60px at 50%, rgba( 255, 255, 255, 0.13 ) 0%, rgba( 255, 255, 255, 0 ) 100% );
}
/*a*/.card__link { display: block; position: relative; width: 150px; height: 228px; overflow: hidden; transform-origin: center center; transform-style: preserve-3d;
}
/*img*/.card__image { position: absolute; width: 100%; height: 100%; top: 0; left: 0; object-fit: cover;
}
/*h2*/.card__title { font-size: 14px; width: 100%; height: 24px; line-height: 24px; text-align: center; color: #FFFFFF; position: absolute; left: 0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity 0.15s ease-in; text-shadow: 0 2px 2px rgba( 0, 0, 0, 0.06 ); /*article*/.card:hover & { opacity: 0.8; }
}
Apple TV style hover - Script Codes JS Codes
$card = $( '.card' );
$card.on( 'mousemove', function( e ) { var $this = $( this ), eX = e.offsetX, eY = e.offsetY, dim = this.getBoundingClientRect(); w = dim.width/2, h = dim.height/2, tiltLimit = 15, posX = ( h - eY ) * ( tiltLimit / h ); posY = ( w - eX ) * ( tiltLimit / w ) * -1; $this.find( 'a' ).css({ 'transform': 'rotateX( ' + posX + 'deg ) rotateY( ' + posY + 'deg )', 'box-shadow': ( posY * -1 ) + 'px ' + ( posX + 14 ) + 'px 34px 0 rgba( 0, 0, 0, 0.1 )' }); $this.find( '.highlight' ).css({ 'opacity': 1, 'transform': 'translate3d( ' + ( posX * -4 ) + 'px, ' + ( posY * -4 ) + 'px, ' + '0 )' });
});
$card.mouseleave( function( e ) { var $el = $( this ).find( 'a' ); $el.removeAttr( 'style' ).addClass( 'hover--ending' ); setTimeout( function() { $el.removeClass( 'hover--ending' ); }, 500 ); $el.find( '.highlight' ).removeAttr( 'style' );
});

Developer | Rosh Jutherford |
Username | the_ruther4d |
Uploaded | September 04, 2022 |
Rating | 4.5 |
Size | 5,419 Kb |
Views | 42,483 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Share toggles | 3,574 Kb |
RvV 2 | 3,115 Kb |
Flame by Kenji Droullard | 3,359 Kb |
Lazy Load for Background Images | 2,977 Kb |
Parallax Canvas Gallery | 12,954 Kb |
Download Button | 4,308 Kb |
Rubee | 3,195 Kb |
CSS Fine Art | 5,996 Kb |
Kinetic Mark by Philip Thepkaysone | 2,504 Kb |
IOS7 Icon | 2,313 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Zip Button test | Lje7462 | 1,932 Kb |
Navier Stoke Fluid Simulation | Esimov | 8,584 Kb |
Fading gradient button | Insprd | 1,713 Kb |
Material Design-Layout-Principles Practice | Fraina | 2,331 Kb |
Multi-step GSAP animation | Acacheung | 2,668 Kb |
Animated SVG stroke-dasharray | Netsi1964 | 3,179 Kb |
Weather App | OmranAbazid | 2,596 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
Nav Test -- cats 1 | Payls | 4,735 Kb |
Calculator - codevember 08 - 2016 | Caiocares | 3,260 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!