The function sumAscii should take an array of names and calculate each name’s score based on the total of each character’s lowercase ASCII value

The function sumAscii should take an array of names and calculate each name’s score based on the total of each character’s lowercase ASCII value. It should return the name with the highest score. E.g. The name ‘John’ would get the score 431 because ‘j’ has the ASCII code 106, ‘o’ has the ASCII code 111, ‘h’ has the ASCII code 104 and ‘n’ has the ASCII code 110.

function sumAscii(arrayOfNames) {
  function getAsciiScore() {
    let sum = 0;
    let arrayOfAsciiCodes = [];
    for (const name of arrayOfNames) {
      name.split("").forEach((letter) => {
        sum += letter.toLowerCase().charCodeAt(0);
      });
    }
    return sum;
  }

  let highestScore = "";
  for (const name of arrayOfNames) {
    for (const letter of name) {
      return getAsciiScore(letter);
    }
  }
}

My function returns the total Ascii code score of all the names

why poi.emergency doesn’t work in javascript map api

I want to color some geometry using API, but I found some of the geometry didn’t work like what it is on the cloud style editing webpage. For exameple, below I want to color the poi.emergency, but it just color the whole map instead of color the selected geometry.

function initMap() {
  // Create a new StyledMapType object, passing it an array of styles,
  // and the name to be displayed on the map type control.
  const styledMapType = new google.maps.StyledMapType(
    [
      {
        "featureType": "administrative",
        "elementType": "labels",
        "stylers": [
          {
            "visibility": "off"
          }
        ]
      },
      {
        "featureType": "land",
        "elementType": "labels",
        "stylers": [
          {
            "visibility": "off"
          }
        ]
      },
      {
        featureType: "poi.park",
        elementType: "geometry.fill",
        stylers: [{ color: "#a5b076" }],
      },
      {
        featureType: "poi.emergency",
        elementType: "geometry.fill",
        stylers: [{color: "#00bfff"}]
      },
     { name: "LandUse" },
    ]
  );
  // Create a map object, and include the MapTypeId to add
  // to the map type control.
  const map = new google.maps.Map(document.getElementById("map"), {
    center: { lat: 55.647, lng: 37.581 },
    zoom: 13,
    //mapId: "38041c807200bb37",
    mapTypeControlOptions: {
      mapTypeIds: [],
    },
    
  });

  //Associate the styled map with the MapTypeId and set it to display.
  map.mapTypes.set("LandUse", styledMapType);
  map.setMapTypeId("LandUse");
}

window.initMap = initMap;

see if you encouter the same case….

Need help in error for react app where i get Seamless SSO error in react application

`Can you please help in providing suggestion to resolve this issue?

I am encountering an issue with the seamless single sign-on (SSO) functionality in my front-end React application. When I attempt to log in using http://localhost:8080,

I receive the following error:
(uncaught exception) InteractionRequiredAuthError: interaction_required: Seamless single sign on failed for the user. This can happen if the user is unable to access on premises AD or intranet zone is not configured correctly
Trace ID: e5199fca-83b4-430a-9932-0ce9b6459f00
Correlation ID: c279bdeb-a4cb-4c5d-abd7-e682dab90b0d
Timestamp: 2024-07-25 13:51:46Z

InteractionRequiredAuthError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.`your text“

I tried running from Cypress I end up in interaction_required Auth error.uncaught exception) InteractionRequiredAuthError: interaction_required: Seamless single sign on failed for the user. This can happen if the user is unable to access on premises AD or intranet zone is not configured correctly
Trace ID: e5199fca-83b4-430a-9932-0ce9b6459f00
Correlation ID: c279bdeb-a4cb-4c5d-abd7-e682dab90b0d
Timestamp: 2024-07-25 13:51:46Z

InteractionRequiredAuthError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

when export data to pdf using itextcharp libarary it give me empty file downloaded and can’t open

I work on asp.net I face issue when export grid view have more than 2000 rows it download empty file pdf without data inside .

and when click on file not open and give me file not in correct format or may be damaged with size 22 byte

so How to solve this issue and generate pdf file have more data and open it.

I don’t need to use base 64 because it small limit for data until 8000 characters

and data exported will have ore than this limit .

what I try as below :

 <div class="form-group col-12">
                                            <button id="btnSave" type="button" class="btn btn-outline-primary col-12" onclick="ExportGridViewToPdf();">
                                                <span style="font-size: 20px; line-height: 1.5;">'طباعة الاحصائية</span><i class="fas fa-print fa-fw fa-2x pull-center"></i></button>
                                        </div>
 <div class="mt-2 row">
                    <div class="form-group col-lg-12">
                        <div class="table-responsive">
                            <asp:GridView ID="gvResults" ClientIDMode="Static" runat="server"
                                ShowFooter="false" RowStyle-CssClass="record" CssClass="table table-striped table-hover table-bordered direction gridview-scroll  customCard card-outline-primary"
                                PageSize="5" Width="100%" border="0" CellSpacing="2" CellPadding="0"
                                AutoGenerateColumns="false">
                                <RowStyle HorizontalAlign="Center" CssClass="record " />

                                <HeaderStyle CssClass="table-info text-center" />

                            </asp:GridView>
                        </div>
                    </div>
                </div>
 
function ExportGridViewToPdf() {
debugger;
    var tableData = [];
    var columns = [];

    // Get the data from the GridView
    $('#gvResults tr').each(function (index) {
        if (index === 0) {
            // Get the column names
            $(this).find('th').each(function () {
                columns.push($(this).text());
            });
        } else {
            var rowData = [];
            $(this).find('td').each(function () {
                rowData.push($(this).text());
            });
            tableData.push(rowData);
        }
    });
 
    // Make an AJAX call to the server-side method
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "../BusinessLayer/WebMethods.asmx/ExportGridViewToPdf",
        data: JSON.stringify({ gridData: tableData, columnNames: columns }),
        responseType: 'arraybuffer',
        processData: false,
        

        success: function (response) {
           

            var fileName = "GridView.pdf";
            var blob = new Blob([response.d], { type: 'application/pdf' });
            var downloadLink = document.createElement("a");
            downloadLink.href = window.URL.createObjectURL(blob);
            downloadLink.setAttribute("download", fileName);
            document.body.appendChild(downloadLink);
            downloadLink.click();
            document.body.removeChild(downloadLink);

        },
        error: function (xhr, status, error) {
            // Handle the error response
            console.error("Error exporting PDF: " + error);
        }
    });
}
   [WebMethod]
        public byte[] ExportGridViewToPdf(string[][] gridData, string[] columnNames)
        {
            try
            {
                // Create a new PDF document
                var document = new Document(PageSize.A4, 25, 25, 30, 30);
                var ms = new MemoryStream();
                var writer = PdfWriter.GetInstance(document, ms);
                document.Open();

                // Add the table to the PDF document
                var table = new PdfPTable(columnNames.Length);
                table.WidthPercentage = 100;

                // Add the column headers
                foreach (var columnName in columnNames)
                {
                    var cell = new PdfPCell(new Phrase(columnName));
                    cell.BackgroundColor = new BaseColor(System.Drawing.Color.LightGray);
                    table.AddCell(cell);
                }

                // Add the data rows
                foreach (var row in gridData)
                {
                    foreach (var value in row)
                    {
                        table.AddCell(value);
                    }
                }

                document.Add(table);
                document.Close();
                writer.Close();
                HttpContext.Current.Response.ContentType = "application/pdf";
                return ms.ToArray();
            }
            catch (Exception ex)
            {
                // Handle the exception
                throw new Exception("Error exporting GridView to PDF: " + ex.Message);
            }
        }

the below is image for what I try with debug
what I try with debug

streaming a video into a web player using javacsript (react component)

I am using Javascript, however the possibly important caveat is in a WebView. I have a stream of data which is an mp4 that I can retrieve like so

            window.runtime.EventsOn('playback-continue', (chunk) => {
                console.log("chunk ", chunk)
                queue.push(new Uint8Array(chunk));
                appendToBuffer(sourceBuffer);
            });

I have no issues retrieving the bytes this way (if i print the chunk i can see the data albeit its printed in base64).

However I can’t seem to be able to use this to stream a video into a player.

My component looks like


