How can I manage to make my boxes appear only once with IntersectionObserver?

I created an UI where when the user scrolls down the page, 4 grid boxes appears with a "fade in" effect, but when we go up the page, then we scroll down the page again, the animation appears again, while precisely, I don’t want the animation to be done several times, but only when the boxes have appeared once.

Here is my code:

const grid_objs = document.querySelectorAll('._grid-obj');

observer = new IntersectionObserver((entries) => {
  entries.forEach((entry) => {
    if (entry.intersectionRatio > 0) {
      entry.target.style.animation = `grid-obj .8s ${entry.target.dataset.delay} forwards ease`;
    } else {
      entry.target.style.animation = "none";
    }
  });
});

grid_objs.forEach((grid_obj) => {
  observer.observe(grid_obj);
});
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

.n-sec__ {
  min-height: 100vh;
  display:grid;
  max-height:100%;
  
}

._box {
  background:#f4f4f4;
  border-radius: 10px;
  position: relative;
}

._grid {
     display: grid;
     grid-template-columns: auto auto;
     min-width: 100%;
}
 ._grid ._grid-obj {
     display: grid;
     margin: 1em;
     padding: 2em;
     max-width: 800px;
     opacity: 0;
}
 ._grid ._grid-obj ._grid-title {
     color:#000000;
     font-family: 'Inter', sans-serif;
}
 ._grid ._grid-obj ._grid-p {
     font-weight: 300;
     color:#000000;
     padding: 0.5em 0;
     font-size: 10pt;
     line-height: 1.1em;
}
<section style="height:100vh;"></section>
<section class="n-sec__     ">
        <div class="_container  ">
            
            <div class="_grid">
                <div class="_grid-obj _box" data-delay="0s">
                    <h5 class="_grid-title _z">Community</h5>
                    <p class="_grid-p _z">Take advantage of a dynamic and caring community, present to propel you to the top of your ladder in your artistic journey. Mainly based on sharing, forge links between passionate or professional artists.</p>
                    <p class="_grid-p">Feel like the best at us (but stay yourself).</p>
                </div>
                <div class="_grid-obj _box" data-delay=".5s">
                    <h5 class="_grid-title">Share</h5>
                    <p class="_grid-p">Sharing is above all our priority, that's what our network represents. Indeed, we want to implement a realization of things that only very few people perceive. You have to know how to share and recognize your work as it is.</p>
                    <p class="_grid-p">So don't be shy, and show your work to other artists.</p>
                </div>
                <div class="_grid-obj _box" data-delay="1s">
                    <h5 class="_grid-title">Security</h5>
                    <p class="_grid-p">Your projects will always be fine at Nosfera, and uploaded on a secure server owned by <a href="//otux.cloud">otux.cloud</a>. Regarding your account, your password is encrypted and neither the administrative team has access to it.</p>
                    <p class="_grid-p">So you can sleep soundly.</p>
                </div>
                <div class="_grid-obj _box" data-delay="1.4s">
                    <h5 class="_grid-title">Customization</h5>
                    <p class="_grid-p">Manage your projects as you wish with our system dedicated to artistic organization.</p>
                    <p class="_grid-p">Manage your projects as you wish with our system dedicated to artistic organization. You have the ability to create the lists you want, reorganize your dashboard, pin the projects you want, and many more!</p>
                </div>
            </div>
        </div>
    </section>

I don’t know why it is not working in the jsfiddle but it normally does.

177 thoughts on “How can I manage to make my boxes appear only once with IntersectionObserver?”

  1. Wonderful blog you have here but I was curious about if you knew of any user discussion forums that cover the same topics talked about here?
    I’d really love to be a part of community where I can get suggestions from other knowledgeable people that share the same interest.
    If you have any suggestions, please let me know.
    Kudos! http://droga5.net/

    Reply
  2. It’s perfect time to make some plans for the long run and
    it’s time to be happy. I have read this publish and if I could I wish to recommend you some interesting things or advice.
    Maybe you could write next articles relating to this article.
    I desire to read even more things approximately it!

    Reply
  3. Howdy, i read your blog occasionally and i own a similar one and
    i was just wondering if you get a lot of spam remarks?
    If so how do you protect against it, any plugin or anything you can suggest?
    I get so much lately it’s driving me insane so any support is very
    much appreciated.

    Reply
  4. Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s very difficult to get that “perfect balance”
    between superb usability and appearance. I must say that you’ve
    done a awesome job with this. Additionally, the blog loads extremely quick for me
    on Safari. Outstanding Blog!

    Reply
  5. I have been browsing online more than 2 hours today,
    yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my view, if all web owners and bloggers made
    good content as you did, the net will be much more useful than ever
    before.

    Reply
  6. Thanks for the interesting things you have disclosed in your article. One thing I would like to reply to is that FSBO human relationships are built eventually. By launching yourself to the owners the first weekend break their FSBO is actually announced, prior to a masses begin calling on Wednesday, you generate a good interconnection. By sending them equipment, educational supplies, free reports, and forms, you become a good ally. If you take a personal affinity for them and also their problem, you create a solid relationship that, on most occasions, pays off when the owners decide to go with a real estate agent they know in addition to trust — preferably you.

    Reply
  7. I’ve been surfing on-line more than three hours lately, but I by no means found any attention-grabbing article like yours.
    It’s beautiful worth enough for me. In my opinion, if all website owners and bloggers made excellent content material
    as you did, the net will likely be much more helpful than ever
    before.

    Reply
  8. It’s the best time to make some plans for the future and it’s time
    to be happy. I’ve read this post and if I could
    I want to suggest you few interesting things or advice.
    Perhaps you could write next articles referring to this article.
    I want to read even more things about it!

    Reply
  9. Pingback: viagra generic
  10. Pingback: natural viagra
  11. It’s the best time to make some plans for the future and it is time to be happy.

    I have read this post and if I could I wish to suggest you some interesting things or tips.
    Perhaps you can write next articles referring to this article.
    I wish to read more things about it!

    Reply
  12. I have been surfing on-line greater than three hours nowadays, yet I by no means found any interesting article like yours.
    It’s beautiful value sufficient for me.
    In my view, if all webmasters and bloggers made
    good content material as you did, the net will likely be a lot more helpful than ever before.

    Reply
  13. Pingback: cialis germany
  14. Pingback: brand cialis
  15. Pingback: cialis 2.5 mg
  16. Pingback: viagra buy
  17. Pingback: cialis 10 mg
  18. I’ve been surfing online more than 3 hours today, yet I never
    found any interesting article like yours. It is pretty worth enough for me.
    Personally, if all site owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

    Reply
  19. Pingback: cialis 20mg
  20. Pingback: cialis avis
  21. Pingback: tadalafil dosage
  22. Pingback: sildenafil generic
  23. Pingback: buy generic viagra
  24. Pingback: viagra price
  25. Pingback: hims viagra
  26. Pingback: lady viagra
  27. Pingback: what is viagra
  28. Pingback: viagra foods
  29. Pingback: roman viagra
  30. Pingback: buy viagra online
  31. Pingback: viagra amazon
  32. Pingback: viagra tablet
  33. I’ve been browsing online more than three hours as of late, but I by no means discovered any attention-grabbing article like yours.

    It is lovely price sufficient for me. In my view, if all web owners and bloggers made excellent content as you probably did, the
    web shall be much more useful than ever before.

    Reply
  34. Pingback: fildena
  35. Pingback: kamagra vs cialis