<?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: David Pollet</title>
    <description>The latest articles on DEV Community by David Pollet (@davidpollet).</description>
    <link>https://dev.to/davidpollet</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F159587%2F05759f21-e0f7-4bbd-a4cb-362f2b818c38.jpg</url>
      <title>DEV Community: David Pollet</title>
      <link>https://dev.to/davidpollet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/davidpollet"/>
    <language>en</language>
    <item>
      <title>Windows apps that massively improve your comfort and your productivity</title>
      <dc:creator>David Pollet</dc:creator>
      <pubDate>Fri, 01 Jul 2022 07:21:04 +0000</pubDate>
      <link>https://dev.to/davidpollet/windows-apps-that-massively-improve-your-comfort-and-your-productivity-34jm</link>
      <guid>https://dev.to/davidpollet/windows-apps-that-massively-improve-your-comfort-and-your-productivity-34jm</guid>
      <description>&lt;p&gt;Whether you are dev or not, these apps are pure gold if you're looking to improve your productivity and your comfort at work.😁 &lt;br&gt;
I spent a lot of times to find a solution that fix windows UX issues and improve my work comfort. Most of the apps are free, some will cost you a few dollars for a lifetime license. For me, it worth it.&lt;/p&gt;
&lt;h2&gt;
  
  
  TLDR / The tools featured in this article
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.stardock.com/products/groupy/"&gt;Groupy&lt;/a&gt; → less than $10 → Tabs in Windows Explorer (you can group any app window too).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/emoacht/Monitorian"&gt;Monitorian&lt;/a&gt; → Free / Open Source → Set and sync the lightness of yours additional screens&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.traystatus.com/"&gt;Tray Status&lt;/a&gt; → Freemium → show status of cap lock / Verr num.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://file-converter.org/"&gt;File converter&lt;/a&gt; → Free / Open Source → convert any media file with 2 clicks. ❗ Be careful, for images, the default settings are a bit aggressive.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.microsoft.com/en-us/windows/powertoys/"&gt;Microsoft PowerToys&lt;/a&gt; → Free / Open Source → 12 features including App launcher, color picker, custom placement zone, explorer enhancements, images resizer&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://screenrecorder.animotica.com/"&gt;Animotica screen recorder&lt;/a&gt; → $10 (with 7 days trial) → very user-friendly screen recorder.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.animotica.com/"&gt;Animotica video editor&lt;/a&gt; → Freemium / $16 → Edit and create professionals looking videos in no time. I really like their products. Efficient and cheap.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://apps.microsoft.com/store/detail/quicklook/9NV4BS3L1H4S"&gt;QuickLook&lt;/a&gt; → Free → Open quickly a file by pressing "space bar".&lt;/li&gt;
&lt;li&gt;And "just" a shortcut to get an emoji or special character : "Windows" + ";"&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How to have tabs on Windows Explorer
&lt;/h2&gt;

&lt;p&gt;It's 2022, the first UI Tab was released in 1998 and my native Files Explorer still not has f*cking tab ! Luckily, I found a smart solution with &lt;a href="https://www.stardock.com/products/groupy/"&gt;Groupy&lt;/a&gt;. Rather than have an alternative file explorer, I keep the native one and Groupy can group any windows in tabs for me.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DsEfGbEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ijn791hq38vzwulvf7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DsEfGbEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ijn791hq38vzwulvf7c.png" alt="Screenshot of Windows File Explorer with tabs" width="803" height="526"&gt;&lt;/a&gt;&lt;br&gt;
I find this approach very smart. Stardock focus and solves one specific problem and let you use the app of your choice. I remember that I had to change some settings for having a "native like" experience. Here are the settings : (in French, but the UI remains the same)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m6LUgZ_f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ull1lms50yjw4snwd0tq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m6LUgZ_f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ull1lms50yjw4snwd0tq.png" alt='Screenshot that shows 2 Groupy options checked : "Group Automatically "explorer.exe" window and "Always show tabs for that type of window"' width="822" height="441"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KfGOBeIW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aarw451z1zbjwgijm9gz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KfGOBeIW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aarw451z1zbjwgijm9gz.png" alt='""' width="834" height="570"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---x1PkSaR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71jm8sinh7dzgmewgc60.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---x1PkSaR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71jm8sinh7dzgmewgc60.png" alt='""' width="840" height="574"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eKddX4aX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7f75dywwp2l5zosc0cm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eKddX4aX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7f75dywwp2l5zosc0cm.png" alt='""' width="841" height="577"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Set and sync the lightness of yours additional screens
&lt;/h2&gt;

