<commit_before>import React, { useEffect, useState, useRef} from 'react';
import { useTranslation } from 'react-i18next';
import { useInView } from "react-intersection-observer";
import { motion, useAnimation } from "framer-motion";
import { ReactComponent as MacMouse } from "../macintosh-mouse.svg";


import "./WelcomePageInfos.css";

import Terminal from "../components/Terminal";
import Window from "../components/Window";
import Trello from "../components/Trello";

function WelcomePageInfos() {
  const { t } = useTranslation();
  const toTexts = useRef<HTMLDivElement>(null);
  const [displayTerminal, setDisplayTerminal] = useState<boolean>(false);
  const [displayTrello, setDisplayTrello] = useState<boolean>(false);
  
  useEffect(() => {
    setTimeout(() => setDisplayTerminal(true) , 2000);
    setTimeout(() => setDisplayTrello(true) , 6000);
  }, []);

  return (
    <section className="welcome-page-content">
      <div className="welcome-page-infos-grid-container">
        <div ref={toTexts} className="textFullStack">
          <FadeInWhenVisibleAndMove direction="left">
            <h3>Full stack developper</h3>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
          </FadeInWhenVisibleAndMove>
        </div>
        <div className="terminal">
          <FadeInWhenVisibleAndMove direction="right">
            <Window backgroundColor="black" minHeight={325}>
              <Terminal />
            </Window>
          </FadeInWhenVisibleAndMove>
        </div>
        <div className="trello">
          <FadeInWhenVisibleAndMove direction="left">
            <Window backgroundColor="none">
              <Trello/>
            </Window>
          </FadeInWhenVisibleAndMove>
        </div>
        <div className="textCTO">
          <FadeInWhenVisibleAndMove direction="right">
            <h3>But a CTO too</h3>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
          </FadeInWhenVisibleAndMove>
        </div>
      </div>
    </section>
  );
}

export default WelcomePageInfos;


interface FadeInWhenVisibleAndMoveInterface {
  children: React.ReactNode;
  direction: "left"| "right";
}


function FadeInWhenVisibleAndMove({ children, direction } : FadeInWhenVisibleAndMoveInterface) {
  const controls = useAnimation();
  const [ref, inView] = useInView();

  useEffect(() => {
    if (inView) {
      controls.start("visible");
      controls.start("move");
    }
  }, [controls, inView]);

  return (
    <motion.div
      ref={ref}
      animate={controls}
      initial="hidden"
      transition={{ duration: 1.0 }}
      variants={{
        visible: { opacity: 1, scale: 1 },
        hidden: { opacity: 0, scale: 0, x: direction === "left" ?  "-25vw" : "25vw" },
        move: {x: 0}
      }}
    >
      {children}
    </motion.div>
  );
}<commit_msg>smooth animation<commit_after>import React, { useEffect, useState, useRef} from 'react';
import { useTranslation } from 'react-i18next';
import { useInView } from "react-intersection-observer";
import { motion, useAnimation } from "framer-motion";
import { ReactComponent as MacMouse } from "../macintosh-mouse.svg";


import "./WelcomePageInfos.css";

import Terminal from "../components/Terminal";
import Window from "../components/Window";
import Trello from "../components/Trello";

function WelcomePageInfos() {
  const { t } = useTranslation();
  const toTexts = useRef<HTMLDivElement>(null);
  const [displayTerminal, setDisplayTerminal] = useState<boolean>(false);
  const [displayTrello, setDisplayTrello] = useState<boolean>(false);
  
  useEffect(() => {
    setTimeout(() => setDisplayTerminal(true) , 2000);
    setTimeout(() => setDisplayTrello(true) , 6000);
  }, []);

  return (
    <section className="welcome-page-content">
      <div className="welcome-page-infos-grid-container">
        <div ref={toTexts} className="textFullStack">
          <FadeInWhenVisibleAndMove direction="left">
            <h3>Full stack developper</h3>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
          </FadeInWhenVisibleAndMove>
        </div>
        <div className="terminal">
          <FadeInWhenVisibleAndMove direction="right">
            <Window backgroundColor="black" minHeight={325}>
              <Terminal />
            </Window>
          </FadeInWhenVisibleAndMove>
        </div>
        <div className="trello">
          <FadeInWhenVisibleAndMove direction="left">
            <Window backgroundColor="none">
              <Trello/>
            </Window>
          </FadeInWhenVisibleAndMove>
        </div>
        <div className="textCTO">
          <FadeInWhenVisibleAndMove direction="right">
            <h3>But a CTO too</h3>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
          </FadeInWhenVisibleAndMove>
        </div>
      </div>
    </section>
  );
}

export default WelcomePageInfos;


interface FadeInWhenVisibleAndMoveInterface {
  children: React.ReactNode;
  direction: "left"| "right";
}


function FadeInWhenVisibleAndMove({ children, direction } : FadeInWhenVisibleAndMoveInterface) {
  const controls = useAnimation();
  const [ref, inView] = useInView();

  useEffect(() => {
    if (inView) {
      controls.start("visible");
      controls.start("move");
    }
  }, [controls, inView]);

  return (
    <motion.div
      ref={ref}
      animate={controls}
      initial="hidden"
      transition={{ duration: 2.0, type: "spring", bounce: 0.20  }}
      variants={{
        visible: { opacity: 1, scale: 1 },
        hidden: { opacity: 0, scale: 0, x: direction === "left" ?  "-25vw" : "25vw" },
        move: {x: 0}
      }}
    >
      {children}
    </motion.div>
  );
}
{'fraction_non_alphanumeric': 0.13284313725490196, 'fraction_numerical': 0.012254901960784314, 'mean_word_length': 2.938867438867439, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3373127', 'n_tokens_mistral': 1878, 'n_tokens_neox': 1798, 'n_words': 443}