const VideoPlayer = () => {
    const videoRef = useRef(null);
    const mimeCodec = 'video/mp4; codecs="avc1.4D401F"';
    let queue = [];
    const mediaSource = new MediaSource();
    useEffect(() => {
        if (!('MediaSource' in window) || !MediaSource.isTypeSupported(mimeCodec)) {
            console.error('Unsupported MIME type or codec: ', mimeCodec);
            return;
        }


        const video = videoRef.current;
        video.srcObject = mediaSource;

        mediaSource.addEventListener('sourceopen', () => {
            const sourceBuffer = mediaSource.addSourceBuffer(mimeCodec);

            window.runtime.EventsOn('playback-continue', (chunk) => {
                console.log("chunk ", chunk)
                queue.push(new Uint8Array(chunk));
                appendToBuffer(sourceBuffer);
            });

            window.runtime.EventsOn('playback-end', () => {
                mediaSource.endOfStream();
            });

            function appendToBuffer(sourceBuffer) {
                if (queue.length > 0 && !sourceBuffer.updating && mediaSource.readyState === 'open') {
                    sourceBuffer.appendBuffer(queue.shift());
                }
            }

            sourceBuffer.addEventListener('updateend', () => appendToBuffer(sourceBuffer));
            sourceBuffer.addEventListener('error', (e) => console.error('SourceBuffer error:', e));
        });

        return () => {
            window.runtime.EventsOff('playback-continue');
            window.runtime.EventsOff('playback-end');
        };
    }, []);

    const startStreaming = () => {
        const videoPath = '/Users/username/Desktop/video.mp4'; // Change to your actual video file path
        OpenVideoFile(videoPath);
    };
    const stopStreaming = () => {
        mediaSource.endOfStream();
    };
    return (
        <div>
            <button onClick={startStreaming}>Start Streaming</button>
            <button onClick={stopStreaming}>Stop Streaming</button>
            <video ref={videoRef} controls />
        </div>
    );
};

I have tried to find blogs/tutorials but I think the issue is how I am passing the stream to the player, not the player code itself.
I just don’t see anything except a continual spinner on the player

P.S OpenVideoFile calls a backend function that begins emitting the stream

EJS isn’t being rendered

I’m making a rock, scissors, paper game on the backend of Node.js with express server, frontend.js client-side, index.ejs and main.css files. I firstly want to render a string line of the result of your decision (won, lost, the same – try again).
However, it doesn’t render the result. I tried to use console.log to detect if the data is passed between the routes, which indeed happens and it literally shows that the data is in the ejs template, but it still doesn’t render.
I tried to use chat GPT to figure it out and it failed…

backend.js:

    import express from "express";
import bodyParser from "body-parser";
import pg from "pg";
import ejs from "ejs";
import axios from "axios";
import { dirname } from "path";
import { fileURLToPath } from "url";


// import icons from "bootstrap-icons";
const __dirname = dirname(fileURLToPath(import.meta.url));
const app = express();
const port = 3000;


let gameResult = [];

app.set('view engine', 'ejs');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static("public"));


app.get("/", (req, res) => {

   const results = [...gameResult];
    gameResult = [];

    console.log("Result from session:", results);

    res.render("index", {results});
});

app.post("/add", (req,res) => {

    const {targetedId, dataIdList} = req.body;

    let compSelector = dataIdList[Math.floor(Math.random() * dataIdList.length)];

    console.log(`Chosen by client: ${targetedId}`);
    console.log(`Chosen by computer: ${compSelector}`);



  function determineResult(targetedId, compSelector) {

    switch (targetedId) {
        case "paper":
            if(compSelector === "scissors") {
                return "You lost";
                
            } else if(compSelector === "rock") {
                return "You won!";
                
            } else {
                return "The same, try again";
                
            }
            break;

        case "scissors":
            if(compSelector === "rock") {
                return "You lost";

            } else if(compSelector === "paper") {
                return "You won!"

            } else {
                return "The same, try again";
            }
            break;

            case "rock":
                if(compSelector === "paper") {
                    return "You lost";
    
                } else if(compSelector === "scissors") {
                    return "You won!"
    
                } else {
                    return "The same, try again";
                }
            break;

        default:
            console.log("Error");
            break;
    }

 }

 try {
    const result = determineResult(targetedId, compSelector);
    console.log(result);
   
    gameResult = [result];
   
    res.redirect("/");
 } catch (error) {
    console.error("Error handling POST /add request:", error);
        res.status(500).send("Internal Server Error");
 }




});



app.listen(port, () => {
    console.log(`Listening on port ${port}`);
});

frontend.js:

console.log("Frontend.js is loaded");

function myFrontFunction(event) {

    const selectedImage = event.target;
    const targetedId = selectedImage.getAttribute("data-id");
    const images = document.querySelectorAll(".image");
    const dataIdList = [];

    images.forEach(dataId => {
       dataIdList.push(dataId.getAttribute("data-id"));
    });

    console.log(`Data list: ${dataIdList}`);


// console.log(typeof(idData));


    console.log(targetedId);

    fetch("/add", {
        method: "POST",
        headers: {"Content-Type": "application/json"},
        body: JSON.stringify({targetedId, dataIdList}),
    })
    .then(response => {

        if(response.ok) {
        console.log("Data sent successfully");
        response.text().then(text => console.log(text));
        console.log("All images:", images); 

        images.forEach(image => {
            if(image !== selectedImage){
                console.log("Hiding image:", image);
                image.classList.add('hidden'); // Use class to hide
            }
        });
        } else {
            console.error("Failed to send data to the server");
        }

        

    })
    .catch(error => console.error("Error:", error));

}

index.ejs:

<%- include('partials/header.ejs') %>


<h1>The RSP App!</h1>

<h2>Choose Rock, Scissors or Paper:</h2>

<img class="image" src="/images/paper.png" alt="A piece of paper" width="400px" height="400px" data-id="paper" onclick="myFrontFunction(event)">
<img class="image" src="/images/rock.png" alt="A rock" width="400px" height="400px" data-id="rock" onclick="myFrontFunction(event)">
<img class="image" src="/images/scissors.png" alt="Scissors" width="400px" height="400px" data-id="scissors" onclick="myFrontFunction(event)">


<div>
<% if (results.length > 0) { %>
    <% results.forEach( result => { %>
       <p> <%= result %></p>
    <% }) %>
<% } %>
</div>






<script src="/frontend.js"></script>

<%- include('partials/footer.ejs') %>

main.css:

.hidden {
    display: none;
}

Responsiveness problem with my div using Vue and Tailwind (Keeping the width when it should shrink)

<div class="flex flex-col bg-sky-600 bg-opacity-35 w-full overflow-y-hidden h-auto max-h-64 px-5 rounded-lg shadow-md pt-5 text-white shrink scroll-smooth">
        <h1>TODAY'S FORECAST</h1>
        <div v-if="data" class="flex overflow-x-scroll overflow-y-hidden scrollbar scrollbar-thumb-sky-200 pb-3">
            <div v-for="(hour, index) in data.forecast.forecastday[0].hour" :key="hour.time_epoch" :class="['flex flex-col w-32 h-40 shrink-0 items-center justify-center hover:bg-sky-500 transition-all', index < data.forecast.forecastday[0].hour.length - 1 ? 'border-r border-white' : '']">
                <span class="text-gray-300">{{ formatHour(hour.time) }}</span>
                <img loading="lazy" :src="hour.condition.icon">
                <span class="text-4xl">{{ Math.round(isCelsius ? hour.temp_c : hour.temp_f) }}&deg;</span>
                <div class="group flex items-center relative">
                    <DropComp class="w-5 h-5" />
                    <span>{{ hour.chance_of_rain }}%</span>
                    <span class="group-hover:scale-100 absolute -top-2 left-20 scale-0 p-2 min-w-max z-30 bg-yellow-500 rounded-lg transition-all duration-100 origin-left">Chance of rain</span>
                </div>
            </div>
        </div>
    </div>

This is the div
I’m having trouble trying to make my web app responsive. When I make the screen size smaller in the dev tools this div doesn’t shrink and also keeps the parent div with it’s children from shrinking.

I thought maybe the parent is causing this to happen so I gave this div a way smaller width size than the parent div and the parent div and all of it’s children were shrinking and growing with the screen until they became the same size as this div and at that point they stopped shrinking.

I also tried this div on it’s own in an empty HTML file and it was shrinking and growing as expected but for some reason it doesn’t do the same in my Vue project.

Other than these I literally have no idea on what to try.

Passing an object to a route with vue-router

Based on this from vue-routers site it seems as though you can pass an object as a prop. However, everytime I try to do this it seems to it fail saying invalid param

