How can i maks a audio music player and add playlist using html css and JavaScript

I has music player working but when i code for the playlist that will not work as the playlist doesn’t have that select option

I have tried many things but didn’t work

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Music Player</title>

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

<link rel="stylesheet" type="text/css" href="style.css">

<script src="https://kit.fontawesome.com/7b8906bc16.js" crossorigin="anonymous"></script>
<!--class container -->

<div class="musicplayer">

    <div class="outputscreen">

         <span class="name"></span>

    </div>

    <div class="disk"></div>

        <!--audio-->

   <audio  id="song"  onended="playnext()">

        <source src="" type="audio/mpeg">

    </audio>

    

        <!--silder-->

    <div class="song-slider">

        <input type="range" value="0" class="seek-bar" id="progress">

        <div class="controls">    <!--control-->

            <div onclick="playprevious()"><i class="fa-solid fa-backward"></i></div>

            <div onclick="playpause()"><i class="fa-solid fa-play" id="ctrlIcon"></i></div>

            <div onclick=" playnext()"><i class="fa-solid fa-forward"></i></div>

        </div>

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

</script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

let songs = [

{

    name: "LEO - Lokiverse 2.0",

    source: "music/LEO - Lokiverse 2.0 Theme Video _ Thalapathy Vijay _ Anirudh Ravichander _ Lokes.m4a",

    image: "images/loki.jpeg" 

},

{

    name: "LEO - badass",

    source: "music/LEO - Badass Lyric _ Thalapathy Vijay _ Lokesh Kanagaraj _ Anirudh Ravichander.m4a",

    image: "images/badass.jpeg"    

},

{   

    name: "LEO - I am Scared",

    source: "music/LEO - Im Scared Lyric _ Thalapathy Vijay _ Anirudh Ravichander _ Lokesh Kanagara.m4a",

    image: "images/scared.jpeg"

},

{

    name: "Once Upon a Time",

    source: "music/Once Upon A Time Video _ VIKRAM _ Kamal Haasan _ Anirudh Ravichander _ Lokesh Ka.m4a",

    image: "images/once.jpeg"

},

{

    name: "PABLO ESCOBAR",

    source: "music/Pablo Sandhanam Theme Video - Vikram _ Kamal Haasan _ ANIRUDH RAVICHANDER _ Loke.m4a",

    image: "images/pablo.jpeg"

},

{

    name: "LEO - ORDINARY PERSON ",

    source: "music/LEO - Ordinary Person Lyric _ Thalapathy Vijay, Anirudh Ravichander, Lokesh Kana.m4a",

    image: "images/ordinsary.jpeg"

}   

];

let currentIndex = 0;

let progress = document.getElementById(‘progress’);

let song = document.getElementById(‘song’);

let ctrlIcon = document.getElementById(‘ctrlIcon’);

let disk = document.querySelector(‘.disk’);

const outputscreen = document.querySelector(‘.outputscreen .name’);

function updateoutputscreen() {

outputscreen.textContent = songs[currentIndex].name;

}

song.addEventListener(‘loadedmetadata’, updateoutputscreen);

function loadSong(index) {

song.src = songs[index].source;

disk.style.backgroundImage = `url(${songs[index].image})`;

song.onloadedmetadata = function() {

    progress.max = song.duration;

    progress.value = song.currentTime;

};

}

function playpause() {

if (ctrlIcon.classList.contains("fa-pause")) {

    song.pause();

    ctrlIcon.classList.remove("fa-pause");

    ctrlIcon.classList.add("fa-play");

    disk.style.animationPlayState = "paused";

} else {

    song.play();

    ctrlIcon.classList.remove("fa-play");

    ctrlIcon.classList.add("fa-pause");

    disk.style.animationPlayState = "running";

}

}

function playnext() {

currentIndex = (currentIndex + 1) % songs.length;

loadSong(currentIndex);

song.play();

}

function playprevious() {

currentIndex = (currentIndex - 1 + songs.length) % songs.length;

loadSong(currentIndex);

song.play();

}

if (song.play) {

setInterval(() => {

    progress.value = song.currentTime;

}, 500);

}

progress.onchange = function() {

if (!song.paused){

    song.play();

}

song.currentTime = progress.value;

}

loadSong(currentIndex);

song.onended = function(){

playnext();

}

*{

margin: 0;

padding: 0;

box-sizing: border-box;

}

body{

width: 100%;

height: 100vh;

display: flex;

justify-content: center;

align-items: center;

background: #ffffff ;

font-family: 'roboto', sans-serif;

}

.musicplayer{

position: fixed;

align-items: center;

width: 350px;

height: 550px;

padding-left: 1000px;

border-radius: 20px;

background: rgba(0, 0, 0, 0.854);

box-shadow: 0 40px 100px rgba(225, 225, 225, 0.1);

padding: 30px;

overflow: hidden;

color:#fff; 

}

.disk{

position: relative;

display: block;

margin: 40px auto;

width: 180px;

height: 180px;

border-radius: 50%;

background-image: url(images/loki.jpeg);

background-size: cover;

box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.08);

animation: rotate 16s infinite linear;

}

.disk::before{

content: '';

position: absolute;

top: 50%;

left: 50%;

transform: translate(-50%, -50%);

width: 30px;

height: 30px;

border-radius: 50%;

background: #4169e1;

}

.song-slider{

width: 100%;

position: relative;

}

.seek-bar{

-webkit-appearance: none;

width: 100%;

height: 5px;

border-radius: 10px;

background: #ADD8E6;

overflow: hidden;

cursor: pointer;

}

.seek-bar::-webkit-slider-thumb{

-webkit-appearance: none;

width: 10px;

height: 20px;

background: #808080;

box-shadow: -400px 0 0 400px #d5eed5;

}

.controls{

display: flex;

justify-content: center;

align-items: center;

}

.controls div{

width: 60px;

height: 60px;

margin: 20px;

background: #fff;

display: inline-flex;

align-items: center;

justify-content: center;

border-radius: 50%;

color: rgb(52, 49, 245);

box-shadow: 0 10px 20px rgba(225, 26, 26, 0.22);

cursor: pointer;

}

.controls div:nth-child(2){

transform: scale(1.5);

background: #313bf5;

color: #fff;

}

.name {

top: 0;

left: 0;

width: 100%;

height: 100%;

text-align: center;

text-transform: capitalize;

font-size: 20px;

font-weight: 500;

}

@keyframes rotate{

from{

    transform: rotate(0deg);

}

to {

    transform: rotate(360deg);

}

}

make a playlist that includes to this music player

ANTD pro table. how to change width of expandable “+” column?

ANTD pro table. how to change width of expandable “+” column?
I added expandable row to the table. But the “+” column width is very large and does not change.
I tried to use css selector

.ant-pro-table .ant-table-thead > tr > th .ant-table-row-expand-icon-cell {
     width: 5px!important;
     padding: 1px!important;
      }
```[enter image description here][1]
but this method doesn't work.


  [1]: https://i.stack.imgur.com/MvapQ.png

Javascript how create an element with attributes with web components

Using web components – if you don’t know what that means don’t answer!!!!!!

I want to create an element on the fly with attributes, NOT add them after the object is already created (setAttribute does not work).

Point: I have setup a web component to interact with it’s attributes inside it’s constructor (this.getAttribute). If you create an element on the fly (document.createElement) the attributes are empty. Setting them afterwards won’t work.

note: I know I can get the funcality I need in another way, this would just create the most user friendly version of the web component (minimal code).

class List extends HTMLElement {
    constructor(temp) {
        super();
             if(this.getAttribute('att')!=null){
                 do stuff
             }
     }
 }

other code

document.createElement('list')

SetInterval function not triggering in for loop (nodejs, express, socket.io)

I have a function called when a game starts. “lobby.players” is an object with 2 socket objects inside. I’ve assigned setInterval to the update variable of each player (socket) object. But the interval only runs for one of them (the second one).

function startGame(lobby) {
        for (var i in lobby.players) {
            console.log(lobby.players[i].id)
            lobby.players[i].emit('startGame', {
                map: lobby.map,
            });
            lobby.players[i].update = setInterval(function() {
                lobby.players[i].emit('update', getUpdatePackage(lobby));
                console.log("update " + lobby.players[i].id)
            }, 1000 / gameConfig.FPS)
            console.log(lobby.players[i].update)
        }
        console.log("Game in lobby " + lobby.id + " is starting.")
    
    }

I’ve added some console.log() lines so that you can see what I mean and this is the output:
enter image description here

It seems like the “update” variable is getting overwritten but it doesn’t seem possible to me with the “i” changing as it should. I have no idea if this can be caused by something outside of the function. If it can I can add more snippets. Thank you for any explanation.

Chart.js Troubleshooting Dynamic Data

My intention:
I am attempting to display loan amortization on a graph for visual representation.

As far as I’ve been able to determine the relevant data remains as an array all the way up until I try to update the graph with those values, but it simply doesn’t render to the graph.

Forgive me if I’m overlooking the obvious.. I haven’t touched Javascript since 2008.

I created a codepen so you can see what I’m working on. I’m not entirely sure how to include it.

https://codepen.io/ifaus/pen/KKJNLQz

Initially I was using an array loans with the forethought that I was going to be able to compare them on the graphs, and then updating the graph via name.data.datasets[index].data …

So I took a step back and figured if I just create an all encompassing variable to set as the data, that should skip the specificity issue .. but to no avail.

I would genuinely appreciate some insight on this issue!

CURL just a moment…enable javascript and cookies to continue

I am trying to dynamically retrieve the content of the next page via PHP / CURL and I always get the error:

just a moment…enable javascript and cookies to continue

URL: https://www.bibliacatolica.com.br/es/la-biblia-de-jerusalen/genesis/1/

With postman I do download it but with PHP it gives me that error.

Any ideas to solve the problem?

Thanks in advance.

The PHP code is this:

$agent = 'PostmanRuntime/7.34.0';

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'User-Agent: PostmanRuntime/7.34.0',
    'Accept: */*',
    'Cache-Control: no-cache',
    'Postman-Token: ab53825d-71ea-4001-9b76-3de716cdbce4',
    'Host: www.bibliacatolica.com.br',
    'Accept-Encoding: gzip, deflate',
    'Connection: keep-alive'
));

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL,'https://www.bibliacatolica.com.br/es/la-biblia-de-jerusalen/genesis/1/'); 
curl_setopt($ch,CURLOPT_ENCODING, 'gzip, deflate');

$response = curl_exec($ch);

if ($response === FALSE) {
  die("Curl error: " . curl_error($ch));
} 

Object is reloading everytime I scroll | React Fiber, GLTF

I have a model of a 3D fridge, and loading it is successful. I am trying to make it drag across the screen when the user scrolls, and moving the div works, however the 3d object itself refreshes. Please watch the attached video to see how it keeps refreshing.

Is there a special setting for me to specify in the canvas whenever I initialize the model? I tried looking around multiple forums and couldn’t find a fix for my problem. Thank you!

https://youtu.be/MxHXLc-C3i4

Code:

import React from 'react'
import Navbar from '../components/Navbar';

import {useRef, useEffect} from 'react';
import {useGLTF, Stage, PresentationControls, OrbitControls, useScroll} from '@react-three/drei';
import {Canvas} from '@react-three/fiber';
import { useLoader, useFrame, useThree } from '@react-three/fiber'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
import { Suspense } from 'react'
import ModelViewer from '../components/ModelViewer';
import * as THREE from 'three';

function Model(props){
  const {scene} = useGLTF("model.glb");

  useThree(({camera}) => {

    camera.position.set(-180, 20, -160);

  });

  // let model = useLoader(GLTFLoader, "model.glb");

  scene.traverse(child => {
    if (child.isMesh) {
        child.castShadow = true
        child.receiveShadow = true
    }
  });



  return <primitive object={scene} {...props} />;
}



export default function Home(props) {

  const groupRef = useRef();

  const [scrollY, setScrollY] = React.useState(0);

  useEffect(() => {
    const handleScroll = () => {
      setScrollY(window.scrollY);
    };
    handleScroll();

    window.addEventListener("scroll", handleScroll);
    return () => {
      window.removeEventListener("scroll", handleScroll);
    };
  });

  useEffect(() => {

    // as the user scrolls, the "fridge" div will move to center of screen
    let fridge = document.getElementById('fridge');

    window.addEventListener('scroll', () => {

      // make it smooth 
      //       fridge.style.transform = "translateX(" + -midScreenX + "px)";
      // for every scrollY, move the fridge to the left by 1px
      for(let i = 0; i < scrollY; i++){
        fridge.style.transform = "translateX(" + -i + "px)";
      }
    });

  });

  return (
    
    <section className="">
        <Navbar />
        
        <div className="flex items-center justify-center">
        <div className="flex flex-col md:flex-row w-9/12 justify-center items-center h-screen">
          <div className="flex items-center bg-gray-300 w-full">
            <div className="flex flex-col">
                <h1 className="font-CreteRoundRegular text-5xl text-center md:text-left">KitchIN</h1>
                <p className="font-CreteRoundRegular text-xl text-center md:text-left">A smart fridge that helps you keep track of your food.</p>
            </div>
          </div>
          <div className="md:w-1/2 w-full h-5/6 bg-red-200" id="fridge">
            <Canvas>
              {/* <Suspense fallback={null}>
                <Stage>
                  <Model />
                      <OrbitControls enableZoom={false} />
                </Stage>
              </Suspense> */}
              <Suspense fallback={null}>
                <Stage>
                <Model />
                <OrbitControls enableZoom={false} />
                </Stage>
                
              </Suspense> 
            </Canvas>
          </div>
          </div>

        </div>
        <div className="flex h-screen">
            <h1>Hello</h1>
          </div>
    </section>
  )
}

useGLTF.preload("modern_fridge.glb");



How to add a radio buttons and CheckBoxs in pdf in Print Office Apex?

I have this code in data source when add button to print report using Print Office Apex

`SELECT
    'file1' AS "filename",
    CURSOR(
        SELECT
            f.FOLLOWUP_TITLE AS "SurveyTitle",
            CURSOR(
                SELECT
                    q.QUESTION_NAME AS "Question",
                    CURSOR(
                        SELECT
                            y.OPTION_NAME AS "Answer"
                        FROM
                            FOLLOWUP_OPTIONS_QUESTION y
                        WHERE
                            y.question_id = q.question_id
                        ORDER BY
                            y.OPTION_NAME
                    ) AS "option"
                FROM
                    FOLLOWUP_QUESTION q
                WHERE
                    f.FOLLOWUP_ID = q.FOLLOWUP_ID
                GROUP BY
                    f.FOLLOWUP_TITLE, q.QUESTION_NAME, q.QUESTION_ID, q.QUESTION_TYPE
                ORDER BY
                    CASE 
                        WHEN q.QUESTION_TYPE = 'Select' THEN 1
                        WHEN q.QUESTION_TYPE = 'Multi select' THEN 2
                        WHEN q.QUESTION_TYPE = 'Text' THEN 3
                        ELSE 4
                    END, q.QUESTION_NAME
            ) AS "questions"
        FROM
            FOLLOWUP_FOLLOWSUP f
        WHERE
            f.FOLLOWUP_ID = :P17_FOLLOWUP_ID
    ) AS "data"
