<?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: Jatin Kathuria</title>
    <description>The latest articles on DEV Community by Jatin Kathuria (@logeekal).</description>
    <link>https://dev.to/logeekal</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%2F161550%2F673a579c-9ae8-4c0d-9269-f67b1571e78e.png</url>
      <title>DEV Community: Jatin Kathuria</title>
      <link>https://dev.to/logeekal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/logeekal"/>
    <language>en</language>
    <item>
      <title>Building State management system like react from scratch with VanillaJS.</title>
      <dc:creator>Jatin Kathuria</dc:creator>
      <pubDate>Fri, 08 Nov 2019 09:16:52 +0000</pubDate>
      <link>https://dev.to/logeekal/building-state-management-system-like-react-from-scratch-with-vanillajs-3eon</link>
      <guid>https://dev.to/logeekal/building-state-management-system-like-react-from-scratch-with-vanillajs-3eon</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;So I have been doing React for 8 months now and I can say with some confidence  that I am comfortable in making and structuring React apps.&lt;/p&gt;

&lt;p&gt;But, I was not sure If I can say that about Vanilla JS because I entered the world of Web development with React. So I had this epiphany to understand some basics and started a campaign for myself called &lt;a href="https://github.com/logeekal/30-days-of-Vanilla-JS"&gt;30-days-of-Vanilla-JS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I strongly think that you learn by action and result oriented tasks so I keep looking for new mini-projects(1-4 hours) I can build.&lt;/p&gt;

&lt;h2&gt;
  
  
  State Management System similar to React.
&lt;/h2&gt;

&lt;p&gt;It is Day 3 of this campaign and I want to build a state Management system similar to React but very bare-bones. But it should follow one-way data flow. I initially had very less clue how I would build it but as I went on it with it, it became easier.&lt;/p&gt;

&lt;p&gt;We are going to take a simple app so that we can focus on state management system, so we will be building a todo App as show below &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JyWb9Erw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vsxqowfjt3q54287zevv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JyWb9Erw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vsxqowfjt3q54287zevv.jpg" width="200"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So If I can build it, any beginner can. Let's get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  Design
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gp6pxnsw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1gqw5n3t6h351zoafxwh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gp6pxnsw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1gqw5n3t6h351zoafxwh.png" width="300" height="300"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now below is the one way flow I was trying to build and there are 3 things that we need to do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Catch user Actions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dispatch those user actions to set a new state&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As soon as the state is set rebuild the view.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's start in reverse order. Let us first build a mechanism so that our page know when the state has been updated and it rebuilds itself.&lt;/p&gt;

&lt;h4&gt;
  
  
  State
&lt;/h4&gt;

&lt;p&gt;First thing we need is an event that will be fired as soon as the state is updated. So let us create an event as show below :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;stateUpdated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;stateUpdate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once, we have the event, we will need to define a state and state setter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialState&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;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;initialState&lt;/span&gt;   
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We define a function/class called StateManager which takes in an initial state for a component and sets it.&lt;/p&gt;

&lt;p&gt;Now let's us write method which will take in the new state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialState&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;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;initialState&lt;/span&gt;
    &lt;span class="c1"&gt;//&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;setStateInternal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newState&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`In the setting. Setting state now with value &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newState&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&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;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newState&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`New state is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&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;state&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&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;For now I have kept the state setter internal as I don't want anyone to directly call this method, because remember, our setter needs to dispatch the event as well so the components gets updated/regenerated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialState&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;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;initialState&lt;/span&gt;
    &lt;span class="c1"&gt;//&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;setStateInternal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newState&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`In the setting. Setting state now with value &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newState&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&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;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newState&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`New state is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&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;state&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;


    &lt;span class="c1"&gt;// public state setter.&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;setState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;setStateInternal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;thisArgs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;argumentList&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Now setting the state&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;argumentList&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;eventFired&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dispatchEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stateUpdated&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Event Fired : &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;eventFired&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&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="p"&gt;}&lt;/span&gt;

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



&lt;p&gt;Checkout this.setState above, it is a proxy for the setStateInternal to dispatch the event (second last line). We simply call dispatchEvent function to dispatch the event that we created in the first step.&lt;/p&gt;

