stop carousel slides when mouse is hovered on div

I’ve made(taken from w3) a slideshow styled menu.
I’d like to have it when the user hovers over the menu, the slideshow will stop, and the user takes control manually, then it continues going when the user has left the container.

Currently the auto play doesn’t work as the function isn’t being called by my failing attempt of an event listener.
I’ve tried various methods with my smooth brain, adding params on showSlides that should only work if true. The setTimeout is hard to work out where I should place it, If I leave it in the showSlides, it creates this endless loop.

html

    <div class="hero-navigate">
        
        <a href="" class="">BEGINNERS</a>
        <a href="" class="">UNDER 18's</a>
        <a href="" class="">EXPERIENCED</a>
        <a href="" class="">CLASSES</a>
        <a href="" class="">GROUPS</a>
        <a href="" class="">INFO</a>
    </div>

scss

a {
        width: min-content;
        display: block;
        color: #fae3df;
        text-decoration: none;
        font-family: lato, sans-serif;
        font-weight: 900;
        font-size: 4.5vw;
        white-space: nowrap;
        transform: skew(0deg, -6deg);
        line-height: 5.5vw;
        transition: 0.2s;

    }
    a:hover, .hover {
        color: #31368a;
        font-size: 5vw;
        transition: 0.5s;
    }

js

let slideIndex = 0;     
const hero = document.querySelector('.hero-navigate');
const aTags = document.querySelectorAll('.hero-navigate a');