&lt;p&gt;It seems weird for me that I have to solve this problem by installing an app. It should be a native option. Anyway, &lt;a href="https://github.com/emoacht/Monitorian"&gt;Monitorian&lt;/a&gt; is free and well integrated.&lt;br&gt;
&lt;/p&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MLwBy2l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/ext_tw_video_thumb/1541344014410158081/pu/img/-YR3Cvj7BXcCP8VH.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--mDMxtndn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1074911042692632576/YZO_-7Ue_normal.jpg" alt="David Pollet profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        David Pollet
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @davidpollet_
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Comment ajuster et synchroniser la luminosité de plusieurs écrans sur Windows ?&lt;br&gt;&lt;a href="https://t.co/BEBxXeQV6B"&gt;github.com/emoacht/Monito…&lt;/a&gt; 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      08:55 AM - 27 Jun 2022
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1541344379369136130" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1541344379369136130" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1541344379369136130" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Get the status of cap lock / Verr num right in your taskbar
&lt;/h2&gt;

&lt;p&gt;Again, this should be a native option. 😤&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pTnSyQa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dlrczqe9s1z02mujo6r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTnSyQa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dlrczqe9s1z02mujo6r.jpg" alt="Screenshot of Tray Status" width="402" height="168"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.traystatus.com/"&gt;Tray Status&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Convert any media in two clicks
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QR8etpDi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uhp7iwsqv7tgis2hcxc5.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QR8etpDi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uhp7iwsqv7tgis2hcxc5.gif" alt="Demonstration of file converter. The user on this demo do a right click on a file and convert it" width="838" height="502"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://file-converter.org/"&gt;File converter&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  PowerToys : Microsoft, I forgive you 💗
&lt;/h2&gt;

&lt;p&gt;Microsoft isn't kidding you with powertoys. 😄 It shipped an app with twelve tools ! My most liked : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App launcher with some useful add-ons (calc, launch VS Code project, unit converter)&lt;/li&gt;
&lt;li&gt;Color picker accessible by keyboard shortcut&lt;/li&gt;
&lt;li&gt;Image resizer in the contextual menu&lt;/li&gt;
&lt;li&gt;FancyZone for having custom screen distribution&lt;/li&gt;
&lt;li&gt;SVG overview in explorer
And for the rest, visit &lt;a href="https://docs.microsoft.com/en-us/windows/powertoys/"&gt;Microsoft PowerToys website&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Screen recorder user-friendly
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_UjFdNpE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1f3zj0dcugk9o01qcpu8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_UjFdNpE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1f3zj0dcugk9o01qcpu8.jpg" alt="The user interface of Animotica screen recorder" width="612" height="168"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://screenrecorder.animotica.com/"&gt;Animotica screen recorder&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Edit and create professionals looking videos in no time
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/4PLXKWYeWoU"&gt;
&lt;/iframe&gt;
&lt;br&gt;
&lt;a href="https://www.animotica.com/"&gt;Animotica video editor&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Open quickly any file by pressing space bar
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T4KITqhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqid8w84bf7ma2bbmyqp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T4KITqhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqid8w84bf7ma2bbmyqp.jpg" alt="Screenshot of Quick Look app" width="880" height="651"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://apps.microsoft.com/store/detail/quicklook/9NV4BS3L1H4S"&gt;QuickLook&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Get an emoji or special character
&lt;/h2&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UBTYwjFG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/ext_tw_video_thumb/1539519159306006531/pu/img/huqyqxamlNHAHll3.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--mDMxtndn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1074911042692632576/YZO_-7Ue_normal.jpg" alt="David Pollet profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        David Pollet
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @davidpollet_
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Insérer des émojis ou des caractères spéciaux genre "œ", c'est fastidieux. Enfin c'était.&lt;br&gt;&lt;br&gt;➡ touche Windows + ";" &lt;br&gt;&lt;br&gt;Maintenant, vous pourrez dire « IL S'EST TUE ! 😮 » ou « IL S'EST TUÉ 😮 » sans risque de confusion 👀&lt;br&gt;&lt;br&gt;&lt;a href="https://twitter.com/hashtag/windows"&gt;#windows&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/tips"&gt;#tips&lt;/a&gt; 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      08:02 AM - 22 Jun 2022
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1539519295281061888" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1539519295281061888" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1539519295281061888" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;Have you some useful tools to share ? 🙂&lt;/p&gt;

&lt;p&gt;Credit for the cover : &lt;a href="https://www.freepik.com/free-vector/freelancer-working-laptop-her-house_11879394.htm"&gt;jcomp - freepik.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>windows</category>
      <category>tooling</category>
      <category>workflow</category>
    </item>
    <item>
      <title>How to animate an element in display none in two steps</title>
      <dc:creator>David Pollet</dc:creator>
      <pubDate>Wed, 29 Jun 2022 14:53:18 +0000</pubDate>
      <link>https://dev.to/davidpollet/how-to-animate-an-element-in-display-none-in-two-steps-30pb</link>
      <guid>https://dev.to/davidpollet/how-to-animate-an-element-in-display-none-in-two-steps-30pb</guid>
      <description>&lt;p&gt;Animate a hidden element is very simple now. We just need 2 CSS declaration and a bit of JavaScript to toggle the state open / close.&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  In this article:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;CSS &lt;code&gt;:not&lt;/code&gt; pseudo-selector&lt;/li&gt;
&lt;li&gt;Single Source of truth&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;animationend&lt;/code&gt; event&lt;/li&gt;
&lt;li&gt;Accessibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Problem we try to solve
&lt;/h2&gt;