&lt;p&gt;In case you are not aware of proxy, you can check out &lt;a href="https://ponyfoo.com/articles/es6-proxies-in-depth"&gt;this tutorial&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;In one line&lt;/em&gt;&lt;/strong&gt;, proxy is a kind of middle-ware for Javascript objects, Let's say if you are calling a function or setting a property of an object you can do an action before/after that function call or property assignment. &lt;/p&gt;

&lt;p&gt;This could have been achieved without Proxy as well easily but I wanted to learn and use it so here it is.&lt;/p&gt;

&lt;p&gt;Alternatively, you can have function which will just call setStateInternal and dispatches the event as show above in second last line.&lt;/p&gt;

&lt;p&gt;Now, the definition of out state is complete and we should have a way for each component to create it's own state as shown below :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;createState&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;initializing state&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tempState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialState&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;tempState&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;Above function will create a new instance for the state everytime it is called with state and setState as public members.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Our state.js is now completed.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since, i am building a todo app, i would call my new file as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Let's first create different views/components within our JS files as shown below : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TODO_ITEM&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This will be our lowest level component which will represent one TODO_ITEM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TODO_NEW_ITEMS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;deletionAction&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`In todo items : &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
        &amp;lt;div id="todo-item" class= "todo-item" data-id=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;
            &amp;lt;p id='todo-text'&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/p&amp;gt;
            &amp;lt;button id="delTodo" onclick=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;deletionAction&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;(this)&amp;gt;DEL&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
     `&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It takes the item details and deletionAction/completionAction from our state. We will find that out soon. But in a nutshell it returns a view/string representation of HTML. &lt;/p&gt;

&lt;p&gt;Are you getting JSXy feeling yet? I was ecstatic when I wrote this piece of code.&lt;br&gt;
Notice () after deleteAction in above code. Remember, in HTML, we need to call the function and not just pass the reference like in React.&lt;/p&gt;

&lt;p&gt;Similarly, we will write a component/view of competed items.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TODO_COMPLETED_ITEMS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&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;return&lt;/span&gt; &lt;span class="s2"&gt;`
        &amp;lt;div id="todo-completed-item" class= "todo-completed-item" data-id=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;
            &amp;lt;p id='todo-completed-text'&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
     `&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It is not exactly following DRY principle but since I was under time constraint, I went ahead with separate declarations.&lt;/p&gt;

&lt;p&gt;Now it is time to write the Completed TODO_COMPONENT&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TODO_PAGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&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;return&lt;/span&gt; &lt;span class="s2"&gt;` &amp;lt;div class="todo-container"&amp;gt;
    &amp;lt;div class="todo-items"&amp;gt;
    &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;
        &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completed&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;TODO_NEW_ITEMS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deleteTodo&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="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&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="s2"&gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;form class="todo-input-container" action='javascript:' "&amp;gt;
      &amp;lt;div class="todo-input"&amp;gt;
        &amp;lt;input id="newTodo" type="text" name="newTodo" value="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentItem&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"  placeholder="Add to do item" onkeyup="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;recordTodo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;(this)" /&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div class="todo-add"&amp;gt;
        &amp;lt;button type='button' id="addTodo" name="addTodo" onclick="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;insertTodoItem&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;(this)" &amp;gt;ADD&amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
    &amp;lt;div class='todo-completed'&amp;gt;
    &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;
        &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completed&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;TODO_COMPLETED_ITEMS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&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="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&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="s2"&gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;`&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I know it is a lot but let us break it part by part.&lt;/p&gt;

&lt;p&gt;a. TODO_PAGE takes in complete state as an input&lt;/p&gt;

&lt;p&gt;b. It has a section for new todo Items as shown below so it looks in the items property of state and loops it  and call our TODO_NEW_ITEMS component.&lt;/p&gt;

&lt;p&gt;Similarly at the end of above code, we have todo Completed Items component code as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;todo-items&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completed&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;TODO_NEW_ITEMS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deleteTodo&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="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;c. The next piece of code is the the text-box to write Todo component and button to submit it to the todo item list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"todo-input-container"&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;'javascript:'&lt;/span&gt; &lt;span class="err"&gt;"&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;"todo-input"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"newTodo"&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;name=&lt;/span&gt;&lt;span class="s"&gt;"newTodo"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"${state.currentItem}"&lt;/span&gt;  &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Add to do item"&lt;/span&gt; &lt;span class="na"&gt;onkeyup=&lt;/span&gt;&lt;span class="s"&gt;"${todoState.state.events.recordTodo}(this)"&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&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"todo-add"&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;type=&lt;/span&gt;&lt;span class="s"&gt;'button'&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"addTodo"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"addTodo"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"${todoState.state.events.insertTodoItem}(this)"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;ADD&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;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now that we have defined our components, it is time to define our initial state and actions.&lt;/p&gt;

