making sidebar and navbar responsive in mobile screens in react

so basically sidebar and navbar is both different components in my code i have navbar.jsx and sidebar.jsx and both are being called under student.jsx … now on mobile screens i want that the sidebar also gets into that hamburger icon in the navbar when on mobile screens and that user can navigate different pages such as dashboard counselling etc when clicked on the icon which contains the sidebar and its different pages

i tried to hide the sidebar in mobile screen my putting the css display none in mobile screens and tried using usestate hook and toggle logic but i cant put the sidebar in the navbar and i want them to be different just in mobile screens they should be together this is what its looking like right now

Web animation API composite accumulate

I’m trying to understand if it’s possible to accumulate animations with the Web API animation and I can’t seem to figure it out.

//move element very fast to 100,100 with no duration
el.animate([{transform: 'translate(100px, 100px'}], {duration: 0, fill: 'forwards'});

//add another movement after that with duration
el.animate([{transform: 'translateX(300px)'}], {duration: 0, fill: 'forwards', composite: 'accumulate'});

Everything happens properly, the box moves to 100,100 then the animation starts. The problem is, at the end of the animation, the boxes moves up like it has suddenly lost the Y transform. It is possible to keep the Y transform at the end? I thought fill: 'forwards' + composite : 'accumulate' would do that …

Note: once in a while, it does behave properly so I’m not sure what’s going on

const el = document.querySelector('.box');

el.animate([{transform: 'translate(100px, 100px'}], {duration: 0, fill: 'forwards'});

el.animate([{transform: 'translateX(200px)'}], {duration: 2000, fill: 'forwards', composite: 'accumulate'});
.container{
  display: block;
  height: 100vh;
  overflow: hidden;
}
.box{
  position: absolute;
  width: 300px;
  height: 200px;
  background-color: brown;
 }
<div class="container">
  <div class="box">  
  </div>
</div>

JsFiddle

How can I obtain a URL to share my react project built using EXPO

I have built a small project and I want to share it with my friend that have both ios and android devices however the npx expo publish command doesnt work cause it has been deprecated.

I have also built the project using EAS update and I have uploaded the project to the expo store

I dont want to publish my app neither on App-Store nor on Play-Store

I only get this console message after building the project using eas update --branch development --platform android


Branch             development
Runtime version    1.0.0
Platform           android, ios
Update group ID    fea6d627-d9d2-49cb-9516-be6f25fbf713
Android update ID  5cb94dcd-fee0-4767-85ec-31741744790f
iOS update ID      0f396149-f63f-494d-8f7b-d0a8305c0fc3
Message            Initial commit
Commit             05203e1673112b0c5bb13b938ad8934bb08d2fc1*
EAS Dashboard      https://expo.dev/accounts/manfomaiva/projects/native-react/updates/fea6d627-

How can i check the properties inside an object accessed by it’s own function?

I’m trying out things to understand how it works.. not sure how would i be able to get the ID for example?

const opciones = [{
        id: 0,
        texto: "Inicio",
        descripcionTitulo: "Bienvenido al programa de carga de Viajes",
        descripcion: "Selecciona lo que quieras hacer",
        icon: <FaCheckCircle />,
        next: function next() {
                console.log(this.id)
        },
        contenido: <Inicio setToggle={setToggle} />,
        botonSiguiente: "Nuevo Viaje"
    },
    {
        id: 1,
        texto: "Descripción",
        descripcionTitulo: "Descripcion",
        descripcion: "detalles importantes",
        icon: <FaBookOpen />,
        next: function next() {

        },
        contenido: <Descripcion setToggle={setToggle} />,
        botonSiguiente: "Siguiente"

    }
    ]

i have a function inside my object and i’m trying to log it’s ID inside it’s own function if it makes sense.. i’m not sure how do I access it?
I’m getting undefined onclick if i try to log “this.id”

How to decide Function chaining priority

I have a problem link

Where I have only 3 requirements:

  1. Create a function that logs a message with whatever passed in arguements
  2. Chain mutiple methods on it.
  3. Give priority in execution of method chaining (e.g. here we need to give priority to sleepFirst, irrespective of its order.)
const LazyMan = (name, logFn)=>{
    logFn(`Hi, I'm ${name}.`)
    return []
}
Array.prototype.sleepFirst = function (time) {
    console.log(`Wake up after ${time} seconds.`)
    return this;
}

Array.prototype.eat = function (food){
    console.log(`Eat ${food}`)
    return this;
}

Array.prototype.sleep = function (second){
    console.log(`Wake up after ${second} seconds.`)
    return this;
}


LazyMan('Ashish', console.log).eat('apple').sleep(10).sleepFirst(20)

Current Output:

Hi, I’m Ashish.

Eat apple

Wake up after 10 seconds.

Wake up after 20 seconds.

Expected Output:

Wake up after 20 seconds.

Hi, I’m Ashish.

Eat apple

Wake up after 10 seconds.

Scroll Event Listener Not Working in Vue 3 Component

Question:

I’m working on a Vue 3 component where I want to add a scroll event listener to change the header’s style when the user scrolls down the page. However, the event listener doesn’t seem to work, and no console logs appear when I scroll.

Here is a simplified version of my code:

<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue';

const isScrolled = ref(false);

const handleScroll = () => {
  if (window.scrollY > 50) {
    isScrolled.value = true;
  } else {
    isScrolled.value = false;
  }
  console.log('isScrolled', isScrolled.value);
};

onMounted(() => {
  console.log('Mounted and adding scroll listener');
  window.addEventListener('scroll', handleScroll);
});

onUnmounted(() => {
  console.log('Removing scroll listener');
  window.removeEventListener('scroll', handleScroll);
});
</script>

Problem:

The scroll event listener is added in onMounted, but it doesn’t trigger when I scroll the page. There’s no console output, and the isScrolled value doesn’t change.

What I’ve Tried:

Verified that the component mounts correctly (logs appear in the console during mounting).
Simplified the event listener to just log to the console, but still no success.

Onchange for with size value

You can notice that if you put size into select – onchange stops working. There is “onfocus” even but it doesn’t work either because you have to click outside select every time.
Is there a way to make a working “onchange” event for select with size?

<select name="fruits" size="5">
  <option>banana</option>
  <option>cherry</option>
  <option>strawberry</option>
  <option>durian</option>
  <option>blueberry</option>
</select>

React Select Custom SingleValue Button Not Clickable

I am trying to add an edit button (which currently triggers an alert) to my react-select component. However, this makes the newly added button unclickable; instead, it opens the react-select menu. Stopping propagation does not solve the issue.

const CustomOption = (props) => {
  const handleEdit = (e) => {
    e.stopPropagation();
    alert("This is working like I want");
  };

  return (
    <components.Option {...props}>
      <div className="test">
        <span>{props.children}</span>
        <button onClick={handleEdit}>Edit</button>
      </div>
    </components.Option>
  );
};
export default function App() {
  const option = [
    { value: "Spring", label: "Spring" },
    { value: "Summer", label: "Summer" },
    { value: "Autumn", label: "Autumn" },
    { value: "Winter", label: "Winter" },
  ];

  return (
    <div className="App">
      <Select
        className="dropdown"
        options={option}
        components={{ SingleValue: CustomSingleValue }}
      />
    </div>
  );
}

Question: Why doesn’t the button inside CustomSingleValue work (while the one inside CustomOption does), and how can I fix it?

Code SandBox

This is especially frustrating because CustomOption, which uses the exact same code, works fine.

Working vs not working

Full code including working CustomOption:

// This isn't working like I want
const CustomSingleValue = (props) => {
  const handleEdit = (e) => {
    e.stopPropagation();
    alert("This I can't click");
  };

  return (
    <components.SingleValue {...props}>
      <div className="test">
        <span>{props.children}</span>
        <div>
          <button onClick={handleEdit}>Edit</button>
        </div>
      </div>
    </components.SingleValue>
  );
};

// This is working how I want
const CustomOption = (props) => {
  const handleEdit = (e) => {
    e.stopPropagation();
    alert("This is working like I want");
  };

  return (
    <components.Option {...props}>
      <div className="test">
        <span>{props.children}</span>
        <button onClick={handleEdit}>Edit</button>
      </div>
    </components.Option>
  );
};
export default function App() {
  const option = [
    { value: "Spring", label: "Spring" },
    { value: "Summer", label: "Summer" },
    { value: "Autumn", label: "Autumn" },
    { value: "Winter", label: "Winter" },
  ];

  return (
    <div className="App">
      <Select
        className="dropdown"
        options={option}
        placeholder="Click on a option and then try to click the edit button"
        components={{ SingleValue: CustomSingleValue, Option: CustomOption }}
      />
    </div>
  );
}

Flickering when scrolling left when first column frozen DataGrid

When the first column hovers over the combobox it starts to flicker, when I scroll past the checkboxes it disappears completely.
I’ve tried style changes but that doesn’t help, I’ve searched on the internet, I haven’t found anything either. GPT chat doesn’t help either.
What can be done about this?

enter image description here

I have table in react:

import React, { useEffect, useState } from 'react';
import axios from 'axios';
import { DataGrid, GridActionsCellItem } from '@mui/x-data-grid';
import { Button, TextField, Dialog, DialogActions, DialogContent, DialogTitle, Checkbox, Box, MenuItem, Select } from '@mui/material';
import DeleteIcon from '@mui/icons-material/Delete';
import { saveAs } from 'file-saver';
import { tableStyles, columnModel } from './TableStyle'; // Import stylów

const Table = () => {
  const [data, setData] = useState([]);
  const [newRow, setNewRow] = useState({
    nazwa: '',
    comments: '',
    weight: '',
    type: '',
    t: false,
  });
  const [open, setOpen] = useState(false);

  useEffect(() => {
    const fetchData = async () => {
      try {
        const token = localStorage.getItem('token');
        const response = await axios.post(`${process.env.REACT_APP_API_URL}/database`, {
          operation: 'fetch',
        }, {
          headers: {
            Authorization: `Bearer ${token}`,
          },
        });
        const fetchedData = response.data.map((row, index) => ({
          id: row.id || index, // Ensure each row has a unique id
          ...row,
        }));
        setData(fetchedData);
      } catch (err) {
        console.error('Error fetching data', err);
      }
    };

    fetchData();
  }, []);

  const handleEditCellChange = async (newRow) => {
    const updatedRow = data.find((row) => row.id === newRow.id);
    if (updatedRow) {
      try {
        const token = localStorage.getItem('token');
        await axios.post(`${process.env.REACT_APP_API_URL}/database`, {
          operation: 'update',
          id: newRow.id,
          data: newRow,
        }, {
          headers: {
            Authorization: `Bearer ${token}`,
          },
        });
        setData(data.map(row => (row.id === newRow.id ? newRow : row)));
      } catch (err) {
        console.error('Error updating data', err);
      }
    }
    return newRow;
  };

  const handleToggleCheckbox = async (id, field, value) => {
    const updatedRow = data.find((row) => row.id === id);
    if (updatedRow) {
      const updatedData = { ...updatedRow, [field]: value };
      try {
        const token = localStorage.getItem('token');
        await axios.post(`${process.env.REACT_APP_API_URL}/database`, {
          operation: 'update',
          id,
          data: updatedData,
        }, {
          headers: {
            Authorization: `Bearer ${token}`,
          },
        });
        setData(data.map(row => (row.id === id ? updatedData : row)));
      } catch (err) {
        console.error('Error updating data', err);
      }
    }
  };

  const handleSelectChange = async (id, field, value) => {
    const updatedRow = data.find((row) => row.id === id);
    if (updatedRow) {
      const updatedData = { ...updatedRow, [field]: value };
      try {
        const token = localStorage.getItem('token');
        await axios.post(`${process.env.REACT_APP_API_URL}/database`, {
          operation: 'update',
          id,
          data: updatedData,
        }, {
          headers: {
            Authorization: `Bearer ${token}`,
          },
        });
        setData(data.map(row => (row.id === id ? updatedData : row)));
      } catch (err) {
        console.error('Error updating data', err);
      }
    }
  };

  const handleAddRowChange = (e) => {
    const { name, value, type, checked } = e.target;
    setNewRow({
      ...newRow,
      [name]: type === 'checkbox' ? checked : value,
    });
  };

  const handleAddRow = async () => {
    try {
      const token = localStorage.getItem('token');
      const response = await axios.post(`${process.env.REACT_APP_API_URL}/database`, {
        operation: 'add',
        data: newRow,
      }, {
        headers: {
          Authorization: `Bearer ${token}`,
        },
      });
      setData([...data, { ...newRow, id: response.data.id || data.length }]);
      setNewRow({
        nazwa: '',
        comments: '',
        weight: '',
        type: '',
        t: false,
      });
      setOpen(false);
    } catch (err) {
      console.error('Error adding row', err);
    }
  };

  const handleDeleteRow = async (id) => {
    try {
      const token = localStorage.getItem('token');
      await axios.post(`${process.env.REACT_APP_API_URL}/database`, {
        operation: 'delete',
        id,
      }, {
        headers: {
          Authorization: `Bearer ${token}`,
        },
      });
      setData(data.filter(row => row.id !== id));
    } catch (err) {
      console.error('Error deleting data', err);
    }
  };

 const handleDownloadExcel = async () => {
    try {
        const token = localStorage.getItem('token');
        const response = await axios.post(`${process.env.REACT_APP_API_URL}/save-excel`, data, {
            headers: {
                Authorization: `Bearer ${token}`,
            },
            responseType: 'blob',
        });

        const blob = new Blob([response.data], {
            type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        });
        saveAs(blob, 'data.xlsx');
    } catch (err) {
        console.error('Error downloading Excel file', err);
        alert(`Error downloading Excel file: ${err.message}`);
    }
};


  const getStageOptions = (type) => {
    switch (type) {
      case 'SZK':
        return ['H', 'U', 'S', 'US', 'C', 'CS', 'G', 'D', 'E'];
      case 'TAN':
        return ['300', '250', '200', '150', 'GRAT'];
      case 'ŚK':
        return ['40', '30', '25', 'GRAT', 'MY'];
      default:
        return [];
    }
  };

  const renderStageCell = (params) => {
    const options = getStageOptions(params.row.type);
    return (
      <Box>
        <Select
          value={params.value || ''}
          onChange={(event) => handleSelectChange(params.id, params.field, event.target.value)}
          fullWidth
        >
          {options.map((option) => (
            <MenuItem key={option} value={option}>{option}</MenuItem>
          ))}
        </Select>
      </Box>
    );
  };

  const columns = [
    { 
      field: 'nazwa', 
      headerName: 'Nazwa', 
      width: 200, 
      editable: true,
      cellClassName: 'MuiDataGrid-cell--stickyLeft',  // Klasa dla zablokowanej kolumny
      headerClassName: 'MuiDataGrid-columnHeader--stickyLeft',  // Klasa dla nagłówka zablokowanej kolumny
    },
    { field: 'comments', headerName: 'Comments', width: 120, editable: true },
    { field: 'weight', headerName: 'Weight', width: 80, editable: true },
    { 
      field: 'type', 
      headerName: 'Type', 
      width: 90, 
      editable: false, 
      renderCell: (params) => (
        <Box>
          <Select
            value={params.value}
            onChange={(event) => handleSelectChange(params.id, 'type', event.target.value)}
            fullWidth
          >
            <MenuItem value="SZK">SZK</MenuItem>
            <MenuItem value="TAN">TAN</MenuItem>
            <MenuItem value="ŚK">ŚK</MenuItem>
          </Select>
        </Box>
      )
    },
    { 
      field: 't', 
      headerName: 'T', 
      width: 50, 
      editable: false, 
      type: 'boolean',
      renderCell: (params) => (
        <Box>
          <Checkbox 
            checked={Boolean(params.value)} 
            onChange={(event) => handleToggleCheckbox(params.id, params.field, event.target.checked)} 
          />
        </Box>
      )
    },
    ...Array.from({ length: 20 }, (_, i) => ({ field: `stage1_${i + 1}`, headerName: `${i + 1}`, width: 90, editable: true, renderCell: renderStageCell })),
    ...Array.from({ length: 15 }, (_, i) => ({ field: `stage2_${i + 1}`, headerName: `${i + 1}`, width: 90, editable: true, renderCell: renderStageCell })),
    {
      field: 'actions',
      type: 'actions',
      width: 100,
      getActions: (params) => [
        <GridActionsCellItem
          icon={<DeleteIcon />}
          label="Delete"
          onClick={() => handleDeleteRow(params.id)}
        />
      ]
    }
  ];

  return (
    <div style={{ height: '100%', width: '100%' }}>
      <Box sx={{ height: '100%', width: '100%' }}>
        <DataGrid
          rows={data}
          columns={columns}
          processRowUpdate={handleEditCellChange}
          columnGroupingModel={columnModel}
          sx={tableStyles.root} // Użycie stylów z osobnego pliku
          pinnedColumns={{ left: ['nazwa'] }} // Przypięcie pierwszej kolumny do lewej strony
        />
      </Box>
      <Button variant="contained" color="primary" onClick={() => setOpen(true)} style={{ marginTop: 20 }}>
        Add Row
      </Button>
      <Button variant="contained" color="secondary" onClick={handleDownloadExcel} style={{ marginTop: 20, marginLeft: 20 }}>
        Download Excel
      </Button>
      <Dialog open={open} onClose={() => setOpen(false)}>
        <DialogTitle>Add New Row</DialogTitle>
        <DialogContent>
          <TextField
            autoFocus
            margin="dense"
            name="nazwa"
            label="Nazwa"
            type="text"
            fullWidth
            value={newRow.nazwa}
            onChange={handleAddRowChange}
          />
          <TextField
            margin="dense"
            name="comments"
            label="Comments"
            type="text"
            fullWidth
            value={newRow.comments}
            onChange={handleAddRowChange}
          />
          <TextField
            margin="dense"
            name="weight"
            label="Weight"
            type="text"
            fullWidth
            value={newRow.weight}
            onChange={handleAddRowChange}
          />
          <Select
            name="type"
            value={newRow.type}
            onChange={handleAddRowChange}
            fullWidth
          >
            <MenuItem value="SZK">SZK</MenuItem>
            <MenuItem value="TAN">TAN</MenuItem>
            <MenuItem value="ŚK">ŚK</MenuItem>
          </Select>
          <Checkbox
            name="t"
            checked={newRow.t}
            onChange={handleAddRowChange}
          /> T
        </DialogContent>
        <DialogActions>
          <Button onClick={() => setOpen(false)} color="primary">
            Cancel
          </Button>
          <Button onClick={handleAddRow} color="primary">
            Add
          </Button>
        </DialogActions>
      </Dialog>
    </div>
  );
};

