<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[web2feel]]></title><description><![CDATA[Hey there, my name is Jinson Abraham, a paramedical professional interested in the world of frontend development. I love working with HTML, CSS, WP, modern Java]]></description><link>https://web2feel.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1647090453483/u1lxwIyZJ.png</url><title>web2feel</title><link>https://web2feel.com</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 11:23:50 GMT</lastBuildDate><atom:link href="https://web2feel.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Reversing a Binary Tree with JavaScript.]]></title><description><![CDATA[To reverse a binary tree in JavaScript, you can use a recursive function that traverses the tree in the opposite order. The basic idea is to traverse the tree in post-order, meaning that you first visit the left and right subtrees, and then the root ...]]></description><link>https://web2feel.com/reversing-a-binary-tree-with-javascript</link><guid isPermaLink="true">https://web2feel.com/reversing-a-binary-tree-with-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[DSA]]></category><dc:creator><![CDATA[Jinson Abraham]]></dc:creator><pubDate>Wed, 07 Dec 2022 04:00:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670385399399/GGSaPt0gx.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>To reverse a binary tree in JavaScript, you can use a recursive function that traverses the tree in the opposite order. The basic idea is to traverse the tree in post-order, meaning that you first visit the left and right subtrees, and then the root node.</p>
<p>Here is one possible implementation:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">reverseTree</span>(<span class="hljs-params">node</span>) </span>{
  <span class="hljs-keyword">if</span> (node === <span class="hljs-literal">null</span>) {
    <span class="hljs-keyword">return</span>;
  }

  <span class="hljs-comment">// Reverse the left and right subtrees</span>
  reverseTree(node.left);
  reverseTree(node.right);

  <span class="hljs-comment">// Swap the left and right subtrees</span>
  [node.left, node.right] = [node.right, node.left];
}
</code></pre>
<p>This function can be called on the root node of the tree to reverse the entire tree. It works by recursively reversing the left and right subtrees of the current node, and then swapping the left and right subtrees of the current node. This effectively reverses the structure of the subtree rooted at the current node.</p>
]]></content:encoded></item><item><title><![CDATA[Create a CSS only Accordion UI]]></title><description><![CDATA[Accordion ui is used on web pages to show or hide content based on user interaction. Normally it is built with the help of any JS library or custom JS with HTML and CSS. 

These days we can easily build an accordion UI just using semantic HTML and CS...]]></description><link>https://web2feel.com/create-a-css-only-accordion-ui</link><guid isPermaLink="true">https://web2feel.com/create-a-css-only-accordion-ui</guid><category><![CDATA[CSS]]></category><category><![CDATA[HTML]]></category><category><![CDATA[UI]]></category><dc:creator><![CDATA[Jinson Abraham]]></dc:creator><pubDate>Mon, 14 Mar 2022 16:28:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1647274988059/cA8Ew867o.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Accordion ui is used on web pages to show or hide content based on user interaction. Normally it is built with the help of any JS library or custom JS with HTML and CSS. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647235748611/Ss6IhiNhG.png" alt="image.png" /></p>
<p>These days we can easily build an accordion UI just using semantic HTML and CSS. That means we don't really need any JavaScript to get this job done. Instead we make use of the <code>&lt;details&gt;</code> and <code>&lt;summary&gt;</code> HTML tags. </p>
<p>The <code>&lt;details&gt;</code> tag is used as a wrapper element for content that the user can open and close.  The <code>&lt;summary&gt;</code> tag denotes the visible heading for the details. Both these tags support global HTML attributes. </p>
<p>Let us build the markup for our accordion UI. </p>
<h3 id="heading-our-html-code">Our HTML code</h3>
<pre><code><span class="hljs-operator">&lt;</span>details class<span class="hljs-operator">=</span><span class="hljs-string">"accordion_element"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>summary class<span class="hljs-operator">=</span><span class="hljs-string">"accordion_title"</span><span class="hljs-operator">&gt;</span>
        Lorem ipsum dolor sit amet
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>summary<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"accordion_content"</span><span class="hljs-operator">&gt;</span>    
        <span class="hljs-operator">&lt;</span>p<span class="hljs-operator">&gt;</span>Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis quidem non deleniti, laudantium ab ex<span class="hljs-operator">!</span>. Ullam ipsa doloribus excepturi eligendi sint. Rerum delectus laborum inventore ut quibusdam deserunt fugit tempora.&lt;<span class="hljs-operator">/</span>p<span class="hljs-operator">&gt;</span>        
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>details<span class="hljs-operator">&gt;</span>
</code></pre><p>Now we will style the elements using the class attributes used in our markup.</p>
<h3 id="heading-our-css-code">Our CSS Code</h3>
<pre><code><span class="hljs-selector-class">.accordion_element</span> {
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#c4c4c7</span>;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">5px</span> auto;
  <span class="hljs-attribute">transition</span>: all <span class="hljs-number">200ms</span>;
  <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">5px</span>;
  <span class="hljs-attribute">max-width</span>: <span class="hljs-number">70%</span>;
}
<span class="hljs-selector-class">.accordion_element</span><span class="hljs-selector-attr">[open]</span> {
  <span class="hljs-attribute">background</span>: <span class="hljs-number">#3872FF</span>;
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#5887f4</span>;
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
}
<span class="hljs-selector-class">.accordion_element</span><span class="hljs-selector-attr">[open]</span> <span class="hljs-selector-class">.accordion_title</span> {
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
}
<span class="hljs-selector-class">.accordion_title</span> {
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">10px</span> <span class="hljs-number">20px</span>;
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#343437</span>;
  <span class="hljs-attribute">font-weight</span>: bold;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1.2em</span>;
}
<span class="hljs-selector-class">.accordion_content</span> {
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">10px</span> <span class="hljs-number">20px</span>;
}
</code></pre><p>Thats it! Job done! Our CSS only accordion element is ready.</p>
<h3 id="heading-check-out-the-live-preview-on-codepen">Check out the live preview on Codepen</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/web2feel/pen/RwjVGwX?editors=0100">https://codepen.io/web2feel/pen/RwjVGwX?editors=0100</a></div>
]]></content:encoded></item></channel></rss>