three实现炫酷三维发光粒子参数调整交互动画代码

代码语言:html

所属分类:粒子

代码描述:three实现炫酷三维发光粒子参数调整交互动画代码,支持多种形状。

代码标签: three 炫酷 三维 发光 粒子 参数 调整 交互 动画 代码

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">

</head>
<body>
<style>
    *, *::before, *::after {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    body {
        width: 100%;
        height: 100vh;
        overflow: hidden;
        background: #000;
        font-family: 'Arial', sans-serif;
    }

    #container {
        width: 100%;
        height: 100%;
        position: relative;
    }

    #ui {
        position: absolute;
        top: 20px;
        right: 20px;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        color: white;
        z-index: 1000;
    }

    #controls {
        position: absolute;
        top: 20px;
        left: 20px;
        color: white;
        z-index: 1000;
    }

    .control-group {
        background: rgba(0, 0, 0, 0.6);
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 15px;
    }

    .slider-container {
        margin: 10px 0;
    }

    .slider-container label {
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
    }

    input[type="range"] {
        width: 200px;
        margin-right: 10px;
    }

    input[type="color"] {
        width: 50px;
        height: 25px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

    #ui > * {
        margin-bottom: 10px;
    }

    .button {
        cursor: pointer;
        padding: 10px 15px;
        border: 2px solid transparent;
        border-radius: 25px;
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        font-size: 16px;
        transition: all 0.3s ease;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
        width: 140px;
        text-align: center;
        position: relative;
        overflow: hidden;
    }

    .button:hover {
        background-color: rgba(255, 255, 255, 0.2);
        border-color: #fff;
        transform: scale(1.05);
    }

    .button.active {
        background-color: rgba(255, 89, 0, 0.8);
        border-color: #ff5900;
        transform: scale(1.1);
    }

    .button::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }

    .button:hover::after {
        opacity: 1;
    }

    #title {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 20px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
        background: linear-gradient(45deg, #ff5900, #ffcc00);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    #info {
        position: absolute;
        bottom: 20px;
        left: 20px;
        color: white;
        font-size: 14px;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
        pointer-events: none;
    }
</style>

<div id="container"></div>
<div id="ui">
    <div id="title">Shape Morpher</div>
    <div class="button" data-shape="sphere">Sphere</div>
    <div class="button" data-shape="cube">Cube</div>
    <div class="button" dat.........完整代码请登录后点击上方下载按钮下载查看

网友评论0