<?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: Moz 🛸</title>
    <description>The latest articles on DEV Community by Moz 🛸 (@mozetsu).</description>
    <link>https://dev.to/mozetsu</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%2F146871%2Fd24c59ff-2d84-4618-9ab6-998f8bcde8e3.jpg</url>
      <title>DEV Community: Moz 🛸</title>
      <link>https://dev.to/mozetsu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mozetsu"/>
    <language>en</language>
    <item>
      <title>Chronoshift - (Rebuilt) Binary Clock</title>
      <dc:creator>Moz 🛸</dc:creator>
      <pubDate>Sun, 26 Dec 2021 18:38:48 +0000</pubDate>
      <link>https://dev.to/mozetsu/chronoshift-rebuilt-binary-clock-3a6g</link>
      <guid>https://dev.to/mozetsu/chronoshift-rebuilt-binary-clock-3a6g</guid>
      <description>&lt;h1&gt;
  
  
  Preface
&lt;/h1&gt;

&lt;p&gt;After a few months away from coding I have finally recovered the energy and motivation to code after what seemed like the roughest months of my life 💀. This past year has been a mix of really unlucky events for me and I just had to take some time for myself. As of now I can say I'm feeling pretty good and ready to get back to work 🔥.&lt;/p&gt;

&lt;p&gt;Unfortunately, the lack of practice made me forget quite a lot. Looking through my repos I wondered how I could get to remember the basics and go back to the pace I was on when I stopped. Concluded I should rebuild an old app since I'm already familiar with it and would also get to improve some things I think could've been done differently 👌.&lt;/p&gt;

&lt;p&gt;That being said, I chose to rebuild a binary clock I made following &lt;a href="https://www.youtube.com/watch?v=VkTj1U_exwA"&gt;this&lt;/a&gt; tutorial back in the day. After completing the tutorial I took my time designing my own version of the clock and building it on my own so I could put the knowledge in practice 🛠️.&lt;/p&gt;

&lt;h1&gt;
  
  
  Bitclock - Old project
&lt;/h1&gt;

&lt;p&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aPd6BXFj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/O75jcHb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aPd6BXFj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/O75jcHb.png" width="880" height="610"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;This was the old version and although I was happy with the overall &lt;br&gt;
design I still had the feeling it could be better 🤔.&lt;/p&gt;

&lt;p&gt;For a basic clock that converts each number of the time into a four-digit binary sequence I assumed there were not many features I could implement other than a dark-theme and some links to Twitter and GitHub. This app was just a small project I did to get my hands around CSS grid and responsive design.&lt;/p&gt;
&lt;h1&gt;
  
  
  Design
&lt;/h1&gt;

&lt;p&gt;If I was going to rebuild this app I would like to make a design that was not only clean but also visually appealing ✨.&lt;/p&gt;

&lt;p&gt;As a developer, designing was never my strongest skill so I had to do some decent amount of research and gather some concepts that could hopefully point me in the right direction 🥲.&lt;/p&gt;

&lt;p&gt;After many shots saved on Dribble I hopped on Figma and put everything together. &lt;/p&gt;
&lt;h1&gt;
  
  
  HTML
&lt;/h1&gt;

&lt;p&gt;Used semantic HTML elements whenever possible as opposed to make everything out of divs as I had previously done. Still have to dive deeper in this area but this was quite easy to accomplish as the given layout was quite simple ✏️.&lt;/p&gt;
&lt;h1&gt;
  
  
  CSS
&lt;/h1&gt;

&lt;p&gt;Declared all the colors in the :root pseudo class as variables so I could define light and dark themes with them.&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_ObkJgMP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/wXgz92B.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_ObkJgMP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/wXgz92B.png" width="880" height="773"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Went with the CSS BEM (Block, Element, Modifier) architecture when applying classes in the HTML as this is a best practice I want to implement in my future projects. It's similar to object-oriented programming but directed to CSS.&lt;/p&gt;

&lt;p&gt;The harder part was making the clock component responsive between different window-sizes but managed to get it done with the use of media-queries.&lt;/p&gt;

&lt;h1&gt;
  
  
  JavaScript
&lt;/h1&gt;

&lt;p&gt;
  &lt;a href="https://i.giphy.com/media/zOvBKUUEERdNm/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/zOvBKUUEERdNm/giphy.gif" width="320" height="180"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Almost the same as the old version but with a few tweaks here and there. The core idea was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get the current time (17:20:32).&lt;/li&gt;
&lt;li&gt;Split each section into an array ([1,7], [2,0], [3,2]).&lt;/li&gt;
&lt;li&gt;Iterate through each item of each array and get the corresponding four-digit binary sequence returned as an array (1 = [0, 0, 0, 1]).&lt;/li&gt;
&lt;li&gt;Iterate through each binary sequence and whenever a "1" is found, add the class ".on" to the corresponding bit in the clock HTML markup turning it on. If it is a "0", remove the class turning the bit off.&lt;/li&gt;
&lt;li&gt;Repeat the process every 200ms.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Reborn as Chronoshift
&lt;/h1&gt;

&lt;p&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WiEr7ZlW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/XOvkNHb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WiEr7ZlW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/XOvkNHb.png" width="880" height="721"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Kept the same features as before but arranged them differently this time with all the navigation placed down at the footer. Again, I still think a designer would do a better job with the UI but this time I was extremely satisfied with the result 😊.&lt;/p&gt;

&lt;p&gt;You can check the live version here: &lt;a href="https://mozetsu.github.io/chronoshift/"&gt;Chronoshift&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;There's still a lot to cover but I think I will progress much faster now. Have lots of new ideas in the design phase and cannot wait to bring them to life. Hope you enjoyed the redesign, until next time 👋.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>writing</category>
      <category>motivation</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
