<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nur Ilyas</title>
    <description>The latest articles on DEV Community by Nur Ilyas (@_nur_ilyas_).</description>
    <link>https://dev.to/_nur_ilyas_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F128238%2Fd0c84c4e-06d6-41f2-9d67-e1953cb7357d.jpg</url>
      <title>DEV Community: Nur Ilyas</title>
      <link>https://dev.to/_nur_ilyas_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_nur_ilyas_"/>
    <language>en</language>
    <item>
      <title>Understanding HTTPS/TLS</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Mon, 16 Nov 2020 17:44:01 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/understanding-https-tls-ep7</link>
      <guid>https://dev.to/_nur_ilyas_/understanding-https-tls-ep7</guid>
      <description>&lt;p&gt;A compilation of articles on HTTPS for a better understanding on how it works.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.websecurity.digicert.com/en/sg/security-topics/what-is-ssl-tls-https"&gt;What is SSL, TLS and HTTPS?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.websecurity.digicert.com/security-topics/how-does-ssl-handshake-work"&gt;How Does SSL/TLS Work? What Is An SSL/TLS Handshake?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://security.stackexchange.com/questions/20803/how-does-ssl-tls-work"&gt;How does SSL/TLS work?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://gravitational.com/blog/ssh-certificates-explained/"&gt;Certificate Authorities Explained&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.cloudflare.com/learning/ssl/what-is-an-ssl-certificate/"&gt;What is an SSL Certificate?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://security.stackexchange.com/questions/16595/what-does-it-mean-for-a-digital-certificate-to-be-signed"&gt;What does it mean for a digital certificate to be “signed”?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://security.stackexchange.com/questions/6737/what-is-an-ssl-certificate-intended-to-prove-and-how-does-it-do-it/16106#16106"&gt;What is an SSL certificate intended to prove, and how does it do it?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/18257185/how-does-a-public-key-verify-a-signature"&gt;How does a public key verify a signature?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.digicert.com/ssl/"&gt;What is an SSL certificate?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/"&gt;What Happens in a TLS Handshake? | SSL Handshake&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/188266/how-are-ssl-certificates-verified"&gt;How are ssl certificates verified?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://crypto.stackexchange.com/questions/71355/signature-verification-vs-decryption"&gt;Signature verification vs decryption?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/10546837/public-key-fingerprint-vs-digital-signature"&gt;Public key fingerprint vs Digital Signature&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://security.stackexchange.com/questions/71199/what-is-the-difference-between-a-thumbprint-algorithm-signature-algorithm-an"&gt;What is the difference between a “Thumbprint Algorithm” “Signature Algorithm” and “Signature Hash Algorithm” for a certificate?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.sslauthority.com/the-difference-between-sha-1-sha-2-and-sha-256-hash-algorithms-2"&gt;SHA1, SHA2 &amp;amp; SHA256&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>http</category>
      <category>web</category>
      <category>encryption</category>
      <category>security</category>
    </item>
    <item>
      <title>Dark mode in your web app</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Sun, 18 Oct 2020 12:42:09 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/dark-mode-in-your-web-app-2big</link>
      <guid>https://dev.to/_nur_ilyas_/dark-mode-in-your-web-app-2big</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/91ShjFGlICE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Implement dark mode in your web app. #html #css #javascript&lt;/p&gt;

&lt;p&gt;Step 1. Set background and text colors using CSS variables. &lt;br&gt;
&lt;a href="https://github.com/nibmz7/live-parade-state/blob/master/dev/main.css#L22-L86"&gt;https://github.com/nibmz7/live-parade-state/blob/master/dev/main.css#L22-L86&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2. Apply variables to elements.&lt;br&gt;
&lt;a href="https://github.com/nibmz7/live-parade-state/blob/master/ui/global_styles.ts#L63-L64"&gt;https://github.com/nibmz7/live-parade-state/blob/master/ui/global_styles.ts#L63-L64&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3. Toggle the dark mode class on document's body and save the user's preference in local storage.&lt;br&gt;
&lt;a href="https://github.com/nibmz7/live-parade-state/blob/master/ui/views/view_switcher.ts#L92-L98"&gt;https://github.com/nibmz7/live-parade-state/blob/master/ui/views/view_switcher.ts#L92-L98&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4. Add a script at the start of 'body' tag to load dark mode preference.&lt;br&gt;
&lt;a href="https://github.com/nibmz7/live-parade-state/blob/master/dev/index-mock.html#L18-L21"&gt;https://github.com/nibmz7/live-parade-state/blob/master/dev/index-mock.html#L18-L21&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Smooth Keyboard Transition on mobile browsers</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Wed, 14 Oct 2020 05:22:40 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/smooth-keyboard-transition-on-mobile-browsers-4bnp</link>
      <guid>https://dev.to/_nur_ilyas_/smooth-keyboard-transition-on-mobile-browsers-4bnp</guid>
      <description>&lt;p&gt;Implementation ---&amp;gt; &lt;a href="https://github.com/nibmz7/live-parade-state/blob/e2d8fe9efbd760baa01d89bb50e584953100b721/dev/index-mock.html#L25-L56"&gt;click here&lt;/a&gt;&lt;br&gt;
Usage ---&amp;gt; &lt;a href="https://github.com/nibmz7/live-parade-state/blob/master/ui/views/login/login_view.ts#L186-L196"&gt;click here&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/y5LxSzCIBlQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>ES6 class vs function constructor</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Sat, 22 Aug 2020 19:20:32 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/es6-class-vs-function-constructor-3d6m</link>
      <guid>https://dev.to/_nur_ilyas_/es6-class-vs-function-constructor-3d6m</guid>
      <description>&lt;p&gt;I wrote an article on ES6 classes and how it was written before it existed. Take a look and let me know what you think! Point out any errors in the information provided if you spot any!&lt;/p&gt;

&lt;p&gt;Demystifying JavaScript ‘Class’&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/demystifying-javascript-class-nur-ilyas"&gt;https://www.linkedin.com/pulse/demystifying-javascript-class-nur-ilyas&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>es6</category>
      <category>html</category>
    </item>
    <item>
      <title>UEFI &amp; GPT</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Mon, 03 Aug 2020 13:40:25 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/uefi-gpt-3af3</link>
      <guid>https://dev.to/_nur_ilyas_/uefi-gpt-3af3</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;DISCLAIMER&lt;/strong&gt;: This post is written by a complete novice. Information stated may be inaccurate and if so, feel free to correct any mistakes.&lt;br&gt;
&lt;strong&gt;RESEARCH TOPIC&lt;/strong&gt;: UEFI &amp;amp; GPT.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;WHAT PROMPTED THIS RESEARCH?&lt;/strong&gt;: After fiddling with the BIOS screen and GRUB menu, I started wondering what they are...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  BIOS &amp;amp; MBR
&lt;/h2&gt;

&lt;p&gt;Before we begin, you might want to take a look at this excellent article on legacy BIOS/MBR to have a bit of context: &lt;a href="https://neosmart.net/wiki/mbr-boot-process/"&gt;MBR BOOT PROCESS.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  UEFI
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1FwHDpel--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/efi.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1FwHDpel--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/efi.webp" alt="EFI diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Picture courtesy of &lt;a href="https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface"&gt;UEFI on Wikipedia&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;“The Unified Extensible Firmware Interface (UEFI) is a specification that defines a software interface between an operating system and platform firmware, replacing the legacy Basic Input/Output System (BIOS) firmware interface.” &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There’s embedded software in your computer also known as firmware. This platform firmware checks and ensures the hardwares (cpu, memory, input-output devices etc) are initialized and ready to be used. The UEFI specification only requires the firmware to create the standardized interfaces and does not state how the underlying interfaces should be implemented so it is up to the vendor to execute that bit. There is an open source firmware implementation of UEFI called &lt;a href="https://github.com/tianocore/tianocore.github.io/wiki/UEFI-EDKII-Learning-Dev"&gt;TianaCore&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You may still come across the ‘BIOS’ setup utility screen, which is essentially the firmware settings. The term ‘BIOS’ is still used although your firmware is built for UEFI. Is this because BIOS is recognized amongst consumers for access to firmware settings that it became a noun? Can anyone clarify.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--13jlTSi1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/uefi_diagram.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--13jlTSi1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/uefi_diagram.webp" alt="UEFI conceptual overview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Diagram from &lt;a href="https://uefi.org/specifications"&gt;UEFI Forum&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--omgqLegz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_efibootmgr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--omgqLegz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_efibootmgr.webp" alt="uefi boot manager NVRAM entries"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;‘efibootmanger -v’&lt;/strong&gt; command output showing the NVMRAM entries&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The platform firmware is responsible for setting up the UEFI protocols and services before starting what is called the &lt;strong&gt;UEFI boot manager.&lt;/strong&gt; The UEFI boot manager will attempt to load the OS boot loaders in order according to globally defined NVRAM variables. You can view the boot order sequence variables in your &lt;strong&gt;‘BIOS setup utility settings’&lt;/strong&gt; or using &lt;strong&gt;‘efibootmanger -v’&lt;/strong&gt; on linux.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The OS loader is a special type of UEFI application (e.g. grubx64.efi) that utilizes the protocols and services provided by the UEFI layer to boot the chosen operating system. Once the OS loader has successfully launched the OS, it will call EFI_BOOT_SERVICES.ExitBootServices(), which will terminate all boot services in the system, including memory management, and the UEFI OS loader is responsible for the continued operation of the system. After control is passed to the operating system, only the runtime services will remain as part of the UEFI layer.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C1nWMl0x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/uefi_runtime_services_1.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C1nWMl0x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/uefi_runtime_services_1.webp" alt="uefi runtime services part 1"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B-9vbbuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/uefi_runtime_services_2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B-9vbbuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/uefi_runtime_services_2.webp" alt="uefi runtime services part 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;List of UEFI runtime services from &lt;a href="https://uefi.org/specifications"&gt;UEFI Forum&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  GPT
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Like MBR, GUID Partition Table (GPT) is a partitioning scheme which describes how partitions are laid out on a storage device. GPT is now the preferred way to partition a storage device and is used mainly for the UEFI boot, instead of MBR.&lt;/li&gt;
&lt;li&gt;Let’s first take a look at the layout of a storage device using the GPT scheme. 
&lt;p&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0tk406Qv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/gpt_scheme.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0tk406Qv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/gpt_scheme.webp" alt="GPT Scheme"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/GUID_Partition_Table"&gt;GPT on Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Logical Block Addressing (LBA)
&lt;/h3&gt;

&lt;p&gt;If you would like to know a bit about LBA and how it relates to data being represented in the media, you may want to check these out.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HDD - Hard Disk Drive

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Cylinder-head-sector"&gt;Cylinder Head Sector (CHS)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/Cj8-WNjaGuM"&gt;Hard Disks, Sectors, Zone Bit Recording, Sectors vs Blocks, CHS, LBA, Sparing - Youtube&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;SSD - Solid State Drive

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://flashdba.com/2014/06/06/understanding-flash-what-is-nand-flash/"&gt;Understanding Flash: What Is NAND Flash?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flashdba.com/2014/06/20/understanding-flash-blocks-pages-and-program-erases/"&gt;Understanding Flash: Blocks, Pages and Program / Erases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flashdba.com/2014/09/17/understanding-flash-the-flash-translation-layer/"&gt;Understanding Flash: The Flash Translation Layer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  GPT Header Format
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2pZtw-Sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/table_header_format.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2pZtw-Sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/table_header_format.webp" alt="gpt header format"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;0x50&lt;/strong&gt; indicates the maximum number of possible partitions. Although this can be unlimited, it’s usually set at 128 partitions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  GPT Partition Entry Format
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9LCR10lG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/partition_entry_format.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9LCR10lG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/partition_entry_format.webp" alt="gpt partition entry format"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The partition type ID is globally unique. You may view the list of types &lt;a href="https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_Type_GUIDs"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  UEFI and GPT
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;For UEFI to work, it looks for a special partition known as the &lt;strong&gt;‘EFI System Partition’&lt;/strong&gt; which must be formatted based on the &lt;strong&gt;FAT filesystem&lt;/strong&gt; (MacOS is an exception). The EFI Boot Manager can interpret FAT filesystem and it is this partition where the EFI Boot Manager searches for EFI boot loaders. Here is an example of the contents in an 'EFI System Partition'.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BxiCPNLm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_efi_partition.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BxiCPNLm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_efi_partition.webp" alt="efi partition contents"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;/EFI/boot/bootx64.efi&lt;/strong&gt; is the fallback path for the boot manager if there are no NVRAM entries saved for that storage media. This is particularly useful say if you want to create a bootable UBUNTU flash drive. You can partition the usb drive according to GPT, create the ‘EFI system partition’ and format it based on FAT32 and then insert grubx64.efi into the ‘EFI/boot/’ folder and rename it to ‘bootx64.efi’. That way when you insert the usb stick into your computer, the EFI boot manager will launch grub under the disguise of bootx64.efi.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Extras
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Partitions on a laptop with SSD dual-booting Windows and Ubuntu&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hKzCFIxR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_blkid.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hKzCFIxR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_blkid.webp" alt="blkid command output"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://unix.stackexchange.com/a/463410/421388"&gt;What is UUID, PARTUUID and PTUUID?&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;fdisk -l&lt;/code&gt; command output&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kYCl-NBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_fdisk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kYCl-NBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/UEFI_and_GPT/assets/webp/cli_fdisk.webp" alt="fdisk -l command output"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you need a better explanation or you’re wondering how to boot multiple distros, you can take a look at the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.restarters.net/UEFI_and_GPT"&gt;UEFI and GPT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zdnet.com/article/hands-on-linux-uefi-multi-boot-my-way/"&gt;Hands-On: Linux UEFI multi-boot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zdnet.com/article/hands-on-linux-uefi-multi-boot-part-2/"&gt;Hands-On: Linux UEFI multi-boot II&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zdnet.com/article/linux-on-your-laptop-heres-what-you-need-to-know-about-uefi-firmware/"&gt;Linux on your laptop: Here's what you need to know about UEFI firmware&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>bios</category>
      <category>uefi</category>
      <category>gpt</category>
    </item>
    <item>
      <title>Basics of Linux GUI stack</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Mon, 03 Aug 2020 13:40:07 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/basics-of-linux-gui-stack-594o</link>
      <guid>https://dev.to/_nur_ilyas_/basics-of-linux-gui-stack-594o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;DISCLAIMER&lt;/strong&gt;: This post is written by a complete novice. Information stated may be inaccurate and if so, feel free to correct any mistakes.&lt;br&gt;
&lt;strong&gt;RESEARCH TOPIC&lt;/strong&gt;: Linux GUI stack&lt;br&gt;
&lt;strong&gt;WHAT PROMPTED THIS RESEARCH?&lt;/strong&gt;: I stumbled across a process called 'xorg' and wondered what that is. A quick Google search shows it has something to do with displaying graphics and so begins the journey of trying to understand the Linux GUI stack on a surface level.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Windowing System
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In a windowing system, there are 2 main components: the display server and the window manager. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Display server 

&lt;ul&gt;
&lt;li&gt;The display server protocol specifies communication between a client (GUI application) and the display server&lt;/li&gt;
&lt;li&gt;Relays inputs (keyboards, mouse, touchscreen etc.) to clients&lt;/li&gt;
&lt;li&gt;Displays the output onto a screen&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Window manager

&lt;ul&gt;
&lt;li&gt;Works hand-in-hand with a display server&lt;/li&gt;
&lt;li&gt;Manages the placement and appearance of windows&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;There are 2 main types of windowing system used in GUI Linux operating systems today: X11 and Wayland.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;X11&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;X&lt;span&gt;.&lt;/span&gt;Org server (display server) + Mutter/KWin (window manager)&lt;/li&gt;
&lt;li&gt;X&lt;span&gt;.&lt;/span&gt;Org server is the dominant implementation of the display server for X Window System (X11 Protocol).
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ySluFo3J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/Basics_of_Linux_GUI_stack/assets/webp/x11.webp" alt="Basic X11 diagram"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;"In the case of X11, A window manager is a regular X client. It doesn’t have any superuser privileges or keys to kernel backdoors; it is a normal user process that is allowed by the X server to call a set of special APIs. X ensures that no more than one window manager is running at any given point by denying a client access to these APIs if another client currently has access. The first client to attempt to access these APIs always succeeds." - &lt;a href="https://jichu4n.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i/"&gt;How X Window Managers Work, And How To Write One (Part I)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Wayland&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mutter/KWin  Wayland compositor (Display server + window manager)&lt;/li&gt;
&lt;li&gt;Wayland, unlike its X11 counterpart, does not have &lt;a href="https://en.wikipedia.org/wiki/Network_transparency"&gt;network transparency&lt;/a&gt; in order to &lt;a href="https://wiki.ubuntu.com/Wayland#What_about_network_transparency.3F"&gt;simplify its architecture&lt;/a&gt;. 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2M5Hbniv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/Basics_of_Linux_GUI_stack/assets/webp/wayland.webp" alt="Basic Wayland diagram"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I was curious as to how a wayland client would communicate to the display server (wayland compositor). In wayland’s case, it would look for a unix socket (ipc socket) typically named wayland-0. &lt;a href="https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Wire-Format"&gt;https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Wire-Format&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linux GUI toolkits (QT, GTK) now supports both X11 and wayland protocol.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Window Manager
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;"A window manager is a system software that controls the placement and appearance of windows within a windowing system in a graphical user interface." - &lt;a href="https://en.wikipedia.org/wiki/Window_manager"&gt;Window Manager on Wikipedia&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;There are 2 notable types of Window Managers: Stacking and Tiling window managers.

&lt;ul&gt;
&lt;li&gt;Stacking

&lt;ul&gt;
&lt;li&gt;Openbox&lt;/li&gt;
&lt;li&gt;Mutter/Kwin - more precisely a compositing window manager&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Tiling

&lt;ul&gt;
&lt;li&gt;i3 (X11 Tiling window manager)&lt;/li&gt;
&lt;li&gt;Sway (Tiling wayland compositor)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Display Manager
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;a href="https://wiki.archlinux.org/index.php/display_manager"&gt;display manager&lt;/a&gt; presents the user with a login screen. A session starts when a user successfully enters a valid combination of username and password.&lt;/li&gt;
&lt;li&gt;Examples are GDM, KDM and LightDM.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iGEgI9aP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nibmz7/portfolio/main/blog/From_Windows_To_Linux/Basics_of_Linux_GUI_stack/assets/webp/display_manager.webp" alt="Ubuntu display manager"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Ubuntu uses GDM by default.&lt;/li&gt;
&lt;li&gt;GDM runs on wayland. Display managers that run on X, on the other hand, starts up the X server before displaying the login UI.&lt;/li&gt;
&lt;li&gt;GDM starts in TTY1 and on user login, it starts up the user session on TTY2. &lt;a href="https://askubuntu.com/questions/910108/why-is-my-gdm-at-a-different-tty-than-my-desktop-environment"&gt;Why is my GDM at a different TTY than my desktop environment?&lt;/a&gt;
Just a question: Is it possible to start greeter and user screen in the same TTY?
Another question: *Session manager &lt;a href="https://www.systutorials.com/docs/linux/man/1-gnome-session/"&gt;https://www.systutorials.com/docs/linux/man/1-gnome-session/&lt;/a&gt;
So the method of starting a window manager directly without a display manager does not use a session manager? What does that mean for a user?&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Desktop Environments
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;"A desktop environment (DE) usually rides on top of a Window Manager and adds many features, including panels, status bars, drag-and-drop capabilities, and a suite of integrated applications and tools. " - &lt;a href="https://askubuntu.com/a/339812/1097045"&gt;zeal&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You can run standalone window managers without the need of a desktop environment.&lt;/li&gt;
&lt;li&gt;See &lt;a href="https://www.reddit.com/r/linux4noobs/comments/69lvet/difference_between_a_window_manager_and_desktop/"&gt;desktop environments vs window managers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Examples include GNOME and KDE.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GUI Toolkits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Developers use these toolkits to ease development. They do not need to know the intricacies of X11/Wayland to start developing apps for the platform.&lt;/li&gt;
&lt;li&gt;Examples of GUI toolkits are QT and GTK.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Digression
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pop.system76.com/"&gt;POP!_OS&lt;/a&gt; and &lt;a href="https://regolith-linux.org/"&gt;Regolith OS&lt;/a&gt; looks pretty sick.&lt;/li&gt;
&lt;li&gt;What's Chrome OS GUI stack like?

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://dev.chromium.org/developers/design-documents/aura/graphics-architecture"&gt;Aura&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ozone

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://chromium.googlesource.com/chromium/src.git/+/master/docs/ozone_overview.md"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.phoronix.com/scan.php?page=news_item&amp;amp;px=Chrome-Ozone-X11-Build-Good"&gt;Chrome Is Reaching The Point Of Good X11 + Wayland Support In Same Build&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Android

&lt;ul&gt;
&lt;li&gt;Has its own windowing system known as SurfaceFlinger

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.bradcypert.com/what-is-androids-surfaceflinger/"&gt;What is Android's SurfaceFlinger&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://source.android.com/devices/graphics"&gt;&lt;/a&gt;&lt;a href="https://source.android.com/devices/graphics"&gt;https://source.android.com/devices/graphics&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;MacOS - &lt;a href="https://en.wikipedia.org/wiki/Quartz_Compositor"&gt;Quartz Compositor ?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>wayland</category>
      <category>xorg</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Material dialog with CSS Animation</title>
      <dc:creator>Nur Ilyas</dc:creator>
      <pubDate>Wed, 02 Oct 2019 18:33:55 +0000</pubDate>
      <link>https://dev.to/_nur_ilyas_/material-dialog-with-css-animation-61</link>
      <guid>https://dev.to/_nur_ilyas_/material-dialog-with-css-animation-61</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1wjgigxctztbrlgzms4i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1wjgigxctztbrlgzms4i.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Refer to the full source code on &lt;a href="https://github.com/nurilyas7/material-motion-examples" rel="noopener noreferrer"&gt;github&lt;/a&gt;. Feedbacks are most welcome :)&lt;/p&gt;

&lt;p&gt;I don't want to blabber too much so let's get right on to making the modal dialog inspired by Material Design.&lt;br&gt;&lt;br&gt;
Our version of modal dialog is made up of three components: the modal screen which also acts as a backdrop, the dialog itself &amp;amp; a form which the dialogue will display. The dialog contains 2 forms and both are set to hidden. The &lt;a href="https://github.com/nurilyas7/material-motion-examples/blob/master/modal-dialog/js/ModalDialog.js" rel="noopener noreferrer"&gt;ModalDialog.js&lt;/a&gt; class will be responsible for displaying/hiding the respective forms.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"modal-screen"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"modal"&lt;/span&gt; &lt;span class="na"&gt;hidden&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"dialog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"user-form-one"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hide"&lt;/span&gt; &lt;span class="na"&gt;hidden&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Continue as . . .&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"alias-list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"seperator"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;span&amp;gt;&lt;/span&gt;or&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Create new user&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"user-form-two"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hide"&lt;/span&gt; &lt;span class="na"&gt;hidden&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"info-alias"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;Enter your alias&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt; 
                    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"tooltip"&lt;/span&gt; &lt;span class="na"&gt;data-tip=&lt;/span&gt;&lt;span class="s"&gt;"Lorem Ipsum blablabla"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./help.svg"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"input-alias"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;maxlength=&lt;/span&gt;&lt;span class="s"&gt;"35"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"e.g. John Doe"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Continue&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"error-message"&lt;/span&gt; &lt;span class="na"&gt;hidden&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To show/hide the modal screen, we will toggle the 'open' and 'close' class on the modal div element.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;

&lt;span class="nc"&gt;.open&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fade-in&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.5s&lt;/span&gt; &lt;span class="n"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nc"&gt;.dialog&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;slide-in&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.5s&lt;/span&gt; &lt;span class="n"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.close&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fade-out&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.5s&lt;/span&gt; &lt;span class="n"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nc"&gt;.dialog&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;slide-out&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.5s&lt;/span&gt; &lt;span class="n"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="nt"&gt;fade-in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;100&lt;/span&gt;&lt;span class="nv"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="nt"&gt;fade-out&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;100&lt;/span&gt;&lt;span class="nv"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="nt"&gt;slide-in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;100&lt;/span&gt;&lt;span class="nv"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="nt"&gt;slide-out&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;100&lt;/span&gt;&lt;span class="nv"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;200%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now on to animating the smooth scaling of the dialog box. The &lt;a href="https://github.com/nurilyas7/material-motion-examples/blob/master/modal-dialog/js/UserForm.js" rel="noopener noreferrer"&gt;UserForm.js&lt;/a&gt; class is created as a base class for the 2 forms. &lt;/p&gt;

&lt;p&gt;Inside show(), &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame" rel="noopener noreferrer"&gt;requestAnimationFrame&lt;/a&gt; function triggers a callback method, draw(), which performs the scaling animation of the dialog box and fading-in of the form. &lt;/p&gt;

&lt;p&gt;But before show() can be called on the form that is about to be displayed, hide() method on the previous form is called first and a callback will be triggered once the fading-out animation has ended.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

     &lt;span class="cm"&gt;/* In ModalDialog.js...
        userFormOne.hide(() =&amp;gt; {
            userFormTwo.show();
        });
    */&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserForm&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;formId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dialog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.dialog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;formId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onclick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onButtonClick&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formHeight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;onButtonClick&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stopPropagation&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;disabled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;hide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;animationend&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onFormHidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hide&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;disabled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    
        &lt;span class="nf"&gt;requestAnimationFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dialog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFormWidth&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dialog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFormHeight&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;show&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;getFormHeight&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formHeight&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formHeight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;offsetHeight&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;getFormWidth&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formWidth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;offsetWidth&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;formWidth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;onFormHidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;listener&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removeEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;animationend&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;listener&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hidden&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;listener&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;UserForm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Take a look at &lt;a href="https://github.com/nurilyas7/material-motion-examples/blob/master/modal-dialog/js/UserFormOne.js" rel="noopener noreferrer"&gt;UserFormOne.js&lt;/a&gt; and &lt;a href="https://github.com/nurilyas7/material-motion-examples/blob/master/modal-dialog/js/UserFormTwo.js" rel="noopener noreferrer"&gt;UserForm2.js&lt;/a&gt; to see which methods were overidden and also added functionalities.&lt;/p&gt;

&lt;p&gt;For navigating between the forms, History API is used to keep track of that and onpopstate listener in the ModalDialog.js class will display the appropriate views.&lt;/p&gt;

&lt;p&gt;I do apologize if this post seems rushed as I'm writing this at 3 in the morning and there's a lot of things to explain and I'm unsure if the code I wrote is proper(which is why I really want feedback). Also reason why I'm rushing through this is because I'm flying off for a month tomorrow leaving my laptop behind and I can't put this off any longer. Also, I find this a good way to improve on my English. Anyhow, It's been a pleasure and thank you so much for reading! Now, time to hit the hay ZzZzZz....&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>html</category>
      <category>css</category>
      <category>materialdesign</category>
    </item>
  </channel>
</rss>
