React Material ui scrollable tabs with position fixed

I was using material-ui scrollable tabs (https://mui.com/material-ui/react-tabs/#scrollable-tabs).
like this code..

 <Tabs
        value={value}
        onChange={handleChange}
        variant="scrollable"
        scrollButtons="auto"
        aria-label="scrollable auto tabs example"
        style={{ position: 'fixed', backgroundColor: 'white' }}  // I add this line!
      >
        <Tab label="전체" component={Link} to="/main"></Tab>
        <Tab label="치킨" component={Link} to="/main/chicken"></Tab>
        <Tab label="피자/양식" component={Link} to="/main/pizza"></Tab>
        <Tab label="중식" component={Link} to="/main/chinese" />
        <Tab label="한식" component={Link} to="/main/korean" />
        <Tab label="일식/돈까스" component={Link} to="/main/japanese" />
        <Tab label="족발/보쌈" component={Link} to="/main/pork" />
        <Tab label="야식" component={Link} to="/main/night" />
        <Tab label="분식" component={Link} to="/main/bunsik" />
        <Tab label="카페/디저트" component={Link} to="/main/cafe" />
        <Tab label="편의점/마트" component={Link} to="/main/mart" />
      </Tabs>

In the meantime, I want to immobilize/fix header and scrollable tab when I scroll through the posts like below picture.
so I add style={{position: 'fixed'}}code to header and scrollable tab.
As a result, Fixing header and scrollable tabs works fine.
But in scrollable tab, tab scrolling doesn’t work as well as it used to be.
How can I handle this?? Please help me ….

enter image description here

How to Import SVG icons in React

I wanted to import too many SVG icons in app & each icons required custom color through css, which is the easiest way to import to react?
Importing to <img tag won’t support the color change via css fill.
Creating a .js component for each icon is too hard for 250+ icons.
what is the other option ? Please help

import IconArrow from "./Arrow.svg";
import Circlearrowdownright from "./Arrow.js";

<img className="ico" src={IconArrow} />
<i className="ico"><Circlearrowdownright /></i>

https://codesandbox.io/s/svg-icon-3z0qu6

Detect xhr progress of php form with javascript

I have a form with action php on submit

<form method="POST" action="action.php">
  <input type="text" name="name" />
  <input type="submit" value="submit" />
</form>

this form on submit will load the page on executing the request;

What i want is with javascript, to detect the progress of the request to show user that his submit form is at N %; cause if i have a big treatment in my php, the user will not know where is the progress of his form; if using ajax we can catch the progress of request but with the case of only php form, i have no idea on how to catch the progress

identifying stack trace error based on condition

I am trying to show a different message when the users are getting local storage error. For both android and ios users who access the site. So the below are the two different error messages we are getting when html5 storage is turned off.

SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

SecurityError: The operation is insecure.

So how can i identify that the security error is only related to html5 (local storage) so that i can show user a message. So apart from this local storage error it should be normal. Is there any status code or something which i can get the difference

Change label color in an Input: “radio” when checked [duplicate]

I currently have this in my radio input, the background already changes color, but I also want the labels to change color when I select one, how can I do this?

I want the label to be white when the radio is checked and white when is not, I don’t really know if there’s any good way to implement this

import React, {useState} from 'react'

import './BotonCambioPerfil.css'



function BotonCambioPerfil() {


  return (

    

    <div className="contenedorBotonCambioPerfil">
      

      <label for="perfilChoice1" >
          <input type="radio" id="Asesorado" name="TipoUsuario" value="Asesorado" checked />
          <span
            style={{
              position: "relative",
              left: "18px",
              top: "-35px",
              fontSize: "20px"
            }}
          >
            Alumno
          </span>
        </label>

        <label for="perfilChoice2">
          <input type="radio" id="Asesor" name="TipoUsuario" value="Asesor" checked />
          <span
            style={{
              position: "relative",
              left: "25px",
              top: "-35px",
              fontSize: "20px"
            }}
          >
            Asesor
          </span>
        </label>
    </div>




  );
}
  
  

export default BotonCambioPerfil

BotonCambioPerfil.css

.contenedorBotonCambioPerfil{
    display: flex;
    flex-direction: row;
    width: 10.5%;
    background-color: #50C7F1;

}


.textoPreguntaCerradaEncuesta{
    font-size: 20px;
}

.contenedorBotonCambioPerfil label {
    display: inline-block;
    line-height: 10px;
  }

.contenedorBotonCambioPerfil input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    border: 1px;
    padding: 0.5em;
    width: 100px;
    height: 50px;
  
    background-color: #E5E5E5;
    transition: 0.2s all linear;
  
    position: relative;

    border-radius: 5px;
    
  }
  
.contenedorBotonCambioPerfil input:checked {
    background-color: #50C7F1;
  }

I’m trying to create a simple blog website using MEVN and connected everything to MongoDB but no inputs seem to go through

I have 5 Vue components: home.vue, create.vue, read.vue, update.vue, delete.vue

Whenever I try to create a blog and click the save button, it stays in the page, does nothing, and I check MongoDB compass and see that nothing also changed in my database. It seems as though it is not connected but nodemon tells me that it is connected to mongo: Database name: “db_blogs” which is my database.

Here are all my files except for the node_modules folder:
https://github.com/uzrheinreyes/help-me

vertical mouse wheel slider

i have used vertical slider(Mousewheel control) in my project from https://swiperjs.com/. this is working fine, but i need positions fixed while scrolling a page. as like the following sample link in section four(https://amernitech.com/dev/). pls provide any sample demo.

