<?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: Gleb Svechnikov</title>
    <description>The latest articles on DEV Community by Gleb Svechnikov (@glebsvechnikov).</description>
    <link>https://dev.to/glebsvechnikov</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%2F134094%2F0cad7af4-33ca-460b-8a60-12dcc68bd462.jpeg</url>
      <title>DEV Community: Gleb Svechnikov</title>
      <link>https://dev.to/glebsvechnikov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/glebsvechnikov"/>
    <language>en</language>
    <item>
      <title>Minimal loader with progress</title>
      <dc:creator>Gleb Svechnikov</dc:creator>
      <pubDate>Mon, 28 Aug 2023 19:58:00 +0000</pubDate>
      <link>https://dev.to/glebsvechnikov/minimal-loader-with-progress-4eb</link>
      <guid>https://dev.to/glebsvechnikov/minimal-loader-with-progress-4eb</guid>
      <description>&lt;p&gt;Recently I've discovered default behavior of &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress"&gt;HTML progress tag&lt;/a&gt;.&lt;br&gt;
If you don't provide any attributes, progress acts like loader.&lt;br&gt;
&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;progress/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is how it look:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Firefox
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MR6gVSbt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckf1vlh9r6mdkfwhobnn.gif" alt="Firefox" width="450" height="156"&gt;
&lt;/li&gt;
&lt;li&gt;In Chrome
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5GyBh2lW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n12crjlgl0319a5knday.gif" alt="Chrome" width="450" height="156"&gt;
&lt;/li&gt;
&lt;li&gt;In Safari
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PvTc_K29--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e3cyuhgewkei2hkrpl9i.gif" alt="Safari" width="450" height="156"&gt;
Although it does not look&amp;amp;feel identical in browsers, it looks ok, even for light theme. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--obeZZb5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92gr84v0ai0zud73ddsi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--obeZZb5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92gr84v0ai0zud73ddsi.png" alt="Image description" width="430" height="138"&gt;&lt;/a&gt;&lt;br&gt;
Such loader solution could be useful for rapid prototyping and minimal interfaces.&lt;/p&gt;

</description>
      <category>html</category>
      <category>progress</category>
      <category>loader</category>
    </item>
    <item>
      <title>Minimal dark/light theme toggle</title>
      <dc:creator>Gleb Svechnikov</dc:creator>
      <pubDate>Sat, 24 Jun 2023 11:00:43 +0000</pubDate>
      <link>https://dev.to/glebsvechnikov/minimal-darklight-theme-toggle-45og</link>
      <guid>https://dev.to/glebsvechnikov/minimal-darklight-theme-toggle-45og</guid>
      <description>&lt;p&gt;There are a lot of implementations for color scheme switch/toggle&lt;br&gt;
My favorite one probably made be &lt;a href="https://github.com/argyleink/gui-challenges/blob/main/theme-switch/public/theme-toggle.js"&gt;Adam Argyle&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/kZiS1QStIWc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;But I think I've found even &lt;em&gt;most minimal solution&lt;/em&gt;.&lt;br&gt;
Few prerequisites:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In general you might have more them 2 themes, but I think dark/light is enough, therefore I'll need only toggle button&lt;/li&gt;
&lt;li&gt;User might have system preference for dark/light and I want to be able to use in my code&lt;/li&gt;
&lt;li&gt;If user want to change theme he/she should be able to do it with one click/touch&lt;/li&gt;
&lt;li&gt;For current implementation I don't want to store toggle state in any, I suppose that developer will decide where to store such info it could be anything like state manager, cookies, Local/Session Storage, user settings on backend. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For design I've decided to use &lt;a href="https://pictogrammers.com/library/mdi/icon/theme-light-dark/"&gt;MDI icon theme-light-dark&lt;/a&gt;&lt;br&gt;
and button that invert background/foreground colors with help of &lt;a href="https://www.w3.org/TR/css-color-3/"&gt;CSS system colors such as WindowText/Window&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;System preference I am getting with &lt;code&gt;window.matchMedia("(prefers-color-scheme: dark)")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example you might find in following codepen:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/gleb-svechnikov/embed/vYQyKPd?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>css</category>
      <category>theme</category>
    </item>
    <item>
      <title>Minimal adaptive carousel slider</title>
      <dc:creator>Gleb Svechnikov</dc:creator>
      <pubDate>Mon, 17 Oct 2022 07:05:06 +0000</pubDate>
      <link>https://dev.to/glebsvechnikov/adaptive-carousel-slider-117</link>
      <guid>https://dev.to/glebsvechnikov/adaptive-carousel-slider-117</guid>
      <description>&lt;p&gt;Lately I needed to implement a carousel slider for website, none of the sliders that I've founded suited design that I needed so I've created another one.&lt;/p&gt;

&lt;p&gt;Key idea of this slider that it has very little JS and work independently from other slider on the page&lt;/p&gt;

&lt;p&gt;All JS is basically two functions for Next and Previous buttons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const nextSlide = (event) =&amp;gt; {
  const slider = event.parentNode.children[1];
  slider.append(slider.children[0]);
}
const prevSlide = (event) =&amp;gt; {
  const slider = event.parentNode.children[1];
  slider.prepend(slider.children[slider.children.length - 1])
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you might see from code it depends on layout and moves slides right in DOM Node.&lt;br&gt;
Pretty simple, don't you think?&lt;/p&gt;

&lt;p&gt;Also it uses media-query in order to react to screen width:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.item {
  flex: 1 0 25%;
  min-height: 200px;
  text-align: center;
  height: auto;
}

@media (max-width: 1024px) {
  .item {
    flex: 1 0 33%;
  }
}
@media (max-width: 768px) {
  .item {
    flex: 1 0 50%;
  }
}

@media (max-width: 576px) {
  .item {
    flex: 1 0 100%;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example you might find in following codepen:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/gleb-svechnikov/embed/QWrPGQg?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>carousel</category>
      <category>css</category>
      <category>flex</category>
    </item>
  </channel>
</rss>
