<!--
Source Code Copyright © 2025 Ringheim Dissolve Media AB.
All rights reserved.
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LED Rollup Preview</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap');

        body {
            font-family: 'Roboto', sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            height: auto;
            min-height: 100vh;
            margin: 0;
            overflow-x: hidden; /* Prevent horizontal scrolling */
            background-color: #ffffff;
            color: #333333;
        }
        body.loading {
            visibility: hidden;
        }
        .logo {
            width: 150px;
            margin: 30px 0 25px 0; /* Padding above and below the logo */
        }
        p.description {
            font-size: 16px;
            color: #797C7F;
            text-align: center;
            margin-bottom: 20px;
            max-width: 600px;
            padding: 0 20px; /* Padding on left and right sides */
        }
        .container {
            position: relative;
            width: 105%;
            max-width: 1500px;
            aspect-ratio: 16 / 9;
            margin-top: 6px;
            margin-bottom: 25px;
        }
        .background {
            position: absolute;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            z-index: 1;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .background.loaded {
            opacity: 1;
        }
        .overlay {
            position: absolute;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            pointer-events: none; /* Prevent overlay from interfering with interactions */
            z-index: 3;
        }
        .preview {
            position: absolute;
            overflow: hidden;
            z-index: 2;
        }

        .preview.screen-1 {
            width: 12.5%;
            height: 74.3%;
            top: 11.1%;
            left: 42.3%;
            transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(0.953);
        }

        .preview.screen-2 {
            width: 25.1%;
            height: 74.3%;
            top: 11.1%;
            left: 36.2%;
            transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(0.953);
        }

        .preview.screen-3 {
            width: 37.6%;
            height: 74.3%;
            top: 11.1%;
            left: 30.45%;
            transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(0.953);
        }

        .preview.screen-4 {
            width: 50.4%;
            height: 74.3%;
            top: 11.1%;
            left: 24.3%;
            transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(0.953);
        }

        .preview.screen-5 {
            width: 63%;
            height: 74.3%;
            top: 11.1%;
            left: 18.7%;
            transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(0.953);
        }

        .preview.screen-6 {
            width: 75.9%;
            height: 74.3%;
            top: 11.1%;
            left: 12.5%;
            transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(0.953);
        }

        canvas {
            position: absolute;
            width: 100%;
            height: 100%;
            object-fit: contain; /* Maintain proportions */
        }
        .upload-form {
            text-align: center;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 30px; /* Increased spacing between elements */
        }
        .upload-form input[type="file"] {
            display: none; /* Hide the original file upload button */
        }
        .upload-form button, select {
            margin-top: 10px;
            padding: 10px 20px;
            font-size: 1rem;
            color: #ffffff;
            background-color: #838383;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .upload-form button:hover, select:hover {
            background-color: #4b4b4b;
        }
        .error {
            font-weight: bold;
            color: #d32f2f;
            font-size: 0.9rem;
            margin-top: 10px;
        }
        .change-background {
            margin-top: 0;
            margin-left: 0px;
            padding: 10px 20px;
            font-size: 1rem;
            color: #ffffff;
            background-color: #838383;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            display: inline-block;
        }
        .change-background:hover {
            background-color: #4b4b4b;
        }
        .footer-text {
            font-family: 'Roboto', sans-serif;
            font-size: 14px;
            color: #D2D3D5;
            text-align: center;
            margin-top: 0px;
        }
        select#screenSelector {
            height: 40px; /* Match height to button height */
            padding: 0 10px; /* Add some inner padding for the text */
            font-size: 1rem; /* Match font size */
            border: none; /* Remove default border */
            border-radius: 5px; /* Rounded corners, like the buttons */
            background-color: #838383; /* Same background color as the buttons */
            color: #ffffff; /* Same text color as the buttons */
            cursor: pointer;
        }
        select#screenSelector:hover {
            background-color: #4b4b4b; /* Matching hover effect */
        }
    </style>
</head>
<body class="loading">
    <img src="logo.png" alt="Logo" class="logo">
    <p class="description">Preview your video on an LED Rollup by clicking 'Select Video'. The video must be in MP4 format and have dimensions <span id="dimensions">256 x 768</span> pixels.</p>
    <div class="upload-form">
        <select id="screenSelector">
            <option value="1" selected>1 Screen</option>
            <option value="2">2 Screens</option>
            <option value="3">3 Screens</option>
            <option value="4">4 Screens</option>
            <option value="5">5 Screens</option>
            <option value="6">6 Screens</option>
        </select>
        <button type="button" id="customUploadButton">Select Video</button>
        <input type="file" id="videoUpload" accept="video/mp4">
        <button class="change-background" id="changeBackground">Change Background</button>
        <div id="errorMessage" class="error"></div>
    </div>
    </div>
    <div class="container">
        <div class="background" id="background" style="background-image: url('scene1.jpg'); opacity: 1;"></div>
        <div class="preview screen-1" id="preview">
            <canvas id="videoCanvas"></canvas>
        </div>
        <div class="overlay" id="overlay" style="background-image: url('stroke1.png');"></div>
    </div>
    <div class="footer-text">LED Rollup, BMF Events AB © <span id="currentYear"></span> All Rights Reserved.<br>Unauthorized use or distribution of this code is prohibited.</div>


<script src="script.js">
</script>
</body>
</html>