lynnesbian.space/assets/bll.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-03-25 12:36:32 +00:00
// @license magnet:?xt=urn:btih:5305d91886084f776adcf57509a648432709a7c7&dn=x11.txt X11 License
2020-03-16 16:32:01 +00:00
// ratio of each part's height to the width of the image (1082px)
var ratios = {
"top": 1.3577,
"leggies": 0.7311,
"bottom": 0.2431
}
// ratio of the image's height to its width
var overall_ratio = 2.3318;
var leggy_factor = 0;
function update_sizes() {
let target_height = window.innerHeight - 300;
let width = target_height / overall_ratio;
if (width > window.innerWidth * 0.90) {
width = window.innerWidth * 0.90;
}
dgel('big-leggy-lynne').style.width = `${width}px`;
for (let [part, ratio] of Object.entries(ratios)) {
dgel(`bll-${part}`).style.height = `${ratio * width}px`;
}
let leggy_height = ratios['leggies'] * width;
dgel('bll-leggies').style.height = `${leggy_height + leggy_factor * 25}px`;
}
window.addEventListener('resize', update_sizes);
window.onload = function () {
this.dgel('bll-enlarge').onclick = function () {
leggy_factor++;
update_sizes();
window.scrollTo({
left: 0,
top: document.body.scrollHeight,
behavior: "smooth"
})
}
update_sizes();
}
2020-03-25 12:36:32 +00:00
// @license-end