css+js实现小树跳动带文字滚动loading加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:css+js实现小树跳动带文字滚动loading加载动画效果代码

代码标签: css 小树 跳动 文字 滚动 loading 加载 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
<style>
path {
  animation: bounce 0.8s infinite;
  transform-origin: bottom;
}

#tree1 {
  animation-delay: 0.15s;
}

#tree2 {
  animation-delay: 0.3s;
}

#tree3 {
  animation-delay: 0.45s;
}

#tree4 {
  animation-delay: 0.6s;
}

@keyframes bounce {
  0% {
    transform: scaleY(1);
  }
  10% {
    transform: scaleY(1.2);
  }
  30% {
    transform: scaleY(0.9);
  }
  40% {
    transform: scaleY(1);
  }
}
body {
  text-align: center;
  background: #f0f0eb;
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  align-items: center;
  justify-content: center;
}

#messages {
  font-family: sans-serif;
  display: flex;
  width: 400px;
  overflow: hidden;
  position: relative;
  height: 1.5em;
  margin-top: -20px;
  color: #275243;
  font-size: 20px;
}
#messages p {
  white-space: nowrap;
  margin: 0;
  line-height: 1.5;
  min-width: 400px;
  text-align: center;
  position: absolute;
  right: 200%;
  transition: right 1s ease-in-out;
}
#messages p:last-child {
  right: -200%;
}
#messages p:nth-last-child(2) {
  right: 0;
}
</style>


</head>

<body>
  <div id="loader">
  <svg width="100" height="134" viewbox="0 0 147 134" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path id="tree1" d="M32.299 85.543a.068.068 0 0 1-.068-.068.069.069 0 0 1 .068-.068c1.918-.357 9.027-2.219 7.11-9.98-2.086-8.446-9.517-5.57-11.244-4.772a.067.067 0 0 1-.083-.022.069.069 0 0 1 .005-.086c.878-.946 3.394-4.151 1.596-8.234-1.167-2.652-4.011-6.82-10.47-4.886-11.085 3.323-5.825 11.952-4.64 13.674a.069.069 0 0 1-.046.105.068.068 0 0 1-.044-.008c-1.666-1.061-8.375-3.91-10.924 2.885-1.983 5.284 2.262 8.146 3.025 8.662a.067.067 0 0 1 .029.072.068.068 0 0 1-.056.052c-.939.147-4.767 1.728-5.368 5.197-.33 1.906.317 4.382 2.95 7.502 3.659 4.335 12.5.339 13.602-.37a.068.068 0 0 1 .068-.002.067.067 0 0 1 .037.057c.17 4.082.718 21.928-2.114 34.918-.185.852.372 1.55 1.238 1.55h7.749c.866 0 1.424-.697 1.238-1.55-2.673-12.26-2.335-28.85-2.145-34.105a.068.068 0 0 1 .113-.05c1.832 1.646 10.448 8.745 15.208 1.367 6.04-9.358-4.447-11.484-6.834-11.84Z" fill="#008009"/>
    <path id="tree2" d="M82.507 46.516c-1.454-1.927-3.975-2.514-6.197-2.081-4.44.866-8.964 3.735-10.886 5.067a.116.116 0 0 1-.193-.094.117.117 0 0 1 .039-.08c3.067-3.346 13.049-14.074 10.358-19.884-1.079-2.336-4.007-2.866-6.37-2.252-3.937 1.016-9.369 4.388-10.727 5.256a.115.115 0 0 1-.174-.071.117.117 0 0 1 .006-.072c.61-1.455 2.894-7.272 3.376-13.834C62.432 9.022 60.629-.984 49.66.078c-18.954 1.835-8.116 29.409-6.87 32.428a.117.117 0 0 1-.085.164.116.116 0 0 1-.07-.01c-1.19-.516-6.203-2.126-10.195-2.658-5.778-.774-8.388 3.428-4.727 8.034 4.595 5.78 8.895 10.343 10.021 11.52a.115.115 0 0 1-.11.192c-1.233-.31-5.174-1.484-9.683-1.539-3.89-.047-6.12 1.884-6.3 4.822-.422 7 9.139 14 24.463 27.637.02.018.034.044.038.071.42 3.146 1.684 17.127-3.29 48.59a2.179 2.179 0 0 0 .49 1.748 2.161 2.161 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0