document.addEventListener('mousemove', (event) => {
  if(event.target !== hero){
    setTimeout(showSlides(), 1800);
});

function showSlides() {
  // code removing current hover
    var i;
  
  for (i = 0; i < aTags.length; i++) {
    aTags[i].classList.remove("hover");
  }
  //adding hover using slideIndex
  slideIndex++;
  if (slideIndex > aTags.length) {slideIndex = 1}
  aTags[slideIndex-1].classList.add('hover')
} 

RegEx filter for webNavigation.onCompleted listener not working

This is my extension code, no way to have the listener trigger, I also tried removing the filters whole but nothing, it must be one of those dumb mistakes that I cannot see:

    const filter_1 = {
      url:
      [
        {urlMatches: "^w*://w*.creoweb.com/data/$"},
        {urlMatches: "^w*://w*.creoweb.com/cp/w*/history/$"}
      ]
  };

    const filter_2 = {
      url:
      [    
        {urlMatches: "^w*://w*.creoweb.com/user/d+/panel/$"}
      ]
  };  


function sample1(details) {
  console.log(`onCompleted => sample1: ${details.url}`);
}

function sample2(details) {
  console.log(`onCompleted => sample2: ${details.url}`);
}

console.log('here'); //this trigger
browser.webNavigation.onCompleted.addListener(sample1, filter_1);
console.log('here 2'); //this never 
browser.webNavigation.onCompleted.addListener(sample2, filter_2);
console.log('here 3'); //this never

how to split on specific string in nodejs?

I want to split string for “>” but not when >> in JavaScript.

But once I am doing a split const words = str.split('>'); it is splitting >> as well.

Currently, after the split I look for “> >” and then substitute them with “>>”.

How to implement it properly.

How can I fix the** `’post’ is not defined

I’m getting lost on How can I fix the 'post' is not defined before was working with the same function but now trying to figure out why did stop working the starting that error is beginning is at {posts.map(function (post) {

  1. How would you solve this problem if you encountered it for the first
    time?
  return ( // This where you be rendering your post.
    <div id="content">
      <Layout location={location} title={siteTitle}>
        <Seo title="All posts" />

        <ol className="inline_blog" style={{ listStyle: `none` }}>
        {posts.map(function (post) {
                const title = post.frontmatter.title || post.fields.slug

                let image = getImage(nodes.frontmatter.featuredimage) // this is getting the post cover image
                let alt = post.frontmatter.title // this is getting the title of the post

                return (
                    <li key={post.fields.slug}>
                        <article
                            className="post-list-item"
                            itemScope
                            itemType="http://schema.org/Article">

                            <header>
                                <div className="cover_image">
                                    <CoverImage
                                        image={image}
                                        alt={alt} />
                                </div>

                                <small>
                                    {post.frontmatter.date}
                                </small>

                                <h2 className="post_heading_title">
                                    <Link to={post.fields.slug} itemProp="url">
                                        <span
                                            itemProp="headline">
                                            {title}
                                        </span>
                                    </Link>
                                </h2>
                            </header>

                            <section>
                                <p dangerouslySetInnerHTML=
                                  {{   
                                    __html: post.frontmatter.description || post.excerpt, 
                                  }}
                                itemProp="description" />
                            </section>
                        </article>
                    </li>
                );
            })}
        </ol>
      </Layout>
    </div>
  )

How can i javascript in mustasche

I want to use javascript inside the mustache template. (test.mustache)

https://test.com/?lang=en

<script>
let query = window.location.search;
console.log(query);
</script>

I got ?lang=en with the above code.

{{#cats}}
<a href="{{link}}" class="ui label-lsc" style="background-color: {{wpsc_cat_bg_color}}; color: {{wpsc_cat_color}};">{{{value}}}</a>
{{/cats}}

i in this code
I want to append ?lang=en after {{link}}.

Is there any way?

How can i get reponse back from service without delay in angularjs?

When I call the service method from the controller it returns data with delay and I need this response to populate the dropdown

EXPECTATION :
When I call this method from the controller it should return a response immediately then other logic should run after this.

Service Code

app
    .service('UserAccounts', ['$http', '$q', function ($http, $q) {
       
        var deferred = $q.defer();
        var allInvoices;
        this.vendorPromise = $http.get('api/invoices/getAllinvoices', { params: { cache: false } }).then(
            function (response){
                Invoices = response.data;
                deferred.resolve(Invoices);
            }).catch(function (err){
           

        });

        
        this.findUserByNameEmail = function (Name, email) {
            if (allInvoices) {
                return $q.when(allInvoices.filter(function (vendor) {
                    return user.ReceivingLegalName == Name && user.ReceivingEmail == email ;
                }));
            }
            else {
                var findDeferred = $q.defer();
                deferred.promise.then(function (Invoices) {
                    findDeferred.resolve(Invoices.filter(function (user) {
                        return user.ReceivingLegalName == Name && user.ReceivingEmail == email ;
                    }));
                });
                return findDeferred.promise;
            }
        };
        
     

    }]);

Controller code :

UserAccounts.findUserByNameEmail($scope.invoice.userName, $scope.invoice.email).then(
                        function (invoiceDetails) {
                            
                         $scope.InvoiceList = invoiceDetails;
                            
                        });

when I try to do it like this it returns a response immediately but gets value inside $$state

$scope.InvoiceList = UserAccounts.findUserByNameEmail($scope.invoice.userName, $scope.invoice.email);

enter image description here

Looks like .then takes some time to return response .could some one help me here

I want to check that any phone number entered MUST start with a Zero

I’m working with a materialui component and I’m trying to get the input to force the user to start with a 0 when entering a phone number. We have a dropdown on the side that specifies that Areacode and I want to keep things nice and clean.

My issue is that I’m not that clued up on regular expressions and if that is even the way to go about solving this issue?

Can someone please help me out with suggestions?

Fire Fox does not count table rows in NVDA Screen Reader, but does in Chrome

I am trying to make an accessible expandable table (taking this as inspiration: https://fuschia-stretch.glitch.me/ , check out “View souce”), but the NVDA screen reader do not read the number of columns in Fire Fox, but reads them in Chrome. Here are some examples:

// It seems like it is this block that is causing it to not count in Fire Fox, but it counts in Chrome, what can the reason be? Or how to solve this?
tr {
  display: flex;
  flex-flow: row wrap;
}

Thank you for all help

here my keydown event listener is not working any idea why ..?

i have been trying to add event listeners to keyboard so when respective keys are pressed a sound is made but the code that i have written is not working properly
i have been trying to add event listeners to keyboard so when respective keys are pressed a sound is made but the code that i have written is not working properly

// Detecting keyboard press
document.addEventListener('keydown',function(event){
makeSound(event.key);
});


//  detecting which key is pressed and producing subsequent tune
  function makeSound(key)
{
switch (key) {
    case "w":
          var tom1 = new Audio("sounds/tom-1.mp3");
          tom1.play() ;
          break;
    case "a":
          var tom2 = new Audio("sounds/tom-2.mp3");
          tom2.play() ;
          break;
   case "s":
          var tom3 = new Audio("sounds/tom-3.mp3");
          tom3.play() ;
          break;
   case "d":
          var tom4 = new Audio("sounds/tom-4.mp3");
          tom4.play() ;
          break;
   case "j":
          var snare = new Audio("sounds/snare.mp3");
          snare.play() ;
          break;
   case "k":
          var kickbass = new Audio("sounds/kick-bass.mp3");
          kickbass.play() ;
          break;
   case "l":
          var crash = new Audio("sounds/crash.mp3");
          crash.play() ;
          break;

    default: console.log(buttonInnerHTML)
        break;
       }}

Is it possible to see the JS related to the element in DevTools?

In the browser whenever I want to see a CSS added to the element I see it in the Styles section:

enter image description here

But what if I want to see a JS related to the element? Like, for example, a reference to the HTML element in a variable or that same variable related to functions, objects, and so on. Would it be possible in the same way as CSS?

I ask this because whenever I want to see some behavior in the element using JS I have to open the source code of the page in the browser and search line by line until I find the element code and that ends up being a lot of work.

Prisma js ORM – how to filter for results that have entry in a related table (effectively JOIN)?

I have 2 tables:

model Collection {
    id                String                 @id @default(uuid()) @db.Uuid/
    floorPrices       CollectionFloorPrice[]
}

model CollectionFloorPrice {
    id           String     @id @default(uuid()) @db.Uuid
    collection   Collection @relation(fields: [collectionId], references: [id])
    collectionId String     @db.Uuid
}

How do I query collections that only have rows present in CollectionFloorPrice? In SQL it would be a simple JOIN.

This isn’t working:

    return await this.prisma.collection.findMany({
      where: {
        floorPrices: {
          exists: true,
        },
      },
    });

Filter array of object based on date range

This problem is quite easy but I still can’t handle it.
I have an array of object let’s say something like:

const array = [{id:1,created_at: 2022-03-14T16:40:10.000000Z}, {id:2, created_at:2022-03-15T16:40:10.000000Z}

I want to filter element using moment.js, and having back only the element that have date of creation of today.

What i want to achieved is something like this:

const filtered = array.filter((item)=> item.created_at >= startOfToday && item.created_at <= endOfToday

Filtered will look like: [0]{id:2, created_at:2022-03-15T16:40:10.000000Z}

Thanks in advance for any tips/answers.

How to listen the values existing in the cells then add the reminder in angular?

I have a table to input quarterly data.
whiteboard

In the table, Q1 means quarter one, Jan, Feb and March etc. The user has to input data by the end of the quarter by the current data. Say toady is 3/16/2022 so it is in Q1. Because user can be forgetting to input the data so I want to add the reminder on the top.

My thought is that when page loading, I search the values in cells. If they are null the add the reminder. Also in input event to detect the values in input elements.

But I am not sure if this the best way to do that. Should I use some of listen event to implement it?

Scraping dynamic JavaScript website with login using beautifulsoup

WIN10 64bit
Python 3.8

First, I would note that I already have a solution with Selenium but scrape time is slow(even combination of Selenium & bs)

As of now I do have a script with bs that logs in and navigates to different pages under the same session. problem is, I’m having issues rendering the page to load js content before scraping it.

Unfortunately I can’t share code due to security reasons but I Would appreciate any suggestions as to how to go about this. would consider any fast solution that can do the job.

Again sorry for the lack of code but I’m basically searching for method/s to solve the issue.

Thanks