gsap实现炫酷冲浪官网落地页动画代码
代码语言:html
所属分类:布局界面
代码描述:gsap实现炫酷冲浪官网落地页动画代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Archivo+Black&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Space+Mono:wght@400;700&display=swap'>
<style>
:root {
--ocean-deep: #03111e;
--ocean-mid: #062035;
--ocean-light: #0a3550;
--teal: #00b4c6;
--teal-dim: #007a88;
--teal-glow: rgba(0, 180, 198, 0.14);
--sand: #e8d5a3;
--sand-light: #f5edd6;
--coral: #ff6b47;
--coral-dim: #cc4422;
--white: #f0f4f7;
--muted: rgba(240, 244, 247, 0.4);
--border: rgba(0, 180, 198, 0.12);
--border2: rgba(240, 244, 247, 0.06);
--f-display: "Archivo Black", sans-serif;
--f-serif: "Libre Baskerville", Georgia, serif;
--f-mono: "Space Mono", monospace;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
font-size: 16px;
}
body {
background: var(--ocean-deep);
color: var(--white);
font-family: var(--f-serif);
overflow-x: hidden;
line-height: 1.6;
}
img {
display: block;
max-width: 100%;
}
body::after {
content: "";
position: fixed;
inset: 0;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
pointer-events: none;
z-index: 9999;
opacity: 0.55;
}
.nav {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
padding: 20px 56px;
display: flex;
align-items: center;
justify-content: space-between;
transition: background 0.4s, padding 0.4s;
}
.nav.solid {
background: rgba(3, 17, 30, 0.92);
backdrop-filter: blur(16px);
padding: 14px 56px;
border-bottom: 1px solid var(--border);
}
.nav-logo {
font-family: var(--f-display);
font-size: 26px;
letter-spacing: -0.01em;
color: var(--white);
text-decoration: none;
display: flex;
align-items: center;
gap: 10px;
}
.nav-logo-wave {
width: 32px;
height: 20px;
flex-shrink: 0;
}
.nav-logo em {
color: var(--teal);
font-style: normal;
}
.nav-links {
display: flex;
gap: 36px;
list-style: none;
}
.nav-links a {
font-family: var(--f-mono);
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--muted);
text-decoration: none;
transition: color 0.2s;
}
.nav-links a:hover {
color: var(--teal);
}
.nav-cta {
font-family: var(--f-mono);
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
padding: 10px 24px;
border: 1px solid var(--teal);
color: var(--teal);
background: transparent;
cursor: pointer;
transition: all 0.2s;
text-decoration: none;
}
.nav-cta:hover {
background: var(--teal);
color: var(--ocean-deep);
}
.hamburger {
display: none;
flex-direction: column;
gap: 5px;
background: none;
border: none;
cursor: pointer;
padding: 4px;
}
.hamburger span {
width: 22px;
height: 1.5px;
background: var(--white);
display: block;
transition: all 0.3s;
}
.hamburger.open span:nth-child(1) {
transform: rotate(45deg) translate(4px, 4px);
}
.hamburger.open span:nth-child(2) {
opacity: 0;
}
.hamburger.open span:nth-child(3) {
transform: rotate(-45deg) translate(4px, -4px);
}
.mob-nav {
display: none;
position: fixed;
inset: 0;
top: 60px;
z-index: 90;
background: rgba(3, 17, 30, 0.97);
backdrop-filter: blur(16px);
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s;
}
.mob-nav.open {
opacity: 1;
pointer-events: all;
}
.mob-nav a {
font-family: var(--f-display);
font-size: clamp(32px, 7vw, 52px);
color: var(--white);
text-decoration: none;
padding: 10px 0;
transition: color 0.2s;
}
.mob-nav a:hover {
color: var(--teal);
}
.hero {
min-height: 100svh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 120px 24px 0;
position: relative;
overflow: hidden;
background: linear-gradient(
180deg,
#03111e 0%,
#051c30 40%,
#072540 60%,
#0a3550 80%,
#0d4060 100%
);
}
.hero-sky {
position: absolute;
inset: 0;
background: radial-gradient(
ellipse 80% 50% at 50% 0%,
rgba(0, 180, 198, 0.08) 0%,
transparent 70%
);
pointer-events: none;
}
.hero-content {
position: relative;
z-index: 2;
max-width: 900px;
}
.hero-badge {
display: inline-flex;
align-items: center;
gap: 8px;
font-family: var(--f-mono);
font-size: 10px;
letter-spacing: 0.22em;
text-transform: uppercase;
color: var(--teal);
margin-bottom: 28px;
padding: 7px 18px;
border: 1px solid rgba(0, 180, 198, 0.25);
border-radius: 100px;
background: rgba(0, 180, 198, 0.06);
opacity: 0;
}
.hero-badge-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--teal);
animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.3;
}
}
.hero h1 {
font-family: var(--f-display);
font-size: clamp(56px, 9vw, 128px);
line-height: 0.88;
letter-spacing: -0.03em;
color: var(--white);
margin-bottom: 16px;
opacity: 0;
}
.hero h1 .line2 {
color: var(--teal);
display: block;
}
.hero-sub {
font-family: var(--f-serif);
font-style: italic;
font-size: clamp(16px, 2vw, 22px);
color: var(--muted);
margin-bottom: 52px;
opacity: 0;
}
.hero-chips {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
flex-wrap: wrap;
margin-bottom: 0;
opacity: 0;
}
.chip {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 20px;
background: rgba(10, 53, 80, 0.6);
border: 1px solid var(--border);
backdrop-filter: blur(8px);
font-family: var(--f-mono);
font-size: 11px;
letter-spacing: 0.08em;
}
.chip-val {
font-size: 18px;
font-weight: 700;
color: var(--white);
line-height: 1;
}
.chip-label {
color: var(--muted);
font-size: 9px;
letter-spacing: 0.18em;
text-transform: uppercase;
}
.chip.good .chip-val {
color: #4ce0a0;
}
.chip.warn.........完整代码请登录后点击上方下载按钮下载查看















网友评论0