I want to update the next-auth session from a NULL state

I have built an app using the Zoom app sdk. The expected flow is if the user is logged in Zoom, he is supposed to get logged into my app automatically. This is done by exchanging the tokens from Zoom with my app’s tokens. I am using NextJS 14 and the next-auth setup.

I tried updating the session using the update() function provided by next-auth. But it didn’t work. It seems like the session needs to be NOT NULL for the update() function to work.

Any way I could tackle this problem. Do I need to create a fake session first or create a new login flow for this scenario?

Thanks in advance!

Return 301 status code while redirecting URLs Via JavaScript code

I want to redirect product recommendation string query URLs to non-string query URLs in Shopify and also want that they should return 301 status code while redirecting.

For example from this URL:
https://ese.net/products/some-product?pr_prod_strat=collection_fallback&pr_rec_id=503f88472&pr_rec_pid=8474186613075&pr_ref_pid=8461060833619&pr_seq=uniform

To this:
https://ese.net/products/some-product

I’ve tried to add redirect in 301 redirection manager of Shopify but the redirection not worked for string query URLs.
redirect setup in shopify but not worked

Then I’ve added the JavaScript code in theme.liquid file to redirect string query URLs to non-string query URLs. It worked but its not returning 301 status code while redirecting. I want that when it redirect via JavaScript it should return 301 status code or also share if there is any other method to redirect them.

Redirection preview

<script>
  document.addEventListener('DOMContentLoaded', function() {
    var url = new URL(window.location.href);
    var params = new URLSearchParams(url.search);

    if (params.has('pr_prod_strat')) {
      // Remove the query string from the URL
      url.search = '';
      // Redirect to the URL without query string
      window.location.replace(url.toString());
    }
  });
</script>

How do i change the parent side iframe to the entire height of the SAPUI5 child side?

My goal is to implement my SAPUI5 website into an iframe that resizes itself to the complete height of the iframe content. The website that includes the iframe is on a different server.

How do i pass the entire height of the website to the parent page?
The examples use a localhost site instead of the original.
The used version of the SAPUI5 framework is 1.120.

My first attempts were entirely parent side calculations, which didn’t work because of the cross-DOM policies. I cannot change these policies at the moment.
The attempts shown below are later implementations since i lost the code for the first attempt.


This was the second attempt. It works with pages that are not created with the SAPUI5 framework. The received size for the SAPUI5 child is always the current iframe height.

Parent side:

<script>        
    window.addEventListener('message', receiveMessage, false);

    function receiveMessage(size){
        resizeIFrameToFitContent(size.data);
    }
                
    function resizeIFrameToFitContent(size){
        document.getElementById("exampleFrame").style.height = size;
    }
</script>

Child side:

function postPageSize(){
    size = window.document.body.scrollHeight + "px";
    window.parent.postMessage(size, '*');
}


There was also this attempt by using an interval and resizing the page more or less “dynamically”. Here i get the error “Uncaught DOMException: Permission denied to access property “document” on cross-origin object” which is currently not solvable for me.

Parent side:

<script>
setInterval(function(){
    var pageHeight = document.getElementById("exampleFrame").contentWindow.document.body.offsetHeight;
}, 1000)
</script>


Last attempt was a bit more elaborate and uses some self written functions of our own. This also returns the current size of the iframe.
It should be noted that this code works on a older webpage made with the SAP framework.

Parent side:

<script>
  window.addEventListener('message', e=>{if (e.origin=="http://localhost"){
        
        var iFr = document.getElementById("exampleFrame")
        if (iFr && iFr.style.height != e.data) iFr.style.height = e.data
    }})
</script>

<iframe src="http://localhost/path/to/page" id="exampleFrame" style="height:500px"></iframe>

Child side:

function ensureIFrameResizingFor(MainCont){
    setInterval(function(){
        var pgId = MainCont.getCurrentPage().getId() //MainCont is our usual App- or Navigation-Container (which holds "Pages")
        var hFrm = 0, hHdr = 0
        
        var hdr = document.querySelector("#" + pgId + " .sapMPageHeader") 
        if (hdr) hHdr = parseInt("0" + getComputedStyle(hdr).getPropertyValue("height"))
 
        var frm = document.querySelector("#" + pgId + " .sapUiSimpleForm") 
        if (!frm){
            hHdr = 3*hHdr
            frm = document.querySelector("#" + pgId + " .sapUiTableVSbContent") //fallback (second attempt, in case the Page is a Listing-Page)
            if (!frm) frm = document.querySelector("#" + pgId + " .sapMListTblCnt") 
        } 
        if (frm) hFrm = parseInt("0" + getComputedStyle(frm).getPropertyValue("height"))
        //console.log(hFrm, hHdr)

        if (hFrm) top.postMessage((hFrm + hHdr + 18) + "px", PostMsg_CallbackURL)
    }, 500)
}

How to remove color in label in Chart.js

How to remove this color from label in Chart.js ?
I’m using primereact, but it’s not difference, because it’s imports Chart.JS inside it.
Looked in docs, but can’t find place where I should write configuration for it.
There is some types of plugins, thats allready inserted into primereact

enter image description here

I have multiple waveforms, how do I stop a playing waveform if I play another one?

I’m building a live chat application where users can send and receive voice messages. Each voice message is visualized using WaveSurfer.js. My issue is that when a user plays a voice message, it works fine, but I want to make sure that only one message plays at a time. If one voice message is already playing and the user starts playing another one, the previous message should automatically stop.

Here’s the my code:

import { useEffect, useRef, useState } from "react";
import MessageStatus from "../common/MessageStatus";
import WaveSurfer from "wavesurfer.js";
import { FaPlay, FaPause } from "react-icons/fa";

const VoiceMessage = ({ user, message }) => {
  const [audioMessage, setAudioMessage] = useState(null);
  const [totalDuration, setTotalDuration] = useState(0);
  const [currentPlaybackTime, setCurrentPlaybackTime] = useState(0);
  const [playingAudio, setPlayingAudio] = useState(false);
  const [waveform, setWaveform] = useState(null);
  const [audioRate, setAudioRate] = useState(1);

  const waveFormRef = useRef(null);

  useEffect(() => {
    const waveSurfer = WaveSurfer.create({
      container: waveFormRef.current,
      waveColor: "#040404",
      progressColor: "#040404",
      barWidth: 2,
      height: 30,
      barGap: 2,
      minPxPerSec: 1,
      fillParent: true,
      dragToSeek: true,
      audioRate: audioRate,
    });

    setWaveform(waveSurfer);

    waveSurfer.on("finish", () => {
      setPlayingAudio(false);
    });

    return () => {
      if (waveSurfer) {
        waveSurfer.destroy();
      }
    };
  }, []);

  useEffect(() => {
    if (waveform) {
      const audio = new Audio(message.message);
      setAudioMessage(audio);
      waveform.load(message.message);

      waveform.on("ready", () => {
        setTotalDuration(waveform.getDuration());
      });

      return () => {
        if (waveform) {
          waveform.un("ready");
        }
      };
    }
  }, [waveform, message.message]);

  const handlePlayingAudio = () => {
    if (audioMessage) {
      waveform.play();
      setPlayingAudio(true);
    }
  };

  const handleStopAudio = () => {
    if (audioMessage) {
      waveform.stop();
      setPlayingAudio(false);
    }
  };

  const handleChangeAudioRate = () => {
    if (audioRate === 1) {
      setAudioRate(1.5);
      waveform.setPlaybackRate(1.5);
    } else if (audioRate === 1.5) {
      setAudioRate(2);
      waveform.setPlaybackRate(2);
    } else {
      setAudioRate(1);
      waveform.setPlaybackRate(1);
    }
  };

  const formatTime = (time) => {
    if (isNaN(time)) return "00:00";
    const minutes = Math.floor(time / 60);
    const seconds = Math.floor(time % 60);
    return `${minutes.toString().padStart(2, "0")} : ${seconds
      .toString()
      .padStart(2, "0")}`;
  };

  useEffect(() => {
    if (waveform) {
      const updatePlaybackTime = () => {
        setCurrentPlaybackTime(waveform.getCurrentTime());
      };

      waveform.on("audioprocess", updatePlaybackTime);

      waveform.on("finish", () => {
        setCurrentPlaybackTime(0);
      });

      return () => {
        waveform.un("audioprocess", updatePlaybackTime);
        waveform.un("finish");
      };
    }
  }, [waveform]);

  return (
    <div
      className={`flex ${
        message.sender !== user.userInfo._id ? "justify-start" : "justify-end"
      } mb-2`}
    >
      <div className="relative max-w-md p-5">
        <div
          className={`p-1 rounded-xl shadow-lg break-words  ${
            message.sender !== user.userInfo._id
              ? "bg-secondary text-secondary-foreground rounded-bl-none"
              : "bg-primary text-primary-foreground rounded-br-none"
          }`}
        >
          <div className="p-2 rounded-xl">
            <div className="flex items-center gap-4">
              {audioMessage &&
                (!playingAudio ? (
                  <div
                    className="cursor-pointer w-8"
                    onClick={handlePlayingAudio}
                  >
                    <FaPlay className="text-xl" />
                  </div>
                ) : (
                  <div className="cursor-pointer w-8" onClick={handleStopAudio}>
                    <FaPause className="text-xl" />
                  </div>
                ))}
              <div className="flex flex-col w-52">
                <div className="flex w-52 gap-2">
                  <div
                    className="w-40"
                    ref={waveFormRef}
                    id="waveformContainer"
                  ></div>
                  <div className="flex justify-center w-10 rounded-full px-2 bg-slate-500/30">
                    <button className="text-sm" onClick={handleChangeAudioRate}>
                      {audioRate}x
                    </button>
                  </div>
                </div>
                <span className="text-xs">
                  {!playingAudio
                    ? formatTime(totalDuration)
                    : formatTime(currentPlaybackTime)}
                </span>
              </div>
            </div>
          </div>
          <div className="flex justify-between px-1 gap-8">
            {message.sender === user.userInfo._id && (
              <MessageStatus recipients={message.recipientStatuses} />
            )}
            <div
              className={`text-xs text-gray-500 ${
                message.sender !== user.userInfo._id ? "text-start" : "text-end"
              }`}
            >
              {calculateTime(message.createdAt)}
            </div>
          </div>
        </div>
      </div>
    </div>
  );
};

export default VoiceMessage;

I’ve tried a few things like using refs and state to keep track of the playing instance, but I can’t seem to get the behavior right where the previous message stops when a new one is played. Could anyone guide me on how to implement this?

How to correctly configure TypeScript with Vue 3 and Cypress for E2E testing?

I’m working on a Vue 3 project where I’ve decided to use TypeScript for type safety and Cypress for end-to-end (E2E) testing. I followed the standard setup instructions, but I’m running into issues where Cypress tests don’t seem to recognize my TypeScript files properly.

Initialized a Vue 3 project with TypeScript using the Vue CLI.
Installed Cypress using the Vue CLI E2E testing option.
Configured Cypress to recognize TypeScript files by adding a tsconfig.json in the cypress folder.

Unable to perform custom rotation for image overlay component over react-leaflet

I want to add a custom overlay image component and user can perform rotation using 4 or 2 bounds on image i have tried few plugin react-leaflet-distortable-imageoverlay but it is not compatible with react-leaflet latest version. I have tried creating issue on that github but not getting any respond.

This is the codesandbox link where i have rendered image and also enable dragging for that

https://codesandbox.io/p/sandbox/react-leaflet-image-5khqrg?file=%2Fsrc%2FApp.js

here i want to add rotation for that image similar like this
ref: https://publiclab.github.io/Leaflet.DistortableImage/examples/index.html

Thanks in advance.
Any suggestion would helpful for me as i am facing issue from last 2 weeks.

current react-leaflet version-> 4.2.1

Is .strokeStyle of the canvas API a method which makes itself global?

I am curious on the curious behaviour of js, in particular with this method .strokeStyle which usually is used to change the color of a stroke on a HTML canvas. It seems to me quite peculiar, for exmaple if I use 2 functions such as in this snippet (to draw an ‘L’)-

<!DOCTYPE html>
<html>
<body>
<h1>HTML5 Canvas</h1>
<h2>The stroke() Method</h2>

<canvas id="myCanvas" width="300" height="150" style="border:1px solid grey"></canvas>

<script>
const c = document.getElementById("myCanvas");
const ctx = c.getContext("2d");

function first() {
ctx.beginPath();
ctx.strokeStyle = "red";
ctx.moveTo(20, 20);
ctx.lineTo(20, 100);
ctx.stroke();
};

function second() {
ctx.beginPath();
ctx.moveTo(20, 100);
ctx.lineTo(70, 100);
ctx.stroke();
};

first();
second();
</script> 

</body>
</html>

One might expect that when the second() is executed, it’s stroke color will be Black (since this is the default). However, this does not happen and the stroke color is Red. This seems strange to me since coming from the land of functional programming, I see function as isolated, independent units of code. Am I doing something wrong? if not, then is there a way to contain it’s global effects?

Determining Current Keyboard Language Settings for External Input in Tizen TV Web Application

I’m working on developing an input field for my Tizen TV web application and have observed that when using an external keyboard, the text entered in the Tizen browser or Search apps reflects the language settings configured in the Input Device Manager -> Keyboard Settings. However, I’m not sure how to identify the current settings. How can I check which keyboard language is currently active?

I attempted to use

const keyboardLang = navigator.language || navigator.userLanguage;

but it didn’t return the language setting of the external keyboard. The same issue occurred when I tried using the

tizen.systeminfo.getPropertyValue("LOCALE",{}) API

Trying to name an array just made by new Array

I’m trying to make an array automatically and store it in another array by making an array and using new Array to do this but I don’t know how to name it.

here is my code:

<button id="newArray">New Array</button>

<script>
    let newArray = document.getElementById("newArray")
    let ArrayOfArrays = []
    newArray.addEventListener("click", function() {
        ArrayOfArrays.push(new Array(1,2,3))
        ArrayOfArrays[0].name = numbers
        numbers.push(4)
        console.log(numbers)
    })
</script>

it turns out that .name isn’t what you use for naming it and if it is you can’t call by it. I’ve tried arrayOfArrays[0] but that isn’t efficient enough.

UIncaught ReferenceError: db is not defined at HTMLButtonElement. (VM586 editor.js:66:9)

I’m building a blog website using Firebase Firestore and JavaScript. I’m trying to save blog posts to Firestore, but I’m encountering an issue where db is not defined when I attempt to use it in my editor.js file.

Here’s a brief overview of what I’m trying to do:

User Interface: I have an input field for the blog title and a text area for the article content. There’s also an option to upload an image for the banner, which gets displayed at the top of the blog post.
Publishing the Post: When the user clicks the “Publish” button, I want to generate a unique document ID, gather the input data, and store it in Firestore under a new document in the “blogs” collection.
Problem: Despite setting up Firebase and Firestore correctly (or so I think), when I try to use the db variable to interact with Firestore, I get a ReferenceError: db is not defined.

this is my editor.js

const blogTitleField = document.querySelector('.title');
const articleField = document.querySelector('.article');

// banner
const bannerImage = document.querySelector('#banner-upload');
const banner = document.querySelector(".banner");
let bannerPath;

const publishBtn = document.querySelector('.publish-btn');
const uploadInput = document.querySelector('#image-upload');

bannerImage.addEventListener('change', () => {
    uploadImage(bannerImage, "banner");
})

uploadInput.addEventListener('change', () => {
    uploadImage(uploadInput, "image");
})

const uploadImage = (uploadFile, uploadType) => {
    const [file] = uploadFile.files;
    if (file && file.type.includes("image")) {
        const formdata = new FormData();
        formdata.append('image', file);

        fetch('/upload', {
            method: 'post',
            body: formdata
        }).then(res => res.json())
            .then(data => {
                if (uploadType == "image") {
                    addImage(data, file.name);
                } else {
                    bannerPath = `${location.origin}/${data}`;
                    banner.style.backgroundImage = `url("${bannerPath}")`;
                }
            })
    } else {
        alert("upload Image only");
    }
}

const addImage = (imagePath, alt) => {
    let curPos = articleField.selectionStart;
    let textToInsert = `r![${alt}](${imagePath})r`;
    articleField.value = articleField.value.slice(0, curPos) + textToInsert + articleField.value.slice(curPos);
}

let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

publishBtn.addEventListener('click', () => {
    if (articleField.value.length && blogTitleField.value.length) {
        // generating id
        let letters = 'abcdefghijklmnopqrstuvwxyz';
        let blogTitle = blogTitleField.value.split(" ").join("-");
        let id = '';
        for (let i = 0; i < 4; i++) {
            id += letters[Math.floor(Math.random() * letters.length)];
        }

        // setting up docName
        let docName = `${blogTitle}-${id}`;
        let date = new Date(); // for published at info

        //access Firestore with db variable;
        db.collection("blogs").doc(docName).set({
            title: blogTitleField.value,
            article: articleField.value,
            bannerImage: bannerPath,
            publishedAt: `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`
        })
            .then(() => {
                location.href = `/${docName}`;
            })
            .catch((err) => {
                console.error(err);
            })
    }
})

this is my firebase installation (firebase.jsm)
Can any one help me plzzz,

import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    apiKey: "AIzaSyDQaVM5xjFB-WB4IQXnupSvWOJSQdlrN00",
    authDomain: "bloggin-site-c4727.firebaseapp.com",
    projectId: "bloggin-site-c4727",
    storageBucket: "bloggin-site-c4727.appspot.com",
    messagingSenderId: "170432646256",
    appId: "1:170432646256:web:f36807db85372e1956f8b5"
};

const app = initializeApp(firebaseConfig);

firebase.initializeApp(firebaseConfig);
const db = firebase.firestore();

export { db };

In my HTML, I’m including the scripts like this:

<script src="https://www.gstatic.com/firebasejs/10.13.0/firebase-app.mjs"></script>
<script src="https://www.gstatic.com/firebasejs/10.13.0/firebase-firestore.mjs"></script>
<script src="js/firebase.js"></script>
<script src="js/home.js"></script>

Here’s a brief overview of what I’m trying to do:

User Interface: I have an input field for the blog title and a text area for the article content. There’s also an option to upload an image for the banner, which gets displayed at the top of the blog post.
Publishing the Post: When the user clicks the “Publish” button, I want to generate a unique document ID, gather the input data, and store it in Firestore under a new document in the “blogs” collection.
Problem: Despite setting up Firebase and Firestore correctly (or so I think), when I try to use the db variable to interact with Firestore, I get a ReferenceError: db is not defined.

However, when I try to publish a blog post,

I get the following error in the console:

Uncaught ReferenceError: db is not defined
at HTMLButtonElement.<anonymous> (editor.js:66:9)

I’m not sure why this is happening, as I’ve correctly exported db from firebase.mjs and imported it in editor.js. I’ve tried including the Firebase SDK via <script> tags as well, but the error persists.

Could anyone point out what might be going wrong here?

Thanks in advance for your help!

Is there a way to make multiple calls in MongoDB all at once?

I’m a developer using MongoDB.
A server based on node.js is using mongoose.

It increases the score of the person you want, and I’m going to give him 5 points if he’s a man and 10 points if he’s a woman.

let person = await Person.findOne({_id:'66cb30f2f3aaaeb2676f0b81'}); // First call
let score = person.gender == 'female'? 10 : 5;
await Person.findOneAndUpdate({_id:'66cb30f2f3aaaeb2676f0b81'}, {'$inc' : {'score':score}}) // Second call

It works as you wish with the code above.
But, it’s very uncomfortable to have MongoDB work twice, and I think there’s a better alternative.
If MongoDB is on an external server, wasteful traffic twice.

The heart of my question is this.
Can multiple commands be grouped together and called at once?

I look forward to hearing from you.

What are the uses of Barium sulphate?

Barium sulfate (BaSO₄) has several important applications across various industries due to its unique properties:

  1. Medical Imaging: It is widely used as a contrast agent in X-ray and CT scans to enhance the visibility of the gastrointestinal tract.
  2. Pigments and Coatings: Barium Sulfate is used as a white pigment in paints and coatings. It provides a lack of transparency and improves the durability of the paint.
  3. Oil and Gas Industry: It is used as a weighting agent in drilling fluids for oil and gas exploration. The high density of barium sulfate helps to control the pressure in the wellbore and prevent blowouts.
  4. Plastics and Rubber: In the plastics and rubber industries, barium sulfate is used as a filler to improve the mechanical properties and durability of products.

Barium sulfate is used to help diagnose or find problems in the esophagus, stomach, and bowels. It is a radiographic contrast agent. Contrast agents are used to create a clear picture of the different parts of the body. This medicine is to be given only by or under the direct supervision of a doctor.

I have native federation redirection issue with angular17 Appliction

TypeError: 404 Not Found
http://localhost:4212/_angular_platform_browser-17_3_12-dev.js
imported from http://localhost:4212/chunk-73VJIL6Z.js this issue is
facing on host application console on firefox there is no issue in
shell application.

package.json is

{
  "name": "host",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular-architects/native-federation": "^17.0.7",
    "@angular/animations": "^17.0.0",
    "@angular/cdk": "^17.0.0",
    "@angular/common": "^17.0.0",
    "@angular/compiler": "^17.0.0",
    "@angular/core": "^17.0.0",
    "@angular/forms": "^17.0.0",
    "@angular/platform-browser": "^17.0.0",
    "@angular/platform-browser-dynamic": "^17.0.0",
    "@angular/router": "^17.0.0",
    "@cubejs-client/ngx": "^0.35.0",
    "@ng-bootstrap/ng-bootstrap": "^16.0.0",
    "@ngx-translate/core": "^15.0.0",
    "@ngx-translate/http-loader": "^8.0.0",
    "angular-gridster2": "^17.0.0",
    "es-module-shims": "^1.5.12",
    "file-saver": "^2.0.5",
    "font-awesome": "^4.7.0",
    "jspdf-autotable": "^3.8.2",
    "jwt-encode": "^1.0.1",
    "primeng": "^17.0.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "xlsx": "^0.18.5",
    "zone.js": "~0.14.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^17.0.0",
    "@angular/cli": "^17.0.0",
    "@angular/compiler-cli": "^17.0.0",
    "@types/jasmine": "~5.1.0",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.2.2"
  }
}

I have used all libraries related to angular 17. Initially it was running but after adding new packages it is giving an error

SVG strategy for simple text animation – acronym to full company name

Thankyou in advance for any feedback you might have.

SVG graphic creation and animation seems like the wild wild west searching between solutions (Sketch, SnapSVG, Raphael, AI). However, when it comes to WordPress, only certain SVG applications work when using as an external SVG file, or a copied “Embed” code.

I’m trying to achieve a simple effect that animates a company acronym on hover, expanding the logo area to display the whole company name. Testing this on a personal project before I apply to a commercial application. The “trigger” effect which cues the animation could be jquery, CSS, or embedded in the SVG… doesn’t matter to me. However, the goal is to preserve as much of the animation functionality within the SVG file itself in the interests of portability and responsive scaling. Externalizing fonts, jquery, and css does not resolve the issue.

The following example demonstrates the desired effect in pure SVG form….
https://simondelasalle.com/wp-content/themes/sdls-2023-uncode/template-test-wordmark-click.svg

Here’s the code:

  <svg xmlns="http://www.w3.org/2000/svg" width="600" height="200" xmlns:xlink="http://www.w3.org/1999/xlink">
    <style type="text/css">
        @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200;500;900&amp;display=swap');
        .brace {
            font-family: 'Nunito', sans-serif;
            font-weight: 200;
            font-size: 80px;
            line-height: 70px;
        }
        .acronym {
            font-family: 'Nunito', sans-serif;
            font-weight: 900;
            font-size: 40px;
            text-transform: uppercase;
            letter-spacing: -2.4px;
        }
        .company-name {
            font-family: 'Nunito', sans-serif;
            font-weight: 500;
            font-size: 24px;
        }
        .subheader {
            font-family: 'Nunito', sans-serif;
            font-weight: 200;
            font-size: 14px;
            color: #666;
            text-align: center;
        }
    </style>

    <!-- Left brace -->
    <text class="brace left-brace" x="0" y="100">{</text>

    <!-- Acronym letters -->
    <g id="acronym-group" class="acronym" transform="translate(36, 73)">
      <text class="letter" x="0" y="0">S</text>
      <text class="letter" x="35" y="0">D</text>
      <text class="letter" x="2" y="40">L</text>
      <text class="letter" x="37" y="40">S</text>
    </g>

    <!-- Full company name -->
    <g id="company-group" class="company-details" transform="translate(26, 75)" opacity="0">
      <text class="company-name" x="0" y="0">Simon de la Salle</text>
      <text class="subheader" x="0" y="20">Web Design &amp; Development</text>
    </g>

    <!-- Right brace -->
    <text class="brace right-brace" x="110" y="100">}</text>

    <!-- JavaScript logic -->
    <script type="application/ecmascript">
      <![CDATA[
        document.addEventListener('DOMContentLoaded', function() {
          const acronymGroup = document.getElementById('acronym-group');
          const companyName = document.getElementById('company-group');
          const leftBrace = document.querySelector('.left-brace');
          const rightBrace = document.querySelector('.right-brace');
          let showingAcronym = true;

          // Function to animate in the company name
          function showCompanyName() {
            acronymGroup.style.transition = "opacity 0.6s ease-out, transform 0.6s ease-out";
            acronymGroup.style.opacity = 0;
            // acronymGroup.style.transform = "translateX(-100px)"; // Slide out to the left

            companyName.style.transition = "opacity 0.6s ease-out, transform 0.6s ease-out";
            companyName.style.opacity = 1;  
            // companyName.style.transform = "translate(100)"; // Slide back into place

              
            leftBrace.style.transition = "font-size 0.6s ease, transform 0.6s ease-out, transform 0.6s ease-out";
            leftBrace.style.fontSize = "40px";
            leftBrace.style.transform = "translate(0,-12px)";
              
            rightBrace.style.transition = "font-size 0.6s ease, transform 0.6s ease-out, transform 0.6s ease-out";
            rightBrace.style.fontSize = "40px";
            rightBrace.style.transform = "translate(116px,-12px)"; 

            showingAcronym = false;
          }

          // Function to animate back to the acronym
          function showAcronym() {
            // acronymGroup.style.transform = "translateX(100, 75)"; // Slide back into place
            acronymGroup.style.opacity = 1;

            companyName.style.opacity = 0;

            leftBrace.style.transition = "font-size 0.6s ease, transform 0.6s ease-out";
            leftBrace.style.fontSize = "80px";
            leftBrace.style.transform = "translateX(0)"; 
              
            rightBrace.style.transition = "font-size 0.6s ease, transform 0.6s ease-out";
            rightBrace.style.fontSize = "80px";
            rightBrace.style.transform = "translateX(0)"; 

            showingAcronym = true;
          }

          // Add click event listener
          document.addEventListener('click', function() {
            if (showingAcronym) {
              showCompanyName();
            } else {
              showAcronym();
            }
          });
        });
      ]]>
    </script>
  </svg>

When implementing within a WordPress environment (such as a theme logo) either as an uploaded SVG or Oembed the animation does not display.

Here is an example of an SVG animation that does work in WordPress (doesn’t have any mouseover interaction, but animation works correctly):
https://sdlsdevelop.wpenginepowered.com/wp-content/uploads/2024/08/icon-software_layers2-MajorelleBlue.svg

Any ideas on what I’m doing wrong in the creation of an SVG that is sensitive to “hover”?

Thanks for your time in advance stackers!