KittenKatja
Active Coder
I have a span element, with JS, I make it visible with "display: flex;" and insert source for the video or image element inside.
The problem is that I can't accurately place it where I want it to be, or make it act with JS.
I want to put it into the bottom right corner, regardless of how devtools is altering the viewport.
When the attribute "in" is not present, it should go out of view only so much that the toggle button is visible.
Video and image should occupy the same space, but for some reason, image is a small, invisible dot in the bottom right corner of the video, stretching the whole construct by itself.
It's also noteworthy, that I have another video element as the background, which has the min-width 100%, and extend left and right without overflowing (IDK why) and the corner construct is the first to cause the overflow scroll to appear, but it is possible that width 100% is not viewport width 100% because of it.
The problem is that I can't accurately place it where I want it to be, or make it act with JS.
HTML:
<html>
<head>
<style>
#corner {box-shadow: 0 0 3px 5px hotpink;background-color: hotpink;/*left and top don't work*/transform: translate(calc(300% - 670px), 700px);flex-direction: row;max-width: fit-content;max-height: fit-content;animation: opacity .3s linear;}
[in]#corner, #corner:hover {opacity: 1;}
#corner :is(video,image) {max-height: 300px;max-width: 300px;position: relative;left: 0;top 0;}
#corner-toggle {width: 40px;height: 100%;}
</style>
</head>
<body style="overflow: hidden;">
<a onclick="document.getElementById('corner-video').src='';document.getElementById('corner-image').src='';document.getElementById('corner').style.display='none'">Remove</a>
<span id="corner">
<a id="corner-toggle">Toggle</a>
<div>
<video id="corner-video" autoplay loop></video>
<image id="corner-image"></image>
</div>
</span>
</body>
</html>
When the attribute "in" is not present, it should go out of view only so much that the toggle button is visible.
Video and image should occupy the same space, but for some reason, image is a small, invisible dot in the bottom right corner of the video, stretching the whole construct by itself.
It's also noteworthy, that I have another video element as the background, which has the min-width 100%, and extend left and right without overflowing (IDK why) and the corner construct is the first to cause the overflow scroll to appear, but it is possible that width 100% is not viewport width 100% because of it.
I have another video element at the top.
It usually plays videos with low height and high width, and the way it is currently setup, it looks like it's centered, but it's not when another video with different dimensions is occupying the spot.
I'd like to actually center it.
It usually plays videos with low height and high width, and the way it is currently setup, it looks like it's centered, but it's not when another video with different dimensions is occupying the spot.
I'd like to actually center it.