Khdulkadir / your-tribe-for-life-profile-card

Maak Directus en Sveltekit jouw visitekaartje.
https://your-tribe-for-life-profile-card-ebon.vercel.app
MIT License
1 stars 0 forks source link

Animeer bewegende bomen op de achtergrond #6

Closed Khdulkadir closed 1 month ago

Khdulkadir commented 1 month ago

Bomen bewegen op deze manier:

    <div class="tree">
      <div class="tree-inner">
        <div class="tree-top"></div>
        <div class="tree-bottom"></div>
      </div>
    </div>

    <div class="tree small">
      <div class="tree-inner">
        <div class="tree-top"></div>
        <div class="tree-bottom"></div>
      </div>
    </div>

  div.tree {
    position: absolute;
    bottom: 0;
    right: -20%;
    animation: moveTrees 5s infinite linear;
    z-index: 2;
  }

  div.tree.small {
    margin-right: 70px;
  }

  div.tree div.tree-inner{
    position: relative;
  }

  div.tree div.tree-top{
    background: #228B22;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: absolute;
    bottom: 100px;
    left: -25px;
  }

  div.tree div.tree-bottom{
    background: #8B4513;
    width: 20px;
    height: 100px;
    position: absolute;
    bottom: 0;
    left: 15px;
  }

  div.tree.small div.tree-top{
    background: #228B22;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    position: absolute;
    bottom: 70px;
    left: -25px;
  }

  div.tree.small div.tree-bottom{
    background: #8B4513;
    width: 16px;
    height: 70px;
    position: absolute;
    bottom: 0;
    left: 0;
  }

  @keyframes moveTrees {
    from {right: -20%;}
    to {right: 200%;}
  }