FROM
    DUAL;

And my template to display this servey inside is

{#questions}
    {Question}
    {#option}
        {Answer}
    {/option}
{/questions}

It work and display servay but i want to add radio button for every option in question type is select and add checkbox if question type is Multi select and add space like ….. if question type is text ?

Javascript only select every other list item in multi-select list boxes

Description: I’m trying to build a page wherein a list of people in a list box can be selected and moved to the right list box. (It will do other things eventually but I’ll spare you the inconsequential details.)

Problem: When multiple list items are selected in the “available” box and the “move right” (select) button is clicked, only every other element selected is moved to the “selected” list box. Put differently, in a list of 0-9, items 0,2,4,6 and 8 are moved, and all others remain selected in the “available” list box.

Below is the full code:

<!DOCTYPE html>
<html>
<head>
    <title>Player Selection</title>
    <style>
        .container {
            display: flex;
            justify-content: space-between;
        }
        .list-box {
            width: 200px;
            height: 200px;
        }
    </style>
    <script>
        function moveSelectedPlayers(direction) {
            var sourceSelect, targetSelect;

            if (direction === 'right') {
                sourceSelect = document.getElementById('available_players');
                targetSelect = document.getElementById('selected_players');
                
            } else if (direction === 'left') {
                sourceSelect = document.getElementById('selected_players');
                targetSelect = document.getElementById('available_players');
            }

            var selectedOptions = sourceSelect.selectedOptions;
            for (var i = 0; i < selectedOptions.length; i++) {
                var option = selectedOptions[i];
                targetSelect.appendChild(option);
            }
        }
    </script>
</head>
<body>
    <h1>Select Players</h1>
    <div class="container">
        <select id="available_players" multiple="multiple" class="list-box">
            <?php
            
            include "db_open.php";
            // Create a database connection
            $conn = mysqli_connect($host, $username, $password, $database);

            if (!$conn) {
                die("Connection failed: " . mysqli_connect_error());
            }

            // Fetch player data from the 'players' table and order by last_name
            $query = "SELECT player_id, last_name, first_name FROM players ORDER BY last_name";
            $result = mysqli_query($conn, $query);

            if (mysqli_num_rows($result) > 0) {
                while ($row = mysqli_fetch_assoc($result)) {
                    echo '<option value="' . $row['player_id'] . '">' . $row['last_name'] . ', ' . $row['first_name'] . '</option>';
                }
            }

            // Close the database connection
            mysqli_close($conn);
            ?>
        </select>
        <div>
            <button type="button" onclick="moveSelectedPlayers('right')">Add &rarr;</button>
            <br><br>
            <button type="button" onclick="moveSelectedPlayers('left')">&larr; Remove</button>
        </div>
        <select id="selected_players" name="selected_players[]" multiple="multiple" class="list-box"></select>
    </div>
    <br>
    <form method="post" action="process_signup.php">
        <input type="submit" value="Submit">
    </form>
</body>
</html>

I’m expecting that all the selected elements in the “available” list will get moved to the “selected” list when the button is clicked. Fair warning and full disclosure, I first learned javascript in 1998 when it was a new thing. My coding skills are so old they have grey hairs, so please be gentle if I’ve made any rookie mistakes. This isn’t my primary occupation.

asp.net 6 mvc view Modal and javascript

I am using asp.net 6 mvc.

In my view part i do have this button over here:

  <a href="#" class="btn btn-md btn-info me-2" data-bs-toggle="modal" data-bs-target="#task_modal">Generate Report</a>

that onClick of it it opens the folowing Modal:

<div class="modal fade global-modal" id="task_modal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered mw-650px" id="task-modal-content-container">
    <!--begin::Modal content-->
    <div class="modal-content rounded">
        <!--begin::Modal header-->
        <div class="modal-header pb-0 border-0 justify-content-end">
            <!--begin::Close-->
            <div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal">
                <i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor"></rect>
                    <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor"></rect>
                </svg>
            </div>
            <!--end::Close-->
        </div>
        <!--End::Modal header-->

        <div class="mb-2 text-center">
            <!--begin::Title-->
            <h1 class="mb-3">@Model.Title</h1>
            <!--end::Title-->
            <!--begin::Description-->
             <div class="text-muted fw-semibold fs-5">
                Created By : @Model.CreatorName
            </div>
            <!--end::Description-->
        </div>


        <!--begin::Modal body-->
        <div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
            <div class="mb-13 text-center">
                <!--begin::Title-->
                <h1 class="mb-3 meeting-title-element"></h1>
                <!--end::Title-->
                <!--begin::Description-->
                <div class="text-muted fw-semibold fs-5 meeting-description-element">
                </div>
                <!--end::Description-->
            </div>

          

            <form novalidate data-kt-path="SaveNewMeeting" 
            class="form flex-lg-row kt_glabal_form"
                  enctype="multipart/form-data
                  data-kt-load-data="true">
             
                <input type="hidden" value="@Model.Id" name="MeetingId" />

             
                <div class="row mb-3">
                    <label class="col-form-label col-lg-4 required">
                        <span>Next Meeting From</span>
                        @*<i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" aria-label="Result within 12 to 48 hours" data-kt-initialized="1"></i>*@
                    </label>
                    <!--begin::Col-->
                    <div class="col-lg-8 fv-row fv-plugins-icon-container">

                        <input class="form-control form-control-lg form-control-solid kt_flatpickr_Time from-date-input" placeholder="Select a From Date" name="DateFrom" eltype="text">

                    </div>
                </div>
                <div class="row mb-3">
                    <label class="col-form-label col-lg-4 required">
                        <span>Next Meeting To</span>
                        @*<i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" aria-label="Result within 12 to 48 hours" data-kt-initialized="1"></i>*@
                    </label>
                    <!--begin::Col-->
                    <div class="col-lg-8 fv-row fv-plugins-icon-container">

                        <input class="form-control form-control-lg form-control-solid kt_flatpickr_Time flatpickr-input" placeholder="Select a To Date" name="DateTo" eltype="text">

                    </div>
                </div>
               @*  <div class="row mb-3">
                    <label class="col-form-label col-lg-4 required">
                        <span>Remark</span>
                    </label>
                    <!--begin::Col-->
                    <div class="col-lg-8 fv-row fv-plugins-icon-container">

                     

                            <textarea id="remarksTextArea" class="form-control mb-2" data-kt-autosize="true" eltype="text" name="RemarksDescription" placeholder="Remark" data-kt-initialized="1" style="overflow: hidden; overflow-wrap: break-word; resize: none;"></textarea>
                            <div class="fv-plugins-message-container invalid-feedback"></div>
                    </div>
                </div> *@

                 <div class="d-flex justify-content-end mb-2 mx-2">
                    <!--begin::Button-->
                    <button type="reset" data-bs-dismiss="modal" id="kt_modal_new_target_cancel" class="btn btn-light me-3">Cancel</button>
                    <!--end::Button-->
                    <!--begin::Button-->
                    <button type="submit"
                            id="kt_ecommerce_add_category_submit"
                            class="btn btn-primary">
                        <span class="indicator-label">Save</span>
                        <span class="indicator-progress">
                            Please wait...
                            <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
                        </span>
                    </button>
                    <!--end::Button-->
                </div> 

            </form>



            <!--begin:Form-->
            <!--begin::Heading-->
           
            <!--end::Heading-->

            <!--begin::Actions-->
           @*  <div class="text-center">
                <button type="reset" id="kt_modal_new_target_cancel" data-bs-dismiss="modal" class="btn btn-light me-3">
                    Cancel
                </button>

                <button type="submit" id="kt_modal_new_target_submit" class="btn btn-primary">
                    <span class="indicator-label">
                        Save
                    </span>
                    <span class="indicator-progress">
                        Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
                    </span>
                </button>
            </div> *@
            <!--end::Actions-->
            <!--end:Form-->
        </div>
        <!--end::Modal body-->
    </div>
    <!--end::Modal content-->

</div>
</div>

In this modul the user can pick a FromDate and ToDate and on click of the submit button a new meeting will be created.

Now i do have this jquery for my date picker

$(“.kt_flatpickr_Time”).flatpickr({

//onReady: function () {
//    this.jumpToDate("2022-01")
//},
altInput: true,
enableTime: true,
dateFormat: "Y-m-d H:i",
altFormat: "F j, Y H:i",
//defaultDate: "today",
minDate: "today",
minTime: minTime,
mode: "single"

});

that the user can choose the date and the time of the meeting.

Now the problem that i am facing is that after i click on the To Date and pick any date the From Date flatpickr is opening automaticaly so i am getting two field that i can choose a date in but i can only choose from the initial one.

How can i fix that beacause i am getting alot of error when i using this type of Modal in my view page

I tried different things and i did alot of research and i am still getting the same problem

Why wont this function return any data? [duplicate]

I want to read a file using a function but it always just returns undefined.

function ReadFromFile(FileName) { 
    data = fs.readFile(`./ServerSaves/${FileName}.txt`, 'utf8', (err, data) => {
        if (err) {
            console.error(err);
            return;
        } 
            
        return data;
        
    }); 
    console.log(data)
    return data;
}

I tried many things already but the output was always either “undefined”, “[object Promise]” or an error.

localhost shows blank page. First time using HTML/Javascript and ThreeJS

I know there are a lot of similar questions and this will get downvoted but I cant solve this and nothing I found online helped me. I want to do an Three JS website because I do a lot of 3D work and I setup everything in VSC with the help of vite. I then just typed “npm run dev” in my cmd while being in my folder directory and was greeted with the basic vite page with a click counter. Everything seemed to work. So I then deleted everything in the style.css and main.js file and put my own code into them (following a tutorial on Youtube). I also added a line of code into the index.html. Now the localhost is just a blank white page and I cant fix it.

My index.html file:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
  </head>
  <body>
    <canvas id="bg"></canvas>
    <script type="module" src="/main.js"></script>
  </body>
</html>

My main.js file:

import './style.css'
import * as THREE from 'three';
//declare module 'three';
//const THREE = require('three');

const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000);

const renderer = new THREE.WebGLRenderer({
  canvas: document.querySelector('#bg'),
});

renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
camera.getWorldPosition.setZ(30);

renderer.render(scene, camera);

const geometry = new THREE.TorusGeometry(10,3,16,100);
const material = new THREE.MeshBasicMaterial({color:0xFF6347, wireframe:true});
const torus = new THREE.Mesh(geometry, material);

scene.add(torus);

// Lights

const pointLight = new THREE.PointLight(0xffffff);
pointLight.position.set(5, 5, 5);

const ambientLight = new THREE.AmbientLight(0xffffff);
scene.add(pointLight, ambientLight);


function animate() {
  requestAnimationFrame(animate);
  renderer.render(scene,camera);
}
animate();

My style.css file:

canvas {position: fixed;top: 0;left: 0;}

How do I disable ES Module Error’s in VSCode?

I have recently made the switch to use Bun as my JS Runtime of choice, and in the switch the relevance of ES Modules vs CommonJS became a moot point because Bun doesn’t acknowledge either and it all just works. Unfortunately VSCode doesn’t seem to agree and whenever I do something that would work in Bun, but not for Node.JS, it gives me errors such as:

enter image description here

and

enter image description here

I acknowledge that I could simply use @ts-ignore, but that would get out of hand rather quickly. I want to know if there is something I can do to my TSConfig file or my VSCode settings that would rid me of these ESM vs CommonJS errors.

Edit: Changing the package.json to "type": "module" produces many more errors than it fixes.