mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Fix radial gradient
This commit is contained in:
parent
9abce6311f
commit
5b0e8779aa
2 changed files with 8 additions and 2 deletions
|
|
@ -228,8 +228,11 @@ const ShipPage = () => {
|
|||
const spotlightRef = useRef()
|
||||
useEffect(() => {
|
||||
const handler = event => {
|
||||
const rect = spotlightRef.current.getBoundingClientRect()
|
||||
const x = event.clientX - rect.left
|
||||
const y = event.clientY - rect.top
|
||||
spotlightRef.current.style.background = `radial-gradient(
|
||||
circle at ${event.pageX}px ${event.pageY}px,
|
||||
circle at ${x}px ${y}px,
|
||||
rgba(0, 0, 0, 0) 10px,
|
||||
rgba(0, 0, 0, 0.8) 80px
|
||||
)`
|
||||
|
|
|
|||
|
|
@ -104,8 +104,11 @@ const ShipPage = () => {
|
|||
const spotlightRef = useRef()
|
||||
useEffect(() => {
|
||||
const handler = event => {
|
||||
const rect = spotlightRef.current.getBoundingClientRect()
|
||||
const x = event.clientX - rect.left
|
||||
const y = event.clientY - rect.top
|
||||
spotlightRef.current.style.background = `radial-gradient(
|
||||
circle at ${event.pageX}px ${event.pageY}px,
|
||||
circle at ${x}px ${y}px,
|
||||
rgba(0, 0, 0, 0) 10px,
|
||||
rgba(0, 0, 0, 0.8) 80px
|
||||
)`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue