js+css实现可视化配置生成文字路径动画代码

代码语言:html

所属分类:动画

代码描述:js+css实现可视化配置生成文字路径动画代码,可导出css动画及html

代码标签: js css 可视化 配置 生成 文字 路径 动画 代码

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

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
<style>
    :root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07070a;
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgb(119 77 255 / 18%), transparent 35%),
    radial-gradient(circle at 90% 100%, rgb(0 210 255 / 14%), transparent 32%),
    #07070a;
}

button,
input {
  font: inherit;
}

.demo {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.demo__panel {
  width: min(1000px, 100%);
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 28px;
  background: rgb(16 16 22 / 84%);
  box-shadow: 0 30px 90px rgb(0 0 0 / 45%);
  backdrop-filter: blur(16px);
}

.demo__heading {
  margin-bottom: 24px;
}

.demo h1,
.demo h2 {
  margin: 0;
  line-height: 1.1;
}

.demo h1 {
  font-size: clamp(28px, 5vw, 56px);
}

.demo h2 {
  font-size: 22px;
}

.demo__description {
  max-width: 680px;
  margin: 14px 0 0;
  color: #aaaaba;
  line-height: 1.6;
}

/* Required component styles */
.text-path {
  position: relative;
  width: 100%;
  height: clamp(180px, 26vw, 260px);
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 1%));
}

.text-path svg {
  display: block;
  width: 100%;
  height: 100%;
}

.text-path text {
  user-select: none;
}

/* Demo configurator styles */
.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.controls__field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #d9d9e3;
  font-size: 14px;
}

.controls__field--wide {
  grid-column: 1 / -1;
}

.controls input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 12px;
  outline: none;
  background: #101017;
  color: #fff;
}

.controls input[type="text"]:focus {
  border-color: #8e76ff;
  box-shadow: 0 0 0 3px rgb(142 118 255 / 18%);
}

.controls input[type="range"] {
  width: 100%;
}

.controls__checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 42px;
}

.controls__color-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
}

.controls.........完整代码请登录后点击上方下载按钮下载查看

网友评论0