Towfiq Sultan About

Poet and Writer Tawfiq Sultan (BN-Al Tawfiqi)

Towfiq Sultan (Ar : التوفيقي) [EN- Al Towfiqi] was born on February 4, 1999 (Bangla Thursday, 21 Magh 1405 Bangabd) 17th Shawwal, 1419 AH: in Barishab village under Kapasia Upazila of Gazipur District, Bangladesh.

Poet and Writer Towfiq Sultan (Poet and Writer Towfiq Sultan) is the eldest child of Abdul Karim (1 January 1972), a former teacher of Islam Taj Balika Dakhil Madrasa, and Fatima Begum (3 March 1982). Kabir’s younger brother Muhammad Fahim Al Tawfiqi is a student of Madrasa.

Poet Tawfiq Sultan hopes to meet Allah by being among the beloved servants of Allah.

He wants to be a pioneer in good works.

Seeking and attaining true knowledge to gain the satisfaction of the great creator, working for the welfare of humanity with honesty and justice, dreams of building a beautiful society. I want to work to make people’s lives easier.

Apart from writing poems, rhymes, daily Pratrika Kalbela, Daily Ittefaq, Samakal, Kale Kanth, Naya Digant, Bhorer Kagazi, Yugantar, Jayzaydin, Prothom Alo, Desh Parwand, Daily Donate Bangladesh, Alokit Bangladesh, Alor Thanh, Daily Khabar Dak, I He writes reports, features and columns in various newspapers including News, Sakal Kanth, Jago News 24.com, Dainik Anandabazar Patrika, Sanbad, Sangram, Inkilab, Lakho Kanth, Bangladesh Bulletin.

Poet Tawfiq Sultan is the Chief Executive Director of Wellfsion Manav Kalyan Sangh and founder of Wellfsion Satya Inquiri Gyan Anuragi Kalyanami Dal Open Library and Al Tawfiqi Family.

Early life:

He was born on 4 February 1999 in Barishab village of Kapasia under Gazipur district. His father, Abdul Karim, is a former teacher at Islam Taj Balika Dakhil Madrasa in Bangladesh and he leads prayers at a mosque in Barishab Union. Mother Fatema Begum is also known as Imam or Maulbi.

The eldest child of the poet Taufiq Sultan family, the writer’s younger brother Mohammad Fahim is studying in class 9.

His maternal grandfather Maulvi Abu Yusuf Barjapur Panchua Riyad Jame Masjid Imam Kavi spent most of his free time with his maternal grandfather.

education life

He passed SSC from Shahabuddin Memorial Academy and got admission in MA Majid Science College. Studied at Dhaka Medical Institute, Bangladesh Medical Institute, Bhawal Badre Alam Government College, Dhaka International University and later completed internship in Emergency Casualty Department, Medicine Outdoor, Surgery Outdoor from Dhaka Medical College Hospital. He also took IT and teacher training from Dhaka.

working life

Author Taufiq Sultan served as Business Development Officer in Banglalink (SME) Company from 2016 to 2017. From 04th February 2019, he took charge as the Chief Executive Officer of Welfare Human Welfare Association. He started teaching for some time and in 2023 he started working as district representative and special correspondent and reporter in various newspapers.

organization

In his 2012 biography of the Prophet ﷺ, author Tawfiq Sultan read the history of the Hilf ul Fuzul or Halaf-ul-Fuzul (Arabic: حلف الفضول‎‎) organization.

Welfare created the impetus to form Shanti Sangha or welfare organizations. Since 2012, he has been researching, researching, surveying, auditing, researching on the needs of Wikipedia with the aim of creating unity among the people of the society, helping the afflicted, sheltering the needy and helping the helpless, education, development and creating well-being people. , Internet, UNESCO structure, with the help of individuals and various social organizations started writing the welfare structure in 2018.

In 2019, he included a group of people in an organizational structure through discussions with his friends, classmates, distinguished people of the society. Kalyan Kami brings groups & individuals together to achieve specific goals & objectives. Social, developmental and developmental with the firm conviction to build a bridge of mutual cooperation, solidarity, brotherhood and build ideal society and life, including education awareness in each area, elimination of unemployment, socio-economic development, action, cultural environment, self-employment, human rights and establishing peace around the world. Voluntary organization Welfare Human Welfare Association established the organization on February 4, 2019 with the slogan “Let’s work for the welfare of humanity and build a beautiful society” with the aim of establishing peace through honesty and welfare.

Muhammad Him Al Tawfiqi:

Fahim Al Tawfiqi was born on 7 August 2004.

He is the younger brother of the poet Tawfiq Sultan and a member of the Al Tawfiqi family.

Abdul Karim:

Abdul Karim Sahib was born on January 1, 1972.

He is the father of author Tawfiq Sultan and a member of the Al Tawfiqi family.

Fatima Begum:

Fatema Begum was born on 3 March 1982.

She is the mother of the poet Tawfiq Sultan and a member of the Al Tawfiqi family.

Poet and Writer Tawfiq Sultan (BN-Al Tawfiqi)

Towfiq Sultan (Ar : التوفيقي) [EN- Al Towfiqi] was born on February 4, 1999 (Bangla Thursday, 21 Magh 1405 Bangabd) 17th Shawwal, 1419 AH: in Barishab village under Kapasia Upazila of Gazipur District, Bangladesh.

Poet and Writer Towfiq Sultan (Poet and Writer Towfiq Sultan) is the eldest child of Abdul Karim (1 January 1972), a former teacher of Islam Taj Balika Dakhil Madrasa, and Fatima Begum (3 March 1982). Kabir’s younger brother Muhammad Fahim Al Tawfiqi is a student of Madrasa.

Poet Tawfiq Sultan hopes to meet Allah by being among the beloved servants of Allah.

He wants to be a pioneer in good works.

Seeking and attaining true knowledge to gain the satisfaction of the great creator, working for the welfare of humanity with honesty and justice, dreams of building a beautiful society. I want to work to make people’s lives easier.

Apart from writing poems, rhymes, daily Pratrika Kalbela, Daily Ittefaq, Samakal, Kale Kanth, Naya Digant, Bhorer Kagazi, Yugantar, Jayzaydin, Prothom Alo, Desh Parwand, Daily Donate Bangladesh, Alokit Bangladesh, Alor Thanh, Daily Khabar Dak, I He writes reports, features and columns in various newspapers including News, Sakal Kanth, Jago News 24.com, Dainik Anandabazar Patrika, Sanbad, Sangram, Inkilab, Lakho Kanth, Bangladesh Bulletin.

Poet Tawfiq Sultan is the Chief Executive Director of Wellfsion Manav Kalyan Sangh and founder of Wellfsion Satya Inquiri Gyan Anuragi Kalyanami Dal Open Library and Al Tawfiqi Family.

Early life:

He was born on 4 February 1999 in Barishab village of Kapasia under Gazipur district. His father, Abdul Karim, is a former teacher at Islam Taj Balika Dakhil Madrasa in Bangladesh and he leads prayers at a mosque in Barishab Union. Mother Fatema Begum is also known as Imam or Maulbi.

The eldest child of the poet Taufiq Sultan family, the writer’s younger brother Mohammad Fahim is studying in class 9.

His maternal grandfather Maulvi Abu Yusuf Barjapur Panchua Riyad Jame Masjid Imam Kavi spent most of his free time with his maternal grandfather.

er of the Al Tawfiqi family.

I want to push the data into the database MongoDB using HTTP request POST

When i npm run dev, the main root file(page.js) executes which connects the database. Below is the code:-

import "./globals.css";
import { connectDB } from "../../mongodb";
import database from "../../models/Schema";

const bodyParser = require("body-parser");
const express = require("express");
const app = express();
app.use(bodyParser.json());

connectDB();


export default function Home() {
  return (
    <>
      <div className="percentContainer">
        <div className="eightyPercent">
          {/* <Image className="chamber" src={chamber} /> */}
        </div>
        <div className="twentyPercent">
          <button className="startButton">
            {" "}
            <a href="/login">START </a>
          </button>
        </div>
      </div>
    </>
  );
}

now i have a signup page which collects the data and stores it into formData (hook) without any issues. The main problem is i want to fetch the data inside of my server.js file using http request post method and push it into my database. Here is the code for signup.js:-

import React from "react";
import Image from "next/image";
import "../src/app/signup.css";
import valoJett from "../public/images/valoJett.jpg";
import valorantlogo from "../public/images/valorantlogo.png";
import { MoveRight } from "lucide-react";
import { useState } from "react";

function signup() {
  const [formData, setFormData] = useState({
    username: "",
    email: "",
    password: "",
  });

  // const handleChange = (e) => {
  //   const { name, value } = e.target;
  //   setFormData((prevState) => ({
  //     ...prevState,
  //     [name]: value,
  //   }));
  // };

  const handleChange = (e) => {
    setFormData({ ...formData, [e.target.name]: e.target.value });
  };

  const handleSubmit = async (e, res) => {
    e.preventDefault();
    try {
      const response = await fetch("/signup", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify(formData),
      });

      if (response.ok) {
        console.log("Form data successfully sent to server");
        console.log(formData);

        // console.log(formData);
        // window.location.href = "/login";
      } else {
        console.error("Failed to submit form data to server");
      }
    } catch (error) {
      console.error("Error submitting form data:", error);
    }

    // const data = formData
    // console.log(data);
  };

  return (
    <>
      <div className="sign-up">
        <div className="valojett">
          <Image className="valojett-image" src={valoJett} />
        </div>
        <form
          onSubmit={handleSubmit}
          id="myForm"
          action="/signup"
          method="post"
        >
          <div className="signup-container">
            <Image className="signup-valorant-logo" src={valorantlogo}></Image>
            <div className="signup-text">
              Sign up for a <span className="valorant-text">valorant</span>{" "}
              Account.
            </div>
            <input
              type="text"
              name="username"
              id="signup-input"
              value={formData.username}
              onChange={handleChange}
              className="signup-username"
              placeholder="USERNAME"
            ></input>
            <input
              name="email"
              type="email"
              value={formData.email}
              onChange={handleChange}
              id="signup-input"
              className="signup-email"
              placeholder="EMAIL"
            ></input>
            <input
              name="password"
              type="text"
              value={formData.password}
              onChange={handleChange}
              id="signup-input"
              className="signup-password"
              placeholder="PASSWORD"
            ></input>
            <button type="submit">
              SUBMIT
              {/* <MoveRight type="submit" className="move-right" href="/login" /> */}
            </button>
            <a className="middle" href="/login">
              <div className="already-have-account">
                Already have an account?
              </div>
            </a>
          </div>
        </form>
      </div>
    </>
  );
}

export default signup;

Please help me.

For some reason app.post() in my server.js is not able to fetch the data from the signup page.

angular.copy on element of type CSSStyleDeclaration

ran into a problem using angularjs writing:

const originalStyles = angular.copy(el.style)

when style is of type:

CSSStyleDeclaration

later on,i try to access originalStyles.position
it works well on chrome, but fails on safari throwing the error

TypeError: The CSSStyleDeclaration.position getter can only be used on
instances of CSSStyleDeclaration

can you please explain why it fails?

LiveChat with laravel and ajax [closed]

My team at work has already created a live chat system using Laravel and Ajax. However, I have noticed an issue with the messages. Currently, the messages are being displayed on either the right or left side of the chat window. I would like to resolve this problem by ensuring that the user’s messages always appear on the right side, while the messages from the guest or the person they are conversing with appear on the left side.

my controller code

