Why is the charging animation is not working



<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Page title</title>

    <style>

        div{

            background: green;

            width: 700px;

            height: 900px;

            margin: 0 auto;

            text-align: center;

        }

        .dot{

            background: #55eaff9d;

            width: 80px;

            height: 80px;

            border-radius: 30px;

            border: 2px solid black;

            margin: 10px 10px;

        }

        .blink{

            background: lightgreen;

            

        }

    </style>

</head>

<body>

    <div>

        

    </div>

</body>

<script>

    let container = document.querySelector("div");

    let dots = [];

    for(let i = 1; i <= 6; i++) {

        let dot = document.createElement("canvas");

        dot.classList.add("dot");

        let currentID = "dot" + i;

        dot.id = currentID;

        dots.push(currentID);

        container.append(dot);

        

    }

    console.log(dots)

    function changeColorRandom(index) {

        id = "dot" + (index + 1);

        let element = document.getElementById(id);

        element.classList.add("blink");

    }

    function sleep(ms) {

        return new Promise(resolve => setTimeout(resolve, ms));

    }

    async function powerAll(ids) {

        for(id of ids) {

            element = document.getElementById(id);

            element.classList.add("blink")

            await sleep(500);

        }

    }

    function clearAll(ids) {

        for(id of ids) {

            element = document.getElementById(id);

            element.classList.remove("blink");

        }

    }

    setInterval(async function() {

    await powerAll(dots);

    clearAll(dots);

}, 1000);

</script>

</html>


Hello, can somebody please try to run this code and see why it does not work as it should? It should look like charging animation repeatedly.

I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.
I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.
I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.I tried everything, but nothing helped me. Please somebody help me in this code!!! I know i am misunderstanding something here.

background image lorsque en click en react native

enter image description here“Erreur: When I click on the image in React Native, it does not work i want to add a backgroud . Fix the errors in this paragraph for me.” any idea to the css the clicked button is working {ImagesLoisirsA.map((item, index) => (
<View

    key={index} style={{gap : 4 , paddingVertical: 4, paddingHorizontal: 2 ,alignItems :"center" , flexDirection:"column" }}>
        <TouchableOpacity
      key={index}
      onPress={() => handelImagePress(index)}
      style={[ 
        selectedImages.includes(index)  && styless.selectedImage
      ]}
    > 
        <Image       style={[
        styless.imageContainer, 
      ]} source={item.image} 

/>

 </TouchableOpacity>

      <Text style={styless.textItem}>{item.name}</Text>

    </View>
  ))}

render the last days of the previous month within a for loop

I’m trying to render the last few days from the last month, however, the days are not rendering in the proper squares.

enter image description here

Ideally Tuesday should be the 31st, Monday should be the 30th, and so on.

How could i go about making such changes that reflects the correct days in the respective squares ?

index.ts

let nav = 0;
const getCalendar = document.getElementById("calendar") as any;
const weekDays = [
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday",
];
function nextButton() {
  document.getElementById("nextButton")?.addEventListener("click", () => {
    nav++;
    render();
  });
}

function backButton() {
  document.getElementById("backButton")?.addEventListener("click", () => {
    nav--;
    render();
  });
}

function render() {
  const dt = new Date();

  if (nav !== 0) {
    dt.setMonth(new Date().getMonth() + nav);
  }

  const day = dt.getDate();
  const month = dt.getMonth();
  const year = dt.getFullYear();
  const firstDayOfMonth = new Date(year, month, 1);
  const daysInMonth = new Date(year, month + 1, 0).getDate();

  const lastDateOfLastMonth = new Date(year, month, 0).getDate();

  const dateString = firstDayOfMonth.toLocaleString("en-us", {
    weekday: "long",
    year: "numeric",
    month: "numeric",
    day: "numeric",
  });

  const getFirstDayMonth = dateString.split(", ")[0]; // Wednesday
  const days = weekDays.indexOf(getFirstDayMonth);

  (
    document.getElementById("month-heading") as any
  ).innerText = `${dt.toLocaleDateString("en-us", { month: "long" })} ${year}`;
  getCalendar.innerHTML = "";

  for (let i = 1; i <= days + daysInMonth; i++) {
    const square = document.createElement("div") as any;
    square.classList.add("day");

    const addedDay = i - days;

    /**
     * if the index is greater than the first day of the month add text for numbers
     *
     * else add padding squares
     */

    if (i > days) {
      square.innerText = addedDay;

      if (addedDay === day && nav === 0) {
        square.id = "currentDay";
      }
    } else {
     

      // enter the last few days of last month here this is where i might be doing 
      // something wrong 


      square.innerText = lastDateOfLastMonth - i + 1;

      // square.classList.add("padding");
    }
    getCalendar?.appendChild(square);
  }
}

nextButton();
backButton();

