Text With Mouse Reactive Soft Shadow
How do I make an text with mouse reactive soft shadow?
What is a text with mouse reactive soft shadow? How do you make a text with mouse reactive soft shadow? This script and codes were developed by Keegan Brown on 16 October 2022, Sunday.
Text With Mouse Reactive Soft Shadow - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Text With Mouse Reactive Soft Shadow</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.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! */ h1{ font-family: "Avant Garde", "Avantgarde", "Century Gothic", "CenturyGothic", "AppleGothic", "sans-serif"; font-size: 92px; padding: 0 50px; text-align: center; text-transform: uppercase; /*text-rendering: optimizeLegibility;*/ color: #FFFFFF; font-weight:900; letter-spacing: 0.4em; transform: translate3d(0,0,10px); top: 30%; position: relative;
}
html, body { background-color: #fdfdfd; width:100%; height:100%; overflow:hidden; perspective: 300px;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <h1 id="main" class="">Text with Shadow</h1> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Text With Mouse Reactive Soft Shadow - Script Codes CSS Codes
h1{ font-family: "Avant Garde", "Avantgarde", "Century Gothic", "CenturyGothic", "AppleGothic", "sans-serif"; font-size: 92px; padding: 0 50px; text-align: center; text-transform: uppercase; /*text-rendering: optimizeLegibility;*/ color: #FFFFFF; font-weight:900; letter-spacing: 0.4em; transform: translate3d(0,0,10px); top: 30%; position: relative;
}
html, body { background-color: #fdfdfd; width:100%; height:100%; overflow:hidden; perspective: 300px;
}
Text With Mouse Reactive Soft Shadow - Script Codes JS Codes
$(function () {
var mainBlock = $('#main');
var mouse = { x: 0, y: 0 };
var wind = { w:window.innerWidth/2, h: 100+(mainBlock.height()/2) };
var h1 = $("h1");
var sunTween = TweenMax.fromTo( mouse, 3, { x:mainBlock.width()/2, y:-100 },{ yoyo:true, repeat: -1, x: mainBlock.width()/2, y: -500, ease: Power3.easeInOut });
document.addEventListener("mousemove", function (e) { sunTween.pause(); mouse.x = e.clientX; mouse.y = e.clientY - h1.offset().top;
});
function ontick () { wind.w = window.innerWidth/2; var shadow = ""; var i = 20; var len = i; while ( i-- ) { shadow += ( Math.round(i*-((mouse.x-(wind.w))/100))+"px "+Math.round(i*-((mouse.y-wind.h)/100))+"px "+(i*4)+"px hsla(0,0%,0%,"+1/(len-1)+")," ); } //console.log(shadow); TweenMax.set(h1, { textShadow: shadow } );
}
//ontick();
TweenMax.ticker.addEventListener("tick", ontick);
});
Developer | Keegan Brown |
Username | keeganbrown |
Uploaded | October 16, 2022 |
Rating | 3.5 |
Size | 2,692 Kb |
Views | 22,264 |
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 |
A CSS Trip through outer space | 326,256 Kb |
Paint drips up the wall, sometimes. | 2,787 Kb |
Meteor Shower | 2,583 Kb |
Easy-peasy 3D Scrolling Parallax with GSAP | 2,468 Kb |
Trying out GSAP 1.19 | 3,898 Kb |
Particles with GSAP and SketchJS | 3,441 Kb |
GreenSock SplitText Contest Entry | 3,389 Kb |
Lava Tiles | 2,809 Kb |
Parallaxy Background images | 2,947 Kb |
Particles with pixi.js | 2,963 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 |
Shopping List | Markmurray | 6,015 Kb |
Pure CSS Torch Light | Juliendargelos | 2,727 Kb |
DevCamp 2014 - Denver Public Library | See8ch | 5,033 Kb |
Boom | Mhrjnsa1 | 1,794 Kb |
CSS 3D Radio buttons | Andreasnylin | 1,650 Kb |
Drawing a Terminal with CSS | Lachlanjc | 3,185 Kb |
Tooltip in table | Roine | 3,713 Kb |
LeMandinque | Aadesida | 9,046 Kb |
Rain Landing in a Pond | Edball | 3,009 Kb |
Canvas Orbital Trails v2 | Jackrugile | 3,421 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!