export default Table;

and style for this:

export const tableStyles = {
  root: {
    '& .MuiDataGrid-root': {
      scrollSnapType: 'x mandatory',
    },
    '& .MuiDataGrid-row': {
      scrollSnapAlign: 'start',
    },
    '& .MuiDataGrid-row:nth-of-type(odd)': {
      backgroundColor: '#f5f5f5', // Alternatywne kolory wierszy
    },
    '& .MuiDataGrid-cell--stickyLeft': {
      position: 'sticky',
      left: 0,
      backgroundColor: 'white',
      zIndex: 1, // Zmniejszenie z-index
      borderRight: '1px solid #ddd',
    },
    '& .MuiDataGrid-columnHeaders .MuiDataGrid-columnHeader--stickyLeft': {
      position: 'sticky',
      left: 0,
      backgroundColor: 'white',
      zIndex: 1, // Zmniejszenie z-index
      borderRight: '1px solid #ddd',
    },
    '& .MuiDataGrid-cell:not(.MuiDataGrid-cell--stickyLeft)': {
      zIndex: 0, // Ustawienie z-index: 0 dla wszystkich komórek poza pierwszą kolumną
    },
    '& .MuiDataGrid-cell:not(.MuiDataGrid-cell--stickyLeft) *': {
      zIndex: 0, // Ustawienie z-index: 0 dla wszystkich elementów wewnątrz komórek poza pierwszą kolumną
    },
    '& .MuiDataGrid-columnHeaders .MuiDataGrid-columnHeader:not(.MuiDataGrid-columnHeader--stickyLeft)': {
      zIndex: 0, // Ustawienie z-index: 0 dla nagłówków kolumn innych niż pierwsza
    },
    '& .MuiDataGrid-columnHeaders .MuiDataGrid-columnHeader:not(.MuiDataGrid-columnHeader--stickyLeft) *': {
      zIndex: 0, // Ustawienie z-index: 0 dla wszystkich elementów wewnątrz nagłówków kolumn innych niż pierwsza
    },
    '& .MuiDataGrid-columnHeaderTitleContainer.MuiDataGrid-withBorderColor': {
      zIndex: 0, // Ustawienie z-index: 0 dla obiektów o klasie MuiDataGrid-columnHeaderTitleContainer MuiDataGrid-withBorderColor
    },
    '& .MuiDataGrid-columnHeaderTitleContainer.MuiDataGrid-withBorderColor *': {
      zIndex: 0, // Ustawienie z-index: 0 dla zawartości obiektów o klasie MuiDataGrid-columnHeaderTitleContainer MuiDataGrid-withBorderColor
    },
  },
};

Pentaho HTTP Post error “Name may not be null”

I have some issues with a HTTP post step in Pentaho. If I preview it works, and does the post acuratly, however when I properly run the transformation I get this error (in the HTTP post step). The thing is there is no name field at all in the HTTP step that corresponds to the issue.

I’ve tried to run a single post, multiple posts, iterrations. Same outcome when “Run”, no error occures when I do a “preview”. Changed the payload to minimum, etc. When I preview it post the action accuratly. I don’t believe it is an issue of the payload it self, I think the step somehow bugs out.

I’ve tried Pentaho 9.0 and 9.4.

Error log:

2024/08/14 09:00:39 - Carte - Installing timer to purge stale objects after 1440 minutes.
2024/08/14 09:00:52 - Spoon - Running transformation using the Kettle execution engine
2024/08/14 09:00:52 - Spoon - Transformation opened.
2024/08/14 09:00:52 - Spoon - Launching transformation [true_post_iterrative]...
2024/08/14 09:00:52 - Spoon - Started the transformation execution.
2024/08/14 09:00:53 - true_post_iterrative - Dispatching started for transformation [true_post_iterrative]
2024/08/14 09:00:53 - url.0 - Finished processing (I=0, O=0, R=0, W=1, U=0, E=0)
2024/08/14 09:00:53 - Microsoft Excel input.0 - Finished processing (I=1, O=0, R=0, W=1, U=0, E=0)
2024/08/14 09:00:53 - Modified JavaScript value.0 - Optimization level set to 9.
2024/08/14 09:00:54 - Modified JavaScript value.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
2024/08/14 09:00:54 - Add constants.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
2024/08/14 09:00:54 - Merge join.0 - Finished processing (I=0, O=0, R=2, W=1, U=0, E=0)
2024/08/14 09:00:54 - HTTP post.0 - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : Unexpected error
2024/08/14 09:00:54 - HTTP post.0 - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : java.lang.IllegalArgumentException: Name may not be null
2024/08/14 09:00:54 - HTTP post.0 -     at org.apache.http.util.Args.notNull(Args.java:54)
2024/08/14 09:00:54 - HTTP post.0 -     at org.apache.http.message.BasicNameValuePair.<init>(BasicNameValuePair.java:59)
2024/08/14 09:00:54 - HTTP post.0 -     at org.pentaho.di.trans.steps.httppost.HTTPPOST.processRow(HTTPPOST.java:436)
2024/08/14 09:00:54 - HTTP post.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2024/08/14 09:00:54 - HTTP post.0 -     at java.lang.Thread.run(Unknown Source)
2024/08/14 09:00:54 - HTTP post.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
2024/08/14 09:00:54 - true_post_iterrative - Transformation detected one or more steps with errors.
2024/08/14 09:00:54 - true_post_iterrative - Transformation is killing the other steps!
2024/08/14 09:00:54 - Select values.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
2024/08/14 09:00:54 - Dummy (do nothing) 3.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
2024/08/14 09:00:54 - true_post_iterrative - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : Errors detected!
2024/08/14 09:00:54 - Spoon - The transformation has finished!!
2024/08/14 09:00:54 - true_post_iterrative - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : Errors detected!
2024/08/14 09:00:54 - true_post_iterrative - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : Errors detected!