//html
  <!-- Swiper -->
    <div class="swiper mySwiper hide-tabview page" style="background:green;">
      <div class="swiper-wrapper ">
        <div class="swiper-slide ">
            <section>
                <div class="container">
                    <!-- <div style=" margin-bottom: 50px;"><h2 class="heading heading-h2 text-white" >Creators Dashboard</h2></div> -->
                    <div class="row" style="flex-wrap: nowrap;">
                        <div class="col-xl-6 col-lg-6 col-md-6 " style="align-self:center;">
                            <div class="shadow-number">01</div>
                            <h2 class="heading heading-h3 text-white"> Upload your work</h2>
                            <p class="heading-L mt-4" style="color: #B7B7B7;">Get started by uploading your very own creations of all types to any array of games and projects.</p>
                        </div>
                        <div class="col-xl-6 col-lg-6 col-md-6  " >
                            <img class="img-fluid custom-border-radius slider-image-wd" src="{{asset('public/assets/img/upload1v1new.png')}}"alt="" style="  margin: 0 auto;display: table;">
                        </div>
                    </div>
                </div>
            </section>
        </div>
        <div class="swiper-slide">
          <section>
        <div class="container">
            <div class="row" style="flex-wrap: nowrap;">
                <div class="col-xl-6 col-lg-6 col-md-6 " style="align-self:center;">
                    <div class="shadow-number">02</div>
                    <h2 class="heading heading-h3 text-white">Create Collections</h2>
                    <p class="heading-L mt-4" style="color: #B7B7B7;">If you want to create multiple creations for one game, we provide you with the
                        ability to create “Collections”, so you can bundle all of your work together! </p>
                </div>
                <div class="col-xl-6 col-lg-6 col-md-6  " >
                    <img class="img-fluid custom-border-radius mt-2 slider-image-wd" src="{{asset('public/assets/img/createmusic1.png')}}"alt=""  style=" margin: 0 auto;display: table;">
                </div>
            </div>
        </div>
      </section>
    </div>
    <div class="swiper-slide">
        <section>
            <div class="container">
                <div class="row" style="flex-wrap: nowrap;">
                    <div class="col-xl-6 col-lg-6 col-md-6 " style="align-self:center;">
                        <div class="shadow-number">03</div>
                        <h2 class="heading heading-h3 text-white">Earn Today!</h2>
                        <p class="heading-L mt-4" style="color: #B7B7B7;">Start earning for your creations today! We provide advanced data analytics for all
                            the work product you produce. This way you have a handle on your projects from Day 1.</p>
                    </div>
                    <div class="col-xl-6 col-lg-6 col-md-6" >
                        <img class="img-fluid custom-border-radius slider-image-wd" src="{{asset('public/assets/img/dashboard1n.png')}}"alt="" style="  margin: 0 auto;display: table;">
                    </div>
                </div>
            </div>
        </section>
    </div>
  </div>
  <div class="swiper-pagination"></div>

Which is more optimum to use when adding keys to an object ? – Spread operator with && or ternary if-else operator

Assuming the first_name key is always present in the request body: which is more optimum , method 1 or method 2 ?

const user: any = {}

// Use ternary operator - 1
user.first_name = req.body.first_name ? req.body.first_name : user.first_name

//Or Spread operator with && - 2
user = {
...(req.body.first_name && {'first_name':  req.body.first_name} )
}


user.save()

How can I fix the position of Sticky Header on Scroll?

In Angular application I am trying to shrink header component of Sticky header when user scrolls down. Currently sticky header works fine.

When user scroll down I am able to HIDE TEXT - Header and when user scroll up I can display the text.

The Problem is the header is not fixed when I scroll up. How can I make Header fixed to hide text and only display placeholder, dropdown and button without text?

Here is the link to output which needs to be fixed- https://screenrec.com/share/G4bQcqhOgf

This is what I have tried so far

.header-container {
  width: 100%;
  height: 148px;
  background: grep;
  border-radius: 0px;
  top: 0;
  position: sticky;
  overflow: hidden;
  transition: 0.90s;
}

.header-outer {
  display: flex;
  align-items: center;
  position: sticky;
  height: 120px;
  top: -52px
}
<header class="header-outer">

  <div class="header-container">
    <p class="text">Header</p>
    <div class="placeholder">
      <input customFormInput [(ngModel)]="searchValue" />

    </div>

    <div class="dropdowns">
      <tf-dropdown #dropdown [options]="label" optionLabelKey="name" inlineLabel="Dropdown" [(ngModel)]="singleSelectedVal"></tf-dropdown>
    </div>

    <div class="btn"> <button customFeaturedButton (click)="searchResults()"> Search </button>
    </div>

  </div>
</header>

Convert JSON with only array into Javascript Array [closed]

My .json file was exported by my company’s application. It’s an uncommon type of JSON as it’s only a file with 1 array with some strings inside.
Example [“value1”, “value2”, “value3”]

I need to:

  1. Sync it live so every time it gets overwritten it reflects on the html page without reloading
  2. Display it in a format like: my name is: value1
    my age is: value2
  3. Change the font colour depending on the value (im guessing css and php?)

Currently i have a html/JS webpage to do this. It displays the entire json file as it is and updates quite slow and i am unsure how to extract the values from the json.
I have tried parsing the json file, then
let parsedJSON = Object.values(JSON.parse(fileReader.result));

but it does not produce an array. Here is the whole code: https://pastebin.com/PkSgq4dg