&lt;p&gt;You have a hidden element with a &lt;code&gt;hidden&lt;/code&gt;attribute. To provide a better UX, you want to animate this opening and closing state. But in CSS, &lt;code&gt;display:none&lt;/code&gt; is like an interrupter; it can be "on" or "off" but animate between both state with a CSS transition is impossible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: animate during opening
&lt;/h2&gt;

&lt;p&gt;The HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a href="#modal" class="modal-button"&amp;gt;Open Modal&amp;lt;/a&amp;gt;
&amp;lt;div class="modal" id="modal" hidden&amp;gt;Modal content&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you notice, I'm opting for a link instead of a button. Why ? Because my modal will still be accessible without JavaScript, thanks to the &lt;code&gt;target&lt;/code&gt; CSS pseudo-class. I will focus on this point after.&lt;/p&gt;

&lt;h3&gt;
  
  
  JS to show the modal
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modalButton.addEventListener("click", function (e) {
  e.preventDefault();
  modal.hidden = false;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CSS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.modal:not([hidden]) {
  animation-name: popIn;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. ¯_(ツ)_/¯. &lt;br&gt;
If you prefer relying on &lt;code&gt;.hidden&lt;/code&gt; class (like in Tailwind), you can switch &lt;code&gt;:not([hidden])&lt;/code&gt; with &lt;code&gt;:not(.hidden)&lt;/code&gt;. If you want both, the &lt;code&gt;not&lt;/code&gt; pseudo-class accept multiple arguments separated by a comma : &lt;code&gt;not([hidden], .hidden)&lt;/code&gt;. Anyway, our Modal appears with a shiny animation now :&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Yt2DtIjZNHU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 : animate during closing
&lt;/h2&gt;

&lt;p&gt;The closing state is a little more tricky. If you set the &lt;code&gt;hidden&lt;/code&gt; attribute to "true", you won't be able to hide it smoothly. You need to add a temporary class like &lt;code&gt;is-closing&lt;/code&gt; to play the closing animation and then, hide the element.&lt;/p&gt;

&lt;h2&gt;
  
  
  JS
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modal.addEventListener("click", function (e) {
  // Omitted…
  if (hasClickedOutside || hasClickedCloseButton) {
    modal.classList.add("is-closing");
    // Omitted…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CSS
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.modal.is-closing {
  animation-name: popOut;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/pEvC9CE2wb8"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Now our modal is closing smoothly, but it is not back to hidden state. You have to wait to the end of the animation to remove the &lt;code&gt;.is-closing&lt;/code&gt; class and back to &lt;code&gt;hidden="true"&lt;/code&gt;. With &lt;code&gt;setTimeout&lt;/code&gt; ? You could, but you have a better option.&lt;/p&gt;
&lt;h2&gt;
  
  
  Animationend event
&lt;/h2&gt;

&lt;p&gt;With a &lt;code&gt;timeout&lt;/code&gt;, we have to declare a value at least equal to the animation duration, which can change.&lt;br&gt;
If you can, you have to have a single source of truth : here, the animation duration declared in the CSS.&lt;br&gt;
The &lt;code&gt;animationend&lt;/code&gt; will wait to the end of the animation, then execute the function inside the listener.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modal.addEventListener("click", function (e) {
  const hasClickedOutside = !e.target.closest(".modal-main");
  const hasClickedCloseButton = e.target.closest(".modal-close");

  if (hasClickedOutside || hasClickedCloseButton) {
    modal.classList.add("is-closing");

    modal.addEventListener(
      "animationend",
      function () {
        modal.hidden = true;
        modal.classList.remove("is-closing");
      },
      { once: true }
    );
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the event is completely done, you have to destroy it with the &lt;code&gt;once: true&lt;/code&gt; option, as you don't need it anymore.&lt;br&gt;
And voilà, you have the knowledge to animate any element hidden in the DOM.&lt;/p&gt;
&lt;h2&gt;
  
  
  Bonus : A little accessibility enhancement
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Button vs Link
&lt;/h3&gt;

&lt;p&gt;As I said above, I choose a &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; instead of a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; because of that :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.modal:target {
  display: grid !important;
  animation-name: popIn;
  .modal-close {
    display: none;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without JS, the modal can still be open via its hash, and you can style the opened state with the &lt;code&gt;:target&lt;/code&gt; pseudo class.&lt;br&gt;
To close it, the user needs to back in your history. This is why I hide the &lt;code&gt;.modal-close&lt;/code&gt;. It's not pertinent to show it if it can't do anything. &lt;/p&gt;
&lt;h3&gt;
  
  
  Don't play animation if user don't want animation.
&lt;/h3&gt;

&lt;p&gt;For personal taste, medical reason or to solve a performance issue on their device, your users may not want any animation, and you have to respect their preferences. It would be a good idea to embed the following the rule as part of your CSS reset, if it's not already done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks for reading. 👋&lt;/p&gt;

</description>
      <category>css</category>
    </item>
  </channel>
</rss>
