Why my array removes all from product id while I say only when product id and sizes/colors exists

I have an array like this:

    "products": Array [
      {
        product_id: '1',
        options: [
          {
            size: 'XS',
            color: 'blue'
          }
        ]
      },
      {
        product_id: '1',
        options: [
          {
            size: 'S',
            color: 'red'
          }
        ]
      }
    ],

So I want to remove the item where the payload is equal with the product id, size and color.

      state.cart = state.cart.filter((el => 
        el.products?.id !== action.payload.id && 
        el.products?.options[0].color !== action.payload.options[0].color && 
        el.products?.options[0].size !== action.payload.options[0].size
        ));

The payload is right, but he removes both objects. So what I am doing wrong ?

how to declare a user created array

window.onload=function load_data(){

    document.getElementById('Fieldset_arrays').innerHTML='';
    document.getElementById('Form_interface').innerHTML='';

    var selected_array_item;
    var new_string;
    var new_user_array;
    var obst = 'Obst';
    const Obst = ["Apfel", "Birne", "Orange", "Erdbeere", "Banane"];
    var gemüse = 'Gemüse';
    const Gemüse = ["Gurke", "Aubergine", "Zuccini", "Möhre", "Tomate"];

    const Arrays = new Array();
    Arrays [0] = obst;
    Arrays [1] = Obst;
    Arrays [2] = gemüse;
    Arrays [3] = Gemüse;

    //var array_chosen;

    var parent_arrays = document.getElementById('Fieldset_arrays');

    for (let i = 0; i < Arrays.length; i = i + 2)
    {
        ul = document.createElement('ul');
        ul.id = 'Ul_' + Arrays[i];
        ul.style = 'display:inline-block;';
        parent_arrays.appendChild(ul);
        h4 = document.createElement('h4');
        h4.textContent = Arrays[i];
        ul.appendChild(h4);

        var li_array = Arrays[i + 1];
        for (let i2 = 0; i2 < li_array.length; i2++)
        {
            li = document.createElement('li');
            li.id = 'Li_' + li_array[i2];
            li.innerHTML = li_array[i2];
            ul.appendChild(li);
        }
    }
    var parent_interface;
    parent_interface = document.getElementById('Form_interface');
    label_select_array = document.createElement('label');
    label_select_array.innerHTML = 'was möchten sie tun?';
    label_select_array.style = 'margin-right:24px;';
    parent_interface.appendChild(label_select_array);
    /*select_array = document.createElement('select');
    select_array.id = 'Select_array';
    parent_interface.appendChild(select_array);
    br_select_array1 = document.createElement('br');
    parent_interface.appendChild(br_select_array1);
    br_select_array2 = document.createElement('br');
    parent_interface.appendChild(br_select_array2);

    for (let i = 0; i < Arrays.length; i = i + 2)     
    {
        opt_array_choice = document.createElement('option');
        opt_array_choice.id = 'Opt_'+Arrays[i];
        opt_array_choice.value = Arrays[i];
        opt_array_choice.innerHTML = Arrays[i];
        select_array.appendChild(opt_array_choice);
    }
    document.getElementById('Select_array').addEventListener('change', array_choice); 

    function array_choice()
    {
        array_chosen = document.getElementById('Select_array').value;
    }*/

    btn_change = document.createElement('button');
    btn_change.id = 'Btn_change';
    btn_change.innerHTML = 'Ändern';
    btn_change.style = 'margin-right:12px;';
    btn_change.type = 'button';
    parent_interface.appendChild(btn_change);
    document.getElementById('Btn_change').addEventListener('click', change_array);

    function change_array()
    {
        parent_interface.innerHTML = "";
    }

    btn_add = document.createElement('button');
    btn_add.id = 'Btn_add';
    btn_add.innerHTML = 'Hinzufügen';
    btn_add.style = 'margin-right:12px;';
    btn_add.type = 'button';
    parent_interface.appendChild(btn_add);
    document.getElementById('Btn_add').addEventListener('click', add_to_array);

    function add_to_array()
    {
        parent_interface.innerHTML = "";
    }

    btn_delete = document.createElement('button');
    btn_delete.id = 'Btn_delete';
    btn_delete.innerHTML = 'Löschen';
    btn_delete.style = 'margin-right:12px;';
    btn_delete.type = 'button';
    parent_interface.appendChild(btn_delete);
    document.getElementById('Btn_delete').addEventListener('click', delete_from_array);

    function delete_from_array()
    {
        parent_interface.innerHTML = "";
    }

    btn_sort = document.createElement('button');
    btn_sort.id = 'Btn_sort';
    btn_sort.innerHTML = 'Sortieren';
    btn_sort.style = 'margin-right:12px;';
    btn_sort.type = 'button';
    parent_interface.appendChild(btn_sort);
    document.getElementById('Btn_sort').addEventListener('click', sort_array);

    function sort_array()
    {
        parent_interface.innerHTML = "";
    }

    btn_new = document.createElement('button');
    btn_new.id = 'Btn_new';
    btn_new.innerHTML = 'Neue Liste';
    btn_new.style = 'margin-right:12px;';
    btn_new.type = 'button';
    parent_interface.appendChild(btn_new);
    document.getElementById('Btn_new').addEventListener('click', new_array);

    function new_array()
    {
        parent_interface.innerHTML = "";

        h3_new_array = document.createElement('h3');
        h3_new_array.textContent = 'Neue Liste';
        h3_new_array.style = 'text-decoration:underline';
        parent_interface.appendChild(h3_new_array);

        p_new_array = document.createElement('p');
        p_new_array.innerHTML = 'Wollen sie eine neue Lebensmittelgruppe erstellen , oder eine Einkaufsliste aus bestehenden Listen?  ';
        parent_interface.appendChild(p_new_array);

        select_list_choice = document.createElement('select');
        select_list_choice.id = 'Select_list_choice';
        select_list_choice.autofocus = 'true';
        p_new_array.appendChild(select_list_choice);

        opt_Einkaufsliste = document.createElement('option');
        opt_Einkaufsliste.value = 'Einkaufsliste';
        opt_Einkaufsliste.id = 'Opt_einkaufsliste';
        opt_Einkaufsliste.innerHTML = 'Einkaufsliste';
        opt_Einkaufsliste.selected = 'selected';
        select_list_choice.appendChild(opt_Einkaufsliste);

        opt_new_list = document.createElement('option');
        opt_new_list.value = 'new_list';
        opt_new_list.id = 'Opt_new_list';
        opt_new_list.innerHTML = 'Neue Lebensmittelgruppe';
        select_list_choice.appendChild(opt_new_list);


        p_list_name = document.createElement('p');
        p_list_name.innerHTML = 'Name der Einkaufsliste : ';
        parent_interface.appendChild(p_list_name);

        var input_new_list_name = document.createElement('input');
        input_new_list_name.type = 'text';
        input_new_list_name.id = 'Input_new_list_name';
        input_new_list_name.maxLength = "75";
        input_new_list_name.style = 'margin-right:24px;';
        p_list_name.appendChild(input_new_list_name);
        
        btn_create = document.createElement('button');
        btn_create.type = 'button';
        btn_create.id = 'Btn_create';
        btn_create.innerHTML = 'Speichern';
        p_list_name.appendChild(btn_create);
             
        select_list_choice_br = document.createElement('br');
        parent_interface.appendChild(select_list_choice_br);

        var section_lists = document.createElement('section');
        parent_interface.appendChild(section_lists);

        document.getElementById('Input_new_list_name').addEventListener('keydown', create_new_section);
        var new_list_fieldset;
        var keydown = 0;
        document.getElementById('Btn_create').addEventListener('click',create_new_array);        

        document.getElementById('Input_new_list_name').addEventListener('keyup', insert_list_name);

        function create_new_section()
        {
            if (keydown === 0)
            {
                new_list_fieldset = document.createElement('fieldset');
                new_list_fieldset.style = 'display:inline-block; float:right;';
                section_lists.appendChild(new_list_fieldset);
                new_list_name = document.createElement('h5');
                new_list_fieldset.appendChild(new_list_name);
                keydown = 1;
            }
        }

        function insert_list_name()
        {
            new_list_name.textContent = document.getElementById('Input_new_list_name').value;
        }
        function create_new_array ()
        {
            Arrays_push=document.getElementById('Input_new_list_name').value;
            new_string=Arrays_push.toLowerCase();
            new_user_array=Arrays_push.charAt(0).toUpperCase()+Arrays_push.slice(1);
            new_user_array = [];
            Arrays.push(new_string);
            Arrays.push(new_user_array);
            console.log(Arrays);
            
            input_new_list_name.disabled = 'true';
        }

        document.getElementById('Select_list_choice').addEventListener('focus', new_array_interface);
        document.getElementById('Select_list_choice').addEventListener('change', new_array_interface);
        var new_list_section_child_counter = 0;
        function new_array_interface()
        {
            var list_choice = document.getElementById('Select_list_choice').value;

            if (new_list_section_child_counter !== 0)
            {
                section_lists.innerHTML = '';
                new_list_section_child_counter = 0;
            }
            
            if (list_choice === 'Einkaufsliste')
            {
                for (let i = 0; i < Arrays.length; i = i + 2)
                {
                    list_fieldset = document.createElement('fieldset');
                    list_fieldset.class = 'Theme_darkblue_fieldset';
                    list_fieldset.id = 'Fieldset_' + Arrays[i];
                    list_fieldset.style = 'display:inline-block;';
                    section_lists.appendChild(list_fieldset);

                    h5_select_from_lists = document.createElement('h5');
                    h5_select_from_lists.textContent = Arrays[i];
                    list_fieldset.appendChild(h5_select_from_lists);

                    select_from_lists = document.createElement('select');
                    select_from_lists.id = 'Select_' + Arrays[i];
                    select_from_lists.class = 'Select_lists';
                    list_fieldset.appendChild(select_from_lists);
                    document.getElementById('Select_'+Arrays[i]).addEventListener('change',selected_item);

                    list_fieldset_br = document.createElement('br');
                    list_fieldset_br2 = document.createElement('br');
                    list_fieldset.appendChild(list_fieldset_br);
                    list_fieldset.appendChild(list_fieldset_br2);

                    list_fieldset_btn = document.createElement('button');
                    list_fieldset_btn.innerHTML = 'Hinzufügen';
                    list_fieldset_btn.id = 'Btn_add_'+Arrays[i];
                    list_fieldset_btn.type = 'button';
                    list_fieldset.appendChild(list_fieldset_btn);
                    document.getElementById('Btn_add_'+Arrays[i]).addEventListener('click',add_item);

                    var list = Arrays[i + 1];

                    for (let i2 = 0; i2 < list.length; i2++)
                    {
                        opt = document.createElement('option');
                        opt.id = list[i2];
                        opt.value = list[i2];
                        opt.innerHTML = list[i2];
                        select_from_lists.appendChild(opt);

                    }
                }
                new_list_section_child_counter = 1;
                

                function selected_item ()
                {
                    selected_array_item = this.value;
                };
                console.log(selected_array_item);
                var item_counter=0;
                function add_item ()    
                {
                    
                    new_user_array[item_counter]=selected_array_item;
                    item_counter++;
                    console.log(item_counter);
                    console.log[new_user_array];
                    
                }
                


            }
        }
    }
};                   

