Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Video Mascot
- // @version 1
- // @match https://*.ziemniachan.org/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Hardcode your video URL here
- const VIDEO_URL = 'https://ziemniachan.org/b/src/1784292774947.webm';
- // Create the main wrapper container
- const wrapper = document.createElement('div');
- // Apply styling to position the wrapper
- Object.assign(wrapper.style, {
- position: 'fixed',
- top: '0px',
- right: '0px',
- zIndex: '2147483647',
- borderRadius: '12px',
- overflow: 'hidden', // Ensures the video and overlay don't break outside the rounded corners
- boxShadow: '0 16px 64px rgba(0, 0, 0, 0.8)',
- border: '1px solid rgba(255, 255, 255, 0.2)', // Subtle edge highlight
- pointerEvents: 'none' // Prevents the container from blocking clicks
- });
- // Create the video element
- const video = document.createElement('video');
- video.src = VIDEO_URL;
- video.autoplay = true;
- video.muted = true;
- video.loop = true;
- video.controls = false;
- // Apply styles to the video
- Object.assign(video.style, {
- display: 'block', // Removes inline baseline gap
- width: 'auto',
- height: 'auto',
- pointerEvents: 'none'
- });
- // Create the dark glass overlay that renders ON TOP of the video
- const glassOverlay = document.createElement('div');
- Object.assign(glassOverlay.style, {
- position: 'absolute',
- top: '0',
- left: '0',
- right: '0',
- bottom: '0',
- background: 'rgba(50, 50, 50, 0.5)', // The dark color layering over the video
- backdropFilter: 'blur(1px)', // Very slight blur to sell the glass effect without completely hiding the video
- WebkitBackdropFilter: 'blur(2px)' // Safari support
- });
- // Assemble the elements (order matters: overlay is appended last so it sits on top)
- wrapper.appendChild(video);
- wrapper.appendChild(glassOverlay);
- // Function to inject the wrapper safely
- const injectVideoContainer = () => {
- if (!document.body.contains(wrapper)) {
- document.body.appendChild(wrapper);
- }
- };
- // Append to body immediately if available, otherwise wait for DOMContentLoaded
- if (document.body) {
- injectVideoContainer();
- } else {
- window.addEventListener('DOMContentLoaded', injectVideoContainer);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment