Created
December 1, 2020 13:44
-
-
Save Nodirbek-Sharipov/c3124716c59a144446eadfbd3d186520 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Menu</title> | |
<script src="jquery.min.js"></script> | |
<script> | |
function change_bg_radgr(event) { | |
var div_pos = $(".radial-gradient").offset(); | |
var x_cord = event.pageX - div_pos.left; | |
var y_cord = event.pageY - div_pos.top; | |
$(".radial-gradient").css('background-image', 'radial-gradient(farthest-corner at '+ x_cord +'px '+ y_cord +'px, #f35 0%, #43e 100%)' ); | |
var coords = "X coords: " + x_cord + ", Y coords: " + y_cord; | |
document.getElementById("demo").innerHTML = coords; | |
} | |
function reverse_gb_radgr() { | |
$(".radial-gradient").css('background-image', ''); | |
} | |
</script> | |
<style> | |
body{ | |
background-image: url(123.png); | |
background-size: cover; | |
background-repeat: no-repeat; | |
} | |
.radial-gradient { | |
cursor: pointer; | |
padding: 20px; | |
border: 1px solid #f35; | |
font-family: verdana; | |
font-size: 24px; | |
font-weight: bold; | |
line-height: 1.5; | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; | |
width: 500px; | |
height: 500px; | |
background-image: radial-gradient(farthest-corner at 250px 250px, #f35 0%, #43e 100%); | |
} | |
</style> | |
</head> | |
<body> | |
<br><br> | |
<div class='radial-gradient' onmousemove="change_bg_radgr(event)" onmouseout="reverse_gb_radgr()"> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | |
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | |
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | |
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | |
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | |
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</div> | |
<div id="demo"></div> | |
<span></span> | |
<span></span> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment