How to work with z indexes in absolute positioning HTML, CSS

I am working on a functionality where clicking on an option in the menu will open up a Modal. The menu to display options has absolute position and modal backdrop has fixed position. The modal backdrop also has flex justify-center items-center class to center the modal.

In current functionality, clicking on buttton opens the modal but menu options still come on top of modal.(z index wise.)

I am aware that working with absolute position disturbs the existing document flow, but I need it so that the shareMenuOptions which are opened on clicking the button do not occupy any extra space.

I will share the basic structure to provide more clarity on what I am saying.

The project is made in nextjs.

<TestiMonialItem/> # flex-col
   <TestimonialToolbar/> #flex (displays three actions related to testimonial item)
      <ShareButton/> #flex-col (one of the actions)
         <Button>Share</Button> (Clicking on it opens share Menu options)
         <ShareMenuOptions> -> absolute

Code for Share Menu options:

 <div
        ref={shareMenuRef}
        className="text-sm max-h-fit mr-[250px] absolute mt-[50px] w-[200px] flex flex-col items-start bg-slate-200 rounded-md"
      >
        <span
          className="p-2 hover:bg-slate-300 w-full text-left cursor-pointer flex items-center"
          onClick={(e) => setShowEmbedTestimonialModal(true)}
        >
          <Code className="text-tiny mr-3" />
          Embed the testimonial
        </span>
        <span className="p-2 hover:bg-slate-300 w-full text-left cursor-pointer flex items-center">
          <Link className="text-tiny mr-3" />
          Get the link
        </span>
      </div>

Desired functionality

When I click on embed the testtimonial, The embed modal should Come on top of it and hide it.

Current functionality

THe shareMenuOptions come on top of the Embed Modal

I have attached the screenshot for reference

  1. Share Menu options are not opened
    Share Menu options are not opened

  2. Share Menu options are opened by clicking on share button
    Share Menu options are opened by clicking on share button

  3. Displaying the embed modal by clicking the Embed the testimonal option.

Displaying the embed modal by clicking the Embed the testimonal option

As you can see, the shareMenuOptions come on top of my `EmbedModal, which is not what I want. Is there any way to fix this?

How do I create a listener to post a channel name when a channel is mentioned?

I’m sure this is fairly simple and I’m just overthinking things as I tend to do but..

I am trying to add code to my discord bot so that when a channel is mentioned (<#channel.ID>) the bot will then post the channel name, not a link to the channel or a channel mention, just the channel name (channel-example-name). I’ve done a bit of sleuthing to see if I could find something similar but everything I find is trying to mention the channel in an embed or post.

I’ve looked through discord.js documentation and even reread through the guide to see if there would be any answers in the guide. I also haven’t seen any guidance on managing this on the discord.js discord server.

Main File:

const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

const client = new Client({ intents: [GatewayIntentBits.Guilds]});

client.commands = new Collection();
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
    // Grab all the command files from the commands directory you created earlier
    const commandsPath = path.join(foldersPath, folder);
    const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
    // Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
    for (const file of commandFiles) {
        const filePath = path.join(commandsPath, file);
        const command = require(filePath);
        if ('data' in command && 'execute' in command) {
            client.commands.set(command.data.name, command);
        } else {
            console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
        }
    }
}

const eventsPath = path.join(__dirname, 'events');
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));

for (const file of eventFiles) {
    const filePath = path.join(eventsPath, file);
    const event = require(filePath);
    if (event.once) {
        client.once(event.name, (...args) => event.execute(...args));
    } else {
        client.on(event.name, (...args) => event.execute(...args));
    }
}

client.login(token);

I have a separate folder called events that includes ready.js (start up event), interactionCreate.js for command handling, and messageCreate.js for the listener and base set up from the discord.js guide. The last is below:

const { Client, Events } = require('discord.js');

const client = new Client({ intents: ['Guilds', 'GuildMessages'] });

client.once(Events.ClientReady, () => {
  console.log('Ready!');
});

client.on(Events.MessageCreate, message => {
  // Check if the message contains a channel mention
  if (message.mentions.channels.size > 0) {
    const mentionedChannel = message.mentions.channels.first();

    // Respond to the message
    message.reply(`Chanel mentioned above: {mentionedChannel.name}`);
  }
});

client.on(Events.MessageCreate, async message => {

    let args;
    if (message.guild) {
        let prefix;

        if (message.content.startsWith(globalPrefix)) {
            prefix = globalPrefix;
        } else {
            const guildPrefix = await prefixes.get(message.guild.id);
            if (message.content.startsWith(guildPrefix)) prefix = guildPrefix;
        }
    }
});

Errors/Debugging:
The bot is not currently throwing any errors after tinkering around with it nor am I getting anything from debugging.

How to decrease CPU usage by an extensive loop?

I am creating a script that draws an ASCII picture. I need to separate each individual character in a tag, though the page gets too laggy and the CPU usage goes up by an extreme amount when executing the loop, the process doesn’t even finish, as it normally would without adding the tag (printing only the characters).

Here is the loop I used:

for(let widthCounter = 0; widthCounter <= 2500; widthCounter++) {
    document.getElementById("textMain").innerHTML += ("<span>" + currentScene[widthCounter] + "</span>");

    totalCharsDrawn += 1 

    if (totalCharsDrawn == 100) {
        document.getElementById("textMain").innerHTML += "<br>"
    }
}

I tried setting a delay for each character with setTimeout() but it didn’t solve the problem.

issues scaling three.js sprite texture

I am trying to scale a sprite and fill the entire screen, to have text on the top and bottom of the screen, but when I do so, it scales the text also. So how do I put a big line of text at top of screen??

my code:

var ui_canvas = document.createElement('canvas');
    var size = 1028; 
    canvas.width = size;
    canvas.height = size;
    var context = ui_canvas.getContext('2d');
    context.fillStyle = '#ff0000'; 
    context.textAlign = 'center';
    context.font = '48px Arial';
    context.fillText("some text", size / 12, size / 12);
    context.strokeStyle = '#ff0000';
    context.lineWidth = 1;
    context.beginPath(); 
    context.moveTo(0,0); 
    context.lineTo(size, 0);
    context.lineTo(size, size);
    context.lineTo(0, size);
    context.lineTo(0, 0);
    context.stroke();

    var amap = new THREE.Texture(ui_canvas);
    amap.needsUpdate = true;
    amap.generateMipmaps = false;

    var mat = new THREE.SpriteMaterial({
    map: amap,
    depthTest: false,//to keep always in front
    depthWrite: false,//to keep always in front
    transparent: false,
    sizeAttenuation: false,
    useScreenCoordinates: false,
    color: 0xffffff
    });

    var sp = new THREE.Sprite(mat);
    sp.scale.set( 1,1,1 ); // CHANGED
    //camera.add(sp);
    //sp.quaternion.copy(camera.quaternion);
    sp.position.set(-10, -6, 0);
    scene.add(sp); 

sp.position.set(-10, -6, 0); does nothing, since sizeAttenuation = false, but even moving the sprite closer when sizeAttenuation = true, the text just gets bigger. I want more area to write text.

sp.scale.set( 1,1,1 ); also grows the text.

and making the sprite bigger and putting smaller font ex: context.font = ’12px Arial’;
makes poor resolution and unreadable font.

how to solve this? how to have high res, crisp font and text all over the entire screen?

thank you!

Proper way to structure nested routing with default redirects in Remix JS

Say I have a Remix project with a route structure like this:

root.tsx (contains a main sidebar with NavLinks, one of which is "Shops", and an <Outlet />)
-routes
 |-_index.tsx (redirects to /shops, so that the "Shops" NavLink is active by default)
 |-shops.tsx (is a list of shops)
 |-shops_.$id.tsx (individual shop page)
 |-shops_.$id.main.tsx
 |-shops_.$id.invoices.tsx
 |-shops_.$id.{etc, etc...}.tsx

/shops/$id contains tabs for navigating to each sub-route, and an <Outlet /> for displaying them (main, invoices, etc…). I want the main tab to be selected by default, similar to how “Shops” is selected by default in the sidebar (which is typically done with a redirect from the parent “index” route). How exactly should I structure my route files, and from which file (if any) should the redirect be done?

I can’t seem to figure it out. If I redirect from /shops/$id to /shops/$id/main, I end up in an infinite redirect loop.

If I don’t redirect, then by default no tab is selected, and the <Outlet /> remains empty until the user selects a tab.

Do CSS variables work inside of a template or custom element?

I’m building a small website using web components written in pure HTML, CSS, and Javascript. Everything is working well except for the CSS variable that I want to use. Here is the stylesheet:

 :root { 
    --bh-color-1:#8f1010;
  }
  .bh-action {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    color:whitesmoke;
    background-color:var(--bh-color-1);
    height:32px;
    padding: 0px 16px;
    border-radius: 16px;
    margin-top: 8px;
  }

Is there a problem with the syntax? This is from DevTools:

<bh-feature>
            <header slot="header">
              <script type="module" src="/@vite/client"></script>
Sharpening Service</header>
            <p slot="content">yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada</p>
            <a href="#" slot="action" class="bh-action">Get Started</a>
        </bh-feature>

You can see that the bh-action class from the stylesheet is set on an <a> element which is inside a custom element.
Also from DevTools:

.bh-action {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    color: whitesmoke;
    background-color: var(--bh-color-1);
    height: 32px;
    padding: 0px 16px;
    border-radius: 16px;
    margin-top: 8px;
}

You can see that the style has been applied to the <a> element, but the variable hasn’t been resolved to a value. Everything else works as expected, including the color if I use the numbers directly. The entire stylesheet is imported into the template, including the variable declaration. So far I’ve tried putting the variable and class declarations in the style tag of the template and wrapping the variable in curly braces, like var({--bh-color-1}) and var({{bh-color-1 }}).
Is there a way to make this work or is it an issue?

In Vue.js (v2), hoow do I prevent the sudden flash of old data, when there is only computed data?

I have a component that contains only computed data. When I navigate away from the page, and go back to the page with a different URL, the old data is displayed for a second while the new data is calculated. How do i prevent this flash of old data?

I tried

  • wrapping it a KeepAlive component with the key set to the id of a param
  • using vm.destroy()
  • toying around with other ways to delete the component and computed properties

How do I use something called Eruda in a web page?

I was wondering if there is a fix to my code, which should toggle a chrome inspect-like feature. However, everything I tried with a bookmarklet I found and made into formatted JS just didn’t work out. Here is the code I tried:

<html>
<head>
  <script src="http://cdn.jsdelivr.net/npm/eruda"></script>
</head>
<body>
  <button id="hi">Inspect</button>
<script>
  document.getElementById("hi").addEventListener("click",  function(){
  eruda.init();
});
</script>
</body>
</html>

If someone could help with my code in any way, I would appreciate the help. Thank you.

Error: Cannot find ffmpeg in firebase cloud function

i’m trying to compress some uploaded files to firebase storage .. using firebase cloud functions but it give me the error Error: Cannot find ffmpeg

here is my function :

const functions = require("firebase-functions");
const admin = require("firebase-admin");
const ffmpeg = require("fluent-ffmpeg");
const ffmpegStatic = require("ffmpeg-static");
const axios = require("axios");

// const {onSchedule} = require("firebase-functions/v2/scheduler");

admin.initializeApp();

// Ensure fluent-ffmpeg uses the binary
ffmpeg.setFfmpegPath(ffmpegStatic.path);

const db = admin.firestore();
const bucket = admin.storage().bucket();
const fs = require("fs");
const downloadVideo = async (url, outputPath) => {
  const response = await axios.get(url, {responseType: "stream"});
  const writer = fs.createWriteStream(outputPath);
  response.data.pipe(writer);
  return new Promise((resolve, reject) => {
    writer.on("finish", () => resolve(outputPath));
    writer.on("error", reject);
  });
};

const compressVideo = (videoFullPath, outputFileName, targetSize) => {
  return new Promise((resolve, reject) => {
    ffmpeg.ffprobe(videoFullPath, (err, metadata) => {
      if (err) return reject(err);
      const duration = parseFloat(metadata.format.duration);
      const targetTotalBitrate =
      (targetSize * 1024 * 8) / (1.073741824 * duration);

      let audioBitrate =
      metadata.streams.find((s) => s.codec_type === "audio").bit_rate;
      if (10 * audioBitrate > targetTotalBitrate) {
        audioBitrate = targetTotalBitrate / 10;
      }

      const videoBitrate = targetTotalBitrate - audioBitrate;
      ffmpeg(videoFullPath)
          .output(outputFileName)
          .videoCodec("libx264")
          .audioCodec("aac")
          .videoBitrate(videoBitrate)
          .audioBitrate(audioBitrate)
          .on("end", resolve)
          .on("error", reject)
          .run();
    });
  });
};

const uploadVideoWithResumableUpload = (filePath, destinationBlobName) => {
  const blob = bucket.file(destinationBlobName);
  const options = {resumable: true, validation: "crc32c"};
  return blob.createWriteStream(options).end(fs.readFileSync(filePath));
};

exports.processLessonsOnDemand =
functions.https.onRequest({timeoutSeconds: 3600, memory: "2GB"}
    , async (context) => {
      console.log("Fetching lessons from Firestore...");
      const lessonsRef = db.collection("leassons");
      const lessonsSnapshot = await lessonsRef.get();

      if (lessonsSnapshot.empty) {
        console.log("No lessons found in Firestore.");
        return; // Exit if no lessons are available
      }

      const lessonDoc = lessonsSnapshot.docs[0]; // Get the first document
      const lessonData = lessonDoc.data();

      if (lessonData.shrinked) {
        console.log(
            `Skipping lesson ID ${lessonDoc.id} as it's already shrunk.`,
        );
        return; // Exit if the first lesson is already shrunk
      }

      const videoURL = lessonData.videoURL;
      if (!videoURL) {
        console.log(
            `No video URL for lesson ID: ${lessonDoc.id}. Skipping...`,
        );
        return; // Exit if no video URL is available
      }

      const tempVideoPath = "/tmp/temp_video.mp4";

      try {
        await downloadVideo(videoURL, tempVideoPath);

        const targetSize = (fs.statSync(tempVideoPath).size * 0.30) / 1024;
        const outputCompressedVideo = `/tmp/compressed_${lessonDoc.id}.mp4`;

        await compressVideo(tempVideoPath, outputCompressedVideo, targetSize);

        await uploadVideoWithResumableUpload(
            outputCompressedVideo,
            `compressed_videos/compressed_${lessonDoc.id}.mp4`,
        );

        const newVideoURL = `https://storage.googleapis.com/${bucket.name}/compressed_videos/compressed_${lessonDoc.id}.mp4`;

        const oldVideoPath = videoURL.replace(`https://storage.googleapis.com/${bucket.name}/`, "");
        const oldBlob = bucket.file(oldVideoPath);
        await oldBlob.delete();

        await lessonsRef.doc(lessonDoc.id).update({
          videoURL: newVideoURL,
          shrinked: true,
        });

        console.log(`Processed lesson ID: ${lessonDoc.id}`);
        fs.unlinkSync(tempVideoPath); // Clean up temporary files
        fs.unlinkSync(outputCompressedVideo); // Clean up compressed file
      } catch (error) {
        console.error(`Error processing lesson ID ${lessonDoc.id}:`, error);
      }
    });


Audio Module Not Enabled Error in Firefox with Zoom Video SDK UI Toolkit

I’m working with the Zoom Video SDK (JavaScript) and specifically using the Video SDK UI Toolkit (following the example from the Zoom SDK UI Toolkit GitHub repository).

Description
I’m encountering an issue with audio in Firefox only. The setup and code work correctly on all other major browsers, but when using Firefox, attempting to start audio fails with an error. The error is reproducible both in my application and on Zoom’s own UI Toolkit Demo site.

Error
When trying to start audio, the following error message appears:

Audio: The operation is invalid, perhaps caused by duplicated operations

And in the console, more details are provided:

start audio error Object { type: "INVALID_OPERATION", reason: "Module:audio is not enabled" }

Troubleshooting Routes

  1. I confirmed that this issue does not occur on other browsers like Chrome or Edge.
  2. I followed the sample application exactly as provided in Zoom’s GitHub repository.
  3. I also tested on the official Zoom UI Toolkit Demo site (videosdk.dev/uitoolkit), and the same issue occurs on Firefox when joining a session with fictional data.

How to Reproduce

  1. Use Firefox (last version or earlier) as the browser. (On windows or MacOs)
  2. Open the Zoom Video SDK UI Toolkit Demo.
  3. Join a session using any fictitious data to authenticate.
  4. Attempt to start audio within the session.
  5. The above error should appear, preventing audio from working as expected.

Thank you for any guidance!

New environment variables reading as empty string in Vite project

I have set up a Vite project with an .env file to read some environment variables, but some environment variables I create for my machine appear as an empty string.

I have created a new environment variable in my terminal: export VITE_TEST="TESTING"

Printed it out to confirm it was set: echo $VITE_TEST // Output: TESTING as expected

I have set up an .env file to read this new env var:

VITE_ENV_TEST=$VITE_TEST

When I print out this env var I defined in my .env file::

App.tsx

...
function App() {
    const [count, setCount] = useState(0);
    const test = import.meta.env.VITE_ENV_TEST;
    console.log(test);

   return (
      <P>{test}</p>
   )
}
...

The output in an empty string.

However when I update my .env file to use a system env var such as $HOME:

.env

VITE_ENV_TEST=$HOME

It correctly prints out my home directory.

Does anyone know why the new environment variable I created would not print correctly while $HOME does?

Nuxt Content – 500 Failed to fetch dynamically imported module: http://localhost:3000/_nuxt/pages/index.vue

I have an error when I go to a markdown document from my main page, and I click on the arrow to go back in my browser.

It notes me this error:

500
Failed to fetch dynamically imported module: http://localhost:3000/_nuxt/pages/index.vue

Here is the full error:

nuxt] error caught during app initialization H3Error: 
Failed to fetch dynamically imported module: http://localhost:3000/_nuxt/pages/index.vue
Caused by: TypeError: Failed to fetch dynamically imported module: http://localhost:3000/_nuxt/pages/index.vue

Here is my […slug].vue code:

<template>
    <main>
        <div>
            <content-renderer :value="prodData" />
        </div>
    </main>
</template>

<script lang="ts" setup>
    import { queryContent, useAsyncData, useRoute } from '#imports';

    const route = useRoute();
    const path = route.path;

    const { data } = await useAsyncData('content-data', () =>
        queryContent(path).findOne(),
    );

    const prodData = data.value;
</script>

Here is my index.vue code:

<template>
    <AllPage>
         <Projects />
    </AllPage>
</template>

<script lang="ts" setup></script>
<style scoped></style>

this is the Projects component:

<template>
    <div class="d-flex flex-column h-100 ga-10">
        <Card
            v-for="doc in docs"
            :key="doc._path"
            :description="doc.description"
            :image="doc.firstImage"
            :path="doc._path"
            :title="doc.title"
        />
    </div>
</template>

<script lang="ts" setup>
    import { queryContent, useAsyncData } from '#imports';

    function extractFirstImage(content) {
        if (!content || !content.children) return null; // Checks that the content exists and has children

        // Recursively searches through children to find the first image
        for (const node of content.children) {
            if (
                node.type === 'element' &&
                node.tag === 'img' &&
                node.props &&
                node.props.src
            ) {
                return node.props.src; // Returns the URL of the first image found
            }

            // If the child has children, call the function recursively
            if (node.children) {
                const image = extractFirstImage(node);
                if (image) return image;
            }
        }
        return null; // No image found
    }

    const { data } = await useAsyncData('projects', () =>
        queryContent('/projects').find(),
    );

    const docs = data.value.map((doc) => ({
        ...doc,
        firstImage: extractFirstImage(doc.body), // Extracts the first image
    }));
</script>

<style scoped>
    @import 'assets/css/dark-theme-content.css';
</style>

This is the Card component :

<template>
    <v-card :href="path" class="project-card mx-auto rounded-lg" width="300px">
        <div class="img-container pa-3 w-100">
            <img
                v-if="displayImage"
                :src="images[`${displayImage}`]"
                alt="Image du document"
                class="card-img w-100 h-100 rounded-lg"
            />
        </div>

        <v-card-title class="card-title">{{ title }}</v-card-title>
        <v-card-subtitle class="card-description pb-3"
            >{{ description }}
        </v-card-subtitle>
    </v-card>
</template>
<script lang="ts" setup>
    import { filename } from 'pathe/utils';

    const props = defineProps({
        title: String,
        description: String,
        image: String,
        path: String,
    });

    console.log(props.path);

    const displayImage = props.image
      ?.replace('../../assets/img/content/', '')
      .replace(/.(png|jpe?g|gif|bmp|webp)$/gi, '');

    // Import all image files from the @/assets/img/content folder
    const glob = import.meta.glob(`@/assets/img/content/*`, {
        eager: true, // Immediately loads images to make them available as soon as the component is rendered
    });

    // Creates an images object where each key is a filename, and each value is the image URL
    const images = Object.fromEntries(
        Object.entries(glob).map(([key, value]) => [filename(key), value.default]),
    );
</script>
<style scoped></style>

This is my nuxt configuration file:

import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';

export default defineNuxtConfig({
  css: ['~/assets/css/style.css'],
  compatibilityDate: '2024-04-03',
  devtools: { enabled: true },
  app: {
    head: {
      meta: [
        { name: 'viewport', content: 'width=device-width, initial-scale=1' }
      ],
      link: [
        {
          rel: 'stylesheet',
          href: 'https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/3.0.1/modern-normalize.min.css'
        },
        {
          rel: 'preconnect', href: 'https://fonts.googleapis.com'
        },
        { rel: 'preconnect', href: 'https://fonts.gstatic.com' },
        {
          href: 'https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap',
          rel: 'stylesheet'
        }
      ],
      script: [
        {
          src: 'https://cdn.anychart.com/releases/v8/js/anychart-base.min.js'

        },
        {
          src: 'https://cdn.anychart.com/releases/v8/js/anychart-tag-cloud.min.js'
        }
      ]
    }
  },
  build: {
    transpile: ['vuetify']
  },
  modules: [
    (_options, nuxt) => {
      nuxt.hooks.hook('vite:extendConfig', (config) => {
        // @ts-expect-error
        config.plugins.push(vuetify({ autoImport: true }));
      });
    },
    '@nuxt/content'
  ],/*
  content: {
    documentDriven: true
  }, */
  vite: {
    vue: {
      template: {
        transformAssetUrls
      }
    }
  },
  runtimeConfig: {
    public: {
      imageBasePath: '~/assets/img'
    }
  }
});

Using window objects to define javascript variables for Chrome extension

I am trying to create a dynamic overlay for a browser game that will update team information as it updates within the game. The function that is used in the game to do so is:

updateGameInfo()

I have the HTML/CSS/JS defined, so for team member name, it would be

const memberName = document.getElementById("name")

And I would like to change it after updateGameInfo() is complete to be

memberName.textContent = window.gameInfo.party[0].name

How can I create this function to automatically run after updateGameInfo() and get the relevant information to change the variables?

Hamburger button is not expanding when pressed

On the mobile view, I turn my nav bar into a collapsible menu, however for some reason the javascript code is not working.

const hamburger = document.getElementById("hamburger");
const navLinks = document.getElementById("nav-links");
const profileIcon = document.querySelector(".profile-icon");

hamburger.addEventListener("click", () => {
 console.log("Hamburger clicked!"); 
 navLinks.classList.toggle("active");
 profileIcon.classList.toggle("active");
});   

Here is the css for creating the three line menu button:


.hamburger {
  display: none; /* Hidden by default; shown on mobile */
  cursor: pointer;
  flex-direction: column;
  gap: 0.3rem;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: #ffffff;
  transition: transform 0.3s ease;
}

/* Responsive Styles for Mobile */
@media screen and (max-width: 768px) {
 

  .hamburger {
      display: flex; /* Show hamburger on mobile */
  } 
}

Here is the website in question: https://enmasantos.github.io/vitality_vista/

Withdrawal BYBIT API

I’m trying to withdraw funds from my wallet via the BYBIT API, but it ends with an error:

{
  rateLimitApi: undefined,
  retCode: 131002,
  retMsg: 'Withdraw address chain or destination tag are not equal',
  result: {},
  retExtInfo: {},
  time: 1730925459032
}

Mine code:

const { RestClientV5 } = require('bybit-api');

const client = new RestClientV5({
  testnet: false,
  key: 'api_key', // stub, for example
  secret: 'secret_key', // stub, for example
});

client
  .submitWithdrawal({
    coin: 'USDT',
    chain: 'ETH',
    address: '0xfa3c24a644b03d20833866f59c539ec4794891ab',
    amount: '10',
    timestamp: Date.now(),
    forceChain: 0,
    accountType: 'FUND', // FUND, UNIFIED
  })
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.error(error);
  });

Here is an example from the documentation:

Documentation: https://bybit-exchange.github.io/docs/v5/asset/withdraw

const { RestClientV5 } = require('bybit-api');

const client = new RestClientV5({
  testnet: true,
  key: 'apikey',
  secret: 'apisecret',
});

client
  .submitWithdrawal({
    coin: 'USDT',
    chain: 'ETH',
    address: '0x99ced129603abc771c0dabe935c326ff6c86645d',
    amount: '24',
    timestamp: 1672196561407,
    forceChain: 0,
    accountType: 'FUND',
  })
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.error(error);
  });

Response example (from docs):

{
    "retCode": 0,
    "retMsg": "success",
    "result": {
        "id": "10195"
    },
    "retExtInfo": {},
    "time": 1672196571239
}

How can this problem be solved? Thanks in advance for your advice, ladies and gentlemen!

I tried changing networks: TON, TRX, but still the same error…