<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dimuthu Pinsara on Medium]]></title>
        <description><![CDATA[Stories by Dimuthu Pinsara on Medium]]></description>
        <link>https://medium.com/@dimuthupinsara?source=rss-874e7990b9b8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NS-p-1FUY_CHzxHY</url>
            <title>Stories by Dimuthu Pinsara on Medium</title>
            <link>https://medium.com/@dimuthupinsara?source=rss-874e7990b9b8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:51:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dimuthupinsara/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cross-Platform Development | Build Once, Run Everywhere]]></title>
            <link>https://medium.com/@dimuthupinsara/cross-platform-development-build-once-run-everywhere-8d9edb434f2a?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d9edb434f2a</guid>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[cross-platform-mobile-app]]></category>
            <category><![CDATA[cross-platformdevelopment]]></category>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 18:40:34 GMT</pubDate>
            <atom:updated>2026-02-23T18:40:34.775Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wx-SGTUOpCh3_MVbQP3tLg.jpeg" /><figcaption>Cross-platform development</figcaption></figure><p>In today’s fast-moving world, users expect apps to work on every device whether it’s an Android phone, an iPhone, a tablet, or even a laptop. But building a separate app for each platform can be costly, time consuming, and hard to maintain. That’s where <strong>cross-platform development</strong> comes in.</p><p><strong>What is the meaning of “Cross-Platform” ?</strong></p><p>At its core, cross-platform development is about <strong>code reuse</strong>. Instead of duplicating logic for different platforms, developers write shared code that works everywhere. This improves efficiency and consistency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLvcy__QCa-vHrZMzgbNFQ.png" /><figcaption><strong>What is the meaning of “Cross-Platform” ?</strong></figcaption></figure><p><strong>Why we need to use this ?</strong></p><ul><li><strong>Faster Development : </strong>we can write code once and deploy it everywhere. Gone are the days of rewriting features for each platform.</li><li><strong>Lower Costs</strong> : Less code means fewer developers needed and less time spent on testing and debugging across platforms.</li><li><strong>Easier Updates</strong> : When the same code runs everywhere, we can easily updating features or fixing bugs.</li><li><strong>Consistent Experience : </strong>Users get the same look and feel across devices</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLQ-ZZv7XOSU_I7m3QHtPQ.png" /><figcaption>benefits of cross-platforms</figcaption></figure><p><strong>Popular Cross-Platform Frameworks</strong></p><p>Several tools have made cross-platform development mainstream.</p><ul><li><strong>Flutter : </strong>Uses Dart and delivers near-native performance with creative UI.</li><li><strong>React Native : </strong>Built by Facebook, uses JavaScript and allows fast iteration.</li><li><strong>Xamarin</strong> : Uses C# and is great for integrating with Microsoft products.</li><li><strong>Ionic</strong> : Web-based apps using familiar web tech like HTML, CSS, and JavaScript.</li></ul><p>Each has its strengths, and the right choice often depends on project needs performance requirements, team skills, and future scalability.</p><p><strong>What is the difference between native and cross-platform</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.tiktok.com%2Fembed%2Fv2%2F6970143696150990086&amp;display_name=tiktok&amp;url=https%3A%2F%2Fwww.tiktok.com%2F%40devslopes%2Fvideo%2F6970143696150990086%3Fis_from_webapp%3D1%26sender_device%3Dpc%26web_id%3D7491324257163626002&amp;image=https%3A%2F%2Fp19-common-sign.tiktokcdn-us.com%2Ftos-maliva-p-0068%2F0660b675f32c4c00b4df9d074e984b2d_1622863052%7Etplv-tiktokx-origin.image%3Fdr%3D9636%26x-expires%3D1772042400%26x-signature%3DmWKAXPg79B06xzrsCthnJwUuggU%253D%26t%3D4d5b0474%26ps%3D13740610%26shp%3D81f88b70%26shcp%3D43f4a2f9%26idc%3Duseast8&amp;type=text%2Fhtml&amp;schema=tiktok" width="340" height="700" frameborder="0" scrolling="no"><a href="https://medium.com/media/64a5f4d0dbd007b52227f8b0854faf49/href">https://medium.com/media/64a5f4d0dbd007b52227f8b0854faf49/href</a></iframe><h3><strong>Challenges to Be Aware Of</strong></h3><ul><li><strong>Performance Considerations : </strong>Some cross-platform apps may not be as fast as fully native ones — though modern tools have minimized this gap.</li><li><strong>Platform-Specific Features : </strong>If your app needs deep integration with device hardware, sometimes you still need native code.</li><li><strong>UI Differences : </strong>Design guidelines differ between iOS and Android, so developers often need extra care to make interfaces feel “native enough” on each.</li></ul><p><strong>Conclusion</strong></p><p>Cross-platform development is shaping the future of app building. It empowers developers to <strong>build smarter, faster, and more affordably</strong>, while maintaining quality across multiple devices. Understanding cross-platform tools gives you a real advantage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d9edb434f2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering RTL & LTR Layouts with CSS Logical Properties]]></title>
            <link>https://medium.com/@dimuthupinsara/mastering-rtl-ltr-layouts-with-css-logical-properties-4bc0fccd2014?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bc0fccd2014</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 05:55:12 GMT</pubDate>
            <atom:updated>2025-12-10T05:55:12.151Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qup2JFhYyOyP62jsBm0-MA.png" /><figcaption>thumbnail</figcaption></figure><p>Designing for both <strong>left-to-right (LTR)</strong> and <strong>right-to-left (RTL)</strong> languages is no longer optional — it’s a necessity for global, multi-language websites.</p><p>Traditionally, developers wrote <strong>separate CSS rules</strong> for each direction, leading to duplicated code and harder maintenance. But thanks to <strong>CSS logical properties</strong>, you can write <em>direction-aware</em> CSS that automatically adapts based on the page’s writing direction.</p><p>In this article, you’ll learn how margin-inline-start, padding-inline-start, and inset-inline-start help eliminate layout headaches and make your styles fully RTL-friendly with ease.</p><h3><strong>Why Use CSS Logical Properties?</strong></h3><p>Here’s how we used to write styles:</p><pre>/* LTR */<br>.element {<br>    margin-left: 10px;<br>    padding-left: 15px;<br>    left: 8px;<br>}<br><br>/* RTL */<br>[dir=&quot;rtl&quot;] .element {<br>    margin-right: 10px;<br>    padding-right: 15px;<br>    right: 8px;<br>    left: auto;<br>}</pre><p>This works… but it’s repetitive, messy, and <strong>hard</strong> to maintain.</p><h3>The Modern Solution: Logical Properties</h3><pre>.element {<br>    margin-inline-start: 10px;<br>    padding-inline-start: 15px;<br>    inset-inline-start: 8px;<br>}</pre><p>With just <strong>one rule</strong>, <strong>your UI now adapts <em>automatically</em> to RTL or LTR. No duplicated styles. No overrides. No extra headaches.</strong></p><h3>Let’s Break Down the Magic</h3><p><strong>margin-inline-start</strong></p><p>Replaces:</p><ul><li>margin-left in LTR</li><li>margin-right in RTL</li></ul><pre>.box {<br>    margin-inline-start: 20px;<br>}</pre><h3>Benefits:</h3><ul><li>Zero direction-specific CSS</li><li>Automatically updates when the dir attribute changes</li><li>Clean, readable, and scalable</li></ul><p><strong>padding-inline-start</strong></p><p>Same idea — but for padding.</p><pre>.button {<br>    padding-inline-start: 12px;<br>}</pre><h3>Best Use Case:</h3><p>Whenever you need spacing <strong>before</strong> an element’s content, regardless of document direction.</p><p><strong>inset-inline-start</strong></p><p>This one replaces <strong>positional properties</strong>:</p><ul><li>left</li><li>right</li></ul><p>Depending on the writing direction.</p><pre>.tooltip {<br>    position: absolute;<br>    inset-inline-start: 10px;<br>}</pre><h3>Perfect For:</h3><ul><li>Tooltips</li><li>Dropdowns</li><li>Floating icons</li><li>Off-canvas menus</li><li>Absolutely positioned UI components</li></ul><p>Anywhere you’d normally switch between left and right.</p><h3>Why Logical Properties Are a Game-Changer</h3><ul><li>No more separate RTL/LTR files</li><li>Cleaner, maintainable code</li><li>Built for modern, multilingual apps</li><li>Plays nicely with CSS frameworks and custom layouts</li><li>Future-proof web development (this is where CSS is heading)</li></ul><p>If you’re building any UI that could support multiple languages, <strong>logical properties should be your default approach</strong> moving forward.</p><h3>Final Thoughts</h3><p>CSS logical properties simplify what was once one of the most frustrating challenges in front-end development. Instead of maintaining multiple stylesheets or writing complex overrides, you get a single, elegant solution that adapts automatically.</p><p>Start using them today — and let CSS handle the direction logic for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bc0fccd2014" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Emmet for HTML | How to Write Code 10x Faster]]></title>
            <link>https://medium.com/@dimuthupinsara/emmet-for-html-how-to-write-code-10x-faster-5c1f9618246f?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c1f9618246f</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Sat, 08 Nov 2025 09:30:50 GMT</pubDate>
            <atom:updated>2025-11-08T09:30:50.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Emmet coding" src="https://cdn-images-1.medium.com/max/1024/1*GtA9SvEANdjS2rxKulROZg.png" /></figure><p>When I first started writing HTML, I used to type every tag manually <br> &lt;div&gt;, &lt;ul&gt;, &lt;li&gt;, &lt;a href=&quot;#&quot;&gt;, and so on.<br> It was fine... until it wasn’t.</p><p>Once your fingers start cramping from typing repetitive code structures, you realize there <em>has</em> to be a faster way.</p><p>That’s when I discovered <strong>Emmet</strong> — and trust me, it changed everything.</p><h3><strong>What Is Emmet?</strong></h3><p>Emmet is like the <strong>autopilot for your HTML and CSS</strong>. It lets you write short abbreviations that expand into full code blocks instantly.</p><p>For example:</p><pre>div.container&gt;ul&gt;li*3</pre><p>turns into:</p><pre>&lt;div class=&quot;container&quot;&gt;<br>  &lt;ul&gt;<br>    &lt;li&gt;&lt;/li&gt;<br>    &lt;li&gt;&lt;/li&gt;<br>    &lt;li&gt;&lt;/li&gt;<br>  &lt;/ul&gt;<br>&lt;/div&gt;</pre><p>Yes, just one line and <em>boom</em> — a complete structure.</p><h3>Why Developers Love Emmet</h3><p>Here’s why Emmet has become an essential tool in modern web development:</p><ul><li><strong>Saves time</strong> — Write less, build more.</li><li><strong>Cleaner workflow</strong> — No more breaking your flow to close tags.</li><li><strong>Works everywhere</strong> — Supported in VS Code, Sublime, Atom, and even browser dev tools.</li><li><strong>CSS support too</strong> — Type m10 and watch it become margin: 10px; instantly.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.tiktok.com%2Fembed%2Fv2%2F7324879113712389419&amp;display_name=tiktok&amp;url=https%3A%2F%2Fwww.tiktok.com%2F%40vscode%2Fvideo%2F7324879113712389419%3Fis_from_webapp%3D1%26sender_device%3Dpc%26web_id%3D7491324257163626002&amp;image=https%3A%2F%2Fp16-common-sign.tiktokcdn-us.com%2Ftos-useast5-p-0068-tx%2Fde727ead92014c2f8a38f1ab17858f2e_1705456341%7Etplv-tiktokx-dmt-logom%3Atos-useast5-i-0068-tx%2FoQJ7kZtIvcHaiAFikBB4yg40oAkAnCMBESAlE.image%3Fdr%3D9634%26x-expires%3D1762765200%26x-signature%3D3EktAGK5B3qm0Ny3rMj56%252BSxKIo%253D%26t%3D4d5b0474%26ps%3D13740610%26shp%3D81f88b70%26shcp%3D43f4a2f9%26idc%3Duseast8&amp;type=text%2Fhtml&amp;schema=tiktok" width="340" height="700" frameborder="0" scrolling="no"><a href="https://medium.com/media/7190f07bd99dea524480ce8942929e9e/href">https://medium.com/media/7190f07bd99dea524480ce8942929e9e/href</a></iframe><h3><strong>Where to Learn All the Emmet Shortcuts</strong></h3><p>Don’t try to memorize everything at once. Start small and add new shortcuts as you go.</p><p>Here’s your go-to reference:</p><p><a href="https://docs.emmet.io/cheat-sheet/">https://docs.emmet.io/cheat-sheet</a></p><h3>Final Thoughts</h3><p>If you’re serious about becoming a faster and smarter developer, mastering <strong>Emmet</strong> is a must.<br> It’s one of those tools that doesn’t just save time — it reshapes how you <em>think</em> about writing code.</p><p>Start using it today, and soon typing full HTML will feel like… well, typing in slow motion.</p><h3>Resources</h3><ul><li>Official Emmet Cheat Sheet: <a href="https://docs.emmet.io/cheat-sheet/">https://docs.emmet.io/cheat-sheet/</a></li><li>Try it on <a href="https://code.visualstudio.com/">VS Code</a> — Emmet is built right in!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c1f9618246f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is BFCache?]]></title>
            <link>https://medium.com/@dimuthupinsara/what-is-bfcache-8b6dfc407c0a?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b6dfc407c0a</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 18:14:16 GMT</pubDate>
            <atom:updated>2025-08-17T16:58:23.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObG5C3zz9rBiUI-vHL-zqA.png" /><figcaption>BFCache</figcaption></figure><p>Have you ever noticed that sometimes, when you hit the <strong>Back</strong> or <strong>Forward</strong> button in your browser, a page loads almost instantly? It feels like magic, right?</p><p>That magic is thanks to a feature called <strong>BFCache</strong>, short for <strong>Back-Forward Cache</strong>. Let’s break down what it is, why it matters, and when it might not work.</p><h3><strong>What exactly is BFCache?</strong></h3><p>BFCache is a special browser optimization that <strong>stores an entire page’s state in memory</strong> when you navigate away.</p><p>Unlike normal caching (which just saves resources like images or scripts), BFCache saves <strong>everything</strong>, including:</p><ul><li>The DOM (all your HTML elements)</li><li>JavaScript heap (so your variables and app state stay intact)</li><li>Scroll position</li><li>Form inputs</li></ul><p>When you go back to that page, the browser simply <strong>restores it instantly</strong>, without reloading from the network or rerunning scripts.</p><h3><strong>Why do we need BFCache?</strong></h3><p>Without BFCache, going back means:</p><ul><li>Reloading the page</li><li>Refetching data</li><li>Reinitializing scripts</li><li>Losing your scroll position or form inputs</li></ul><p>With BFCache, the page feels as if you never left. It makes navigation <strong>much faster and smoother</strong>, almost like a native app.</p><h3><strong>When BFCache does <em>not</em> work</strong></h3><p>BFCache is awesome, but it doesn’t always kick in. Here are some common reasons it might be disabled:</p><ul><li>Your page has an active unload or beforeunload event listener</li><li>You use open WebSockets or long-running JavaScript tasks</li><li>The page uses certain APIs that block caching for security or stability</li><li>Heavy memory usage might cause the browser to skip it</li></ul><h3><strong>How can you check if BFCache was used?</strong></h3><p>Browsers provide a handy way to detect this. You can listen to the pageshow event and check the persisted property:</p><pre>window.addEventListener(&#39;pageshow&#39;, function(event) {<br>  if (event.persisted) {<br>    console.log(&#39;Page was restored from BFCache!&#39;);<br>  }<br>});</pre><h3><strong>In short</strong></h3><ul><li><strong>BFCache</strong> makes back and forward navigation feel instantaneous by saving your entire page state in memory.</li><li>It improves user experience dramatically.</li><li>But certain code patterns and APIs can prevent it from working.</li></ul><p><strong><em>Thank you, Happy Coding..</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b6dfc407c0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Tipnix Tooltip JS — The Customizable Tooltip Plugin for Developers]]></title>
            <link>https://medium.com/@dimuthupinsara/introducing-tipnix-tooltip-js-the-customizable-tooltip-plugin-for-developers-efc4c4d38da1?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/efc4c4d38da1</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Tue, 22 Apr 2025 19:34:54 GMT</pubDate>
            <atom:updated>2025-04-27T16:39:41.398Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing Tipnix Tooltip JS — The Customizable Tooltip Plugin for Developers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*2s6RynrXYqkkqgCTa166hQ.png" /></figure><p>Tooltips are essential in UI design — they enhance UX, clarify interfaces, and provide helpful hints. But customizing them often requires extra JavaScript or messy inline styles. That’s why I built <strong>Tipnix</strong>, a lightweight and developer-friendly tooltip plugin designed for quick styling and easy integration.</p><p><strong>Live Docs</strong>: <a href="https://tipnix-documentation.vercel.app/">tipnix-documentation.vercel.app</a></p><h3><strong>What is Tipnix?</strong></h3><p><strong>Tipnix</strong> is a JavaScript-based tooltip plugin that makes it incredibly simple to add styled tooltips using custom HTML attributes. It allows developers to control appearance and behavior directly from the DOM using intuitive tipnix-* attributes — no bloated code, no complex setup.</p><h3><strong>Key Features</strong></h3><ul><li>✅ Easy to use: Plug and play with minimal configuration.</li><li>🎨 Fully customizable: Change colors, width, font size, padding, and animation with attributes.</li><li>💡 Smart positioning: Automatically adjusts tooltip position for better visibility.</li><li>🌙 Dark mode aware: Adjusts contrast based on user theme preferences.(Coming Soon)</li><li>⚡ Lightweight and fast.</li></ul><h3><strong>Usage Example</strong></h3><p>First, you need to add these CDN links :</p><p>CSS Link :</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/Dimuthu-Pinsara/tipnix-tooltip-js@master/tipnix-tooltip.css&quot;&gt;</pre><p>JS Link :</p><pre>&lt;script src=&quot;https://cdn.jsdelivr.net/gh/Dimuthu-Pinsara/tipnix-tooltip-js@master/tipnix-tooltip.js&quot;&gt;&lt;/script&gt;</pre><pre>&lt;span <br>  class=&quot;tipnix&quot;<br>  tipnix-text=&quot;This is a tooltip&quot;<br>  tipnix-bg=&quot;#000000&quot;<br>  tipnix-text-color=&quot;#ffffff&quot;<br>  tipnix-font-size=&quot;14px&quot;<br>  tipnix-width=&quot;200px&quot;<br>  tipnix-animation=&quot;fadeIn&quot;<br>&gt;<br>  Hover me<br>&lt;/span&gt;</pre><p>Then initialize the plugin in JavaScript:</p><pre>document.addEventListener(&quot;DOMContentLoaded&quot;, () =&gt; {<br>  initTipNixTooltip({<br>    backgroundColor: &#39;#000000&#39;,<br>    textColor: &#39;#ffffff&#39;,<br>  });<br>});</pre><p>That’s it! Your tooltip is ready and fully customizable.</p><h3><strong>Developer Highlight</strong></h3><p>Once initialized, tipnix-* attributes allow quick, dynamic styling without altering the core plugin logic. This makes your HTML cleaner, more readable, and easier to maintain.</p><h3><strong>Documentation</strong></h3><p>Check out full usage, demos, and advanced configs here:<br> <a href="https://tipnix-documentation.vercel.app/">tipnix-documentation.vercel.app</a></p><p>Finally, Whether you’re building a dashboard, form interface, or e-commerce site — <strong>Tipnix</strong> saves you time while giving you design freedom. Try it out and share your thoughts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efc4c4d38da1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix Deprecated jQuery Issues with jQuery Migrate — A Step-by-Step Guide]]></title>
            <link>https://medium.com/@dimuthupinsara/fix-deprecated-jquery-issues-with-jquery-migrate-a-step-by-step-guide-cce887d1efc0?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cce887d1efc0</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Thu, 13 Mar 2025 17:48:25 GMT</pubDate>
            <atom:updated>2025-03-13T17:48:25.959Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fix Deprecated jQuery Issues with jQuery Migrate — A Step-by-Step Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGR5aftN_1zxTo5slJ7Edw.png" /></figure><p>If you’ve ever updated your jQuery version and suddenly found your website breaking, you’re not alone! Many developers face this challenge when moving from an older jQuery version to a newer one. The culprit? Deprecated or removed features. But don’t worry, jQuery Migrate is here to save the day!</p><h3><strong>What is jQuery Migrate?</strong></h3><p><strong>jQuery Migrate</strong> is a plugin that helps your existing jQuery code transition smoothly to newer versions by restoring deprecated features and logging warnings about outdated code. It acts as a bridge, allowing you to upgrade jQuery without instantly breaking your site.</p><h3>Why Use jQuery Migrate?</h3><ul><li><strong>Smooth Transition:</strong> Restores removed functions and deprecated features.</li><li><strong>Error Logging:</strong> Alerts you to outdated code that needs fixing.</li><li><strong>Incremental Upgrades:</strong> Helps in testing and gradually updating your jQuery-based applications.</li></ul><h3>How to Use jQuery Migrate</h3><p>Adding jQuery Migrate to your project is super simple! Just include it after loading jQuery.</p><pre>&lt;script src=&quot;https://code.jquery.com/jquery-3.7.1.min.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;https://code.jquery.com/jquery-migrate-3.5.2.min.js&quot;&gt;&lt;/script&gt;</pre><h3>Step 1: Identify Issues</h3><p>Once added, open your browser console (F12 in most browsers) and check for warnings about deprecated functions. This will help you pinpoint areas that need attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CANfDgZsX1vcxFJKCJS9SQ.png" /><figcaption>Console log in after include Jquery migrate CDN</figcaption></figure><h3>Step 2: Fix &amp; Update</h3><p>Gradually update your code by replacing deprecated methods with modern alternatives. For example, if you see a warning about .click(), replace it with .on().</p><pre>// Old way (deprecated)<br>$(&quot;#btn&quot;).click(function() {<br>    alert(&quot;Clicked!&quot;);<br>});<br><br>// New way (recommended)<br>$(&quot;#btn&quot;).on(&quot;click&quot;, function() {<br>    alert(&quot;Clicked!&quot;);<br>});</pre><h3>Step 3: Remove jQuery Migrate</h3><p>Once you’ve updated all deprecated code, remove jQuery Migrate to ensure your site is fully compatible with the latest jQuery version.</p><h3>Final Thoughts</h3><p>Updating jQuery doesn’t have to be a nightmare. With <strong>jQuery Migrate</strong>, you can bridge the gap between old and new, making the transition seamless. So next time you upgrade, don’t panic — just migrate! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cce887d1efc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Dynamically Change Icon Color in Color Inputs]]></title>
            <link>https://medium.com/@dimuthupinsara/how-to-dynamically-change-icon-color-in-color-inputs-153069fe28a9?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/153069fe28a9</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 17:42:07 GMT</pubDate>
            <atom:updated>2024-09-16T17:42:07.453Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with color input fields, one common problem is that the icon inside the field can become invisible or hard to see when the user picks a color that lacks enough contrast. To solve this, I came up with a simple yet effective approach using React’s state management and event handling.</p><p><strong>The Problem</strong></p><p>Imagine a color input field with a nice little icon in the center, which works perfectly when the background color contrasts well with the icon. But what happens when a user picks a light or dark shade that makes the icon blend in? The icon disappears or becomes hard to see, leading to a poor user experience.</p><p><strong>The Solution</strong></p><p>We can dynamically change the icon’s color based on the input color, ensuring it always contrasts with the selected background. Here’s how I achieved it.</p><p><strong>Step 1: Setting Up the State</strong></p><p>First, I created a useState hook to manage the icon’s color, initializing it with white:</p><pre>const [iconColor, setIconColor] = useState(&quot;white&quot;);</pre><p><strong>Step 2: Adding an Event Listener to the Input</strong></p><p>Next, I wrote an useEffect hook to listen for changes in the color input. It runs a function whenever the input value changes, and dynamically calculates whether the icon color should be black or white based on the selected color:</p><pre>useEffect(() =&gt; {<br>  var colorElement = document.getElementById(&quot;color&quot;);<br><br>  colorElement.addEventListener(&quot;input&quot;, changeIconColor);<br><br>  function changeIconColor(e) {<br>    var getColor = e.currentTarget.value;<br>    getColor = getColor.split(&quot;#&quot;).join(&quot;&quot;);<br>    var rgbColor = getColor.match(/.{1,2}/g);<br>    var rgbCode = [<br>      parseInt(rgbColor[0], 16),<br>      parseInt(rgbColor[1], 16),<br>      parseInt(rgbColor[2], 16),<br>    ];<br><br>    // If the green component is high, switch the icon color to black for better contrast<br>    if (rgbCode[1] &gt;= 180) {<br>      setIconColor(&quot;black&quot;);<br>    } else {<br>      setIconColor(&quot;white&quot;);<br>    }<br>  }<br>}, [iconColor]);</pre><p>This code listens for color changes, extracts the RGB values, and decides whether the icon should be black or white. Here, I used the green component (rgbCode[1]) to check brightness levels, assuming a lighter green would require a dark (black) icon.</p><p><strong>Step 3: Updating the JSX</strong></p><p>Now that we have the icon’s color dynamically set, we can apply it to our JSX code. I updated the className property of the icon to reflect the icon color dynamically:</p><pre>&lt;span<br>  className={`icon-wrp text-${iconColor} absolute top-[50%] left-[50%] transform -translate-x-1/2 -translate-y-1/2 pointer-events-none`}<br>&gt;<br>  🎨<br>&lt;/span&gt;</pre><p>This ensures that the icon always contrasts with the background, even as the user changes the color input.</p><p><strong>Do you need to check this please check my website</strong></p><p><a href="https://dimuthu-pinsara.vercel.app/#challengers">https://dimuthu-pinsara.vercel.app/#challengers</a></p><p><strong>Final Thoughts</strong></p><p>This solution is simple but effective in improving the user experience with color inputs. The dynamically changing icon color ensures that the UI remains accessible and visually appealing, regardless of the selected color. Feel free to try this approach in your own projects!</p><p>If you found this helpful, leave a comment or share how you’ve handled similar UI challenges! Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=153069fe28a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Fix Disappearing Footer Issues When Virtual Keyboards Open on Your Website in Mobile]]></title>
            <link>https://medium.com/@dimuthupinsara/how-to-fix-disappearing-footer-issues-when-virtual-keyboards-open-on-your-website-in-mobile-0c2e1f2ec0fd?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c2e1f2ec0fd</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 15:26:24 GMT</pubDate>
            <atom:updated>2024-09-16T15:27:18.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qhNcZQzZ3XVC8aaRVEh-uw.png" /></figure><p>In modern web development, handling virtual keyboards on mobile devices can be tricky, especially when they affect the layout of your web page. I recently encountered an issue in my project where, when users clicked on an input field, the virtual keyboard appeared, but the footer disappeared. In this article, I’ll share how I fixed this using the Virtual Keyboard API and some CSS tricks.</p><p><strong>The Problem</strong></p><p>When the user clicked on the input field, the virtual keyboard opened, but the footer was pushed off the screen or hidden. The goal was to keep the footer visible or adapt the layout to accommodate the virtual keyboard, maintaining a good user experience.</p><h3><strong>The Solution</strong></h3><p><strong>Step 1: Adding Meta Tags</strong></p><p>First, we need to adjust the viewport behaviour. Add the following meta tag to your project(for next js):</p><pre>export const viewport = {<br>  themeColor: &#39;white&#39;,<br>  width: &#39;device-width&#39;,<br>  initialScale: 1,<br>  maximumScale: 1,<br>  userScalable: false,<br>  virtualKeyboard: &#39;overlays-content&#39;,<br>  interactiveWidget: &#39;resizes-content&#39;<br>};</pre><p>or add this meta tag in your <strong>HEAD element</strong></p><pre>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, user-scalable=no, virtual-keyboard=overlays-content&quot; /&gt;<br>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, user-scalable=no, interactive-widget=resizes-content&quot;&gt;</pre><p>This ensures that the viewport scales correctly and prevents unwanted zooming while using the virtual keyboard.</p><p><strong>Step 2: Using the Virtual Keyboard API</strong></p><p>Next, I utilized the Virtual Keyboard API, which allows better control over how the content resizes when the keyboard is displayed. Include the following JavaScript code in your project:</p><pre>if (&quot;virtualKeyboard&quot; in navigator) {<br>  navigator.virtualKeyboard.overlaysContent = true;<br>}</pre><p>This line checks if the virtual keyboard API is supported in the browser and allows content to overlay with the keyboard, keeping the footer in view.</p><p><strong>Step 3: Adjusting Footer Styles</strong></p><p>To make sure the footer adapts to the virtual keyboard’s height, I used a CSS env() function specific to Chrome&#39;s environment variables:</p><pre>footer {<br>  bottom: max(0rem, env(keyboard-inset-height, 0rem));<br>}</pre><p>This ensures that the footer stays in place by dynamically adjusting its bottom position based on the height of the virtual keyboard.</p><p>you can check this solution in my website :</p><p><a href="https://dimuthu-pinsara.vercel.app/#challengers">https://dimuthu-pinsara.vercel.app/#challengers</a></p><p><strong>Conclusion</strong></p><p>By using the Virtual Keyboard API and some CSS environment variables, we can solve the problem of disappearing footers when the virtual keyboard opens on mobile devices. <strong>This solution works on Android Chrome and Samsung browsers only.</strong> I will explain how to implement IOS devices in the next blog. Thank you. Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c2e1f2ec0fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fix intl tel input search issue]]></title>
            <link>https://medium.com/@dimuthupinsara/step-by-step-guide-to-fix-the-country-search-issue-in-intl-tel-input-85523ecbcfb3?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/85523ecbcfb3</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 11:10:00 GMT</pubDate>
            <atom:updated>2025-01-16T09:25:26.760Z</atom:updated>
            <content:encoded><![CDATA[<p>While integrating the <a href="https://intl-tel-input.com/"><strong>intl-tel-input</strong></a> library into one of my projects, I came across a quirky bug that caught me off guard: when I typed the letter &#39;U&#39; into the country search bar, the first country listed was “Anguilla”. Strange, right? The expected behavior would be to show countries starting with &#39;U&#39; — like the United States or Uganda. So, I rolled up my sleeves and dove into the issue.</p><p><strong>The Bug Breakdown</strong></p><p>The intl-tel-input library offers an awesome user experience for phone number input fields, providing country flags and automatic formatting. However, there’s an issue in how the search functionality filters countries by name. Specifically, when searching for a country by entering the first letter, the results don’t always align with user expectations.</p><p><strong>The Solution</strong></p><p>I updated the _filterCountries function in the library’s script to resolve this behavior. Below is my modified version of the function:</p><pre>_filterCountries(query, isReset = false) {<br>  let noCountriesAddedYet = true;<br>  this.countryList.innerHTML = &quot;&quot;;<br>  const normalisedQuery = normaliseString(query);<br>  <br>  for (let i = 0; i &lt; this.countries.length; i++) {<br>    const c = this.countries[i];<br>    const normalisedCountryName = normaliseString(c.name);<br>    const isMatch = (normalisedCountryName &amp;&amp; normalisedQuery) &amp;&amp; <br>      (normalisedCountryName.toLowerCase().localeCompare(normalisedQuery.toLowerCase()));<br>    const fullDialCode = `+${c.dialCode}`;<br>    <br>    if (isMatch == 1 || isMatch == 0 || isReset) {<br>      const listItem = c.nodeById[this.id];<br>      if (listItem) {<br>        this.countryList.appendChild(listItem);<br>      }<br>      if (noCountriesAddedYet) {<br>        this._highlightListItem(listItem, false);<br>        noCountriesAddedYet = false;<br>      }<br>    }<br>  }<br>  <br>  if (noCountriesAddedYet) {<br>    this._highlightListItem(null, false);<br>  }<br>  <br>  this.countryList.scrollTop = 0;<br>  this._updateSearchResultsText();<br>}</pre><p><strong>How It Works</strong></p><p>The core of the fix lies in how the search query and country names are normalized and compared. By using localeCompare, I was able to ensure that both the input query and the country name are correctly matched, respecting case and diacritics. The condition isMatch == 1 || isMatch == 0 checks if the query closely matches the country name, allowing for accurate filtering.</p><p>Additionally, the script resets and updates the country list dynamically based on the query, ensuring that the right countries are highlighted and listed.</p><p><strong>Conclusion</strong></p><p>Sometimes, even the best libraries have hidden quirks that can affect the user experience. Fixing this search issue in intl-tel-input has been a fun learning experience, and I’m excited to continue exploring ways to improve and customize popular libraries. If you’ve encountered similar bugs, don’t hesitate to dive into the code—it’s often simpler than it looks!</p><p><strong>Do you have any problem please check this website:</strong></p><p><a href="https://dimuthu-pinsara.vercel.app/#challengers">https://dimuthu-pinsara.vercel.app/#challengers</a></p><p>Feel free to ask any questions in the comments or suggest improvements! Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85523ecbcfb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Easily Revert a Git Rebase to a Previous Soft Reset Commit]]></title>
            <link>https://medium.com/@dimuthupinsara/how-to-easily-revert-a-git-rebase-to-a-previous-soft-reset-commit-6e6f87d2e13e?source=rss-874e7990b9b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e6f87d2e13e</guid>
            <dc:creator><![CDATA[Dimuthu Pinsara]]></dc:creator>
            <pubDate>Tue, 27 Aug 2024 16:55:16 GMT</pubDate>
            <atom:updated>2024-09-16T09:23:25.633Z</atom:updated>
            <content:encoded><![CDATA[<p>Stuck in the middle of a rebase gone wrong? Don’t worry — Git’s got you covered! This quick guide will show you how to easily revert a rebase to a previous soft reset commit in just a few steps.</p><p><strong>Why Does This Matter?</strong></p><p>Sometimes, when you’re trying to clean up your Git history or resolve conflicts, you might realize that a rebase didn’t work out as you expected. Instead of starting from scratch or losing your progress, you can easily revert to a previous commit and save yourself time. Let’s dive in!</p><p><strong>Step 1: Retrieve the Commit Hash Using Git Reflog</strong></p><p>Git keeps track of your actions, even if you’ve already performed a reset. This is where Git’s Reflog comes into play — it maintains a log of all the changes you’ve made to your repository.</p><p>To start, you’ll need the hash of the previous commit where you want to revert. Open your terminal and run the following command.</p><p>This command shows a list of <strong>all the recent actions in your Git repository, including commits, rebases, and resets.</strong></p><pre>git reflog</pre><p><strong>Copy the git commit hash</strong></p><p>Once the list appears, locate and copy the commit hash that corresponds to the previous soft reset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*s9CVZEz70iLGebfQ7JXfsA.png" /></figure><h4>Step 2: Reset to the Previous Commit</h4><p>Now that you have the commit hash, the next step is to use Git’s reset command. The soft reset is especially useful because it preserves your working directory and index, allowing you to revert your Git history without losing any uncommitted changes.</p><p>Run the following command, replacing &lt;commit_hash&gt; with the hash you copied earlier:</p><pre>git reset --soft &lt;commit_hash&gt;</pre><p><strong>Bonus Git Tips</strong></p><p>Use git reflog to track any mistakes, even after a reset.<br>Practice using git reset — soft to save time when you want to roll back but keep changes in your working directory.</p><p>Feel free to share this guide or drop any questions in the comments below. If you’re hungry for more Git wisdom, check out my other blog posts on Git strategies and tips for seamless version control. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e6f87d2e13e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>