<?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: Ajay Babu</title>
    <description>The latest articles on DEV Community by Ajay Babu (@ajay_babu_4fef98fd4857104).</description>
    <link>https://dev.to/ajay_babu_4fef98fd4857104</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1502825%2F169c0b5b-2719-487b-be58-cc7558d2750e.jpg</url>
      <title>DEV Community: Ajay Babu</title>
      <link>https://dev.to/ajay_babu_4fef98fd4857104</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ajay_babu_4fef98fd4857104"/>
    <language>en</language>
    <item>
      <title>Split screen left , right and bottom . But bottom should be moved to left side.</title>
      <dc:creator>Ajay Babu</dc:creator>
      <pubDate>Fri, 17 May 2024 10:53:03 +0000</pubDate>
      <link>https://dev.to/ajay_babu_4fef98fd4857104/split-screen-left-right-and-bottom-but-bottom-should-be-moved-to-left-side-18eo</link>
      <guid>https://dev.to/ajay_babu_4fef98fd4857104/split-screen-left-right-and-bottom-but-bottom-should-be-moved-to-left-side-18eo</guid>
      <description>&lt;p&gt;Here is my html code&lt;br&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;
&lt;br&gt;



    Left
    
    
        Top
        
        Bottom
    


&lt;p&gt;&lt;br&gt;
&lt;br&gt;
here is my css&lt;br&gt;
.container {&lt;br&gt;
    display: flex;&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Misc */
border: 1px solid #cbd5e0;
height: 32rem;
width: 100%;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;br&gt;
.resizer[data-direction='horizontal'] {&lt;br&gt;
    background-color: #cbd5e0;&lt;br&gt;
    cursor: ew-resize;&lt;br&gt;
    height: 100%;&lt;br&gt;
    width: 2px;&lt;br&gt;
}&lt;br&gt;
.resizer[data-direction='vertical'] {&lt;br&gt;
    background-color: #cbd5e0;&lt;br&gt;
    cursor: ns-resize;&lt;br&gt;
    height: 2px;&lt;br&gt;
    width: 100%;&lt;br&gt;
}&lt;br&gt;
.container__left {&lt;br&gt;
    /* Initially, the left takes 1/4 width */&lt;br&gt;
    width: 50%;&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Misc */
align-items: center;
display: flex;
justify-content: center;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;br&gt;
.container__right {&lt;br&gt;
    /* Take the remaining width */&lt;br&gt;
    flex: 1;&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Misc */
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;br&gt;
.container__top {&lt;br&gt;
    /* Initial height */&lt;br&gt;
    height: 12rem;&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Misc */
align-items: center;
display: flex;
justify-content: center;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;br&gt;
.container__bottom {&lt;br&gt;
    /* Take the remaining height */&lt;br&gt;
    flex: 1;&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Misc */
align-items: center;
display: flex;
justify-content: center;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;br&gt;
Here is my js&lt;br&gt;
document.addEventListener('DOMContentLoaded', function () {&lt;br&gt;
    const resizable = function (resizer) {&lt;br&gt;
        const direction = resizer.getAttribute('data-direction') || 'horizontal';&lt;br&gt;
        const prevSibling = resizer.previousElementSibling;&lt;br&gt;
        const nextSibling = resizer.nextElementSibling;&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // The current position of mouse
    let x = 0;
    let y = 0;
    let prevSiblingHeight = 0;
    let prevSiblingWidth = 0;

    // Handle the mousedown event
    // that's triggered when user drags the resizer
    const mouseDownHandler = function (e) {
        // Get the current mouse position
        x = e.clientX;
        y = e.clientY;
        const rect = prevSibling.getBoundingClientRect();
        prevSiblingHeight = rect.height;
        prevSiblingWidth = rect.width;

        // Attach the listeners to document
        document.addEventListener('mousemove', mouseMoveHandler);
        document.addEventListener('mouseup', mouseUpHandler);
    };

    const mouseMoveHandler = function (e) {
        // How far the mouse has been moved
        const dx = e.clientX - x;
        const dy = e.clientY - y;

        switch (direction) {
            case 'vertical':
                const h =
                    ((prevSiblingHeight + dy) * 100) /
                    resizer.parentNode.getBoundingClientRect().height;
                prevSibling.style.height = h + '%';
                break;
            case 'horizontal':
            default:
                const w =
                    ((prevSiblingWidth + dx) * 100) / resizer.parentNode.getBoundingClientRect().width;
                prevSibling.style.width = w + '%';
                break;
        }

        const cursor = direction === 'horizontal' ? 'col-resize' : 'row-resize';
        resizer.style.cursor = cursor;
        document.body.style.cursor = cursor;

        prevSibling.style.userSelect = 'none';
        prevSibling.style.pointerEvents = 'none';

        nextSibling.style.userSelect = 'none';
        nextSibling.style.pointerEvents = 'none';
    };

    const mouseUpHandler = function () {
        resizer.style.removeProperty('cursor');
        document.body.style.removeProperty('cursor');

        prevSibling.style.removeProperty('user-select');
        prevSibling.style.removeProperty('pointer-events');

        nextSibling.style.removeProperty('user-select');
        nextSibling.style.removeProperty('pointer-events');

        // Remove the handlers of mousemove and mouseup
        document.removeEventListener('mousemove', mouseMoveHandler);
        document.removeEventListener('mouseup', mouseUpHandler);
    };

    // Attach the handler
    resizer.addEventListener('mousedown', mouseDownHandler);
};

// Query all resizers
document.querySelectorAll('.resizer').forEach(function (ele) {
    resizable(ele);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;});&lt;br&gt;
This code is working fine with resizable screen. But i need bottom area should be moved to left side.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