render();

HTML

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>Some Calendar</title>
        <link rel="stylesheet" href="style.css" />
    </head>
    <body>
        <div class="container">
            <div class="calendar-body">
                <div id="header">
                    <h1 id="month-heading"></h1>
                    <div>
                        <button id="backButton">Back</button>
                        <button id="nextButton">Next</button>
                    </div>
                </div>
                <div id="weekdays">
                  <div>Sunday</div>
                  <div>Monday</div>
                  <div>Tuesday</div>
                  <div>Wednesday</div>
                  <div>Thursday</div>
                  <div>Friday</div>
                  <div>Saturday</div>
                </div>

                <div id="calendar"></div>
            </div>
        </div>

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

Analysis of Productivity Between Statically and Dynamically Typed Programming Languages [closed]

This survey is willing to determine the relationship between software developers tools, particularly STATICALLY VS DINAMICALLY TYPED programming languages, and the effect they have on project completion time, code quality and mantainability, learning curve etc.
A colleague from university are conducting this survey for our final Applied Reseaach and Data Analysis report,

you help will be greatly appreciated!

link to survey:

https://forms.gle/3TaU7jvHsc5zbW7h9

My project was running fine on GoggleAppScript. However after trying to launch it again it leads with an error message

My program is a signature pad which would use google app script as the platform. It was working as plan however, I was trying to relaunch my program and see the web app again but now the appp launches with an error message. Not sure if it is on the fault of google or my code (https://i.stack.imgur.com/RJKiJ.png)](https://i.stack.imgur.com/RJKiJ.png)

HTML:

<!doctype html>
<html lang="en">
  <head>
    
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <title>Sam's Place</title>
  </head>
 
 
  <body>
    <header id = "header">
    <div id = "app" class = "container">
      <nav>
        <div class = "margin text-center">
        <div class = "canvas mx-auto">
          <ul> 
            <li><a href="index.html">Home</a></li>
          </ul> 
      </div>
    </div>
  </nav>
  </header>
  
  <main> 
    <div class = "margin text-center">
      <div class = "canvas mx-auto">
        <h1> Important Contract </h1>
        <p> Description </p>
        <canvas id = "sig" width = "400px" height = "100px" class = "border"> </canvas>
        <div> 
          <button type="button" class="btn btn-dark" id ="clearSig">Clear</button>
          <button type="button" class="btn btn-dark" id ="send">Send</button>
      </div>
      </div>
    </div>
  </main>

    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.umd.min.js"></script>
    <script>

          var signaturePad;
          function setupSignatureBox(){
            var canvas = document.getElementById("sig");
            signaturePad = new SignaturePad(canvas);
          }

          function clearSignature(){
            signaturePad.clear();
          }

          function sendToDrive(){
            var imageData = signaturePad.toDataURL();
            google.script.run.recieveSignature(imageData);
          }

          document.getElementById("clearSig").addEventListener("click",clearSignature);
          document.getElementById("send").addEventListener("click",sendToDrive);
          document.addEventListener("DOMContentLoaded",setupSignatureBox);
    </script>
  </body>
</html>

JS (GS):

function doGet() {
  return HtmlService.createTemplateFromFile("index").evaluate();
}

function recieveSignature(encodedImage){
  const data = encodedImage.split(",")[1];
  const dataDecoded = Utilities.base64Decode(data);
  const signatureAsPictureBlob = Utilities.newBlob(dataDecoded).setName("somefile.png");
  DriveApp.getFolderById("1DlVK84J9gVjfk5Gepw9L2pOhfMCFk74Q").createFile(signatureAsPictureBlob);
}

Converting existing code in ASP.net MVC to React

I have a piece of code in ASP.net MVC and want to use it in React js (gateway is response of an API)

var form = document.createElement("form");
form.setAttribute("method", "POST");
form.setAttribute("action", gateway.URL);
form.setAttribute("target", "_self");

gateway.Data.map(function (item, index) {
if (item != undefined) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("name", item.Key);
hiddenField.setAttribute("value", item.Value);
form.appendChild(hiddenField);
}
});

document.body.appendChild(form);
form.submit();
document.body.removeChild(form);

