homepage/src/js/lens.js

46 lines
1 KiB
JavaScript
Raw Normal View History

2023-03-15 09:04:46 +00:00
2023-03-15 09:07:15 +00:00
// OK so the next thing to do is make it so it's blurry when the screen is too
// big or too small, and thne prompt someone to make their screen bigger or smaller
// to be a lens and then you have to move the window around to be able to see the different
// links on the page
2023-03-15 09:04:46 +00:00
function _init(){
let lens = document.querySelector('.lens');
lens.style.setProperty(
'--screen-width',
`${window.screen.availWidth}px`
);
lens.style.setProperty(
'--screen-height',
`${window.screen.availHeight}px`
);
function set_position(){
lens.style.transform = `translate(-${window.screenX}px, -${window.screenY}px)`
// lens.style.setProperty(
// '--screen-left',
//
// )
// lens.style.setProperty(
// '--screen-top',
// `${window.screenY}px`
// )
// console.log('set vars')
setTimeout(set_position, 10);
}
set_position();
// setTimeout(set_size,100);
// set_size()
}
export function init(){
// document.addEventListener('load', () => {
// _init();
// })
_init();
}