<?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: likaiZnazis</title>
    <description>The latest articles on DEV Community by likaiZnazis (@likaiznazis).</description>
    <link>https://dev.to/likaiznazis</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%2F2841987%2F04a6be62-0673-4f62-ab5c-5385b900c2a7.png</url>
      <title>DEV Community: likaiZnazis</title>
      <link>https://dev.to/likaiznazis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/likaiznazis"/>
    <language>en</language>
    <item>
      <title>Red LED blinking does not stay constant on ESP32</title>
      <dc:creator>likaiZnazis</dc:creator>
      <pubDate>Wed, 02 Apr 2025 23:17:09 +0000</pubDate>
      <link>https://dev.to/likaiznazis/-2a56</link>
      <guid>https://dev.to/likaiznazis/-2a56</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/likaiznazis" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2841987%2F04a6be62-0673-4f62-ab5c-5385b900c2a7.png" alt="likaiznazis"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/likaiznazis/esp32-red-light-blinking-37oj" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;ESP32 red light blinking&lt;/h2&gt;
      &lt;h3&gt;likaiZnazis ・ Apr 2&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#esp32&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#learning&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>esp32</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>ESP32 red light blinking</title>
      <dc:creator>likaiZnazis</dc:creator>
      <pubDate>Wed, 02 Apr 2025 23:15:33 +0000</pubDate>
      <link>https://dev.to/likaiznazis/esp32-red-light-blinking-37oj</link>
      <guid>https://dev.to/likaiznazis/esp32-red-light-blinking-37oj</guid>
      <description>&lt;p&gt;This might be a little lengthy post since I saw a couple of posts talking about this problem but I couldn't find a solution on the forms or other places, so i thought I could share my way of fixing this issue. &lt;em&gt;So if you don't have a ESP32 you might go along with your day.&lt;/em&gt; This post is made that you can start interacting with esp32 as fast as possible. It does not go into detail why things are the way they are, could be cool to know but I'm new to this. If you are facing any other problems let me know.&lt;/p&gt;

&lt;p&gt;The ESP32 that I have can be bought - &lt;a href="https://www.amazon.co.uk/AZDelivery-NodeMCU-CP2102-Development-Parent/dp/B07ZZFXRTY?th=1" rel="noopener noreferrer"&gt;https://www.amazon.co.uk/AZDelivery-NodeMCU-CP2102-Development-Parent/dp/B07ZZFXRTY?th=1&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Problems that I faced
&lt;/h2&gt;

&lt;p&gt;When I plugged my USB cable inside ESP32 I saw the red light blink a couple of times and then it went silent. At first I did not think much of it since I heard the device connect to my computer &lt;em&gt;&lt;em&gt;USB connected sound&lt;/em&gt;&lt;/em&gt;. Also there was a new device that showed up on &lt;strong&gt;Device Manager&lt;/strong&gt;. What made me think that it is a faulty product is that the red LED did not stay on. Many tutorials show that when plugging the USB red light was constant and did not blink. TLDR: it is okay for the red light to blink. Also my ESP32 did not connect when using Arduino IDE.&lt;/p&gt;

&lt;p&gt;First things first - install drivers so that your computer can understand what device is being connected. The driver for my ESP32 could be found on this resource - &lt;a href="https://www.silabs.com/developer-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads" rel="noopener noreferrer"&gt;https://www.silabs.com/developer-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads&lt;/a&gt;. &lt;em&gt;The driver might be different for your ESP32&lt;/em&gt;. Keep in mind we need driver so that our computer inside &lt;strong&gt;Device manager&lt;/strong&gt; will put the ESP32 device under PORTS(COM &amp;amp; LPT).&lt;/p&gt;