My route is defined as follows:

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('../layouts/DashboardLayout.vue'),
      meta: {
        requiresAuth: true,
      },
      children: [
        {
          path: '/upload',
          name: 'Upload Review',
          component: () => import('../pages/CertificationUploadPage.vue'),
          props: { mode: 'manual'}
        },
      ],
    },
    // default redirect to home page
    { 
      path: '/:pathMatch(.*)*', 
      redirect: '/error',
      meta: {
      requiresAuth: true,
      }
    },
    { path: '/:pathMatch(.*)*', 
      redirect: '/login',
      meta: {
        requiresAuth: false,
     }
    }
  ]
})

I programmatically push a new page using this:

router.push({ name: 'Upload Review', params : {mode: 'email'} })

I am curious if I can also go one step further and pass a nested object with some additional data I want to get to the next page/component or would I have to use pinia for that?

Show custom HTML in Firefox add-on popup/dialog

I’m learning how to make an extension (for Firefox).

This add-on reads the youtube main page (https://www.youtube.com/) and get the visible videos on it. From those videos, I’m able to extract the video ID, title, duration of the video, channel name and channel ID.

With this data, I want to show a pop-up dialog with a HTML table that has the obtained info as folows:

Channel No. of videos
NationSquid 1
Numberphile 4
JhnNroses 8
HugoX Chugox 3

[…and so on]


My manifest.json – doesn’t really add much, but, I’ve followed the description of the tag.

{
  "manifest_version": 2,
  "name": "Ejemplo",
  "version": "1.0",

  "description": "Inspeccionar elementos de youtube.com.",

  "icons": {
    "48": "icons/border-48.png"
  },

  "applications": {
    "gecko": {
      "id": "[email protected]"
    }
  },

  // N.B: This is the code extracted from 
  // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups#specifying_a_popup 
  "browser_action": {
     "default_icon": "icons/beasts-32.png",
     "default_title": "Ejemplo",
     "default_popup": "popup/base_html_file.html"
  },

  "content_scripts": [
    {
      "matches": ["https://*.youtube.com/"],
      "js": ["Ejemplo.js", "jquery-1.9.1.min.js"]
    }
  ]
}

My goal is:

I want the add-on shows a pop-up dialog with the HTML I want to specify – in this case, a HTML <table> as shown in the example above.

My current issue is:

I haven’t found a way to pass the JSON object to my base html file1 OR
a way to use the JSON object to build a custom HTML code in the pop-up
dialog.

I’ve read about the user interface and popups in the documentation; however, I haven’t found how the extension can be coded for achieve this requirement.

Can anyone point me to the right path to achive this goal?


1 In the documentation – section “specifying a popup”, the add-on uses a base HTML with a pre-defined HTML, but, I haven’t found if this “base HTML” can be modified with javascript.

Refresh / Reload page on pause youtube iframe api

I have a problem with my code. I want to refresh the page on pause or exit of full screen. The exit on Full screen works. The pause using the youTube iframe API does not “onstatechange”. Any suggestions I could be missing? It appears the onstatechange is not being received. Could there be a Issue with the way I have constructed the “onYouTubeIframeAPIReady()”? I have followed the documentation but this continues to not refresh when the video is paused.

Thanks

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        .container {
            width: 80%;
            margin: 0 auto;
        }
        .responsive-video {
            overflow: hidden;
            padding-bottom: 56.25%;
            position: relative;
            height: 0;
        }
        .responsive-video iframe {
            left: 0;
            top: 0;
            height: 100%;
            width: 100%;
            position: absolute;
        }
    </style>
    <script src="https://www.youtube.com/iframe_api"></script>
</head>
<body>
    <div class="container">
        <div class="responsive-video">
            <iframe id="youtubeIframe" width="560" height="315" src="https://www.youtube.com/embed/oJUvTTGVdTMyY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
        </div>
    </div>

    <script>
        var player;
        var iframe = document.getElementById('youtubeIframe');
        var src = iframe.src;

        function onYouTubeIframeAPIReady() {
            console.log('YouTube IFrame API Ready');
            player = new YT.Player('youtubeIframe', {
                events: {
                    'onReady': onPlayerReady,
                    'onStateChange': onPlayerStateChange
                }
            });
        }

        function onPlayerReady(event) {
            console.log('Player Ready');
        }

        function onPlayerStateChange(event) {
            console.log('Player State Changed:', event.data);
            if (event.data == YT.PlayerState.PAUSED || event.data == YT.PlayerState.ENDED) {
                console.log('Playback stopped or paused, reloading the player');
                setTimeout(reloadPlayer, 100); // Call the reload function after a short delay
            }
        }

        function reloadPlayer() {
            console.log('Reloading player');
            iframe.src = src; // Reset the src attribute to reload the iframe
        }

        function checkFullscreen() {
            if (!document.fullscreenElement && 
                !document.webkitFullscreenElement && 
                !document.mozFullScreenElement && 
                !document.msFullscreenElement) {
                console.log('Exiting fullscreen, reloading the player');
                setTimeout(reloadPlayer, 100); // Call the reload function after a short delay
            }
        }

        // Add event listeners for fullscreen change
        document.addEventListener('fullscreenchange', checkFullscreen);
        document.addEventListener('webkitfullscreenchange', checkFullscreen);
        document.addEventListener('mozfullscreenchange', checkFullscreen);
        document.addEventListener('MSFullscreenChange', checkFullscreen);

        window.onYouTubeIframeAPIReady = onYouTubeIframeAPIReady;
    </script>
</body>
</html>

Hide page count from the go to section of the pdf toolbar when pdf is opened in browser

From java side I am converting tiff images to PDF like below.

        Rectangle pagesize = new Rectangle(maxWidth, maxHeight);
        Document document = new Document(pagesize);
        PdfWriter.getInstance(document, output);
        document.open();

        for (int imageIndex = 0; imageIndex < numPages; imageIndex++) {

            img = images.get(imageIndex);
            img.setAlignment(Image.MIDDLE);
            document.setPageSize(new Rectangle(maxWidth, maxHeight));
            document.add(img);
            document.newPage();
        }

        document.close();

and then from the angular side , I am using window.open to show the PDF file like this

.subscribe(fileUrl => {
        dialogRef.close();
        windowRef = window.open(..${fileUrl}#toolbar=0, '_blank', 'width=800,height=600');
            this.addToAttachmentManager(windowRef, processId);},
() => dialogRef.close());

When the pdf is opened in the browser , I want to hide the Total page count only from the pdf toolbar panel
reference img

How to automatically change the background color on left side of an HTML range slider?

I’m making an HTML music player project and I’m trying to make the left part of the <input type="range" value="0"> slider be black.
The slider is to show how much a song has played and to change from where the song is played. The slider has this CSS:

#progress{
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    cursor: pointer;
    border-radius: 4px;
    margin: 40px 0;
    background: white;
    border: 4px solid black;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
}
#progress::-webkit-slider-thumb{
    -webkit-appearance: none;
    background-color: rgb(245, 245, 245);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid black;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
}