Bootstrap 5 navbar expands but on 2nd tap on toggler not collapsing the content in Laravel 8

I was utilizing Boostrap’s navbar collapse feature, on testing it in w3schools editor it worked and when i used it in my Laravel 8 project the Navbar Expands but on another interaction on Navbar Toggle it doesn’t collapse the content / shrink it back.

Below i posted the Screenshot

Navbar Collapse Bootstrap 5

Bootstrap SDN’s

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>

Code:

  <button class="navbar navbar-toggler" type="button" data-bs-toggle="collapse" 
data-bs-target="#collapseTarget" aria-controls="navbarSupportedContent" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span></button>

<div class="collapse" id="collapseTarget">
    <ul class="navbar-nav me-auto">
    <li> <a href="">Wishlist</a> </li> <li> <a href="">SigIn</a> </li> <li> <a href="">Language</a> </li> </ul></div>

Why is my projects card not getting any smaller after the screen size reaches 911 px by 911 px?

I am making a page to show my projects. It works fine on desktop and I am currently trying to make the page responsive. I am using Next.js and tailwindcss. I was able to make the page responsive up until screen sizes of 911 px by 911 px or less. Once I reach the screen size, the projects stay the same size. I wam trying to figure out why they are not shrinking futher.

Project.js code:

import AnimatedText from "@/components/AnimatedText";
import { GithubIcon } from "@/components/Icons";
import Layout from "@/components/Layout";
import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import React from "react";
import project1 from "../../public/images/projects/keyword-search.png";
import project2 from "../../public/images/projects/lexflow.png";
import project3 from "../../public/images/projects/project-citizen.png";
import project4 from "../../public/images/projects/aclu-archives.png";

