I've been making a 3D book with CSS based on this example, and I've been struggling with making it responsive. The height is the biggest issue. I've tried the following:
a) making width 100% and using vh for the height, but that doesn't look good
b) using this jQuery example, which is
window.addEventListener("resize", function(e) {
var mapElement = document.getElementById("map");
mapElement.style.height = mapElement.offsetWidth * 1.72;
});
but because I have a several divs with set height, it doesn't seem like it's working
c) using padding-bottom with percentages, but while that seemed like a good idea, I couldn't make that work for the life of me because I'd have to set padding-bottom on several divs:
.bk-left, .bk-back, .bk-front, .bk-cover {
/* and they also can't be the same padding-bottom
because it doesn't seem to work like that */
}
But none of those really worked. Either I used them incorrectly, or there's something else I can do. Here's the codepen with my 3D book as it is currently. I'm using Bootstrap 4, but only for the grid, so I'm not really looking to implement Bootstrap solutions to the actual book. But can someone please take a look and let me know how I can do this? I'm open for both CSS and JS/jQuery approaches, as long as it scales properly. Thanks a bunch!