This is the whole HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="style.css">
    <title>
        HTML Music Player
    </title>
    <script defer src="script.js"></script>
</head>
<body>
    <div class="container">
        <div class="music-player">
            <audio id="song"></audio>

            <img id="thumbnail">
            <h1 id="title"></h1>
            <h4 id="artist"></h4>

            <input type="range" value="0" id="progress">
            <div class="controls">
                <div onclick="previousSong()" onmouseover="prevOver()" onmouseout="prevOut()" id="backward">
                    <img src="icons/backward.png" width="40%">
                </div>
                <div onclick="playPause()" onmouseover="playOver()" onmouseout="playOut()" id="play">
                    <img src="icons/play.png" width="40%" id="ctrlIcon">
                </div>
                <div onclick="nextSong()" onmouseover="nextOver()" onmouseout="nextOut()" id="forward">
                    <img src="icons/forward.png" width="40%">
                </div>
            </div>
        </div>
    </div>
</body>
</html>

accent-color: black; won’t work for some reason.
I’m using vanilla JavaScript. This code makes so that the left side’s background color changes only on an input, not automatically while the song is playing.

song.ontimeupdate = function() {
    progress.value = song.currentTime;
}

progress.oninput = function() {
    song.currentTime = progress.value;
}

progress.onchange = function() {
    progress.style.background = `linear-gradient(to right, black 0%, black ${(this.value-this.min)/(this.max-this.min)*100}%, #DEE2E6 ${(this.value-this.min)/(this.max-this.min)*100}%, #DEE2E6 100%)`;
}

I need to change the background of the left side automatically.