&lt;p&gt;We know that out state should have below properties&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;items&lt;/strong&gt; : List of todo-Items  with the text, an identifier and whether it has been completed or not.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;events&lt;/strong&gt; : list of actions/events that need to be performed. Because as you see in the above code, we need to pass action to the components as well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;currentItem&lt;/strong&gt; : What current Item that user is trying to save.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;target&lt;/strong&gt; :  The element on which our action has taken place. As we go further, I will explain why this is required. For now, may be you can ignore it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So below will be the code for initial state and remember that &lt;em&gt;todoState&lt;/em&gt; below is not a state but our StateManager Object. It has 2 members state and todoState:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;todoInitialstate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="na"&gt;currentItem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;recordTodo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;recordTodo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;insertTodoItem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;insertTodoItem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;deleteTodo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;deleteTodo&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="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:{}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todoInitialstate&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see above, there are 3 events are are required. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;recordTodo -&amp;gt; This is to maintain what the user is typing when she is trying to add Todo. Below will be the simple code for it. For people familiar with React it is a cake walk.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;recordTodo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//todoItemsSpace.appendChild(todoItem(event.target.value));&lt;/span&gt;
    &lt;span class="c1"&gt;// state.currentItem = event.target.value;&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`event fired with state value &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;// updateState(state);&lt;/span&gt;
    &lt;span class="c1"&gt;// rough.innerHTML = event.target.value&lt;/span&gt;
    &lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;currentItem&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;target&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;One thing you will notice that, it take target as an input and not the event. this is because how HTML and JavaScript work. There are 2 ways to attach an event&lt;/p&gt;

&lt;p&gt;a. When you attach it in HTML as I have done above. This method gives target HTML element to the JavaScript function if you pass this within HTML&lt;/p&gt;

&lt;p&gt;b. When you add event listener with addEventListener function in JavaScript, then you get Event as the parameter. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please correct if I am missing something here but this is what I observed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Also, in the last line of above code, we will simple call set state and it will set the appropriate state and fire the event. We will see how we will refresh this component by listening to stateUpdate event.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;insertTodo
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;insertTodoItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;insertTodoItem&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Adding todo npow.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tempState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;tempState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;tempState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="nx"&gt;tempState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;tempState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tempState&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;Just bear with me, we are almost done. We have created the state, State Manager, components and actions.&lt;/p&gt;

&lt;p&gt;Now is the time to see how we can regenerate the the view. You remember, we generate the view when stateUpdate event is fired. So let us listen to that first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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;stateUpdate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;generateView&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now that we are listening to this event, let  us define generateView function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;generatePage&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;main_Page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;TODO_PAGE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;main_Page&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;todoState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&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="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;setSelectionRange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectionStart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectionEnd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;focus&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;First line gets the HTML string of the TODO_PAGE component.&lt;/p&gt;

&lt;p&gt;In Second line, we find the root Element in our HTML file and just render this HTML string. Our HTML page is very similar to react which I will share below.&lt;/p&gt;

&lt;p&gt;From third line, we can see that I use target and I promised you, I will explain why we need target. Consider a scenario,&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens when you set innerHTML
&lt;/h3&gt;

&lt;p&gt;I am trying to add a todo component and as I type, it will fire recordTodo action which will update the state and will in turn re-render the view as can be seen by code above.&lt;/p&gt;

&lt;p&gt;Now as page is re-renders, we will lose the focus on the text box in which we were typing our todo item. Not only we need to maintain the focus, but also, we need to restore the cursor position so that page seems smooth and flicker-less.&lt;/p&gt;

&lt;p&gt;Therefore, I just reset that focus back to that element where event actually occurred and I also restore that cursor position.&lt;/p&gt;

&lt;p&gt;That's it. We are done. Below is the minimal HTML file :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;index.html
_____________________________

&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Todo - State Managed App&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;'./state.js'&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;script  &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;'./todo.js'&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel= &lt;/span&gt;&lt;span class="s"&gt;'stylesheet'&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;'text/css'&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./index.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;body&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;'root'&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;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;To see the whole code, please visit my &lt;a href="https://github.com/logeekal/30-days-of-Vanilla-JS"&gt;30-days-of-Vanilla-JS&lt;/a&gt; repo. You can star it to follow my 30 days of Vanilla JS ideas in case you are beginner like me.&lt;/p&gt;

&lt;p&gt;In case you are a guru, do support me by suggesting some ideas of mini-projects that can be completed in 1-4 hours and will have something to learn.&lt;/p&gt;

</description>
      <category>react</category>
      <category>vanillajs</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Design Review Needed - An anonymous Chat Application</title>
      <dc:creator>Jatin Kathuria</dc:creator>
      <pubDate>Wed, 14 Aug 2019 11:00:24 +0000</pubDate>
      <link>https://dev.to/logeekal/design-review-an-anonymous-chat-application-3575</link>
      <guid>https://dev.to/logeekal/design-review-an-anonymous-chat-application-3575</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;So I have been learning design by action from 5-6 weeks(or weekends) now for my Resume Builder application and I made 3 posts for my journey &lt;a href="https://dev.to/logeekal/web-design-by-for-a-non-designer-part-1-55gl"&gt;here&lt;/a&gt;. I was finding it really difficult to proceed with the design of that website so I thought of trying something easier. Hence, I designed a simple Chat Application will be good as a starting point as it has less number of screens and interactions as a part of my MVP design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Welcome Chatrr
&lt;/h2&gt;

&lt;p&gt;Chatrr is the name I thought during the rise of Web 2.0 8-9 years back ( you can guess that just by looking at the name) but at the time, I didn't have time, skills and dedication to get started with it. Welcome 2019, I got into web development after years of making excuses and I was sure that this is one of the open-source product, I need to ship. It works or not is not really my priority as of now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;There are 100s of chat applications out there but very less of them are anonymous. I had always loved the feel of Yahoo Rooms that used to exist 10 years back but now there is nothing like that. Moreover, Chat Application will help me develop following skills from scratch :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mobile Design Languages&lt;/li&gt;
&lt;li&gt;Design tools such as Figma&lt;/li&gt;
&lt;li&gt;Web Sockets&lt;/li&gt;
&lt;li&gt;React Native/Flutter/Kotlin (Not sure yet)&lt;/li&gt;
&lt;li&gt;GraphQL&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  First Phase
&lt;/h2&gt;

&lt;p&gt;So I plunged into it 3 weeks back and have been spending weekends on doing the prototyping in Figma. I think I am happy with first draft and can start doing the development. UI is not my forte and hence I am feeling a little accomplished because I am liking colors, fonts, choice of buttons and overall look and feel of the app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;But who doesn't love their own solution.&lt;/em&gt;&lt;/strong&gt; Hence, I would appreciate the community's opinion. If you are an expert, please be brutal in judging what looks good, bad and ugly and Why. If you are not, please do not hide your opinion. &lt;/p&gt;

&lt;p&gt;With this, I will not take much of your time and state assumptions and functionality of app in few lines before we get to mock-up video so that you have some context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Functionality
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;So this is an anonymous chat application and hence login screen doesn't have anything apart from :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;username&lt;/li&gt;
&lt;li&gt;gender&lt;/li&gt;
&lt;li&gt;submit button
(May be captcha in actual app)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rooms&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chat-rooms are pre-created and cannot be created by user.&lt;/li&gt;
&lt;li&gt;These are like groups which will have members who have joined that particular chat room.&lt;/li&gt;
&lt;li&gt;People cannot exit all rooms, they can only switch rooms. Hence, if during the login if a person has joined a Room, they will remain joined in the background and User should be able to access the member list from anywhere. User can either switch rooms of Log out.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;User Profile&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Very minimalist as already stated and you can only modify your gender as a part of MVP.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Settings page is still remaining as I am still thinking about it but it will mostly have notification stuff and gender hiding. Nothing more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Font is Quicksand in multiple sizes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logo and Name is temporary and are merely placeholders.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note : Figma has only screen transition but not component animation and transition so there are elements where current animation is not there or it sucks. For example, The main menu will be an expanding circle like shown below (not mine). but in prototype it just slides or dissolves: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IALtrnXN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/72b4t0df7nm2i8xhhzzx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IALtrnXN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/72b4t0df7nm2i8xhhzzx.gif" alt="Expanding Circle Animation"&gt;&lt;/a&gt;&lt;br&gt;
Note : above awesome animation is by &lt;a href="http://011101.it/"&gt;Fausto Renier&lt;/a&gt;. Do checkout this &lt;a href="http://011101.it/"&gt;website's&lt;/a&gt; home page. It have really interesting elements.&lt;/p&gt;