So , i know thats a fucking shit-ton of code , and im already sorry for even asking this , but im trying to build a User controlled database,fully in javascript , im new to Html and yes , i do know that using html code , would make things much easyer to read , yet im doing this to improve my thought structures and workflow when using java-script.

The part im stuck at , at the moment (which somehow is the first time i really feel stuck) is the creation of a shopping list , the user can input a List name , which then shall be used as declaration for the Array , in which his later choices or inputs of items , are going to be saved.
creating the Array works fine , as console prints it´s there , the problem is , it´s an unnamed array , so , how can i declare it?

also is the missing declaration the reason for the variable selected_array_item not beeing saved within so said array? (note the last 2 functions)

I´d be super super super Thankfull if anyone can figure this out and explain in a way a beginner understands

greetings

Navigation Menu Not Working on Big Cartel

I have a custom drop-down navigation menu that I want to use on my big cartel theme. It has HTML, CSS and Java Script.

Unfortunately, It is not working. The Java Script helps with the toggle event.
The drop-downs are on “Shop” and “About”. When I click those dropdowns, they don’t show.

In my Big Cartel Theme, I first tried linking to the JS file — that didn’t work.
I then put the script in the area and it still didn’t work.

Here’s the code working
https://codepen.io/findingcolors/pen/ZErZZgo

HTML

<div class="navigation">
  <div class="nav-container">
    <nav>
      <div class="nav-mobile"><a id="nav-toggle" href="#!"><i class="fa-solid fa-bars"></i> &nbsp; Menu</a></div>
      <ul class="nav-list">
        <li>
          <a href="#!">Home</a>
        </li>
        <li>
          <a href="#">Shop &nbsp; <i class="fa-solid fa-angle-down"></i></a>
          <ul class="nav-dropdown">
            <li>
              <a href="https://www.maddiemarieexclusives.com/products">All Products</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/category/sticker">Stickers</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/category/notes">Notepads + Sticky Notes</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/category/bookmark">Bookmarks</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/category/jewelry">Jewelry</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/category/phone-strap">Phone Straps</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="#!">About &nbsp; <i class="fa-solid fa-angle-down"></i></a>
          <ul class="nav-dropdown">
            <li>
              <a href="https://www.maddiemarieexclusives.com/the-brand">The Brand</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/shipping-returns">Shipping + Returns</a>
            </li>
            <li>
              <a href="https://www.maddiemarieexclusives.com/faq">FAQ</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="#!">Contact</a>
        </li>
        <li>
          <a href="#!">Cart</a>
        </li>
        <li>
          <a href="#!">Search</a>
        </li>
      </ul>
    </nav>
  </div>
</div>

CSS

/* --- NAVIGATION bar --- */
 .navigation {
     height: 50px;
     background: #fefcfc;
     font-family: "Open Sans", sans-serif;
}
 .nav-container {
     text-align: center;
     margin: 0 auto;
}
 nav {
     font-size: 16px;
     text-transform: uppercase;
     font-weight: bold;
}
 nav ul {
     list-style: none;
     margin: 0;
     padding: 0;
}
 nav ul li {
     float: left;
     position: relative;
}
 nav ul li a, nav ul li a:visited {
     display: block;
     padding: 0 20px;
     line-height: 50px;
     background: #fefcfc;
     color: #716558;
     text-decoration: none;
}
 nav ul li a:hover, nav ul li a:visited:hover {
     color: #90867a;
}
 nav ul li ul li {
     min-width: 250px;
}
 nav ul li ul li a {
     padding: 15px;
     line-height: 20px;
}
 .nav-dropdown {
     position: absolute;
     display: none;
     z-index: 1;
     text-align: left;
}
/* Mobile navigation */
 .nav-mobile {
     display: none;
     position: absolute;
     top: 0;
     right: 0;
     background: #fefcfc;
     height: 50px;
     width: 50px;
}
 @media only screen and (max-width: 798px) {
     .nav-mobile {
         display: block;
    }
     nav {
         width: 100%;
         padding: 50px 0 15px;
    }
     nav ul {
         display: none;
         text-align: left;
    }
     nav ul li {
         float: none;
    }
     nav ul li a {
         padding: 15px;
         line-height: 20px;
    }
     nav ul li ul li a {
         padding-left: 30px;
    }
     .nav-dropdown {
         position: static;
    }
}
 @media screen and (min-width: 799px) {
     .nav-list {
         display: inline-block;
    }
}
 #nav-toggle {
     position: absolute;
     left: -160px;
     top: 10px;
     cursor: pointer;
     padding: 10px 35px 16px 0px;
     color: #716558;
     text-decoration: none;
     font-size: 16px;
}
 article {
     max-width: 1000px;
     margin: 0 auto;
     padding: 10px;
}

Java

(function($) { // Begin jQuery
  $(function() { // DOM ready
    // If a link has a dropdown, add sub menu toggle.
    $('nav ul li a:not(:only-child)').click(function(e) {
      $(this).siblings('.nav-dropdown').toggle();
      // Close one dropdown when selecting another
      $('.nav-dropdown').not($(this).siblings()).hide();
      e.stopPropagation();
    });
    // Clicking away from dropdown will remove the dropdown class
    $('html').click(function() {
      $('.nav-dropdown').hide();
    });
    // Toggle open and close nav styles on click
    $('#nav-toggle').click(function() {
      $('nav ul').slideToggle();
    });
    // Hamburger to X toggle
    $('#nav-toggle').on('click', function() {
      this.classList.toggle('active');
    });
  }); // end DOM ready
})(jQuery); // end jQuery

change burger menu when click on link

In the code below, when I click on the burger menu, the design changes from burger to an X and the menu opens successfully. However, when I click on a link within the menu, the menu does close BUT the X menu does NOT change its design back to a burger.In other words, the menu closes but the css of the icon does not change back. Does anyone know what I am doing wrong?

  const handleClick = (event: any) => {
    if (!menuOpen) {
      event.currentTarget.classList.add("open");
      setMenu(true);
    } else {
      event.currentTarget.classList.remove("open");
      setMenu(false);
    }
  };
  <div className="mt-4 container page-container">
      <div className="row">
        <div className="d-grid gap-2 pb-3 col-4 mx-auto ">
          <div className="menu-btn" onClick={handleClick}>
            <div className="menu-btn_burger"></div>
          </div>
        </div>
      </div>
      {menuOpen && (
        <div className="row">
          <div className="d-grid gap-2 pt-3 col-6 mx-auto ">
            <Link to="/add" onClick={handleClick} className="btn btn-primary btn-sm  ">
              Add Task
            </Link>
            <Link to="/" onClick={handleClick} className="btn btn-primary btn-sm">
              All Reminders <span className="badge badge-light text-dark">{tasks.length > 0 && tasks.length}</span>
            </Link>
          </div>
        </div>}

How to check if an image was blocked by a browser extension?

Following Scenario

How can I check if the images were blocked by an extension, so I can show the user fallback images?

Thanks for any advice.

Let Ball Moving and be shootable [closed]

i need some help at my project. I want that a ball is moving from left to the right side and it should be shootable. So that i can shoot the ball with my mouse and a new ball spawns.

HTML:

<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title>SHOOT THE BALL!</title>
    <script src = "GameJS.js"></script>
    <link href="GameStylesheet.css" rel="stylesheet">

</head>
<body onload="init()">

<img src="../images/Crosshair.png" alt="Crosshair" class="cursor">

<div style = "text-align:center;">
    <br>
    <canvas id="myCanvas" width="800" height="500" style="border:1px solid #b0b0b0;"></canvas>
</div>

<p id="demo"></p>

</body>
</html>

JS:

function init() {
    const cursor = document.querySelector(".cursor");
    window.addEventListener("mousemove", (e) => {
        cursor.style.top = e.pageY + "px";
        cursor.style.left = e.pageX + "px";
    })
    movingBalls();
}


function movingBalls() {
    let canvas = document.getElementById("myCanvas");
    let ctx = canvas.getContext("2d");

    let xPosition = 30;
    let width = 25;
    let yPosition = (Math.random() * (canvas.height - width)) + width;
    let xSpeed = 2;
    let score = 0;

    reDraw = function() {
        ctx.fillStyle = "red";
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        ctx.beginPath();
        ctx.arc(xPosition, yPosition, width, 0, Math.PI*2, true);
        ctx.closePath();
        ctx.fill();
        requestAnimationFrame(reDraw);
    }

    function moveBall() {
        xPosition += xSpeed;
    }

    window.addEventListener("click", (e) => {
        if(e.target == moveBall()) {
            score++;
        }
    })

    reDraw();
    setInterval(moveBall, 16.7);
}
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title>SHOOT THE BALL!</title>
    <script src = "GameJS.js"></script>
    <link href="GameStylesheet.css" rel="stylesheet">

</head>
<body onload="init()">

<img src="../images/Crosshair.png" alt="Crosshair" class="cursor">

<div style = "text-align:center;">
    <br>
    <canvas id="myCanvas" width="800" height="500" style="border:1px solid #b0b0b0;"></canvas>
</div>

<p id="demo"></p>

</body>
</html>

If somebody can help me I would be very thankful.

Improving a loops and tasks to scrape multiple paths that I need to match values

The page elements are in this pattern:

<ul class="scorer-info">
 <li class="  ">
   <span class="scorer">
       <a href="/players/maximilian-mittelstadt/359295/">
         M. Mittelstädt
       </a>

       

         <span class="minute">
           3'
         </span>

       

         <span class="assist">
           (assist by
           <a href="/players/salomon-kalou/2540/">S. Kalou</a>)
         </span>

   </span>

   <span class="score">1 - 0</span>

   <span class="scorer">
  </span>
   <div class="clearfix"></div>
 </li>
 <li class="  ">
   <span class="scorer">
   </span>

   <span class="score">1 - 1</span>

   <span class="scorer">

         <span class="minute">
           7'
         </span>


       <a href="/players/serge--gnabry/213651/">
         S. Gnabry
       </a>

       

  </span>
   <div class="clearfix"></div>
 </li>
 <li class="  ">
   <span class="scorer">
   </span>

   <span class="score">1 - 2</span>

   <span class="scorer">

         <span class="minute">
           49'
         </span>


       <a href="/players/serge--gnabry/213651/">
         S. Gnabry
       </a>

       

         <span class="assist">
           (assist by
           <a href="/players/james-david-rodriguez/72408/">J. Rodríguez</a>)
         </span>
  </span>
   <div class="clearfix"></div>
 </li>
 <li class="  ">
   <span class="scorer">
       <a href="/players/davie-selke/213931/">
         D. Selke
       </a>

       

         <span class="minute">
           67'
         </span>

       


   </span>

   <span class="score">2 - 2</span>

   <span class="scorer">
  </span>
   <div class="clearfix"></div>
 </li>
 <li class="  ">
   <span class="scorer">
   </span>

   <span class="score">2 - 3</span>

   <span class="scorer">

         <span class="minute">
           98'
         </span>


       <a href="/players/kingsley-coman/265385/">
         K. Coman
       </a>

       

         <span class="assist">
           (assist by
           <a href="/players/robert-lewandowski/41310/">R. Lewandowski</a>)
         </span>
  </span>
   <div class="clearfix"></div>
 </li>
</ul>

My Code:

function score() {
  var ss = SpreadsheetApp.getActive().getSheetByName('copy');
  var response = UrlFetchApp.fetch('URL URL URL URL', {muteHttpExceptions: true});
  if (response.getResponseCode() == 404) {
  } else {
    var contentText = response.getContentText();
    var $ = Cheerio.load(contentText);
    
    var list_minutes = [];
    var list_score = [];
    
    var minute_goal = $('ul.scorer-info > li > span.scorer > span.minute');
    var score_goal = $('ul.scorer-info > li > span.score');
    
    minute_goal.each((index, element) => {list_minutes.push([($(element).text().trim()).substring(0, ($(element).text().trim()).indexOf("'"))]);});
    score_goal.each((index, element) => {list_score.push([$(element).text().trim()]);});

    var before_90 = [[]];

    var i=0;
    var max = list_minutes.length
    for(i; i<max; i++){
      if (list_minutes[i][0] <= 90) {
        before_90[0] = list_score[i];
      }
    }
    Logger.log(before_90[0][0])
  }
}

Output Logger.log:

2 - 2

The values that are collected by the patches are:

span.minute span.score
3′ 1 – 0
7′ 1 – 1
49′ 1 – 2
67′ 2 – 2
98′ 2 – 3

As seen, this way I need to create several lists until I can in a last loop to find the last value of the list before the 90'.

Is there any way to generate a loop at the moment of collecting the path values to reduce the code size and its execution time?

Accordion expand/collapse states not working properly

Accordions have two visually different states for headers. inactive for closed, active for expanded:

The 1st accordion you click on expands and header changes to active state as expected.
1st accordion, expanded with active state for header

Then, when you click on 2nd accordion, it expands and header becomes active and the 1st accordion automatically collapses as expected. But the issue is the 1st accordions header doesn’t go back to inactive state.
2nd accordion exapanded, 1st accordion automatically collapses but still shows active header

I am not that great with JS so thought someone here might be able to get it to perform properly?

Here is link to live demo: https://utsa-asc.github.io/college-dls/components/detail/accordion.html

JS BELOW

$(document).ready(function () {
  $(".search-btn").click(function () {
    $(this).parents("body").toggleClass("search-bar-active");
  }),
    $(".navbar-toggler").click(function () {
      $(this).toggleClass("toggle-active");
    }),
    $(".video-Controls .play-pause-btn").on("click", function () {
      1 == $(this).attr("data-click")
        ? ($(this).attr("data-click", 0),
          $(this).html(
            'Play Video <span class="play-icon"><i class="fal fa-play-circle"></i></span>'
          ),
          $("#video")[0].pause())
        : ($(this).attr("data-click", 1),
          $(this).html(
            'Pause Video <span class="pause-icon"><i class="fal fa-pause"></i></span>'
          ),
          $("#video")[0].play());
    }),
    $("#header.main-header .navbar-toggler-icon").click(function () {
      $("body").addClass("nav-slide");
    }),
    $("#header.main-header .navbar-toggler-closeicon").click(function () {
      $("body").removeClass("nav-slide");
    }),
    $(".sidebar-toggler").click(function () {
      $(this).parents(".typography-pages-sec").toggleClass("active");
    }),
    $(".card-link").click(function () {
      $(this).parent().toggleClass("active");
    }),
    $(".toggle-span").click(function () {
      $(this).parent().toggleClass("activate");
    }),
    $(".dropdown-menu a.dropdown-toggle").on("click", function (e) {
      return (
        $(this).next().hasClass("show") ||
          $(this)
            .parents(".dropdown-menu")
            .first()
            .find(".show")
            .removeClass("show"),
        $(this).next(".dropdown-menu").toggleClass("show"),
        $(this)
          .parents("li.nav-item.dropdown.show")
          .on("hidden.bs.dropdown", function (e) {
            $(".dropdown-submenu .show").removeClass("show");
          }),
        !1
      );
    }),
    $(".Skip-btn").focus(function () {
      $(this).parent().addClass("active");
    }),
    $(".Skip-btn")
      .on("blur", function () {
        $(this).parent().removeClass("active");
      })
      .on("focus", function () {
        $(this).parent().addClass("active");
      }),
    $(".Skip-btn").click(function () {
      $("html").scrollTop(200);
    }),
    $(window).scroll(function () {
      300 <= $(window).scrollTop()
        ? $(".sticky-header").addClass("active", 1e3)
        : $(".sticky-header").removeClass("active", 1e3);
    });
  var e,
    a = $(".item").length,
    o = $("div.item.active").index() + 1,
    o =
      ($(".num").html(o + "/" + a),
      $(".carousel-control-next").click(function () {
        (currentIndex_active = $("div.item.active").index() + 2),
          a >= currentIndex_active &&
            ((e = $("div.item.active").index() + 2),
            $(".num").html(currentIndex_active + "/" + a));
      }),
      $(".carousel-control-prev").click(function () {
        1 <= (e -= 1) && $(".num").html(e + "/" + a);
      }),
      $("#playButton").click(function () {
        $("#homeCarousel").carousel("cycle");
      }),
      $("#pauseButton").click(function () {
        $("#homeCarousel").carousel("pause");
      }),
      $(".js-example-disabled-results"));
  o.length && o.select2(),
    $("body").keydown(function (e) {
      27 == e.keyCode &&
        ($("#accordion .card-header").removeClass("active"),
        $("#accordion .card>div").removeClass("show"),
        $("#accordion .card>div").removeClass("open"),
        $("#accordion .card>div").removeClass("active"),
        $("body").removeClass("search-bar-active"),
        $(".navbar-collapse").removeClass("show"),
        $(".navbar-toggler").removeClass("toggle-active"),
        $(".category-list-wrapper .collapse").removeClass("show"),
        $(".category-list-wrapper>ul>li").removeClass("activate"));
    });
}),
  $(window).on("load", function () {
    $("#cover").fadeOut(450);
  });

FullCalendar – Getting bootstrap modal to open on select

I am trying to open a bootstrap 5 modal when selecting times in the TimeGridWeek view. I can successfully send an alert but can’t open a modal. Opening the modal via a button works so the modal itself is fine.

select: function( selectionInfo ) {
      // alert("Début: " + selectionInfo.startStr + "  Fin: " + selectionInfo.endStr + "  Toute la journée: " + selectionInfo.allDay);
      $("#evenementSoumission").modal("show");
    },

Does this only work with dayClick and eventClick?

Puppeteer not loading complete page render

I am trying to scrape from an MT5 server. On my browser the site shows loading for a few seconds or milliseconds then renders the login form. But with puppeter it doesn’t. Just the loading page like forever, till timeout. And when i try to code puppeteer wait until the element is rendered it crashes after timeout. I have tried different methods to find out whats wrong(Some of which i commented out in my code). I don’t know where i got it wrong or is it from the site?

This is my first time using Puppeteer too.
My Code is below. Any body that can help me out with solutions?

const puppeteer = require("puppeteer");

const baseUrl = "https://trade.mql5.com/trade?servers=";

const getData = async () => {
  console.log(baseUrl);
  // launch pupprteer
  const browser = await puppeteer.launch({ headless: false });
  const page = await browser.newPage();
  //   await page.setDefaultNavigationTimeout(60000);
  await page.goto(baseUrl, { waitUntil: "networkidle2", timeout: 0 });
  //   await page.waitForNavigation(() =>
  //     document.querySelector("#hero-head-circle")
  //   );
  //   await page.screenshot({ path: "login.png" });
  await page.waitForSelector("#login"),
    await page.screenshot({ path: "login.png" });

  await browser.close();
};

getData();

How do I stop useEffect from running when rendering a modal?

I’m working on a react movie app. I’m still working on my hero picture which shows a popular movie/show in random but whenever I click the button to open a modal, useEffect runs then changes the movie in the hero slide. How do I stop useEffect from running after rendering a modal then run when that modal is closed?:

  const [movies, setMovies] = useState([]);

  //Select movie in random so main page displays a different popular movie everytime the page loads
  const randomPopularMovie = movies[Math.floor(Math.random() * movies.length)];

  useEffect(() => {
    axios.get(requests.requestPopular).then((response) => {
      setMovies(response.data.results);
    });
  }, []);```

Passing props into URL in button using Nextjs

This is for an NFT minting dAPP. I have 4 different NFTs minting pages in my web app built with nextjs, and after each one is minted I have a button appear that says “View on OpenSea”.

When you click on this button, I’d like it so that it will open a new tab and send you to the individual listing to a link that looks like:

“testnets.opensea.io/assets/mumbai/0xb636c1a63c3b092a7c74304b1947b0162d08a1e4/0”.

0xb63… being the contract address, and /0 being the tokenID. I have the tokenId saved in a data file, passing that prop into other areas of my app. But I can’t figure out how to get it into a URL.

This is what I have so far:

  const url =
    "testnets.opensea.io/assets/mumbai/0xb636c1a63c3b092a7c74304b1947b0162d08a1e4/{props.id}";
  window.open(url, "_blank");
};

But it doesn’t work. Any help on this is appreciate. Here is a link to that line in my repo: https://github.com/redbrickmedia/rdbrck-nft/blob/0872e3bbd69ae12ff2b2d5532d5e0da0c78663fa/components/Buttons.js#L52