gsap+react实现网站底部发光流线动态波浪页脚效果代码

代码语言:html

所属分类:动画

代码描述:gsap+react实现网站底部发光流线动态波浪页脚效果代码

代码标签: gsap react 网站 底部 发光 流线 动态 波浪 页脚 代码

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

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

<head>
  <meta charset="UTF-8">
  


  
  
  
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: 'Inter', sans-serif;
}

.container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
}

svg {
  width: 100%;
  height: auto; 
  position: absolute;
  top: 0;
  left: 0;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  max-height: 500px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.footer-text {
  display: flex;
  width: 100%;
  max-height: 500px;
  justify-content: space-between;
  overflow: hidden;
}

.footer-section {
  flex: 1;
  font-size: 18px;
  font-weight: bold;
  color: #FFF;
  text-align: center;
  padding: 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.footer-section h2 {
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-section p {
  font-weight: 400;
  color: #DDD;
}

.footer-section:hover {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.line, .line2, .line3 {
  filter: url(#glow);
}


.line1 {
  text-shadow: 0 0 8px rgba(0, 180, 255, 0.7);
}

.line2 {
  text-shadow: 0 0 10px rgba(0, 180, 255, 0.9);
}

.line3 {
  text-shadow: 0 0 12px rgba(0, 180, 255, 1);
}
</style>


  
  
</head>

<body translate="no">
  <div id="root"></div>
  <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/babel.7.18.13.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.production.17.1.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.production.17.1.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.5.2.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/DrawSVGPlugin3.min.js"></script>
      <script  type="text/babel">
const { useEffect } = React;

const DynamicSVGAnimation = () => {
  useEffect(() => {
    let i = 0;

    gsap.set('.line', {
      attr: { 'stroke': 'hsl(200, 100%, 95%)', 'stroke-width': 4, 'stroke-linecap': 'round' },
      filter: 'url(#glow)'
    });
    gsap.set('.line2', { attr: { 'stroke-width': 6 }, opacity: 0.6, filter: 'url(#glow)' });
    gsap.set('.line3', { attr: { 'stroke-width': 9 }, opacity: 0.3, filter: 'url(#glow)' });

    [].forEach.call(document.getElementsByClassName('line'), (el) => {
      gsap.timeline({ defaults: { duration: 1 }, repeat: -1, repeatDelay: (27 - i) / 50 })
        .to(el, { duration: 2, attr: { .........完整代码请登录后点击上方下载按钮下载查看

网友评论0