&lt;p&gt;Now that ESP32 is under PORTS(COM &amp;amp; LPT) let's start interacting with the board. The first thing that I found is that you can hold -&amp;gt; BOOT -&amp;gt; press RST -&amp;gt; hold BOOT for couple of more seconds. This made that my ESP32 starts blinking. &lt;em&gt;Don't know if this step is necceseery but I did it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then I followed this tutorial - &lt;a href="https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html#manual-installation" rel="noopener noreferrer"&gt;https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html#manual-installation&lt;/a&gt;. Choose your platform. &lt;/p&gt;

&lt;p&gt;The program setup might take a couple of minutes. There should open up &lt;strong&gt;cmd&lt;/strong&gt; or &lt;strong&gt;PowerShell&lt;/strong&gt; inside directory - C:\Espressif\frameworks\esp-idf-v5.4.1&amp;gt;. Navigate to directory - C:\Espressif\frameworks\esp-idf-v5.4.1\examples\get-started\hello_world&amp;gt; here are some sample projects that you can try out. Then run command - &lt;code&gt;idf.py build&lt;/code&gt;. If you did not get any errors you can now run command - &lt;code&gt;idf.py -p COM-yourCOM flash&lt;/code&gt;. Then run the command - &lt;code&gt;idf.py -p COM5 monitor&lt;/code&gt;. You should see Hello world! appear inside the console.&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Drop down language button</title>
      <dc:creator>likaiZnazis</dc:creator>
      <pubDate>Mon, 17 Feb 2025 12:15:02 +0000</pubDate>
      <link>https://dev.to/likaiznazis/drop-down-language-button-5921</link>
      <guid>https://dev.to/likaiznazis/drop-down-language-button-5921</guid>
      <description>&lt;p&gt;Hello. Today I tried to create a language button that has a drop down with other languages. I wanted the button to be round and not move other objects that are on the page. I didn't really succeed with this task.&lt;br&gt;
I created a drop down button but not the way I wanted it to work. However wanted to share this maybe someone knows how you can achieve this. Further I will explain in more detail what I wanted to achieve and what problems I ran into.&lt;/p&gt;
&lt;h2&gt;
  
  
  Idea
&lt;/h2&gt;

&lt;p&gt;I wanted to create a round button. When the round button is clicked a smooth sliding down transition should happen with other languages. Sounds pretty simple. Button that i made: &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frj7majy9xglefsjd0gc9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frj7majy9xglefsjd0gc9.PNG" alt="Image description" width="83" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Button that i wanted:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxvxhlaxv7y6k8qyiqms.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxvxhlaxv7y6k8qyiqms.PNG" alt="Image description" width="83" height="107"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;It should have filled the middle with the background color.&lt;/em&gt; This was not achievable if I wanted that the expanded button wouldn't move any elements.&lt;/p&gt;

&lt;p&gt;There were two main problems that I ran into. It's either I don't make the other languages position absolute and then other elements move around the screen when language options appear or make something like what i made there.&lt;/p&gt;


&lt;h2&gt;
  
  
  How I approached the problem
&lt;/h2&gt;

&lt;p&gt;HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;header&amp;gt;
        &amp;lt;nav&amp;gt;
          &amp;lt;div class="company-name"&amp;gt;ZS-DZINTRAS&amp;lt;/div&amp;gt;

          &amp;lt;ul class="navigation-links"&amp;gt;
            &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Flowers&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Bouquets&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;&amp;lt;a href="#"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
            &amp;lt;li class="language-box"&amp;gt;
              &amp;lt;div class="main-langugage"&amp;gt;
                &amp;lt;span&amp;gt;LV&amp;lt;/span&amp;gt;
                &amp;lt;svg width="20" height="20" class="main-langugage-arrow"&amp;gt;
                  &amp;lt;use
                    href="/src/Images/illustations.svg#icon-alert-triangle"
                  &amp;gt;&amp;lt;/use&amp;gt;
                &amp;lt;/svg&amp;gt;
              &amp;lt;/div&amp;gt;
              &amp;lt;ul class="other-langague"&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;span&amp;gt;ENG&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
              &amp;lt;/ul&amp;gt;
            &amp;lt;/li&amp;gt;
          &amp;lt;/ul&amp;gt;
        &amp;lt;/nav&amp;gt;
      &amp;lt;/header&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is pretty much a parent element - (language-box). Inside the parent element there are two child elements: one that shows the main language and the other that shows other languages - (main-langugage,other-langague).&lt;/p&gt;




&lt;p&gt;CSS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  .language-box {
    position: relative;
    background-color: $background;
    color: $text;
    justify-content: center;
    align-items: center;
    border-radius: 2rem;
    font-family: "Lato", sans-serif;
    font-size: 105%;
    letter-spacing: 0.07rem;
    font-weight: 500;
  }
  .main-langugage {
    padding: 0.6rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.2rem;
    &amp;amp;-arrow {
      cursor: pointer;
      transition: transform 0.3s ease-in-out;
      transform: rotate(180deg);
      color: $primary;
    }
  }
  .other-langague {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: inherit;
    list-style: none;
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding: 0;
    transform: translateY(100%); 
    border-radius: 2rem;
  }
  .language-box.active {
    .other-langague {
      max-height: 150px;
      padding: 0.5rem;
    }
  }
  .language-box.active .main-langugage-arrow {
    transform: rotate(0deg);//this rotates the arrow
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;The main thing that makes that other elements not move around when other languages are expanded - we make the &lt;strong&gt;parent element relative&lt;/strong&gt; so that we can place &lt;strong&gt;other languages absolute&lt;/strong&gt; to that parent element.&lt;br&gt;
&lt;em&gt;3iple dot (...) is other code that is not that important for that section.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; .language-box {
    position: relative;
    ...
}
.other-langague {
    position: absolute;
    left: 0;
    bottom: 0;
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;This is cool but without a smooth drop down transition to make this more  appealing. To make a drop down menu that does not fade or appear instantly in, we need to play with height and other spacing properties. Also we need to make the overflow hidden that the language options are not showing because it has position absolute and placed at the bottom of the parent element. &lt;/p&gt;

&lt;p&gt;Before we can manipulate these properties that would expand other languages. First we need to set a active class to the parent element so that we know other languages should appear. You can probably do this with CSS or a bunch of other ways, but I use JS.&lt;/p&gt;




&lt;p&gt;Javascript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document
  .querySelector(".main-langugage-arrow")
  .addEventListener("click", function () {
    const languageButtonEl = document.querySelector(".language-box");
    languageButtonEl.classList.toggle("active");
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The javascirpt is pretty simple. All that is being done here that we are applying a active class when the language arrow is clicked.&lt;/p&gt;

&lt;p&gt;When this toggles the active class now we need to look at this part of the CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; .other-langague {
    max-height: 0;
    padding:0;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding: 0;
    transform: translateY(100%); 
    border-radius: 2rem;
    ...
  }
  .language-box.active {
    .other-langague {
      max-height: 150px;
      padding: 0.5rem;
      overflow: visible; //not necessary but there
    }
  }
  .language-box.active .main-langugage-arrow {
    transform: rotate(0deg);//this just rotates the arrow
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So when the active class is added, other languages grow in size and space around the box (max-heihgt and padding). Also it moves down 100% Y axes so that it is not on top of it. This could also be achieved if we positioned the element 100% from top. Then the transfromY(100%) would not be needed but I did it this way. Like so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.other-language{position: absolute; top:100%;...}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Hope I gave you some ideas on how to make these types of buttons if you didn't know. Not saying that is is the correct or the best way to do it. If you have any ideas how to make a button that I wanted or even some suggestions for the button that I have. Leave a comment hinting to something or a article that tried to do something like that. It would help me a lot. Have a nice day!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>code</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What happens when you press enter in a browsers search bar?</title>
      <dc:creator>likaiZnazis</dc:creator>
      <pubDate>Mon, 10 Feb 2025 17:54:12 +0000</pubDate>
      <link>https://dev.to/likaiznazis/what-happens-when-you-press-enter-in-a-browsers-search-bar-2foe</link>
      <guid>https://dev.to/likaiznazis/what-happens-when-you-press-enter-in-a-browsers-search-bar-2foe</guid>
      <description>&lt;p&gt;Recently I started to make websites but didn't really know how fundamentally the browser works or talks to the server. So thought I could make a post about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  First there are a couple of terms that everyone should familiarize themselves with:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Web page&lt;/strong&gt; - document that can be displayed inside a browser. These are often called "pages" and written in HTML.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Website&lt;/strong&gt; - collection of "pages" that are grouped together into a single resource. There are links that are connecting these "pages".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web server&lt;/strong&gt; - computer that holds the resources associated with the website.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search engine&lt;/strong&gt; - service that allows you to find all kinds of websites.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser&lt;/strong&gt; - software that request, retrieves and displays web pages from the internet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These terms might be simple and you already know them. However there could be a misconception between a search engine and a browser also web server and a website. For example when we open a browser some people might think that it's a search engine or when a web server is not responding they refer to it as the website is not working.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;open up FireFox&lt;/em&gt;&lt;br&gt;
The first thing there is already a new tab. Inside the search bar where the website URL goes there is some placeholder text - &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtietgbxg0mp71r24d2m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtietgbxg0mp71r24d2m.PNG" alt="Image description" width="312" height="38"&gt;&lt;/a&gt;&lt;br&gt;
As we can see that it offers us two options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for something using Google (search engine).&lt;/li&gt;
&lt;li&gt;Enter a address.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Let's enter a address.&lt;/em&gt; - example.com&lt;/p&gt;

&lt;p&gt;First of all how does it know where it could find this address (example.com) domain? This is where &lt;strong&gt;DNS&lt;/strong&gt; comes into play. &lt;strong&gt;DNS&lt;/strong&gt; is short for &lt;strong&gt;Domain Name System&lt;/strong&gt;. In short it &lt;strong&gt;maps domain names (example.com) with IP addresses&lt;/strong&gt;. So your browser essentially requests to a DNS server - "What is the IP address of this domain?". Then if it locates that IP address to the requested domain name then returns it to the browser. &lt;strong&gt;DNS&lt;/strong&gt; involves a lot more steps between.&lt;/p&gt;

&lt;p&gt;When browser retrieves this IP address it sends a HTTP request to that IP address and asks if it could get a copy of the website to the browser. This IP address is a web server where the website resources are located. All of these messages between browser and the web server are using TCP/IP.&lt;/p&gt;

&lt;p&gt;If the website approves this request it will respond to the browsers request with a "200 OK" response message. After this response message it will start sending the website files as a series of chunks or so called &lt;strong&gt;packets&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Then the browser will put these packets together and show the web page. In some sites they can have dynamic content so based on your actions more requests could be made and more packets put together to show a different page or something more to a page.&lt;/p&gt;

&lt;p&gt;My analogy - Let's say you want to wear a green T-shirt today. You can't find it anywhere. You ask your mother - "Do we have a green T-shirt"? She responds - "your brother has one". You go to your brother and ask - "could I wear your green T-shirt." If you have a good relationship with your brother he will give it to you :). In this case you are the browser, your mother is the DNS server. Your brother is the web server. You are making a request to your brother and getting a response.&lt;/p&gt;

&lt;p&gt;This might not be the best analogy :D. Don't know how DNS works completely. From this analogy could mean that you are talking in one language to your mother and in a another to your brother.&lt;br&gt;
&lt;strong&gt;Let me hear some of your analogies!&lt;/strong&gt; Have heard about a road where you are going to a store.&lt;/p&gt;

&lt;p&gt;Next topics I could write about: HTTP requests and responses, TCP/IP, packets, URL, dynamic websites. Later on will write more about DNS seemed a bit complicated.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