public function getGroupMessage($chat_id)
 {
$user_id = Auth::user();
$member_id = ChatsMembers::where('user_id', $user_id->id)->select('id')->first()->id;
$chats = Chats::with('messages', 'member')->find($chat_id);

$memberGroup = [];
foreach ($chats->member as $member) {
  if ($member->user_type == '0') {
    // admin  
    $memberAdmin = User::select('id', 'name', 'image')->where('id', $member->user_id)->first();
    $adminDetailes = [
      "user_id" => $memberAdmin->id,
      "name" => $memberAdmin->name,
      "image" => $memberAdmin->image,
      "user_type" => "0",
      "member_id" => $member->id,
      "chat_id" => $member->chat_id,
    ];
    array_push($memberGroup, $adminDetailes);
  } elseif ($member->user_type == '1') {
    $memberTeacher = Teacher::select('id', 'first_name', 'last_name', 'image')->where('id', $member->user_id)->first();
    $teacherDetailes = [
      "user_id" => $memberTeacher->id,
      "name" => "<a href='" . route('management.teachers.index', ['userId' => $member->user_id]) . "'>" . $memberTeacher->first_name . ' ' . $memberTeacher->last_name . "</a>",
      "image" =>  $memberTeacher->image,
      "user_type" => "1",
      "member_id" => $member->id,
      "chat_id" => $member->chat_id,
    ];
    array_push($memberGroup, $teacherDetailes);
  } elseif ($member->user_type == '2') {
    $memberStudent = Student::select('id', 'first_name', 'last_name', 'image')->where('id', $member->user_id)->first();
    $studentDetailes = [
      "user_id" => $memberStudent->id,
      "name" => "<a href='" . route(('management.families.showy'), ['id' => $member->user_id]) . "'>" . $memberStudent->first_name . ' ' . $memberStudent->last_name . "</a>",
      "image" =>  $memberStudent->image,
      "user_type" => "2",
      "member_id" => $member->id,
      "chat_id" => $member->chat_id,
    ];
    array_push($memberGroup, $studentDetailes);
  }
}

and there is a ajax code

$('#messages-container').empty();
                    // Append the new messages to the container
                    for (var i = 0; i < response[0].messages.length; i++) {
                        let createdAt = new Date(response[0].messages[i].created_at);
                        let formattedTime = new Intl.DateTimeFormat('en-US', {
                            hour: 'numeric',
                            minute: 'numeric',
                            hour12: true
                        }).format(createdAt);

                        let senderMessage, userId, messageSeen, messageDelete;

                        if (response[0].member[i] && response[0].messages[i] && response[0].member[i].id === response[0].messages[i].member_id === currentUserId) {
                          senderMessage = false;
                            userId = "";
                            messageSeen = "";
                        } else {
                          senderMessage = true;
                            userId = "chat-message-right";
                            messageSeen = "text-success";
                        }

the problem I think in condition i already try a lot of solutions but still the same problem

and the last thing I do some tests

console.log(response[0].member[i]);
console.log(response[0].messages[i]);
console.log(response[0].member[i].id);
console.log(response[0].messages[i].member_id);

and after that this is the response

{id: 9, chat_id: 4, user_id: 1, is_admin: 0, user_type: '0', …}chat_id: 4created_at: 
nulldeleted_at: nullid: 9is_admin: 0updated_at: nulluser_id: 1user_type: "0" 
[[Prototype]]: Object
chat:1511 {id: 1, member_id: 12, chat_id: 4, content: {…}, seen: {…}, …}chat_id: 
4content: {body: 'HERO', size: null, type: 'Text'}created_at: "2024-02- 
21T15:09:23.000000Z"deleted_at: nullid: 1member_id: 12seen: {10: '0', 12: 
'2'}updated_at: 
"2024-02-21T15:13:04.000000Z"user_id: null[[Prototype]]: Object
chat:1512 9
chat:1513 12

pleas help me i stay in this issue for 4 days XD

service worker scope in webpack

  1. I register a service work by following code in webpack project, I deliberately narrowed the scope of the service worker.
    const registration = await navigator.serviceWorker.register(
      /* webpackChunkName: "service-worker-index" */ new URL(
        'sw',
        import.meta.url,
      ),
      {
        scope: '/js/business/',
      },
    )
  1. And then I update the “output/chunkFileName” setting of webpack as follow:
  output: {
    chunkFilename: (pathData) => {
      ......
      if (name.includes('service-worker-index')) {
        return '[name].js'
      }
      ......
    }
  }
  1. I visit the page, from the chrome dev tool, it seems the service work has been registered successully

service worker in dev tools

  1. But it also has already activated successfully, this is my confusing point; In my understanding, it should not be activated until I visit the page under the path ‘/js/business/’, is it right?

  2. And from the Network panel of the dev tools, I am very sure we did not visit any assets under the path ‘/js/business/’

Luxon .toLocaleString() returns [object Object] instead of a string

This should be pretty straight forward

import {DateTime} from "luxon";

const formatDate = (dateToFormat: DateTime, currentLanguage: string | undefined) => {
    return dateToFormat.toLocaleString({
        day: '2-digit',
        month: 'long',
        year: 'numeric',
    }, {locale: currentLanguage})
}

When I try formatDate(DateTime.local(), "en") it returns [object Object].

Why?

Reading response Json in to Map in javascript

I am getting below JSON as response to an AJAX call to a Java controller from Javascript.

{
  "dbList": {
    "1000002": "FTR Production, Ending: 2017-01-01",
    "1000438": "Coal File, Ending: 2018-01-31",
    "1000461": "TxP Activity, Ending: 2018-11-12"
    "1000850": "MarketScan 100% 6 plus years Set B, Ending: 2023-04-30"
 },
  "available": {
    "3": "Amgen",
    "5": "J&J/Janssen",
    "395": "IBM NPS Walkme Testing"
  }
}

I want to read value as key value pair in map in JavaScript like 1000002 as key and FTR Production, Ending: 2017-01-01 as value in one map and 3 as key and Amgen in another map.

One map for reading dbList and other map for reading available as key value.

Can any anybody help me out in resolving this issue?

How to repeat firing api call out in a while loop till there are no results left in response

I have an API running in Azure function which needs to be run multiple times in a loop so that i can get all the results .

The first API when it runs. It returns results with locator parameter in the heaader. Using the locator parmater we need to hit the api inside a loop to get all the results. locator paramter will always have a new value when the api is hit.

ANd each time i want to write the response into a new file. How to call the same api with different locator parameter till the locator value becomes null

const getjobresult = async(t) => {

  const requestOptions = {
    method: "GET",
    headers: {
      "Content-Type": 'application/json',
      "Accept": "text/csv",
      "Authorization": "Bearer " + t
    },
    redirect: "follow"
  };

  // This below api is called for first time where it returns 500000 records (which i am writing in a file ) and a parameter locator which contains a value through which we will get another set of record
  const resp = await fetch("https://someapi.test.com/services/data/v59.0/jobs/query/750Pw000005PqqBIAS/results?maxRecords=500000", requestOptions)
  const json = await resp.text();
  const fields = ['Id']
  let aa = resp.headers.get('locator')
  const rows = json.split((/r?n|r/)).slice(1);
  let lsttis = []
  rows.forEach(res => {
    let tis = {
      'tablename': 'TestTable'
    };
    tis.AccessLevel = 'Read';
    tis.ParentId = res.replace(/['"]+/g, '')
    tis.RowCause = 'Manual'
    tis.UserOrGroupId = '11111111'
    lsttis.push(tis)
  })

  if (lsttis.length > 0) {
    await creatcsvfile(lsttis)
  }
  // In this below code i am trying to refire the api using locator parameter inside a while loop.Everytime when api gets hit inside while loop, it returns a new locator value. This while loop should run till resp1.headers.get('locator') becomes null and everytime the response should be written in 
  // new file.
  var i = 0;
  while (true) {
    i++;
    const resp1 = await fetch("https://someapi.com/services/data/v59.0/jobs/query/750Pw000005PqqBIAS/results?locator=" + aa + "&maxRecords=500000", requestOptions)
    const json1 = await resp1.text();
    if (resp1.headers.get('locator') === undefined) {
      break;
    }
    const rows1 = json1.split((/r?n|r/)).slice(1);
    rows1.forEach(res => {
      let tis = {
        'tablename': 'TestTable'
      };
      tis.AccessLevel = 'Read';
      tis.ParentId = res.replace(/['"]+/g, '')
      tis.RowCause = 'Manual'
      tis.UserOrGroupId = '11111111'
      lsttis.push(tis)
    })
    // in this i am sending the i for creating new file for every response.
    if (lsttis.length > 0) {
      await creatcsvfile(lsttis, i)
    }
  }
}

const creatcsvfile = async(data, t) => {
  const fields = ['AccessLevel', 'ParentId', 'RowCause', 'UserOrGroupId']
  let csv = await json2csv.parse(data, {
    fields
  });
  //console.log(csv)
  fs.writeFileSync('./test' + t + '.csv', csv)
}

Appscript is not working error showing 500

Our AppScript process has been experiencing difficulties for the past four hours, consistently displaying Error 500. This issue is critical as the AppScript plays a vital role in our workflow, directly impacting our operations and productivity. Despite our internal troubleshooting efforts, we have been unable to resolve the issuE.

Need Solution ? how to resolve ?

Blurry Content in Dropdown Menu in Chrome but Not in Firefox

I’m experiencing an issue where the content of a dropdown menu appears blurry in Google Chrome, but it displays fine in Firefox. This issue occurs when the dropdown exceeds a certain height, and I’ve implemented a max-height with overflow scrolling to accommodate the content. The problem persists in Chrome regardless of various attempted fixes, including adjustments to CSS properties related to rendering and hardware acceleration.

<div id="dropdown-assignees" class="dropbtn">Assignees</div>
<div id="assign-to" class="dropdown-content-assign">
    <!-- Dynamically filled content -->
</div>
.dropdown-content-assign {
    max-height: 260px;
    overflow-y: auto;
    /* Other styling properties */
}
function toggleAssigneeDropdown() {
    let dropdownContent = document.getElementById('assign-to');
    dropdownContent.style.display = dropdownContent.style.display === 'block' ? 'none' : 'block';
    // Additional code to handle arrow icons and adjustments
}

Attempts to fix the issue:

I’ve tried applying CSS properties such as transform: translateZ(0); and will-change: transform; to force GPU acceleration, hoping it would improve the rendering, but it didn’t help.
Adjusting the -webkit-font-smoothing property didn’t resolve the blurriness.
Ensuring the latest version of Chrome is used and toggling the hardware acceleration setting in Chrome’s settings.
Despite these attempts, the content remains blurry in Chrome but is displayed correctly in Firefox. I suspect it might be a browser-specific rendering issue, but I’m at a loss for how to address it.

Question:

Has anyone encountered a similar issue or can provide insights into why this might be happening specifically in Chrome and how to fix it? Any suggestions or workarounds would be greatly appreciated.

Why ASYNC await acts differently in this code?

//1 code
async function test(){
    const a1 = await new Promise((res,rej)=>{
        setTimeout(()=>{
      return res("5 second promise")
        },5000)
   })
 
   console.log("first")
   const a2 = await new Promise((res,rej)=>{
    setTimeout(()=>{
    return res("2 second promise")
    },2000)
})
   
   console.log("second")
}
test();

//2 code
const p1 = new Promise((res,rej)=>{
    setTimeout(()=>{
  return res("5 second promise")
    },5000)
})

const p2 =  new Promise((res,rej)=>
    setTimeout(()=>{
    return res("2 second promise")
 }),2000)

async function test2(){
   await p1;
   console.log("first")
   await p2;
   console.log("second")

}
test2();


Code 1 prints “first” in 5 secs and then “second” after 2 seconds
Code 2 prints “first” and “second” after 5 seconds

I have questions

  1. why same code acting differently?
  2. If we call await it suspends that function then how come the second await p2 which has delay of 2 seconds is getting completed in same time that of first await p1 which has delay of 5 seconds, await p1 should complete in 5 seconds and after 2 seconds await p2 should suspend function and paused and print “second” after 2 seconds.
  3. what’s the difference which made code 1 to run properly ??

I am not getting be async is meant to pause at await and function is suspended how come the second await p2’s time is also started with p1 if the code in that line is not hit yet as its paused by first await.

Apache Echarts – custom toolbox feature not showing

In Apache Echarts I want to add a custom button to the toolbox. According to the examples and documentation it must be done in this way. But nothing shows up.

  toolbox: {
  right: '20%', 
  feature: {
      dataZoom: {},
      saveAsImage: {},
      magicType: {},
      myCustBut:{
        show: true,
        title: 'test option',
        icon: 'path://"../images/Europa.png"', // tried different options here
        onclick: function() {alert("Test")}
      }
  }
},  

This is what I see:
This is my result

What am I missing here?

Google API QR image is not rendering using html2canvas JS

I am creating a certificate using html2canvas JS and htmltopdf JS.I have an issue in my code while rendering Google API QR image but same if I render simple local folder images there is no issue.
It’s working cool with all images in my folder but I am generating QR code image using Google API

https://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=text

I got a QR code image on web page but while rendering and on final out it gets disappred.
I can upload image in my folder and display like this

<img src="myfolder/qr.png">

It works and never disappears from the rendering or final out using htmltocanvas.

Am I doing something wrong?
I want to use Google API and it should not be disappeared.

JS code

  function genPDF(quality = 15) {
    $("#dload").hide();
              $('#loading').html('<img src="assets/icon/subloader.gif" height="80" style="margin-top:-20px;">');
        const filename  = 'certificate.pdf';
         window.scrollTo(0,0); 
        html2canvas(document.querySelector('#testDiv'), 
                                {scale: quality,
                                width:840,
                            }
                         ).then(canvas => {
            var pdf = new jsPDF("l", "px", [828, 587]);
       
            
            var imgData = canvas.toDataURL('image/jpeg');
            var imgProps= pdf.getImageProperties(imgData);
                var pdfWidth = pdf.internal.pageSize.getWidth();
        var pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
            pdf.addImage(imgData, 'JPEG', 0, 0, pdfWidth, pdfHeight);
            pdf.save(filename);
             $('#loading').html('');
               $("#dload").show();
                setTimeout(function(){ 
       window.close();
}, 1000);

              
        });


    }

Javascript trigging a css animation problem

I was trying to trigger a css grid-template-columns animation via javascript. But I got a problem that in this video : https://youtu.be/Gw4WO_-cj8w
What’s the reason of that?

These’re my code blocks:

.left-bar-open{
    animation-name: left-menu-open;
    animation-duration: 0.2s;
    animation-direction:normal ;
}
.left-bar-close{
    animation-name: left-menu-close;
    animation-duration: 0.2s;
    animation-direction:normal ;
}
@keyframes left-menu-close{
    to{
        grid-template-columns: 0px 8fr;
    }
}
@keyframes left-menu-open{
    to{
        grid-template-columns: minmax(270px 1fr) 8fr;
    }
}
var leftMenuOpen = true;
var leftMenuButton = document.getElementById("header-menu-button");
var gridLayout = document.getElementById("main");
function menuButtonClick(){
    {
        if(leftMenuOpen === false){
            leftMenuOpen = true;
            gridLayout.classList.add("left-bar-open");
            gridLayout.classList.remove("left-bar-close");
            console.log("açık")
        }
        else{
            leftMenuOpen = false;
            gridLayout.classList.add("left-bar-close");
            gridLayout.classList.remove("left-bar-open");
            console.log("kapalı")
        }   
    }
};
leftMenuButton.addEventListener("click", menuButtonClick);