<?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 Sultonkhon Oblokulov on Medium]]></title>
        <description><![CDATA[Stories by Sultonkhon Oblokulov on Medium]]></description>
        <link>https://medium.com/@sultondev?source=rss-43bd8f73c91b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*b2P1lR3YNmKVt6cT</url>
            <title>Stories by Sultonkhon Oblokulov on Medium</title>
            <link>https://medium.com/@sultondev?source=rss-43bd8f73c91b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:06:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sultondev/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[ Building a Smooth Building a Smooth Collapse/Expand Animation in Vue 3: A Deep Dive into…]]></title>
            <link>https://medium.com/@sultondev/building-a-smooth-building-a-smooth-collapse-expand-animation-in-vue-3-a-deep-dive-into-2ac68a2aeb50?source=rss-43bd8f73c91b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ac68a2aeb50</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vue-3]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[css-animation]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Sultonkhon Oblokulov]]></dc:creator>
            <pubDate>Sun, 25 May 2025 10:12:01 GMT</pubDate>
            <atom:updated>2025-05-25T10:15:04.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Building a Smooth Building a Smooth Collapse/Expand Animation in Vue 3: A Deep Dive into Techniques and Performance</h3><p>In modern UI design, <strong>collapse/expand animations</strong> are everywhere — from FAQs to side menus, filter sections, and accordions. Done right, they create a smooth and responsive experience. Done wrong, they lag, stutter, or fail entirely on edge cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-tRZUoNbvjOoZVOz.jpg" /></figure><p>In this article, I’ll walk you through three major techniques for implementing collapse/expand transitions in Vue 3 — including the <strong>newcomer </strong><strong>grid-template-rows trick</strong>, the traditional max-height method, and my own <strong>Vue </strong><strong>&lt;transition&gt; component</strong> approach.</p><p>Let’s explore the <strong>pros and cons of each</strong>, and why I ended up building a custom solution using Vue’s Transition API.</p><h3>💡 Technique 1: grid-template-rows: 0fr → 1fr</h3><p>How it works</p><p>This method leverages CSS Grid and animates the grid-template-rows property:</p><pre>&lt;template&gt;<br>  &lt;div<br>    :class=&quot;{ open: isOpen }&quot;<br>    class=&quot;transition-grid&quot;<br>  &gt;<br>    &lt;div class=&quot;content&quot;&gt;<br>      &lt;!-- Collapsible content here --&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/template&gt;<br><br>&lt;style scoped&gt;<br>.transition-grid {<br>  display: grid;<br>  grid-template-rows: 0fr;<br>  transition: grid-template-rows 0.3s ease;<br>}<br>.transition-grid.open {<br>  grid-template-rows: 1fr;<br>}<br>.content {<br>  overflow: hidden;<br>}<br>&lt;/style&gt;</pre><h4>✅ Pros</h4><ul><li><strong>Pure CSS</strong>: Simple and declarative — no JavaScript required.</li><li><strong>Layout-aware</strong>: Works beautifully with dynamic content height.</li><li><strong>Modern &amp; smooth</strong>: Leverages GPU-accelerated transitions.</li></ul><h4>❌ Cons</h4><ul><li><strong>Limited browser support</strong>: grid-template-rows animations are not fully supported in all browsers (especially older versions).</li><li><strong>Strict structure</strong>: You must use CSS Grid. Doesn’t work with flexbox or block elements out of the box.</li><li><strong>Not flexible for width transitions</strong>: Only works well for height.</li></ul><h3>💡 Technique 2: max-height: 0 → 500px</h3><p>How it works</p><p>This older method uses a large max-height and transitions between 0 and, say, 500px.</p><pre>&lt;template&gt;<br>  &lt;div :class=&quot;{ open: isOpen }&quot; class=&quot;collapse-box&quot;&gt;<br>    &lt;slot /&gt;<br>  &lt;/div&gt;<br>&lt;/template&gt;<br><br>&lt;style scoped&gt;<br>.collapse-box {<br>  max-height: 0;<br>  overflow: hidden;<br>  transition: max-height 0.3s ease;<br>}<br>.collapse-box.open {<br>  max-height: 500px;<br>}<br>&lt;/style&gt;</pre><h4>✅ Pros</h4><ul><li><strong>Very compatible</strong>: Works on all browsers.</li><li><strong>Quick to implement</strong>.</li></ul><h4>❌ Cons</h4><ul><li><strong>Not truly dynamic</strong>: You must know the maximum height in advance.</li><li><strong>Glitches on content change</strong>: If content height exceeds max-height, it gets cut off.</li><li><strong>Bad for performance</strong>: Doesn’t leverage GPU (transitions layout property, not transform/composite).</li></ul><h3>💡 Technique 3: Vue &lt;transition&gt; + Inline Styles (My Approach)</h3><p>Now for my custom implementation: I use Vue 3’s &lt;transition&gt; component and control the height or width dynamically with JavaScript.</p><h4>CollapseExpand.vue</h4><pre>&lt;script lang=&quot;ts&quot; setup&gt;<br>import { computed, ref, watch } from &quot;vue&quot;;<br>import type { CollapseExpandEmits } from &quot;@/types/components/collapse-expand.types.ts&quot;;<br><br>/**<br> * Define component props<br> */<br>interface Props {<br>  name: string;<br>  dimension: &quot;height&quot; | &quot;width&quot;;<br>  duration: number;<br>  easing: string;<br>}<br><br>const {<br>  name = &quot;collapse&quot;,<br>  dimension = &quot;height&quot;,<br>  duration = 300,<br>  easing = &quot;ease-in-out&quot;,<br>} = defineProps&lt;Props&gt;();<br><br>/**<br> * Define emitted events – note that all events now use `Element` as the type.<br> */<br>const emit = defineEmits&lt;CollapseExpandEmits&gt;();<br><br>/**<br> * This ref will cache the dimensions (and related paddings) of the transitioning element.<br> */<br>const cachedStyles = ref&lt;Record&lt;string, string&gt; | null&gt;(null);<br><br>/**<br> * Computed property that returns a CSS transition string for each property that will be animated.<br> */<br>const transition = computed(() =&gt; {<br>  if (!cachedStyles.value) return &quot;&quot;;<br>  const transitions: string[] = [];<br>  for (const key in cachedStyles.value) {<br>    transitions.push(`${convertToCssProperty(key)} ${duration}ms ${easing}`);<br>  }<br>  return transitions.join(&quot;, &quot;);<br>});<br><br>/**<br> * When the `dimension` prop changes, clear the cached dimensions.<br> */<br>watch(<br>  () =&gt; dimension,<br>  () =&gt; {<br>    clearCachedDimensions();<br>  },<br>);<br><br>/* Transition hook methods – note that the parameter is now of type `Element`.<br>   Inside the functions, if you need HTMLElement‐only properties (like offsetHeight),<br>   you can cast the element to HTMLElement. */<br><br>function beforeAppear(el: Element): void {<br>  emit(&quot;before-appear&quot;, el);<br>}<br><br>function appear(el: Element): void {<br>  emit(&quot;appear&quot;, el);<br>}<br><br>function afterAppear(el: Element): void {<br>  emit(&quot;after-appear&quot;, el);<br>}<br><br>function appearCancelled(el: Element): void {<br>  emit(&quot;appear-cancelled&quot;, el);<br>}<br><br>function beforeEnter(el: Element): void {<br>  emit(&quot;before-enter&quot;, el);<br>}<br><br>function enter(el: Element, done: () =&gt; void): void {<br>  const htmlEl = el as HTMLElement;<br>  detectAndCacheDimensions(htmlEl);<br>  setClosedDimensions(htmlEl);<br>  hideOverflow(htmlEl);<br>  forceRepaint(htmlEl);<br>  setTransition(htmlEl);<br>  setOpenedDimensions(htmlEl);<br><br>  emit(&quot;enter&quot;, el, done);<br>  setTimeout(done, duration);<br>}<br><br>function afterEnter(el: Element): void {<br>  const htmlEl = el as HTMLElement;<br>  unsetOverflow(htmlEl);<br>  unsetTransition(htmlEl);<br>  unsetDimensions(htmlEl);<br>  clearCachedDimensions();<br>  emit(&quot;after-enter&quot;, el);<br>}<br><br>function enterCancelled(el: Element): void {<br>  emit(&quot;enter-cancelled&quot;, el);<br>}<br><br>function beforeLeave(el: Element): void {<br>  emit(&quot;before-leave&quot;, el);<br>}<br><br>function leave(el: Element, done: () =&gt; void): void {<br>  const htmlEl = el as HTMLElement;<br>  detectAndCacheDimensions(htmlEl);<br>  setOpenedDimensions(htmlEl);<br>  hideOverflow(htmlEl);<br>  forceRepaint(htmlEl);<br>  setTransition(htmlEl);<br>  setClosedDimensions(htmlEl);<br><br>  emit(&quot;leave&quot;, el, done);<br>  setTimeout(done, duration);<br>}<br><br>function afterLeave(el: Element): void {<br>  const htmlEl = el as HTMLElement;<br>  unsetOverflow(htmlEl);<br>  unsetTransition(htmlEl);<br>  unsetDimensions(htmlEl);<br>  clearCachedDimensions();<br>  emit(&quot;after-leave&quot;, el);<br>}<br><br>function leaveCancelled(el: Element): void {<br>  emit(&quot;leave-cancelled&quot;, el);<br>}<br><br>/* Utility functions – these continue to work with HTMLElement since they access DOM-specific properties. */<br><br>function detectAndCacheDimensions(el: HTMLElement): void {<br>  if (cachedStyles.value !== null) return;<br><br>  const originalVisibility = el.style.visibility;<br>  const originalDisplay = el.style.display;<br><br>  el.style.visibility = &quot;hidden&quot;;<br>  el.style.display = &quot;&quot;;<br>  cachedStyles.value = detectRelevantDimensions(el);<br>  el.style.visibility = originalVisibility;<br>  el.style.display = originalDisplay;<br>}<br><br>function clearCachedDimensions(): void {<br>  cachedStyles.value = null;<br>}<br><br>function detectRelevantDimensions(el: HTMLElement): Record&lt;string, string&gt; {<br>  if (dimension === &quot;height&quot;) {<br>    return {<br>      height: el.offsetHeight + &quot;px&quot;,<br>      paddingTop: el.style.paddingTop || getCssValue(el, &quot;padding-top&quot;),<br>      paddingBottom: el.style.paddingBottom || getCssValue(el, &quot;padding-bottom&quot;),<br>    };<br>  } else if (dimension === &quot;width&quot;) {<br>    return {<br>      width: el.offsetWidth + &quot;px&quot;,<br>      paddingLeft: el.style.paddingLeft || getCssValue(el, &quot;padding-left&quot;),<br>      paddingRight: el.style.paddingRight || getCssValue(el, &quot;padding-right&quot;),<br>    };<br>  }<br>  return {};<br>}<br><br>function setTransition(el: HTMLElement): void {<br>  el.style.transition = transition.value;<br>}<br><br>function unsetTransition(el: HTMLElement): void {<br>  el.style.transition = &quot;&quot;;<br>}<br><br>function hideOverflow(el: HTMLElement): void {<br>  el.style.overflow = &quot;hidden&quot;;<br>}<br><br>function unsetOverflow(el: HTMLElement): void {<br>  el.style.overflow = &quot;&quot;;<br>}<br><br>function setClosedDimensions(el: HTMLElement): void {<br>  if (!cachedStyles.value) return;<br>  Object.keys(cachedStyles.value).forEach((key) =&gt; {<br>    el.style.setProperty(convertToCssProperty(key), &quot;0&quot;);<br>  });<br>}<br><br>function setOpenedDimensions(el: HTMLElement): void {<br>  if (!cachedStyles.value) return;<br>  Object.keys(cachedStyles.value).forEach((key) =&gt; {<br>    el.style.setProperty(convertToCssProperty(key), cachedStyles.value![key]);<br>  });<br>}<br><br>function unsetDimensions(el: HTMLElement): void {<br>  if (!cachedStyles.value) return;<br>  Object.keys(cachedStyles.value).forEach((key) =&gt; {<br>    el.style.removeProperty(convertToCssProperty(key));<br>  });<br>}<br><br>function forceRepaint(el: HTMLElement): void {<br>  // Accessing a property forces the browser to repaint.<br>  const b = getComputedStyle(el)[dimension];<br>  console.log(b, &quot;repaint&quot;);<br>}<br><br>function getCssValue(el: HTMLElement, styleProp: string): string {<br>  return getComputedStyle(el).getPropertyValue(styleProp);<br>}<br><br>function convertToCssProperty(style: string): string {<br>  const upperChars = style.match(/([A-Z])/g);<br>  if (!upperChars) {<br>    return style;<br>  }<br>  for (const char of upperChars) {<br>    style = style.replace(new RegExp(char), &quot;-&quot; + char.toLowerCase());<br>  }<br>  if (style.startsWith(&quot;-&quot;)) {<br>    style = style.slice(1);<br>  }<br>  return style;<br>}<br>&lt;/script&gt;<br><br>&lt;template&gt;<br>  &lt;transition<br>    :name=&quot;name&quot;<br>    @appear=&quot;appear&quot;<br>    @enter=&quot;enter&quot;<br>    @leave=&quot;leave&quot;<br>    @before-appear=&quot;beforeAppear&quot;<br>    @after-appear=&quot;afterAppear&quot;<br>    @appear-cancelled=&quot;appearCancelled&quot;<br>    @before-enter=&quot;beforeEnter&quot;<br>    @after-enter=&quot;afterEnter&quot;<br>    @enter-cancelled=&quot;enterCancelled&quot;<br>    @before-leave=&quot;beforeLeave&quot;<br>    @after-leave=&quot;afterLeave&quot;<br>    @leave-cancelled=&quot;leaveCancelled&quot;<br>  &gt;<br>    &lt;slot&gt;&lt;/slot&gt;<br>  &lt;/transition&gt;<br>&lt;/template&gt;</pre><h4>Collapse-Expand.types.ts</h4><pre>export interface CollapseExpandEmits {<br>  (e: &quot;before-appear&quot;, el: Element): void;<br><br>  (e: &quot;appear&quot;, el: Element, done?: () =&gt; void): void;<br><br>  (e: &quot;after-appear&quot;, el: Element): void;<br><br>  (e: &quot;appear-cancelled&quot;, el: Element): void;<br><br>  (e: &quot;before-enter&quot;, el: Element): void;<br><br>  (e: &quot;enter&quot;, el: Element, done: () =&gt; void): void;<br><br>  (e: &quot;after-enter&quot;, el: Element): void;<br><br>  (e: &quot;enter-cancelled&quot;, el: Element): void;<br><br>  (e: &quot;before-leave&quot;, el: Element): void;<br><br>  (e: &quot;leave&quot;, el: Element, done: () =&gt; void): void;<br><br>  (e: &quot;after-leave&quot;, el: Element): void;<br><br>  (e: &quot;leave-cancelled&quot;, el: Element): void;<br>}</pre><h3>✅ Benefits</h3><ul><li><strong>Fully dynamic</strong>: Handles both height and width, with no hardcoded sizes.</li><li><strong>Fine control</strong>: Works with paddings, overflow, and emits all lifecycle events (before-enter, after-leave, etc.).</li><li><strong>SSR-safe &amp; Vue idiomatic</strong>: Built with &lt;transition&gt;, integrates cleanly with Vue apps.</li><li><strong>Works with both height and width</strong>: More flexible than grid-based methods.</li></ul><h4>❌ Drawbacks</h4><ul><li><strong>More complex to write</strong>: Requires some manual work with refs, styles, and computed transitions.</li><li><strong>Slightly more CPU usage</strong>: Uses layout reads (offsetHeight) and paints.</li><li><strong>Not pure CSS</strong>: You’re tightly coupling JS and styling logic.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDlL8y_sc2RTc1q_J61DUA.png" /></figure><h3>🧠 Final Thoughts</h3><p>Animations can be tricky — not because they’re hard to implement, but because <strong>UI/UX quality matters</strong>. A choppy or glitchy collapse animation is worse than none at all.</p><p>If you want a quick-and-dirty solution: use max-height.<br> If you want a modern, CSS-only approach (and accept grid-only layout): try grid-template-rows.<br> But if you want <strong>precision, control, and flexibility</strong>, consider my approach using &lt;transition&gt;.</p><p>It’s more work upfront, but the result is smoother, more reliable, and adapts well to complex UI requirements.</p><h3>🧩 Bonus: Try the Component</h3><p>I recommend wrapping this logic into a reusable component in your design system. Whether you’re building accordions, dropdowns, or multi-step forms — one well-built CollapseExpand component can go a long way.</p><p>If you’re interested, feel free to explore the [GitHub Repo or Vue Plugin Playground] (link your playground if you have one).</p><p>Thanks for reading! 🧡<br> You can follow me on <a href="https://www.instagram.com/sultondev">Instagram</a> or visit <a href="https://sulton.dev/">https://sulton.dev</a> for more tips on building powerful UIs with Vue 3.</p><p>Would you like me to format this for actual publishing (with headings, markdown, image ideas, etc.) or even help with a GitHub playground?<br>Also, you can leave your solutions in the comment section below. I will compare and update the article. Thanks for reading, your opinion matters to me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ac68a2aeb50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Folder structure for Nuxt 3]]></title>
            <link>https://medium.com/@sultondev/folder-structure-for-nuxt-3-478d147452ba?source=rss-43bd8f73c91b------2</link>
            <guid isPermaLink="false">https://medium.com/p/478d147452ba</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nuxtjs]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[folder-structure]]></category>
            <category><![CDATA[nuxt-3]]></category>
            <dc:creator><![CDATA[Sultonkhon Oblokulov]]></dc:creator>
            <pubDate>Sun, 18 Aug 2024 20:09:58 GMT</pubDate>
            <atom:updated>2024-08-18T20:09:58.525Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will show my solution for folder structuring Nuxt 3 Application.</p><figure><img alt="sultondev nuxt series thumbnail" src="https://cdn-images-1.medium.com/max/1024/1*pvsF42cOzT96mNrAoH1umg.png" /></figure><h3>Beginning</h3><p>This is how your app looks like when it is created</p><pre><strong>public/</strong><br>-- favicon.ico<br><strong>server/</strong><br>-- tsconfig.json<br>.gitignore<br>app.vue<br>nuxt.config.ts<br>package.json<br>pnpm-lock.yaml<br>README.md<br>tsconfig.json<br></pre><h3>End</h3><p>This is the folder structure</p><pre><strong>public/</strong><br>--- folders<br><strong>server/</strong><br>--- <em>tsconfig.json</em><br><strong>src/<br></strong>--- <em>app.vue</em><br>--- <em>error.vue</em><br>--- <strong>config/<br></strong>----- <em>index.ts</em><br>----- <strong>head/</strong><br>------ <em>seo.ts</em><br>------ <em>head-tags.ts</em><br>----- <strong>nuxt-modules/<br></strong>------ <em>i18n.ts<br></em>------ <em>index.ts </em>(import all modules into this file)<br>--- <strong>pages/</strong><br>----- ...other-pages<br>----- <em>index.vue<br>--- </em><strong>public/<br></strong><em>--- </em><strong>locales/<br></strong>----- vueI18n.ts<br>----- ru.json<br>----- en.json<strong><br></strong>----- uz.json<strong><br></strong><em>--- </em><strong>layouts/</strong><em><br></em>--- <strong>components/<br></strong>--- <strong>composables/<br></strong>--- <strong>store/</strong><br>--- <strong>plugins/<br></strong><em>nuxt.config.ts<br>package.json<br>pnpm-lock.yaml<br>README.md</em><br><em>tsconfig.ts</em></pre><h4><strong>nuxt-config file</strong></h4><pre>import config from &quot;./config/index&quot;<br>export default defineNuxtConfig(config)</pre><h4>config/index.ts</h4><pre>// https://nuxt.com/docs/api/configuration/nuxt-config<br>import modules from &quot;./nuxt-modules&quot;<br>import {noScripts as seoNoScripts, scripts as seoScripts} from &#39;./head/seo&#39;<br>import {scripts, meta, links} from &#39;./head/head-tags&#39; // google tag manager connection scripts<br><br>export default defineNuxtConfig({<br> modules,<br> srcDir: &#39;src/&#39;,<br> routeRules: {<br>  &#39;/**&#39;: {<br>   swr: false,<br>   cache: false,<br>  },<br> },<br> imports: {<br>  dirs: [&#39;composable/**&#39;, &#39;store/**&#39;, &#39;api/&#39;],<br> },<br> components: [<br>  {<br>   path: &#39;~/components&#39;,<br>   pathPrefix: false,<br>  }<br> ],<br> app: {<br>  head: {<br>   titleTemplate: &#39;%s | SULTONDEV&#39;,<br>   meta: [...meta],<br>   link: [...links],<br>   script: [...seoScripts, ...scripts],<br>   noscript: [...seoNoScripts],<br>  },<br> },<br> i18n: {<br>  lazy: false,<br>  langDir: &#39;locales&#39;,<br>  locales: [<br>   {<br>    code: &#39;en&#39;,<br>    file: &#39;en.json&#39;<br>   },<br>   {<br>    code: &#39;ru&#39;,<br>    file: &#39;ru.json&#39;<br>   },<br>   {<br>    code: &#39;uz&#39;,<br>    file: &#39;uz.json&#39;<br>   }<br>  ],<br>  defaultLocale: &#39;en&#39;<br> },<br>})</pre><h4>config/nuxt-modules/index.ts</h4><pre>import type { NuxtConfig } from &quot;@nuxt/schema&quot;;<br>import { i18n } from &quot;./i18n&quot;;<br><br>export default [<br>  i18n,<br>  &quot;@nuxt/image&quot;,<br>  &quot;@nuxtjs/tailwindcss&quot;,<br>  &quot;@nuxtjs/color-mode&quot;,<br>  &quot;@pinia/nuxt&quot;,<br>  &quot;nuxt-icon&quot;,<br>  &quot;@vueuse/nuxt&quot;,<br>] as NuxtConfig[&quot;modules&quot;];</pre><h4>config/nuxt-modules/i18n.ts</h4><pre>import &#39;@nuxtjs/i18n&#39;<br>import type { NuxtConfig } from &#39;nuxt/config&#39;<br><br>const locales = [<br>    {<br>        code: &#39;en&#39;,<br>        iso: &#39;en&#39;,<br>        file: &#39;en.json&#39;,<br>    },<br>    {<br>        code: &#39;ru&#39;,<br>        iso: &#39;ru&#39;,<br>        file: &#39;ru.json&#39;,<br>    },<br>    {<br>        code: &#39;uz&#39;,<br>        iso: &#39;uz&#39;,<br>        file: &#39;uz.json&#39;,<br>    },<br>]<br><br>export const i18nOptions: NuxtConfig[&#39;i18n&#39;] = {<br>    langDir: &#39;locales/&#39;,<br>    defaultLocale: &#39;en&#39;,<br>    locales,<br>    skipSettingLocaleOnNavigate: false,<br>    types: &#39;composition&#39;,<br>    strategy: &#39;prefix_except_default&#39;,<br>    debug: false,<br>    vueI18n: &#39;src/locales/vueI18n.ts&#39;,<br>}<br><br>export const [i18n]: NuxtConfig[&#39;modules&#39;] = [[&#39;@nuxtjs/i18n&#39;, i18nOptions]]</pre><h4>locales/vueI18n.ts</h4><pre>import en from &#39;./en.json&#39;<br>import ru from &#39;./ru.json&#39;<br>import uz from &#39;./uz.json&#39;<br>export const messages = { en, ru, uz }<br><br>export default defineI18nConfig(() =&gt; ({<br> legacy: false,<br> globalInjection: true,<br> locale: &#39;en&#39;,<br> fallbackLocale: &#39;en&#39;,<br> missingWarn: false,<br> fallbackWarn: false,<br> silentTranslationWarn: true,<br> messages,<br> pluralRules: {<br>  ru: function (choice: number, choicesLength: number) {<br>   if (choice === 0) {<br>    return 0<br>   }<br><br>   const teen = choice &gt; 10 &amp;&amp; choice &lt; 20<br>   const endsWithOne = choice % 10 === 1<br><br>   if (choicesLength &lt; 4) {<br>    return !teen &amp;&amp; endsWithOne ? 1 : 2<br>   }<br>   if (!teen &amp;&amp; endsWithOne) {<br>    return 1<br>   }<br>   if (!teen &amp;&amp; choice % 10 &gt;= 2 &amp;&amp; choice % 10 &lt;= 4) {<br>    return 2<br>   }<br><br>   return choicesLength &lt; 4 ? 2 : 3<br>  },<br> },<br>}))</pre><p>In summary, I use this folder structure on most of my projects. And yeah you may think that this folder structure is too separated but as the project becomes complex then more useful this folder structure becomes. <a href="https://www.linkedin.com/in/uktam-usmanov/">Uktam Usmanov</a> inspired this article.</p><p>I hope this article was useful for you. If you are a front-end developer who uses Nuxt/Vue, I would appreciate your comments. Thank you a lot for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=478d147452ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Numeric-Only Input Field in Vue.js: Excluding the Dot]]></title>
            <link>https://medium.com/@sultondev/creating-a-numeric-only-input-field-in-vue-js-excluding-the-dot-b701add1705e?source=rss-43bd8f73c91b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b701add1705e</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sultonkhon Oblokulov]]></dc:creator>
            <pubDate>Wed, 27 Dec 2023 00:31:48 GMT</pubDate>
            <atom:updated>2023-12-27T00:56:37.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoLNIofhAQrMjeDIMXhu3w.png" /></figure><p>In modern web applications, it’s often necessary to restrict user input to specific formats. One common requirement is allowing only numeric input, while excluding decimal points or other non-numeric characters. In Vue 3, especially with the &lt;script setup&gt; syntax and TypeScript, implementing this functionality is straightforward and elegant. Let’s walk through creating a numeric-only input field in a Vue 3 component.</p><h4>Prerequisites</h4><ul><li>Basic knowledge of Vue 3</li><li>Understanding of TypeScript in the context of Vue</li></ul><h4>Step 1: Setting Up the Component</h4><p>Start by creating a new Vue component. We’ll use the &lt;script setup&gt; syntax, which is a more concise way of writing Vue components in Vue 3.</p><pre>&lt;template&gt;<br>  &lt;div&gt;<br>    &lt;input type=&quot;text&quot; @keydown=&quot;checkDigit&quot; /&gt;<br>  &lt;/div&gt;<br>&lt;/template&gt;<br><br>&lt;script setup lang=&quot;ts&quot;&gt;<br>import { defineProps } from &#39;vue&#39;;<br><br>const checkDigit = (event: KeyboardEvent) =&gt; {<br>  if (event.key.length === 1 &amp;&amp; isNaN(Number(event.key))) {<br>    event.preventDefault();<br>  }<br>};<br>&lt;/script&gt;</pre><h4>Step 2: Understanding the checkDigit Function</h4><p>In the checkDigit function, we handle the keydown event of the input field:</p><ul><li>event.key.length === 1: This condition ensures that we are only dealing with single-character keys, excluding control keys like Enter or Backspace.</li><li>isNaN(Number(event.key)): This checks if the pressed key, when converted to a number, is not a number. If it&#39;s NaN, the key is not a digit and the input is prevented.</li><li>event.preventDefault(): This method stops the key from being registered in the input field, effectively preventing non-numeric characters.</li></ul><h4>Step 3: Integrating with Vue 3</h4><p>The &lt;script setup&gt; syntax allows for a more straightforward and less verbose component structure. It&#39;s part of the Composition API in Vue 3, which provides a more flexible way to organize and reuse logic.</p><h4>Disadvantage</h4><p>⚠ You can’t copy and paste the number in this field because of v.key’s length restriction.</p><h4>Conclusion</h4><p>Restricting input to numbers only, especially excluding dots, is a common requirement in web applications. Vue 3, with its Composition API and TypeScript support, offers a clean and efficient way to implement this. By attaching a simple event handler to the input field, we can ensure that only numeric input is accepted, maintaining data integrity and user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b701add1705e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SVG icons in web applications | “Enhancing SVG Integration in Webpack: The Superiority of…]]></title>
            <link>https://medium.com/@sultondev/svg-icons-in-web-applications-enhancing-svg-integration-in-webpack-the-superiority-of-e3d91249fab3?source=rss-43bd8f73c91b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3d91249fab3</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Sultonkhon Oblokulov]]></dc:creator>
            <pubDate>Sat, 25 Nov 2023 16:59:27 GMT</pubDate>
            <atom:updated>2023-11-26T20:11:41.284Z</atom:updated>
            <content:encoded><![CDATA[<h3>SVG icons in web applications | “Enhancing SVG Integration in Webpack: The Superiority of @svgr/webpack”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wGVqLQ9qNCLu-PE0T_9sg.png" /></figure><p>As a front-end (react) developer,<em> I always used to face with problems SVG icons</em>. The designers in your team will give you a pack of icons in Figma, which you should download and use in SVG format. But is it okay to use SVG icons with the IMG tag? Here in this article, you will find an amazing way to solve this problem.</p><p>Firstly, you need to download @svgr/webpack to your project.</p><pre>npm install @svgr/webpack --save-dev</pre><p>or</p><pre>yarn add @svgr/webpack</pre><p>after you should configure your webpack like this:</p><pre>{<br>  test: /\.svg$/,<br>  use: [&#39;@svgr/webpack&#39;],<br>}</pre><p>Or if you use Next.js you will have to configure your next.config.js like this:</p><pre>const nextConfig = {<br>  webpack: (config) =&gt; {<br>    config.module.rules.push({<br>      test: /\.svg$/i,<br>      use: [&#39;@svgr/webpack&#39;],<br>    });<br>    return config;<br>  },<br>};</pre><p>After configuration, you can freely import SVG files in your code and use them as components : )</p><pre>import Star from &#39;./star.svg&#39;<br><br>const App = () =&gt; (<br>  &lt;div&gt;<br>    &lt;Star /&gt;<br>  &lt;/div&gt;<br>)</pre><p>There is also one powerful thing I want you to know. In your SVG files, you will have the attribute called fill within the SVG tag. This attribute value will be set to the SVG file and will not be changeable. If in your web app you may, use the same icon but in a different color I recommend you to remove the fill attributes from the tags within SVG and set “currentColor” value to the SVG tag’s fill attribute:</p><p># before:</p><pre>&lt;svg width=&quot;40&quot; height=&quot;40&quot; viewBox=&quot;0 0 40 40&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;<br>  &lt;circle cx=&quot;20&quot; cy=&quot;20&quot; r=&quot;20&quot; fill=&quot;#3EBA59&quot;/&gt;<br>&lt;/svg&gt;</pre><p># after:</p><pre>&lt;svg width=&quot;40&quot; height=&quot;40&quot; viewBox=&quot;0 0 40 40&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;<br>  &lt;circle cx=&quot;20&quot; cy=&quot;20&quot; r=&quot;20&quot;/&gt;<br>&lt;/svg&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*DBDzxLjJ86ZkREcbBq0aPg.png" /></figure><p>Now with this trick, you can set the color to the SVG icons with the CSS property “color” like for texts</p><pre>.YourSVGIcon {<br>  color: #3EBA59;<br>}</pre><p>Now, just think about what flexibility this package gives you when it comes to styling icons for dark themes. You can configure based on your case if you read the documentary of this package.</p><p>Link to the document: <a href="https://react-svgr.com/">https://react-svgr.com/</a></p><p>Clap and follow for more tricks like this one : )</p><p>#WebDevelopment #SVGIcons #ReactDevelopment #FrontEndTips #Webpack #SVGRWebpack #CodingTutorial #WebDesign #JavaScript #UIUXDesign #TechTips #ModernWeb #DevCommunity #CodeOptimization #WebAppDesign</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3d91249fab3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Expanding Web Development Landscape: A Plethora of Choices]]></title>
            <link>https://medium.com/@sultondev/navigating-the-expanding-web-development-landscape-a-plethora-of-choices-1559dd55bc8f?source=rss-43bd8f73c91b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1559dd55bc8f</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[back-end-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sultonkhon Oblokulov]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 08:00:37 GMT</pubDate>
            <atom:updated>2023-07-03T08:00:37.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4AvrqC6mHJocoGOnbKVeA.png" /></figure><h3>Introduction</h3><p>In today’s digital era, the web development landscape has witnessed exponential growth in the number of technologies available for creating websites. This abundance of options has made website development more accessible, but it has also introduced challenges, especially when it comes to choosing the most suitable technology for long-term use. Additionally, beginner programmers often find themselves in a dilemma, unsure of where to start in this vast sea of possibilities. In this article, we’ll explore the proliferation of web development technologies, the challenges they pose, the benefits of having an experienced teacher, and my personal experiences using Vue.js, Nuxt.js, and React.js. Furthermore, I encourage readers to share their preferred arsenal of technologies for web application development.</p><h3>1. The Dizzying Array of Choices:</h3><p>Web development technologies have rapidly multiplied, offering developers a plethora of options for creating websites. From front-end libraries to back-end frameworks, the possibilities seem endless. This profusion of choices has made it easier to build websites, but it has also created a conundrum — how to select the technology that best suits our needs for the long haul.</p><h3>2. The Predicament of Beginner Programmers:</h3><p>For beginner programmers, the task of choosing the right starting point in this expansive web development ecosystem can be overwhelming. The vast array of technologies can lead to decision paralysis, hindering their progress. Aspiring developers often ask themselves, “Which technology should I learn first? Which one will provide a solid foundation for future growth?”</p><h3>3. The Power of an Experienced Teacher:</h3><p>One way to alleviate the challenges faced by beginner programmers is through the guidance of an experienced teacher. A mentor or instructor can help navigate the sea of web development technologies, offering insights based on practical experience. They can provide recommendations tailored to the learner’s goals, strengths, and areas of interest. With an experienced teacher, beginners can embark on their web development journey with confidence and a clear sense of direction.</p><h3>4. My Beloved Arsenal: Vue.js, Nuxt.js, and React.js:</h3><p>In my own web development journey, I have discovered the power of Vue.js, Nuxt.js, and React.js. Vue.js, with its simplicity and gentle learning curve, served as an excellent starting point. It allowed me to grasp fundamental web development concepts and build interactive user interfaces effortlessly. To take my Vue.js projects to the next level, I embraced Nuxt.js — a framework that added essential features like server-side rendering and routing. Nuxt.js empowered me to create easy web apps efficiently, delivering seamless user experiences.</p><p>For more complex and demanding projects, such as large CRM systems, my go-to technology is React.js. Its robustness, scalability, and vibrant ecosystem make it the perfect choice. With React.js, I can build sophisticated user interfaces and tackle intricate challenges with confidence and ease.</p><h3>5. Expanding Our Arsenal Together:</h3><p>As we navigate the ever-expanding web development landscape, it’s essential to collaborate and learn from each other. I invite readers to share their beloved technologies and frameworks, creating a vibrant community of developers united by their passion for creating exceptional web applications. Together, we can collectively enrich our arsenal and explore new frontiers in web development.</p><h3>6. Some websites that are useful for every developer.</h3><ul><li>Choose the right technologies for your specialty area with — <a href="https://roadmap.sh/">https://roadmap.sh/</a></li><li>Make learning programming fun with — <a href="https://exercism.io/">https://exercism.io/</a></li><li>Solve and develop your programming skills with — <a href="https://codewars.com/">https://codewars.com/</a></li><li>United tech docs — <a href="https://devdocs.io/">https://devdocs.io/</a></li><li>Developer’s Instagram — <a href="https://dev.to/">https://dev.to/</a></li><li>Developer’s Twitter — <a href="https://daily.dev/">https://daily.dev/</a></li></ul><h3>7. Youtube channels to learn new technologies easily</h3><ul><li>Developed By Ed — <a href="https://www.youtube.com/@developedbyed">https://www.youtube.com/@developedbyed</a></li><li>Design Course — <a href="https://www.youtube.com/@DesignCourse">https://www.youtube.com/@DesignCourse</a></li><li>Dennis Ivy — <a href="https://www.youtube.com/@DennisIvy">https://www.youtube.com/@DennisIvy</a></li><li>Traversy Media — <a href="https://www.youtube.com/@TraversyMedia">https://www.youtube.com/@TraversyMedia</a></li><li><a href="https://www.youtube.com/@WebDevSimplified">Web Dev Simplified</a>— <a href="https://www.youtube.com/@WebDevSimplified">https://www.youtube.com/@WebDevSimplified</a></li></ul><h3>Conclusion:</h3><p>The proliferation of web development technologies has undeniably made creating websites more accessible than ever before. However, this abundance of choices can pose challenges, from selecting the right technology for long-term usage to deciding where to begin for beginner programmers. An experienced teacher can play a crucial role in guiding newcomers through the maze of options. In my own journey, Vue.js, Nuxt.js, and React.js have been invaluable tools, enabling me to create easy web apps and tackle complex projects. Let us embrace collaboration, share our experiences, and continue to expand our arsenal of web development technologies to shape the digital world.</p><p>#WebDevelopment #VueJS #NuxtJS #ReactJS #WebDevelopmentTechnologies #BeginnerProgrammers #ExperiencedTeachers #CodingCommunity</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1559dd55bc8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Information Technologies]]></title>
            <link>https://medium.com/@sultondev/what-are-information-technologies-7bc8346cb34d?source=rss-43bd8f73c91b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bc8346cb34d</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[programmer]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sultonkhon Oblokulov]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 04:48:15 GMT</pubDate>
            <atom:updated>2023-04-10T04:48:15.721Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*YDmxEgR0kfX0hZR6cXRyQA.png" /></figure><p>Information Technology (IT) is a part of our daily lives and has changed the way we live and work. However, some people think that IT professionals can fix any technology-related problem, which is not true. For example, just because someone is good at swimming does not mean they are good at other sports. IT has many different areas of expertise, such as software development, cybersecurity, and data analysis. It is impossible for one person to be good at everything. Additionally, IT is constantly changing and evolving, so IT professionals need to keep learning to stay relevant. So, it’s important to understand that IT professionals have different skills and specialize in different areas.</p><p>p.s. It is my first article, I hope you will support me 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bc8346cb34d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>