&lt;p&gt;And here is mine : &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k4ir4bbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oan9w0vujod0hhkhte3z.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k4ir4bbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oan9w0vujod0hhkhte3z.gif" alt="Figma mockup animation."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find all the material on my github Repo &lt;a href="https://github.com/logeekal/Chatrr"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>design</category>
      <category>chat</category>
      <category>figma</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Making Strides | Web Design by/for a Non-designer - Part 3</title>
      <dc:creator>Jatin Kathuria</dc:creator>
      <pubDate>Sat, 20 Jul 2019 20:53:55 +0000</pubDate>
      <link>https://dev.to/logeekal/making-strides-web-design-by-for-a-non-designer-part-3-3k05</link>
      <guid>https://dev.to/logeekal/making-strides-web-design-by-for-a-non-designer-part-3-3k05</guid>
      <description>&lt;p&gt;It's a happy day today as I think I have made some good progress in this 3rd weekend of designing as a noob. If you are interested in background, links are given below : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/logeekal/web-design-by-for-a-non-designer-part-1-55gl"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/logeekal/web-design-by-for-a-non-designer-part-2-1na3"&gt;Some Progress&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;As concluded in the part 2, I said I was not very happy with the design but it is OK for now to move forward with. And as I started my work today and looked at it... Yukkk! I couldn't even look at it. I needed to do something about it and guess what, I already had an idea what I am gonna do.&lt;/p&gt;

&lt;h2&gt;
  
  
  More Inspiration
&lt;/h2&gt;

&lt;p&gt;This past week I was listening to &lt;a href="https://www.programmingthrowdown.com/2019/07/episode-92-basics-of-ui-design-for.html"&gt;Basics of UI Design for Engineers with Erik Kennedy&lt;/a&gt; on Programming Throwdown and it gave me a lot of insight on different design elements and &lt;a href="http://erikdkennedy.com/"&gt;Erik&lt;/a&gt; was congnizant of how a non-designer would approach any design. Go give it a listen if you interested to learn design and you will come back enlightened in one way or the other.&lt;/p&gt;

&lt;p&gt;One of the things &lt;a href="http://erikdkennedy.com/"&gt;Erik&lt;/a&gt; emphasised on was the important of &lt;a href="https://www.smashingmagazine.com/2017/02/improving-ui-design-skills-copywork/"&gt;CopyWork&lt;/a&gt; and how it can help any newbie in developing gut feeling for the design they work on. "Should I just copy that website?", this thought has already crossed my mind multiple times. So I thought, I should go ahead and try to find a website that may be similar to what I am trying to do and I will first copy that and then customize(ruin) it according to my needs and liking.&lt;/p&gt;

&lt;p&gt;So I started browsing &lt;a href="http://land-book.com0"&gt;land-book&lt;/a&gt; &amp;amp; &lt;a href="http://dribble.com"&gt;dribbble&lt;/a&gt; for more inspiration with below things in my mind. : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It should have some kind of caraousal or photo showcase where I can show-case CV templates. Like did it previous design on the left side, see below for reference&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It should have place where I can write captions as you see on the right.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A basic Nav bar.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Essentially, I didn't want elements on the page to change. So after couple of hours of change, I reached what you can see on the left side.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--41lmpoTz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.dribbble.com/users/1019466/screenshots/6811979/dribbble_25.png" alt="Dribbble 25" class=""&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G-s4VLLl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5sja8vhk9bhot4hv33xa.png" alt="drawing"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Learnings &amp;amp; Action
&lt;/h2&gt;

&lt;p&gt;We can see the design I found has very similar layout but was much more professional and better in every way. My initial wish was to have Material theme and Flat icons but this looks really good to eye and I love white and black whitespace which this design has in plenty.&lt;/p&gt;

&lt;p&gt;So we start with the result. After much of tinkering, this is what I got.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AQLRsuMf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ip21y0hcfjgqsfp0nas4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AQLRsuMf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ip21y0hcfjgqsfp0nas4.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I didn't copied it exactly but I ripped off main text layout, shadow and color decision where was I struggling a lot and applied it to my elements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Things I am happy about
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Color&lt;/em&gt;&lt;/strong&gt; - White is looking much better than the violet/mauve(I'm not sure) I chose earlier, the gradient didn't seem very smooth.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Text Layout&lt;/em&gt;&lt;/strong&gt; - This is my favourite part of the page today. I am loving how it looks and color of button is very bold.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I added my flavour of pagination as well which was represented by arrows in last design. Not sure if you noticed but this text box will be sliding carousal for 3 difference Call To Actions(CTAs).&lt;/li&gt;
&lt;li&gt;Typography is also something I chose independently with one font remaining as it is in the previous design. Although, I think I can do better. Below are the fonts I'm using :

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fonts.google.com/specimen/Righteous"&gt;Righteous&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://fonts.google.com/specimen/Ubuntu"&gt;Ubuntu&lt;/a&gt; (One of my favourites)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Buttons&lt;/em&gt;&lt;/strong&gt; - Color of buttons is not much better and I need to solve this mystery of what makes a color better than the other. I am unable to answer why this color is better.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Can anybody please explain What makes #8144E6 better than #AA86E6 which is just few shaded lighter. See example below: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GBu-aMDK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/sjrnlw7nz8q2wn154x42.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GBu-aMDK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/sjrnlw7nz8q2wn154x42.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Things that are missing/need improvements.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Alignments&lt;/em&gt;&lt;/strong&gt; :  Alignment is off at many places and I am still figuring out how to correct or control that. See below examples.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Check the alignment on left and right.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k_wRL1eV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4i92z29jqttnoqb2mawz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k_wRL1eV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4i92z29jqttnoqb2mawz.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Carefully look at the gridlines and alignment above login word is much more than it is below. Not terrible. Not Great. ;).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IOxoOLgd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xl9j463cytpjyypral2r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IOxoOLgd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xl9j463cytpjyypral2r.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You see this red line. This is the whitespace, I don't like. I am not sure what to do with it as I don't have any more content. Any suggestions are welcome.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Extra-extra whitespace&lt;/em&gt;&lt;/strong&gt; - See the red block on the bottom, It is empty space and it is too much, I would like to fill it. But I am not sure with what. Suggestions?&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SaYnjPGF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qa36h1rljt2p7ck535xe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SaYnjPGF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qa36h1rljt2p7ck535xe.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Background&lt;/em&gt;&lt;/strong&gt; - If you look closely, the original design has some kind of white background, it is giving it some texture on the right hand side. I tried some gradient but those were hedious, I will try some more and will report next week.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ciao.&lt;/p&gt;

</description>
      <category>web</category>
      <category>design</category>
      <category>beginners</category>
      <category>figma</category>
    </item>
    <item>
      <title>Web Design by/for a Non-designer - Part 2</title>
      <dc:creator>Jatin Kathuria</dc:creator>
      <pubDate>Sat, 13 Jul 2019 17:38:42 +0000</pubDate>
      <link>https://dev.to/logeekal/web-design-by-for-a-non-designer-part-2-1na3</link>
      <guid>https://dev.to/logeekal/web-design-by-for-a-non-designer-part-2-1na3</guid>
      <description>&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;This is part 2 in the series of stories that I am writing about my struggles with front end design. You might want to start in the beginning &lt;a href="https://dev.to/logeekal/web-design-by-for-a-non-designer-part-1-55gl"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Last week, I came up with a very rudimentary style of homepage for my web-site after thinking about the contents I wanted to keep on my homepage. But there were some problems with that page.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Scaling was completely off. Login page seems too big.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There was no marketing material on the page which will tell user why this CV Builder is different from others.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The way CV's previews were stacked on the left side were ugly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  New Strategy
&lt;/h2&gt;

&lt;p&gt;I went back to drawing board and thought a little harder on things I needed on my homepage. Here are things I came up with :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Marketing material&lt;/em&gt;&lt;/strong&gt; - as I discussed above&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Request a new template&lt;/em&gt;&lt;/strong&gt; - The main feature of this website is ability to request new templates. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Contribute&lt;/em&gt;&lt;/strong&gt; - This is a call to action for developers, so that they can contribute new templates as requested by users. This will good opportunity for anyone looking to learn CSS and React as a newbie.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Templates&lt;/em&gt;&lt;/strong&gt; - Showcase of CV Templates. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Login/Register&lt;/em&gt;&lt;/strong&gt; - Login/Registration screen&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;By this time, I am sure that I will not be able to build something from scratch until after 2 weeks. So it was time to look for an inspiration and steal a good design.&lt;/p&gt;

&lt;p&gt;I did some research and landed on &lt;a href="https://land-book.com/"&gt;land-book.com&lt;/a&gt; and after going through some of the templates I decided to go with traditional layout  and came up with something like this :&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WSCbAU2g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xwaq83n7kjkna4y3yzxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WSCbAU2g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xwaq83n7kjkna4y3yzxi.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although, I am not happy with the colour but it is okay for now. And I have discovered that I am pretty bad at it.&lt;/p&gt;

&lt;p&gt;To talk about &lt;strong&gt;&lt;em&gt;typography&lt;/em&gt;&lt;/strong&gt;, I went with very safe Roboto font(Lato is again very similar), It is still fluid and may change in future. For now, it is good as a placeholder.&lt;/p&gt;

&lt;p&gt;There are now 2 things left.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CV template showcase&lt;/li&gt;
&lt;li&gt;Marketing material.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here also I decided  to divide the main coloured section in 2 parts as below : &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G-s4VLLl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5sja8vhk9bhot4hv33xa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G-s4VLLl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5sja8vhk9bhot4hv33xa.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Things I liked about this design
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Layering&lt;/em&gt;&lt;/strong&gt; : I liked the layering in Resume templates and I am happy that shadows came off fine. Curves on the corner are pretty good.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Things I don't like about this design
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Everything&lt;/em&gt;&lt;/strong&gt; : Coloured section is ending abruptly which is not at all eye pleasing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;**Marketing Material Layout *&lt;/em&gt;* : There is no boundary on this layout, I think Righteous font is looking pretty nice.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it for today, It is not really very good but it is evolving well. Let's see how we proceed on this next week.&lt;/p&gt;

</description>
      <category>web</category>
      <category>design</category>
      <category>beginners</category>
      <category>figma</category>
    </item>
    <item>
      <title>Web Design by/for a Non-designer - Part 1</title>
      <dc:creator>Jatin Kathuria</dc:creator>
      <pubDate>Sat, 06 Jul 2019 20:12:03 +0000</pubDate>
      <link>https://dev.to/logeekal/web-design-by-for-a-non-designer-part-1-55gl</link>
      <guid>https://dev.to/logeekal/web-design-by-for-a-non-designer-part-1-55gl</guid>
      <description>&lt;h2&gt;
  
  
  Why this article
&lt;/h2&gt;

&lt;p&gt;I aim to narrate my thought process behind web design which I am doing it for my web app and seek advice and validation from the experts here.&lt;/p&gt;

&lt;h2&gt;
  
  
  You guys are awesome
&lt;/h2&gt;

&lt;p&gt;I recently joined Dev.to community and I must say I enjoy reading the discussions here and passion of the people is infectious.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background about me
&lt;/h2&gt;

&lt;p&gt;Since, this is my first post, I will give some background about me. I am from India, been in IT for 9 years now. I have mainly worked on data-modelling and Oracle application implementations. I have been wanting to work on Web development for years now.&lt;/p&gt;

&lt;p&gt;Recently, I moved to a role I love and which involves working with web and juggling multiple technologies. First thing I did was to kick-off my personal project as I wanted to learn some technologies so that I can be up-to speed with latest in web.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Project
&lt;/h2&gt;

&lt;p&gt;3 months back I started my personal project called &lt;a href="https://github.com/logeekal/ResumeBuilder/tree/dev" rel="noopener noreferrer"&gt;Resume Builder&lt;/a&gt;. It is inspired from &lt;a href="https://novoresume.com/" rel="noopener noreferrer"&gt;NovoResume&lt;/a&gt; which is an amazing website but paid.&lt;/p&gt;

&lt;p&gt;It involves different templates of CV which users can download in pdf format. I had an idea to build all this as open source so that template building can be more democratic and people can request certain templates to be created on this site.&lt;/p&gt;

&lt;p&gt;There are 3 reason I decided to go with this project : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It was very UI driven project and I wanted to learn React.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is heavily &lt;strong&gt;&lt;em&gt;design&lt;/em&gt;&lt;/strong&gt; focused project and I am very bad in both design process and CSS. Hence, it is good opportunity to build everything from ground-up.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open source and free education online has give me a lot and Resume Builder seems like a thing which many people can make use of.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Design
&lt;/h2&gt;

&lt;p&gt;Let's get to the meat now. I am done with some part of the back-end of my web app and I thought now may be a good time to start designing a good homepage and give my web-app a design language. So after lots of crappy CSS mock-ups and scrapping them I decided to follow below process : &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Settle on a good design tool for creating mock-up
&lt;/h3&gt;

&lt;p&gt;Creating UI on CSS takes time, especially when you are learning it. Also, it is tough to imagine how your design is moving forward. So I decided that I need to work on a tool where I can create quick mock-ups and get a good understanding of the design language I want to follow. &lt;/p&gt;

&lt;p&gt;There are not many free tools and only good options that I found were :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adobe XD&lt;/li&gt;
&lt;li&gt;&lt;a href="http://figma.com" rel="noopener noreferrer"&gt;Figma&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt; I decided to go with Figma as it is available as Web App and very easy to get started with. It is also completely free for personal use. &lt;/blockquote&gt; 

&lt;h3&gt;
  
  
  2. Decide on the content of the page
&lt;/h3&gt;

&lt;p&gt;Alright, as now we are sorted with the tool, I need to think about what i want on my homepage.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Logo&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I haven't designed it yet. But for now I will keep it as placeholder.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;SignIn/SignUp Page.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted to give a "dev"vy feel to the signIn/SignUp page so I decided to make it little geeky with a JSON like template. Not sure how it is but I am liking it for the starters. Any kind of comments/crtique is welcome. &lt;/p&gt;

&lt;p&gt;But it is too white as of now and every time I try to use colors I screw up. Anyway, I happy that I have made progress on this front.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/logeekal/embed/wLJNRM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Some Carousel of Resume templates.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I surely need carousel/collection of some "Hall of Fame" resume templates that will displayed on the homepage. &lt;/p&gt;

&lt;p&gt;So these are things I need to arrange on my page and after 2 hours of dabbling I came up with very simpleton design as below : &lt;/p&gt;

&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%2Fxtyyypmz4u3of76g6hgp.jpg" 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%2Fxtyyypmz4u3of76g6hgp.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know it is pretty shitty but I want to share few things that I am finding very difficult here.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scaling&lt;/strong&gt; - Inspite of Figma providing exact Desktop screen resolution templates, I am not able wrap my head around scaling. If you look at this simple design carefully, the login is page is pretty humongous, it is half page. Which login page in the world is this big.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Negative/White Space&lt;/strong&gt; -  I love neagative space but I don't have any idea how to use it and if I attempt to use, I end up like my login page, no colors - only negative space &amp;amp; no colors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Typography&lt;/strong&gt; - I am sure that I want to go with a sans serif font. This is why my login page I chose &lt;a href="https://fonts.google.com/specimen/Righteous" rel="noopener noreferrer"&gt;Righteous&lt;/a&gt; and it was looking slick to me until I put it on my homepage in my Figma mock-ups and Yuck! it looks hideous.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backgound/Colors&lt;/strong&gt; - I feel this is my most challenging task and I have no idea as of now if I will be able to do it myself or will end up copying from somewhere. :(&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is it for now. &lt;br&gt;
I will be adding to this post every week and documenting the whole process of this design completion as it may help any of my fellow devs who may be in same dilemma of &lt;strong&gt;&lt;em&gt;"how can I learn to design"&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;=========================&lt;/p&gt;

&lt;p&gt;Any input/advice/comment/criticism is graciously welcome. Please do comment if you think that can help me move in right direction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fun Trivia
&lt;/h3&gt;

&lt;p&gt;Check out &lt;a href="https://userinyerface.com" rel="noopener noreferrer"&gt;User In yer Face&lt;/a&gt; for some really bad designs, worse than mine :P.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;.........To be Continued.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/logeekal/web-design-by-for-a-non-designer-part-2-1na3"&gt;Web Design by/for a Non-designer - Part 2&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/logeekal/making-strides-web-design-by-for-a-non-designer-part-3-3k05"&gt;Making Strides | Web Design by/for a Non-designer - Part 3&lt;/a&gt;&lt;/p&gt;

</description>
      <category>web</category>
      <category>design</category>
      <category>beginners</category>
      <category>figma</category>
    </item>
  </channel>
</rss>