const FeaturedProject = ({ type, title, summary, img, link, github }) => {
  return (
    <article
      className="w-full flex items-center justify-between relative rounder-br-2xl
    rounded-3xl border border-solid border-dark bg-light shadow-2xl p-12 dark:bg-dark dark:border-light
    lg:flex-col lg:p-9 xs:rounded-2xl xs:rounded-br-3xl xs:p-4
    "
    >
      <div
        className="absolute top-0 -right-3 -z-10 w-[101%] h-[103%] rounded-[2.5rem] bg-dark dark:bg-light
      rounded-br-3xl xs:-right-2 sm:h-[102%] xs:w-full xs:rounded-[1.5rem]
      "
      />
      <Link
        href={link}
        target="_blank"
        className="w-1/2 cursor-pointer overflow-hidden rounded-lg
        lg:w-full
        "
      >
        <Image
          src={img}
          alt={title}
          className="w-full h-auto transition-transform duration-300 transform hover:scale-105"
          priority
          sizes="(max-width: 768 px) 100vw, (max-width: 1200px) 50vw, 50vw"
        />
      </Link>

      <div
        className="w-1/2 flex flex-col items-start justify-between pl-6
      lg:w-full lg:pl-0 lg:pt-6
      "
      >
        <span
          className="text-primary font-medium text-xl dark:text-primaryDark
        xs:text-base
        "
        >
          {type}
        </span>
        <Link
          href={link}
          target="_blank"
          className="hover:underline underline-offset-2"
        >
          <h2
            className="my-2 w-full text-left text-4xl font-bold dark:text-light
          sm:text-sm
          "
          >
            {title}
          </h2>
        </Link>
        <p
          className="my-2 font-medium text-dark dark:text-light
        sm:text-sm
        "
        >
          {summary}
        </p>
        <div className="mt-2 flex items-center">
          <Link href={github} target="_blank" className="w-10">
            <GithubIcon />
          </Link>
          <Link
            href={link}
            target="_blank"
            className="ml-4 rounded-lg bg-dark text-light p-2 px-6 text-lg font-semibold dark:bg-light dark:text-dark
            sm:px-4 sm:text-base
            "
          >
            Visit Project
          </Link>
        </div>
      </div>
    </article>
  );
};

const FeaturedProjectNoGit = ({ type, title, summary, img, link }) => {
  return (
    <article
      className="w-full flex items-center justify-between relative rounder-br-2xl
    rounded-3xl border border-solid border-dark bg-light shadow-2xl p-12 dark:bg-dark dark:border-light
    lg:flex-col lg:p-9 xs:rounded-2xl xs:rounded-br-3xl xs:p-4
    "
    >
      <div
        className="absolute top-0 -right-3 -z-10 w-[101%] h-[103%] rounded-[2.5rem] bg-dark dark:bg-light
      rounded-br-3xl xs:-right-2 sm:h-[102%] xs:w-full xs:rounded-[1.5rem]
      "
      />
      <Link
        href={link}
        target="_blank"
        className="w-1/2 cursor-pointer overflow-hidden rounded-lg
        lg:w-full
        "
      >
        <Image
          src={img}
          alt={title}
          className="w-full h-auto transition-transform duration-300 transform hover:scale-105"
          priority
          sizes="(max-width: 768 px) 100vw, (max-width: 1200px) 50vw, 50vw"
        />
      </Link>

      <div
        className="w-1/2 flex flex-col items-start justify-between pl-6
      lg:w-full lg:pl-0 lg:pt-6
      "
      >
        <span
          className="text-primary font-medium text-xl dark:text-primaryDark
        xs:text-base
        "
        >
          {type}
        </span>
        <Link
          href={link}
          target="_blank"
          className="hover:underline underline-offset-2"
        >
          <h2
            className="my-2 w-full text-left text-4xl font-bold dark:text-light
          sm:text-sm
          "
          >
            {title}
          </h2>
        </Link>
        <p
          className="my-2 font-medium text-dark dark:text-light
        sm:text-sm
        "
        >
          {summary}
        </p>
        <div className="mt-2 flex items-center">
          <Link
            href={link}
            target="_blank"
            className="ml-4 rounded-lg bg-dark text-light p-2 px-6 text-lg font-semibold dark:bg-light dark:text-dark
            sm:px-4 sm:text-base
            "
          >
            Visit Project
          </Link>
        </div>
      </div>
    </article>
  );
};

const Project = ({ type, title, img, link, github }) => {
  return (
    <article
      className="w-full flex flex-col items-center justify-center rounded-2xl
    border border-solid border-dark bg-light p-6 relative dark:bg-dark dark:border-light
    xs:p-4
    "
    >
      <div
        className="absolute top-0 -right-3 -z-10 w-[101%] h-[103%] rounded-[2rem] bg-dark
      rounded-br-3xl dark:bg-light
      md:-right-2 md:w-[101%] xs:h-[102%] xs:rounded-[1.5rem]
      "
      />

      <Link
        href={link}
        target="_blank"
        className="w-full cursor-pointer overflow-hidden rounded-lg"
      >
        <Image
          src={img}
          alt={title}
          className="w-full h-auto transition-transform duration-300 transform hover:scale-105"
        />
      </Link>

      <div className="w-full flex flex-col items-start justify-between mt-4">
        <span
          className="text-primary dark:text-primaryDark font-medium text-xl
        lg:text-lg md:text-base
        "
        >
          {type}
        </span>
        <Link
          href={link}
          target="_blank"
          className="hover:underline underline-offset-2"
        >
          <h2 className="my-2 w-full text-left text-4xl font-bold lg:text-2xl">
            {title}
          </h2>
        </Link>
        <div className="w-full mt-2 flex items-center justify-between">
          <Link
            href={link}
            target="_blank"
            className="text-lg font-semibold underline
            md:text-base
            "
          >
            Visit
          </Link>
          <Link
            href={github}
            target="_blank"
            className="w-8
          md:w-6
          "
          >
            <GithubIcon />
          </Link>
        </div>
      </div>
    </article>
  );
};