I use below code, but doesn’t work (

 return(
   <form onSubmit = {()=>{
      window.location.href = gateway.URL;
   }}>
   {gateway.Data.map(item =>  {
     <input name={item.Key} value ={item.Value}></input>
   })};
   <button type = 'submit'>Click to submit</button>
   </form>
 );

Swiper JS – Go To Slide By Clicking On A Seperate Element

I’ve been struggling with this functionality for the past few days as I am still learning javascript.

I’m using Swiper JS in my website and I have a list of links that are outside my swiper instance.

//SWIPER JS
$(".slider-main_component").each(function (index) {
  let loopMode = false;
  if ($(this).attr("loop-mode") === "true") {
    loopMode = true;
  }
  let sliderDuration = 300;
  if ($(this).attr("slider-duration") !== undefined) {
    sliderDuration = +$(this).attr("slider-duration");
  }
  const swiper = new Swiper($(this).find(".swiper")[0], {
    speed: sliderDuration,
    loop: loopMode,
    autoHeight: false,
    centeredSlides: false,
    followFinger: true,
    freeMode: false,
    slideToClickedSlide: true,
    slidesPerView: 1,
    spaceBetween: "4%",
    rewind: false,
    mousewheel: {
      forceToAxis: true
    },
    keyboard: {
      enabled: true,
      onlyInViewport: true
    },
    breakpoints: {
      // mobile landscape
      480: {
        slidesPerView: 1,
        spaceBetween: "4%"
      },
      // tablet
      768: {
        slidesPerView: 1,
        spaceBetween: "4%"
      },
      // desktop
      992: {
        slidesPerView: 1,
        spaceBetween: "2%"
      }
    },
    pagination: {
      el: $(this).find(".swiper-bullet-wrapper")[0],
      bulletActiveClass: "is-active",
      bulletClass: "swiper-bullet",
      bulletElement: "button",
      clickable: true
    },
    navigation: {
      nextEl: $(this).find(".swiper-next")[0],
      prevEl: $(this).find(".swiper-prev")[0],
      disabledClass: "is-disabled"
    },
    scrollbar: {
      el: $(this).find(".swiper-drag-wrapper")[0],
      draggable: true,
      dragClass: "swiper-drag",
      snapOnRelease: true
    },
    slideActiveClass: "is-active",
    slideDuplicateActiveClass: "is-active"
  });

  swiper.on("slideChange", function (e) {
    $(".tab-link").eq(e.realIndex).click();
  });
});

I am trying to add some additional functionality that when I click on a link with the class of .home-gift-dropdown_dropdown-link, find the index of that .home-gift-dropdown_dropdown-link and then go to the slide that matches the index

After changing my package name i got an error in run time file .which is not exist in my project

enter image description here
Amidst refining my Android project, I embarked on the task of altering the package name. However, upon making this change, an unexpected error surfaced, impeding the progression of the modification. The attempt to modify the package name within the Android framework led to an error that requires attention and resolution. Seeking guidance or insights to address this obstacle in an elegant and effective manner.

Google Maps API – How to pull location of liquor stores based on user entering their loacation? [closed]

I am 1 month in to learning web development. I want to use the Google Maps API to develop a feature for a project website.
When a user enters their location(preferably zip code) it will render a static map with the location of liquor stores in the area.

Im brand new to using APIs so Im looking for a little guidance approaching this API.

click function in js stacking up

I need some help with my js code…

I am currently trying to make some keyboard shortcuts to make my job a little bit faster and I wrote this code that runs using violent monkey everytime I load the site.

var reloadButton = document.getElementById("btnSearchAll");
document.addEventListener('keydown', (event) => {
    if(event.altKey && event.key == "r") {
    reloadButton.click();
  }
});

The problem is that for every time I use this shortcut, the click function of the button I am trying to click stacks up. the first time I use it, it clicks once, the second time it fires twice and so on.

I tried making some logic into it using if statements and adding an event listener for when I let go of the keys but it doesn’t seem to work.

I’m not really that good with javascript so I’m asking for your help. what does the issue seem to be?

Issue with Swiper.js Infinite Loop

So I have been succesfully using a cool “double vertical Swiper.js slider” for my hero sections on some sites for the last couple of years. The two in production right now are using swiper.js 9 and work great.

www.thehendrix.gi
www.adrenalinecombatives.com

The issue is pertinent to where the loop restarts. On the two aforementioned sites, I have set overflow: hidden on the hero section (.section1) and the swipers in .section1-column2 successfully restart their loop where the overflow is set on the aforementioned .section1 parent. Creating a nice effect.

However, on my current implementation using React Swiper.js 11, the loop is only restarting where the swiper/swiper-wrapper begins and not the where the parent element overflow: hidden is set. causing a little gap between the padding of the overflow and where the .section1-column2 begins containing the swiper.

Any ideas how to fix this? Or should I provide code of the React Swiper.js 11 implementation not working too? Thanks

Have tried loopAdditionalSlides, but not working. Also reverting to Swiper 9. Maybe an issue with React Swiper?

How to hide a card when it reaches the outside of a container but have them be able to scroll in to view? [closed]

I want the card to hide when they reach the outside of the container div. With the effect that they are going behind the edge.

I have tried adding overflow-x: scroll. Tried adding a class of hidden with its opacity set to zero using javascript when a card reaches the edge.

I have also tried a number of things I have found online, some of which make no sense to me.

My Code