Impossible to reproduce the clickup carousel animation

its seems impossible to reproduce the carousel of clickup saas… Anyone can help me please ?

the carousel
https://clickup.com/

There is my actual code :

<!DOCTYPE html>
<html lang="fr">
   <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Carousel</title>
      <style>
         body {
         font-family: Arial, sans-serif;
         background-color: #f0f0f5;
         display: flex;
         justify-content: center;
         align-items: center;
         height: 100vh;
         margin: 0;
         }
         .carousel-wrapper {
         position: relative;
         width: 70%;
         margin: 0 auto;
         display: flex;
         align-items: center;
         }
         .carousel-container {
         overflow: hidden;
         width: 100%;
         display: flex;
         justify-content: center;
         position: relative;
         padding-left: 100px;
         padding-right: 100px;
         }
         .carousel {
         display: flex;
         transition: transform 0.5s ease-in-out;
         position: relative;
         }
         .carousel-item {
         display: flex;
         flex-direction: column;
         align-items: center;
         justify-content: center;
         text-align: center;
         margin: 0 30px;
         padding: 20px;
         background-color: #fff;
         border-radius: 10px;
         box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
         opacity: 0.6;
         transition: opacity 0.3s ease, transform 0.3s ease-in-out;
         cursor: pointer;
         width: 150px;
         }
         .carousel-item:hover {
         transform: translateY(-5px);
         }
         .carousel-item.active {
         opacity: 1;
         transform: scale(1.1);
         box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
         }
         .fade-left, .fade-right {
         position: absolute;
         top: 0;
         bottom: 0;
         width: 100px;
         pointer-events: none;
         }
         .fade-left {
         left: 0;
         background: linear-gradient(to right, rgba(240, 240, 245, 1), rgba(240, 240, 245, 0));
         }
         .fade-right {
         right: 0;
         background: linear-gradient(to left, rgba(240, 240, 245, 1), rgba(240, 240, 245, 0));
         }
         .fa-duotone {
         font-size: 50px;
         color: #333;
         }
      </style>
   </head>
   <body>
      <div class="carousel-wrapper">
         <div class="fade-left"></div>
         <div class="carousel-container">
            <div class="carousel">
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-image"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-subtitles" style="--fa-primary-color: #000;"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-link"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-file-code"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-file-pen"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-wand-magic-sparkles"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-circle-question"></i></div>
               <!-- Dupliquer les éléments pour créer un effet continu -->
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-image"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-subtitles" style="--fa-primary-color: #000;"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-link"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-file-code"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-file-pen"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-wand-magic-sparkles"></i></div>
               <div class="carousel-item"><i class="fa-duotone fa-solid fa-circle-question"></i></div>
            </div>
         </div>
         <div class="fade-right"></div>
      </div>
      <script>
         const carousel = document.querySelector('.carousel');
         const items = document.querySelectorAll('.carousel-item');
         const visibleItems = 7; // Le nombre d'éléments visibles
         let currentIndex = Math.floor(items.length / 3); // Index de l'élément central initial
         
         function updateCarousel(newIndex) {
             const middleIndex = Math.floor(visibleItems / 2);
             const offset = newIndex - currentIndex;
         
             if (newIndex < 0 || newIndex >= items.length) return;
         
             const itemWidth = items[0].offsetWidth + 60;
         
             // Déplacer le carrousel pour centrer le nouvel élément cliqué
             carousel.style.transform = `translateX(${-(newIndex - middleIndex) * itemWidth}px)`;
         
             // Mettre à jour la classe active
             items[currentIndex].classList.remove('active');
             items[newIndex].classList.add('active');
         
             currentIndex = newIndex; // Mettre à jour l'index courant
         }
         
         // Ajouter l'événement de clic à chaque élément du carrousel
         items.forEach((item, index) => {
             item.addEventListener('click', () => {
                 updateCarousel(index);
             });
         });
         
         // Initialiser la position du carrousel
         items[currentIndex].classList.add('active');
         carousel.style.transform = `translateX(${-(currentIndex - Math.floor(visibleItems / 2))     * (items[0].offsetWidth + 60)}px)`;
      </script>
   </body>
</html>

But i have already try many things.

So, to recap, I’m trying to create a carousel where 7 elements are visible at the same time, with the 4th element always centered. When a user clicks on an element to the right or left of the center, that element should move to take the central position. For example, if I click on an element that’s to the right of the center, that element should move to the center. The same behavior should occur if an element to the left of the center is clicked. The movement should be smooth and maintain the order of the elements, without scrolling through the entire carousel. Basically, just like ClickUp.

Thanks for any help !


Try & test

Moving Based on Initial and Target Index
Problem: Movement was fixed in increments of 7 items, causing inconsistent shifts and incorrect centering of items.

Absolute Pixel Calculation for Movement
Problem: Used fixed pixel values for movement, resulting in incorrect display and misalignment of centered items.

Using currentOffset for Position Calculation
Problem: Incorrect initial positioning led to misalignment and improper centering of items.

CSS Animation for Pixel Movement
Problem: CSS animations were out of sync with JavaScript calculations, causing display issues.

Recalculation Based on Clicks
Problem: Miscalculated the pixel movement needed, leading to improper centering and alignment.

Initial Centering with Movement Calculation
Problem: Incorrect initial centering resulted in the wrong element being centered and displayed.

Direct translateX Manipulation
Problem: Directly manipulating translateX with incorrect values led to inconsistent movement and centering.

And many other things…

How can I get the decibel (dB) level from sound URI in react native?

const stopRecording = async (coordinate: { latitude: number; longitude: number }) => {
    try {
      if (record) {
        await record.stopAndUnloadAsync();
        const uri = record.getURI();
        const dB = //dB level here
        if (uri) {
          setMarkers((prevMarkers) => [
            ...prevMarkers,
            { coordinate, audioUri: uri },
          ]);
        }
      }
    } catch (err) {
      console.error('Failed to stop recording', err);
    }
  };

Me and my group have been making a noise pollution map. This map allows users to record audio in their cities, which then the location and loudness of the recording will be entered into our database, allowing other users to see the noise pollution in that location. We are able to get the user’s location, but we are having trouble getting the loudness, in dB, of the recording. Nothing has worked so far. How can we do it?

Question about synchronous ajax call in JS

With below code, what I was expecting is “diameter-selected” class to be added to the button and then to run the synchronous ajax calls. But, it seems that ajax calls run before the “.addClass” command and since it is waiting the promise I guess, I see the button effect after ajax request is completed. When I added setTimeout to the ajax calls for 1 nano second, I see the button effect before ajax calls are completed. So, I solved my issue in a weird way but I want to learn if there is a more professional way to achieve this.

    $(document).on("click", ".btn-diameter", function(){

       $(this).addClass("diameter-selected");

       $.ajax({
         method: "POST",
         async: false,
         url: "/page1.asp"
       });

       $.ajax({
         method: "POST",
         async: false,
         url: "/page2.asp"
       });

    });     

How to Efficiently Send updates in a Chat App with Node.js, Socket.io?

I’m developing a chat application with Node.js and Socket.io for the backend. The frontend is built with React.js for the web and Flutter for mobile platforms.

In many implementations I’ve seen, the entire chat history is sent every time a user opens a specific chat, which seems inefficient. I want to optimize this by sending only the new messages or updates that have occurred since the user last accessed the chat.

Key Updates to Handle:

New messages that have been sent.
Actions such as message deletion, changes to group images, and other metadata updates.

I’m looking for advice on how to structure this to achieve efficient and real-time updates with minimal data overhead.

import with Error [ERR_MODULE_NOT_FOUND]: Cannot find module

I looked at the similar questions but couldn’t find solution.

I have a vanilla JS library that I’m testing locally. The library supports both ESM and CommonJS.


Source Code

src/foo/Foo.js

class Foo {}

export {Foo}

src/bar/Bar.js

class Bar {}

export {Bar}

src/index.js (exporting classes)

export { Foo } from "./foo/Foo.js"
export { Bar } from "./bar/Bar.js"

Unit Tests

In my Unit Tests, I encounter [ERR_MODULE_NOT_FOUND] error if I use

test/foo/FooTest.js (preferable using entry point)

import {Foo} from "../../src/index.js"; // doesn't work
import chai from "chai" // is chai the problem?

but works fine if I import Foo directly

import {Foo} from "../../src/foo/Foo.js" // works, and my IDE suggests to use the above short import
import chai from "chai"

I prefer the earlier version since it uses the main entry point.


Package JSON file

package.json

  "name": "mylib",
  "version": "1.0.0",
  "type": "module",
  "main": "bin/cjs/mylib.js",
  "modules": "bin/esm/mylib.js",
  "exports": {
    ".": {
      "import": "./bin/esm/mylib.js",
      "require": "./bin/cjs/mylib.js"
    }
  },

Svelte, Snapshot & Cannot destructure property error

I am creating a Svelte application using Firebase Database and am trying to convert a simple Firebase call to use a Query Snapshot, rather than a Get, so that I can instantly see changes on screen if the database changes.

I have some working code but it is currently not updating as I need it to and when I use the Query Snapshot code it stops working almost completely. For the purposes of this – I am simply trying to get a list of Users from the database and display them on a page, which updates if any new users are added or details are changed without the need to refresh. I will list both the working and non-working code below:

Working Code

allUsersStore.JS

import { fetchUsers } from "@api/allUsers";
import { onMount } from "svelte";
import { writable } from "svelte/store"

export function allUsersStore() {

    const users = writable([]);
    const loading = writable(false);
 

   
    onMount(loadUsers);
    
    async function loadUsers() {
    loading.set(true);
try{

   const {users: theUsers} = await fetchUsers();
   
   
   
//  console.log(theUsers)

  users.set(theUsers);



} catch(e) {
console.log("ERROR!" + e.message);
}

finally {
loading.set(false);
}



       
    }
    
    
    
 
    
    return {
    //  assignedUser: { subscribe: assignedUser.subscribe },
    users: { subscribe: users.subscribe },
    loading: { subscribe: loading.subscribe },
       // users
    
    }
    
    }

allUsers.js

import { db } from "@db/index";
import { getCountFromServer, Timestamp, doc, collection, getDocs, query, addDoc, orderBy, getDoc, where, setDoc, onSnapshot, updateDoc, deleteDoc, arrayUnion, arrayRemove } from "firebase/firestore";
async function fetchUsers() {

 const q = query(collection(db, "userData"), orderBy('fullName', 'asc'));
 const qSnapshot = await getDocs(q);
 
 const users = qSnapshot.docs.map(doc => {
     const user = doc.data();
    
     return {...user, id: doc.id}
 });


 return {users};
 
 
 }

+page.svelte

<script>
import { allUsersStore } from "@stores/allUsersStore";
const { users, loading} = allUsersStore();
</script>

{#each $users as user (user.id)}
<h2>{user.fullName} </h2>
{/each}

This code works fine to produce a list of Usernames but, as I mentioned above, it will not update if a change to the database is made. As I come from an IOS background I know about Query Snapshots so I tried to implement that solution. All I changed was the call on the allUsers.js page as below:

async function fetchUsers() {

  const q = query(collection(db, "userData"), orderBy('fullName', 'asc'));
  const unsubscribe = onSnapshot(q, (querySnapshot) => {
    const users = [];
    querySnapshot.forEach((doc) => {
        users.push(doc.data());
    });

    
  for (const x of $users) {

console.log(x.fullName)

}



return {users};

  });



}

The console.log is showing the list of users names and I can see this list updating when I trigger a change in the database, however I am now getting an error from the try/catch block on allUsersStore.JS and no list is produced on my +page.svelte. The error is:

Cannot destructure property ‘users’ of ‘(intermediate value)’ as it is undefined

Could some kind person please explain to me what I am doing wrong and if there is a better practice for what I am trying to achieve please?

Thanks in advance 🙂

dom-to-image export error when there is a value between 10-20

this is my first question, so if I didn’t explain the problem correctly, I’d appreciate any feedback.

Issue: I’m using the following code to export a PDF, but when %{Math.abs(differenceView)} has a value between 10 and 20, dom-to-image throws an error.

Code:

const downloadPdf = async () => {
    domtoimage.toJpeg(document.getElementById('htmlToPdf'), { quality: 0.95 })
      .then(function (dataUrl) {
        var img = new Image();
        img.src = dataUrl;
        img.onload = function () {
          console.log(img)
          var pdf = new jsPDF();
          var width = pdf.internal.pageSize.getWidth();
          var height = pdf.internal.pageSize.getHeight();
          pdf.addImage(img, 'JPEG', 0, 0, width, height);
          pdf.save('my-pdf-name.pdf');
        };
      })
      .catch(function (error) {
        console.error('Error:', error);
      });
}
<div className="-graphic-ratio">
    <div className="graphic-ratio-div">
        <label className={
            `chart-subtitle ${differenceView > 0
                ? 'label-positive'
                : differenceView === 0
                ? 'label-neutral'
                : 'label-negative'
            }`
        }>
            %{Math.abs(differenceView) || 0}
        </label>
    </div>
</div>

Problem: When the differenceView value is between 10 and 20, dom-to-image produces an error. Does anyone know why this is happening and how to fix it?

Thanks!

ReactJS website not working after timeout in Google Chrome (Aw snap)

It is built with ReactJS. After some time (between 5-20 minutes) the site doesn’t respond anymore, user can’t click anywhere, can’t inspect elements, it is completly down. And shortly after that there comes a white screen and Chrome displays the “Aw Snap” error message (“Oh Nein” in german).

This happens with and without browser extensions enabled, in Incognito mode, with logged in or logged out users.

It is not an issue after an event or function, as it also happens on the News page where nothing runs in the background after the news have loaded.

We use Redux as store and I suspect there is too much data saved in the storage?

Google Search only tells me to reload the page, which is no solution.

Does anyone have a clue what the issue could be? Or experienced something similar with React in Chrome?

Thanks in advance!

Socket Io based Card game dealing with 4 different views

Iam creating a card game using socket Io and the problem Iam facing is how to deal with local view and players view for example the part Iam stuck in now is when someone draw a card Iam struggling with animations and the idea that if A card got to be in the middle then how other players see it from thier view this thing is exhausting my mind And I need to find a good approach so I can use it in the future with the upcoming events that needs to get back cards to hand so reverse the animation is there any tips or anyone struggled with the multiple views

Tried to make an animation that moves the card to the middle of the field as all my cards are covered in a parent div so I can’t actually get them into the middle that easy

      <div class="deck1">
        <div class="card card1" id="card1deck1"></div>
        <div class="card card2" id="card2deck1"></div>
        <div class="card card3"></div>
        <div class="card card4"></div>
      </div>

the approach Iam thinking of is to center them all to thier parent then move them outside of the parent with negative top value or right or left based on where it’s located But Iam still strugling also so much
enter image description here

I am facing issue related to form validation

When i am clicking on submit button error not showing in form validation. But when i am changing any text in input field it’s giving errors. Like i am not filling fname field and submitting form it’s not showing anything on UI but when i type a single letter than it’s showing error. please help and let me now what is wrong in below code block?

import React from "react";
import { useState } from "react";
const Login = () => {
  const [value, setValue] = useState({
    fname: "",
    email: "",
    password: "",
    confirmPassword: "",
    gender: "",
    error: {},
  });

  const [errors,seterrors] = useState({
    fname: "",
    email: "",
    password: "",
    confirmPassword: "",
    gender: "",
    error: {},
  });

  const validateForm = () => {
    if (!value.fname) {
      errors.fname = "Name is required";
    }
    if(!value.email){
      errors.email = "Email is required";
    }
    else if(!/^[^s@]+@{1}[a-z]{5,}.{1}[w]{3,}$/.test(value.email)) {
       errors.error = "Email id invalid";
    }
    if(!value.password){
      errors.password="Password is required";
    }
    else if(value.password.length<6){
      errors.password = "Password must be at least of 6 digits long";
    }
    if(!value.confirmPassword){
      errors.confirmPassword="please confirm the password";
    }
    else if(value.password!==value.confirmPassword)
    {
      errors.confirmPassword="Password doesnot match";
    }
    return errors;
   
  };

  const handleSubmit = (e) => {
    e.preventDefault();
    const validationErrors = validateForm();
    console.log(validationErrors);
    console.log(value);
    if(Object.keys(validationErrors).length>0){
      seterrors(validationErrors);
    }
    else{console.log("form submitted");}
    
    
  };
  
  return (
    <div className="maincontainer flex items-center justify-center ">
      <div className="w-6/12 h-max bg-yellow-600 mt-10 flex items-center  justify-center ">
        <form onSubmit={handleSubmit} className=" pt-10 flex flex-col">
          <label
            htmlFor="fname"
            className="text-2xl text-rose-800 font-bold flex justify-between"
          >
            First Name : 
            <input
              type="text"
              id="fname"
              onChange={(e) => setValue({ ...value, fname: e.target.value })}
              placeholder="Type your first name"
              className="p-2 ml-5"
            />
          </label>
          {errors.fname}

          <label
            htmlFor="email"
            className="text-2xl text-rose-800 font-bold  mt-5 flex justify-between"
          >
            Email ID :
            <input
              type="email"
              id="email"
              onChange={(e) => setValue({ ...value, email: e.target.value })}
              placeholder="Type your email id"
              className="p-2 ml-5"
            />
          </label>
          {errors.email}
          <label
            htmlFor="password"
            className="text-2xl text-rose-800 font-bold  mt-5 flex justify-between"
          >
            Password :
            <input
              type="password"
              id="password"
              onChange={(e) => setValue({ ...value, password: e.target.value })}
              placeholder="Type your password"
              className="p-2 ml-5"
            />
          </label>
          <label
            htmlFor="confirmPassword"
            className="text-2xl text-rose-800 font-bold  mt-5 flex justify-between"
          >
            Confirm Password :
            <input
              type="password"
              id="confirmPassword"
              onChange={(e) =>
                setValue({ ...value, confirmPassword: e.target.value })
              }
              placeholder="Type your password"
              className="p-2 ml-5"
            />
          </label>
          <label
            htmlFor="confirm-password"
            className="text-2xl text-rose-800 font-bold  mt-20"
          >
            Gender :
            <select className="p-1 ml-6">
              <option
                onChange={(e) => setValue({ ...value, fname: e.target.value })}
              >
                Male
              </option>
              <option
                onChange={(e) => setValue({ ...value, fname: e.target.value })}
              >
                Female
              </option>
            </select>
          </label>

          <button className="w-40 h-12 bg-indigo-500 mt-10 mb-10" type="submit">
            Submit
          </button>
        </form>
      </div>
    </div>
  );
};

export default Login;

How exactly works updates in React useState with an Array

I’m not sure how ReactJs is updating the DOM. In the case bellow, I have a table that display an array that comes from a service like this:

const [dailySchedule, setDailySchedule] = useState([]);
const [isLoading, setIsLoading] = useAtom(loadingAtom);

useEffect(() => {
    setIsLoading(true);
    myService.getSchedule(new Date())
        .then(data => {
            setDailySchedule(data);
            setIsLoading(false);
        });
}, []);

Then, I display this date in a table:

...
<tbody>
{dailySchedule.map((row, i) => (
    <tr key={i}>
        <td>
            <ScheduleActions
                schedule={row}
                someAction={someActionHandler}>
            </ScheduleActions>
        </td>
        <td>{item.name}</td>
        <td>{item.foo}</td>
        ...

someActionHandler:

const someActionHandler= (row) => {
    myService.someAction(row.id)
        .then((response) => {
            row.foo = response.data != "" ? response.data : null;
            setDailySchedule([...dailySchedule]);
        }).catch((error) => {
            toast.error(error.response.data);
        });
}

What’s getting updated in my page? Is it the entire table or only the row that is changing in someActionHandler?

color function from python to javascript

How can we translate the below python function to javascript? Thanks.

def coloring(a): #takes an integer number, returns rgb color
    a = a % 255 
    akM = a // 43 
    ypD = a % 43 
    if   akM == 0: color = (255, ypD*255/43, 0)
    elif akM == 1: color  = (255-ypD*255/43, 255, 0)
    elif akM == 2: color = (0, 255, ypD*255/43)
    elif akM == 3: color = (0, 255-ypD*255/43, 255)
    elif akM == 4: color = (ypD*255/43, 0, 255)
    elif akM == 5: color = (255, 0, 255-ypD*255/43)
    return color

I tried the basics, but no solution.

Problem solving recaptcha V2 using python, selenium and twocaptcha

I’ve written an automation task using selenium python, I want to automate form submission on this website:
https://portal.311.nyc.gov/article/?kanumber=KA-01060
after filling out the forms, there is a google recaptcha version 2, I solve it using the twocaptcha api and submit the answer in the reponse element as followed:

recaptcha_iframe = driver.find_element(By.XPATH, '//iframe[@title="reCAPTCHA"]')
sitekey0 = recaptcha_iframe.get_attribute("src")
sitekey = sitekey0[sitekey0.index("&k=") + len("&k=") : sitekey0.index("&co")]
driver.execute_script("arguments[0].scrollIntoView();", recaptcha_iframe)
response = solver.recaptcha(sitekey, driver.current_url)
code = response['code']
print("Captcha solved.")
# Set the solved Captcha
recaptcha_response_element = driver.find_element(By.ID, 'g-recaptcha-response')
driver.execute_script(f'arguments[0].value = "{code}";', recaptcha_response_element)
print("captcha answer submitted.")

until here everything is good. after that, there is an inactive submit button below the captcha that submits the form. but it’s like the proper callbacks are not executed after the submission of the answer, and the checkbox of the captcha doesn’t get checked. I don’t know how fix it. Please help me.

I’ve tried so many things by now.
I tried to execute scripts using python, such as grecaptcha.render(). there isn’t a grecaptcha.execute() function.
I’ve tried removing the disabled attribute of the submit button as below:

submit = driver.find_element(By.XPATH, "//*[contains(text(), 'Complete and Submit')]")
if submit.get_attribute('disabled'):
    driver.execute_script('arguments[0].removeAttribute("disabled");', submit)

but after clicking the modified button the website gives me an error.

I’ve tried to find the callback function or data in the website HTML inspect, but there isn’t anything as such there.
I went to the sources tab and found the render function, which is as bellow:

               var b = function() {
                    grecaptcha.render(s.value, {
                        sitekey: c.value,
                        theme: l.value,
                        size: u.value,
                        callback: function(t) {
                            return n("verify", t)
                        },
                        "expired-callback": function() {
                            grecaptcha.reset(),
                            n("expire")
                        },
                        "error-callback": function() {
                            return n("fail")
                        }
                    })
                }
                

as you can see the callback function is callback: function(t) { return n("verify", t) }, but it’s not global and I can’t execute it or find it anywhere.

another thing I tried is analyzing the network tab of the developer mode, fount the userverify post request, and tried to implement it manually as such:

        url = "https://www.google.com/recaptcha/api2/userverify?k=" + sitekey

        # Headers extracted from the HAR file
        headers = {
        'authority': 'www.google.com',
        'method': 'POST',
        'path': '/recaptcha/api2/userverify?k=' + sitekey,
        'scheme': 'https',
        'accept': '*/*',
        'accept-encoding': 'gzip, deflate, br, zstd',
        'accept-language': 'en-US,en;q=0.9',
        'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
        'cookie': '__Secure-3PAPISID=OMx7ukSBc0BpS5Na/Alxk-9ULAxcM07AIZ; __Secure-3PSID=g.a000mwj-1j3R4kek2s6gLGfa4606_k1GVKHnam8CHX4Uz0-U8lN6WENsEOIWnWVwGC7329HsUAACgYKAd8SARQSFQHGX2MiF0t66p3fGx0sYUWOQtW-GxoVAUF8yKrbjqcFQM_j1FG6L3jfXDBs0076; NID=516=S6ixUATP9JhzCb1U1USb8dIO2BSq2SKwPMW9HdgJ9l391dixtPJEGcy4xH2Vnc3ayD293fvhCAr2GJp5EDIeYbtV-wqzr4obdY0B3pRqJxb9LwBVgQa8_8UXIvPfWNvm3aAuN8Y90CvVeBEtKHm02hp6bT6GpuZLPKzAKYL1maQiD1dFunLu2LN5DIZMXW6hF3aGi5c1MWsjF-ZeOcEGBanWK8sN8Ytv_KZ7LwcDCMvFmPhBe0WCJixBpDLH2ttLUQbg6cHObPJiMtWNS-s7VbUaGAwDoPtjIbLbIqt2mZyVsa5mZWOjNlNkdIvw1VI5D3GZJxmKmGMKO2oOV7VnN-gNE9r23Myj8Hw9eWH5tyeUnK0mgtACpw_cCohdnznAGHFYWIU7bet1HciAruMwHuXnkg-X6r-ink7How; __Secure-3PSIDTS=sidts-CjABUFGoh9oMvO4pakCAadU9471P44GHs2OOrqNqjqmD2F_kFoRI--TPpayogOJdM7MQAA; __Secure-3PSIDCC=AKEyXzUNiD_0j4-HsRr0MwP8hjlXFxIWm-5KDwZAsPF0mV0k3wSfCcQXhZyTGq18mV5bYA1ZHP_X',
        'origin': 'https://www.google.com',
        'referer': 'https://www.google.com/recaptcha/api2/bframe?hl=en&v=_ZpyzC9NQw3gYt1GHTrnprhx&k=' + sitekey,
        'user-agent': 'Your User Agent String',
        }

        # Body extracted from the HAR file (you'll need the actual token and other parameters)
        data = {
        'c': code,  # replace this with the actual token
        'k': sitekey,
        'response': code,  # replace this with the actual token
        # Additional fields may be required depending on the original request
        }

        response = requests.post(url, headers=headers, data=data)

        print("Response Status Code:", response.status_code)
        print("Response Body:", response.text)

and this is the result I get:
Response Status Code: 200
Response Body: )]}’
[“uvresp”,null,null,null,0]

I also tried getting the cookies from selenium and sending them in the request but the result was the same.

I also tried this script:

driver.execute_script("""
    for (var key in window) {
        if (window[key] && typeof window[key].callback === 'function') {
            window[key].callback();
            break;
        }
    }
""")

but received this error:
selenium.common.exceptions.JavascriptException: Message: javascript error: {“status”:18,”value”:”Failed to read a named property ‘callback’ from ‘Window’: Blocked a frame with origin “https://portal.311.nyc.gov” from accessing a cross-origin frame.”}

I’m very frustrated, please help me.

I run my client side first then server side in my react.js project built using MERN stack and got the error below. Web UI runs well on client side

I run my client side first then server side in my react.js project built using MERN stack and got the error below. Web UI runs well on client side.
If I run the client side first the web interface loads perfectly at localhost:3000 but after running server side and reloading I get the following error how do I fix this?

VM6068:1 Uncaught 
SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at ./src/redux/slices/localSlice.js (localSlice.js:4:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./src/redux/store.js (taskSlice.js:39:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./src/index.js (SidebarContext.js:3:1)

(https://i.sstatic.net/BHsmyiyz.png)

Please assist me in debugging this error