const projects = () => {
  return (
    <>
      <Head>
        <title>Projects - </title>
        <meta
          name="Projects Page for "
          content="Technology, Computer Science, Law, Coding, Web Development, Student, High School, Stanford, UPenn, Github"
        />
      </Head>
      <main className="w-full mb-16 flex flex-col items-center justify-center dark:text-light">
        <Layout className="pt-16">
          <AnimatedText
            text="I'm not a businessman, I'm a business, man."
            className="mb-16
            lg:!text-7xl sm:mb-8 sm:!text-6xl xs:!text-4xl
            "
          />

          <div
            className="grid grid-cols-12 gap-24 gap-y-32
          xl:gap-x-16 lg:gap-x-8 md:gap-y-24 md:gap sm:gap-x-0
          "
          >
            <div className="col-span-12">
              <FeaturedProject
                title="Competition Cases Keyword Search"
                img={project1}
                summary="A index where you can search keywords related to return market definitions decided in European Commission competition cases."
                link="/"
                github="/"
                type="Featured Project"
              />
            </div>
            <div className="col-span-6 sm:col-span-12">
              <Project
                title="LexFlow"
                img={project2}
                link="/"
                github="/"
                type="Featured Project"
              />
            </div>
            <div className="col-span-6 sm:col-span-12">
              <Project
                title="Project Citizen"
                img={project3}
                link="/l"
                github="/"
                type="Website"
              />
            </div>
            <div className="col-span-12">
              <FeaturedProjectNoGit
                title="ACLU of Delaware Archives"
                img={project4}
                summary="The ACLU of Delaware Archives preserves the organization's history and ongoing efforts to protect civil liberties in Delaware.
                These archives showcase important legal cases, campaigns, and advocacy efforts the ACLU has worked on, including education
                reform and voting rights. The archives serve as a resource for understanding the impact of the ACLU's work in Delaware over
                the years."
                link="https://www.aclu-de.org/en/archives"
                type="Archival Project"
              />
            </div>
            {/* //TODO: add another featured project */}
            {/* <div className="col-span-12">Featured Project</div> */}
            {/* //TODO: add another project */}
            {/* <div className="col-span-6">Project-4</div> */}
          </div>
        </Layout>
      </main>
    </>[![[![enter image description here](https://i.sstatic.net/trkhVCXy.png)](https://i.sstatic.net/trkhVCXy.png)](https://i.sstatic.net/yr6xYOt0.png)](https://i.sstatic.net/yr6xYOt0.png)
  );
};

export default projects;
[![enter image description here](https://i.sstatic.net/j3vpz8Fd.png)](https://i.sstatic.net/j3vpz8Fd.png)

I’ve tried changing the width, the gaps, the columns, and the grid layout but nothing worked. Either I made the wrong changes or I was making changes in the wrong place.

[This is what a project on my projects page currently looks like on an Iphone 14 Pro.]
[This is what a project on my projects page should look like on an Iphone 14 Pro.

UI is not same in firefox

I am making an extension using Plasmo React, and while the UI looks exactly how I want it in Chrome, but it doesn’t look the same in Firefox.

I tried the problem is this meta tag is adding in chrome but not seeing this firefox. I think UI is not same in firefox because of this .

match() not working with regex expression

    const contentWithVideo = `
<p><br></p>
<video style="max-width: 50%; height: auto;" controls="">
  <source src="http://chartbeat-datastream-storage.s3.ap-south-1.amazonaws.com/wp-content/uploads/2024/08/1723616374/SampleVideo_1280x720_30mb.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>`;

    // Find the <video> tag with its source URL
    const videoTagRegex = /<video[^>]*>s*<sources+src=['"]([^'"]+)['"]s+type=['"]([^'"]+)['"][^>]*>s*</video>/is;

    // Using exec() to match the content
    const matchResult = videoTagRegex.exec(contentWithVideo);

the code must match the video tag in given variable but its returning null

  • i have tried various methods but nothing is working
    if anyone understand where i m going worng please let me know

i have tried changing the expression at first but soon i understand match() is not working with regex