用html写一个有趣的鬼魂动画

news2025/7/10 13:12:02

在这里插入图片描述

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>一个有趣的鬼魂动画</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="./style.css">

</head>
<body>
<div class="scene-container stars-out" tabindex="1">
  <div class="ghost-container">
    <div class="ghost">
      <!-- 鬼魂的头部、眼睛、嘴、腮红 -->
      <div class="ghost-head">
        <div class="ghost-face">
          <div class="eyes-row">
            <div class="eye left"></div>
            <div class="eye right"></div>
          </div>
          <div class="mouth-row">
            <div class="cheek left"></div>
            <div class="mouth">
              <div class="mouth-top"></div>
              <div class="mouth-bottom"></div>
            </div>
            <div class="cheek right"></div>
          </div>
        </div>
      </div>

      <!-- 鬼魂的身体 -->
      <div class="ghost-body">
        <div class="ghost-hand hand-left"></div>
        <div class="ghost-hand hand-right"></div>
        <div class="ghost-skirt">
          <div class="pleat down"></div>
          <div class="pleat up"></div>
          <div class="pleat down"></div>
          <div class="pleat up"></div>
          <div class="pleat down"></div>
        </div>
      </div>
    </div>

    <!-- 装饰部分 -->
    <div class="stars">
      <div class="star orange pointy star-1"><div class="star-element"></div></div>
      <div class="star orange pointy star-2"><div class="star-element"></div></div>
      <div class="star yellow pointy star-3"><div class="star-element"></div></div>
      <div class="star yellow pointy star-4"><div class="star-element"></div></div>
      <div class="star blue round star-5"><div class="star-element"></div></div>
      <div class="star blue round star-6"><div class="star-element"></div></div>
    </div>
  </div>

  <!-- 阴影 -->
  <div class="shadow-container">
    <div class="shadow"></div>
    <div class="shadow-bottom"></div>
  </div>
</div>
<!-- partial -->
  <script src="./script.js"></script>

</body>
</html>
/*
动画原型参看https://dribbble.com/shots/3055734-Have-a-Happy-Halloween 和 https://dribbble.com/shots/3878696-Happy-Halloween!
*/

// 设定参数
class Ghost {
    constructor(el) {
      this.scene = el;
      this.clone = el.cloneNode(true);
      this.isEscaping = false;
      this.ghost = el.querySelector('.ghost');
      this.face = el.querySelector('.ghost-face');
      this.eyes = el.querySelector('.eyes-row');
      this.leftEye = this.eyes.querySelector('.left');
      this.rightEye = this.eyes.querySelector('.right');
      this.mouth = el.querySelector('.mouth');
      this.mouthState = 'neutral';
      this.shadow = el.querySelector('.shadow-container');
      this.leftCheek = el.querySelector('.left.cheek');
      this.leftCheek = el.querySelector('.right.cheek');
      this.leftHand = el.querySelector('.hand-left');
      this.rightHand = el.querySelector('.right-hand');
      this.activityInterval = null;
    }
    
    reset() {
      this.scene.remove();
      this.scene = this.clone.cloneNode(true);
      this.resetRefs();
      this.scene.classList.remove('stars-out');
      this.scene.style.position = 'absolute';
      this.scene.style.left = Math.floor(Math.random() * (document.querySelector('body').getBoundingClientRect().width - 140)) + 'px';
      this.scene.style.top = Math.floor(Math.random() * (document.querySelector('body').getBoundingClientRect().height - 160)) + 'px';
      this.scene.classList.add('descend');
      this.shadow.classList.add('disappear');
      document.querySelector('body').append(this.scene);
      this.enter();
    }
    
    resetRefs() {
      this.ghost = this.scene.querySelector('.ghost');
      this.face = this.scene.querySelector('.ghost-face');
      this.eyes = this.scene.querySelector('.eyes-row');
      this.leftEye = this.eyes.querySelector('.left');
      this.rightEye = this.eyes.querySelector('.right');
      this.mouth = this.scene.querySelector('.mouth');
      this.mouthState = 'neutral';
      this.isEscaping = false;
      this.shadow = this.scene.querySelector('.shadow-container');
      this.leftCheek = this.scene.querySelector('.left.cheek');
      this.leftCheek = this.scene.querySelector('.right.cheek');
      this.leftHand = this.scene.querySelector('.hand-left');
      this.rightHand = this.scene.querySelector('.right-hand');
    }

    // 眨眼睛
    blink() {
      this.leftEye.classList.add('blink');
      this.rightEye.classList.add('blink');
      setTimeout(() => {
        this.leftEye.classList.remove('blink');
        this.rightEye.classList.remove('blink');
      }, 50)
    }
    
    // 挥手动作
    wave() {
      this.leftHand.classList.add('waving');
      setTimeout(() => {
        this.leftHand.classList.remove('waving');
      }, 500);
    }
    
    // 嘴
    openMouth() {
      this.mouth.classList.remove('closed');
      this.mouth.classList.add('open');
      this.mouthState = 'open';
    }
    
    closeMouth() {
      this.mouth.classList.remove('open');
      this.mouth.classList.add('closed');
      this.mouthState = 'closed';
    }
    
    neutralMouth() {
      this.mouth.classList.remove('open');
      this.mouth.classList.remove('closed');
      this.mouthState = 'neutral';
    }
    
    // 鼠标放上时的状态
    hover() {
      this.ghost.classList.add('hover');
    }
    
    surprise() {
      this.face.classList.add('surprised');
    }
    
    // 逃离状态
    runAway() {
      clearInterval(this.activityInterval);
      if (!this.isEscaping) {
        this.isEscaping = true;
        this.scene.classList.add('run-away', 'move-stars-in');
        this.scene.classList.remove('stars-out');
        setTimeout(() => {
          this.shadow.classList.add('disappear');
          setTimeout(() => {
            this.reset();
          }, Math.floor(Math.random()*1000) + 500);
        }, 450);
      }
    }
    
    // 回来时状态
    enter() {
      setTimeout(() => {
        this.shadow.classList.remove('disappear');
      }, 5);
      setTimeout(() => {
        this.scene.classList.remove('descend');
        this.scene.classList.add('stars-out', 'move-stars-out');
      }, 600);
      setTimeout(() => {
        this.hover();
        this.prepareEscape();
        this.startActivity();
      }, 1200)
    }
    
    startActivity() {
      this.activityInterval = setInterval(() => {
        switch (Math.floor(Math.random()*4)) {
          case 0:
            this.blink();
            setTimeout(() => { this.blink() }, 400);
            setTimeout(() => { this.blink() }, 1300);
            break;
          case 1:
            this.wave();
            break;
          default:
            break;
        }
      }, 7000);
    }
    
    prepareEscape() {
      this.scene.addEventListener('click', () => { this.runAway() }, false);
      this.scene.addEventListener('mouseover', () => { this.runAway() }, false);
      this.scene.addEventListener('focus', () => { this.runAway() }, false);
    }
  }
  
  let ghost = new Ghost(document.querySelector('.scene-container'));

  ghost.hover();
  ghost.startActivity();
  ghost.prepareEscape();
html {
    height: 100%;
}

body {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #292B25;
}

.scene-container {
    position: relative;
    width: 140px;
    height: 160px;
}

.scene-container:focus {
    outline: none;
}

.scene-container.run-away .ghost {
    transform: rotateX(-10deg) scale3d(1.4, 4, 1) translate3d(0, 130%, -30px);
    transition: transform 800ms ease;
}

.scene-container.descend .ghost {
    transform: translate3d(0, 130%, 0);
}

.ghost-container {
    position: relative;
    width: 80px;
    height: 140px;
    padding: 20px 30px 0 30px;
    overflow: hidden;
    perspective: 30px;
}

.ghost {
    position: relative;
    height: 115px;
    z-index: 1;
    transition: transform 2000ms ease-out;
}

.ghost.hover {
    -webkit-animation: hover 600ms ease-in-out infinite alternate;
    animation: hover 600ms ease-in-out infinite alternate;
}

.ghost-head {
    position: relative;
    width: 80px;
    height: 0;
    padding-top: 100%;
    border-radius: 100%;
    background-color: #F0EFDC;
}

.ghost-head .ghost-face {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 50px;
    height: 30px;
    z-index: 1;
}

.eyes-row, .mouth-row {
    position: relative;
    height: 10px;
}

.mouth-row {
    margin-top: 3px;
}

.eye {
    height: 10px;
    width: 10px;
    background-color: #271917;
    border-radius: 100%;
    position: absolute;
    bottom: 0;
    transition: height 50ms ease;
}

.eye.left {
    left: 5px;
}

.eye.right {
    right: 5px;
}

.eye.blink {
    height: 0;
}

.mouth {
    position: absolute;
    left: 50%;
    top: 0;
    height: 10px;
    transform: translate3d(-50%, 0, 0);
}

.mouth .mouth-top {
    width: 18px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background-color: #271917;
}

.mouth .mouth-bottom {
    position: absolute;
    width: 18px;
    height: 8px;
    bottom: 0;
    overflow: hidden;
    transition: height 150ms ease;
}

.mouth .mouth-bottom:after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 18px;
    height: 16px;
    border-radius: 100%;
    background-color: #271917;
}

.mouth.open .mouth-bottom {
    height: 16px;
}

.mouth.closed .mouth-bottom {
    height: 0;
}

.cheek {
    position: absolute;
    top: 0;
    width: 12px;
    height: 4px;
    background-color: #F5C1B6;
    border-radius: 100%;
}

.cheek.left {
    left: 0;
}

.cheek.right {
    right: 0;
}

.ghost-body {
    position: absolute;
    top: 40px;
    height: 0;
    width: 80px;
    padding-top: 85%;
    background-color: #F0EFDC;
}

.ghost-hand {
    height: 36px;
    width: 22px;
    background: #F0EFDC;
    border-radius: 100%/90%;
    position: absolute;
}

.ghost-hand.hand-left {
    left: -12px;
    top: 10px;
    transform: rotateZ(-45deg);
    left: 0;
    top: 5px;
    transform-origin: bottom center;
}

.ghost-hand.hand-left.waving {
    -webkit-animation: waving 400ms linear;
    animation: waving 400ms linear;
}

.ghost-hand.hand-right {
    right: -12px;
    top: 10px;
    transform: rotateZ(45deg);
}

.ghost-skirt {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    transform: translateY(50%);
}

.ghost-skirt .pleat {
    width: 20%;
    height: 8px;
    border-radius: 100%;
}

.ghost-skirt .pleat.down {
    background-color: #F0EFDC;
}

.ghost-skirt .pleat.up {
    background-color: #292B25;
    position: relative;
    top: 1px;
}

.shadow-container {
    transition: transform 800ms ease;
}

.shadow-container.disappear {
    transform: scale3d(0, 1, 1);
    transition: transform 400ms ease;
}

.shadow {
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    width: 100%;
    height: 8px;
    background-color: #1B1D18;
    border-radius: 100%;
    z-index: -1;
}

.shadow-bottom {
    position: absolute;
    top: 100%;
    left: 0;
    height: 4px;
    width: 100%;
    overflow: hidden;
}

.shadow-bottom:after {
    content: "";
    display: block;
    width: 100%;
    position: absolute;
    height: 8px;
    left: 0;
    bottom: 0;
    border-radius: 100%;
    background-color: #1B1D18;
    z-index: 2;
}

.star {
    position: absolute;
    -webkit-animation: twinkle 2s infinite linear;
    animation: twinkle 2s infinite linear;
    transition: top 400ms ease-out, left 400ms ease-out;
}

.star.round .star-element {
    height: 9px;
    width: 9px;
    border-radius: 100%;
}

.star.pointy {
    transform: rotate(-15deg);
}

.star.pointy .star-element {
    height: 6px;
    width: 6px;
}

.star.pointy .star-element:before, .star.pointy .star-element:after {
    content: "";
    display: block;
    position: absolute;
    background: green;
    border-radius: 6px;
}

.star.pointy .star-element:before {
    height: 6px;
    width: 12px;
    left: -3px;
    top: 0;
    transform: skewX(60deg);
}

.star.pointy .star-element:after {
    height: 12px;
    width: 6px;
    right: 0;
    bottom: -3px;
    transform: skewY(-60deg);
}

.star.orange .star-element, .star.orange .star-element:before, .star.orange .star-element:after {
    background-color: #DF814D;
}

.star.yellow .star-element, .star.yellow .star-element:before, .star.yellow .star-element:after {
    background-color: #FFD186;
}

.star.blue .star-element, .star.blue .star-element:before, .star.blue .star-element:after {
    background-color: #83D0BC;
}

.star-1 {
    top: 130%;
    left: 40%;
    transition-delay: 200ms;
    -webkit-animation-delay: 0ms;
    animation-delay: 0ms;
    z-index: 2;
}

.star-2 {
    top: 130%;
    left: 44%;
    transition-delay: 250ms;
    -webkit-animation-delay: 200ms;
    animation-delay: 200ms;
}

.star-3 {
    top: 130%;
    left: 48%;
    transition-delay: 300ms;
    -webkit-animation-delay: 400ms;
    animation-delay: 400ms;
    z-index: 2;
}

.star-4 {
    top: 130%;
    left: 52%;
    transition-delay: 350ms;
    -webkit-animation-delay: 600ms;
    animation-delay: 600ms;
}

.star-5 {
    top: 130%;
    left: 56%;
    transition-delay: 400ms;
    -webkit-animation-delay: 800ms;
    animation-delay: 800ms;
    z-index: 2;
}

.star-6 {
    top: 130%;
    left: 60%;
    transition-delay: 450ms;
    -webkit-animation-delay: 1000ms;
    animation-delay: 1000ms;
}

.move-stars-out .star-element {
    -webkit-animation: star-entrance 1500ms;
    animation: star-entrance 1500ms;
}

.stars-out .star {
    transition: top 1500ms ease-out, left 1500ms ease-out;
}

.stars-out .star-1 {
    top: 75%;
    left: 6%;
}

.stars-out .star-2 {
    top: 35%;
    left: 88%;
}

.stars-out .star-3 {
    top: 8%;
    left: 20%;
}

.stars-out .star-4 {
    top: 70%;
    left: 92%;
}

.stars-out .star-5 {
    top: 35%;
    left: 4%;
}

.stars-out .star-6 {
    top: 2%;
    left: 70%;
}

.stars-out .star-1 {
    transition-delay: 0ms, 0ms;
}

.stars-out .star-1 .star-element {
    -webkit-animation-delay: 0ms;
    animation-delay: 0ms;
}

.stars-out .star-2 {
    transition-delay: 200ms, 200ms;
}

.stars-out .star-2 .star-element {
    -webkit-animation-delay: 200ms;
    animation-delay: 200ms;
}

.stars-out .star-3 {
    transition-delay: 400ms, 400ms;
}

.stars-out .star-3 .star-element {
    -webkit-animation-delay: 400ms;
    animation-delay: 400ms;
}

.stars-out .star-4 {
    transition-delay: 600ms, 600ms;
}

.stars-out .star-4 .star-element {
    -webkit-animation-delay: 600ms;
    animation-delay: 600ms;
}

.stars-out .star-5 {
    transition-delay: 800ms, 800ms;
}

.stars-out .star-5 .star-element {
    -webkit-animation-delay: 800ms;
    animation-delay: 800ms;
}

.stars-out .star-6 {
    transition-delay: 1000ms, 1000ms;
}

.stars-out .star-6 .star-element {
    -webkit-animation-delay: 1000ms;
    animation-delay: 1000ms;
}

.move-stars-in .star-element {
    -webkit-animation: star-exit 400ms linear;
    animation: star-exit 400ms linear;
}

.move-stars-in .star-1 .star-element {
    -webkit-animation-delay: 100ms;
    animation-delay: 100ms;
}

.move-stars-in .star-2 .star-element {
    -webkit-animation-delay: 150ms;
    animation-delay: 150ms;
}

.move-stars-in .star-3 .star-element {
    -webkit-animation-delay: 200ms;
    animation-delay: 200ms;
}

.move-stars-in .star-4 .star-element {
    -webkit-animation-delay: 250ms;
    animation-delay: 250ms;
}

.move-stars-in .star-5 .star-element {
    -webkit-animation-delay: 300ms;
    animation-delay: 300ms;
}

.move-stars-in .star-6 .star-element {
    -webkit-animation-delay: 350ms;
    animation-delay: 350ms;
}

/* 动画部分 */

@-webkit-keyframes hover {
    0% {
        top: 0;
    }
    100% {
        top: 8px;
    }
}

@keyframes hover {
    0% {
        top: 0;
    }
    100% {
        top: 8px;
    }
}

@-webkit-keyframes star-entrance {
    0% {
        transform: rotate(-735deg) scale(0, 0);
    }
    100% {
        transform: rotate(0) scale(1, 1);
    }
}

@keyframes star-entrance {
    0% {
        transform: rotate(-735deg) scale(0, 0);
    }
    100% {
        transform: rotate(0) scale(1, 1);
    }
}

@-webkit-keyframes star-exit {
    0% {
        transform: rotate(0) scale(1, 1);
    }
    100% {
        transform: rotate(360deg) scale(0, 0);
    }
}

@keyframes star-exit {
    0% {
        transform: rotate(0) scale(1, 1);
    }
    100% {
        transform: rotate(360deg) scale(0, 0);
    }
}

@-webkit-keyframes twinkle {
    0% {
        transform: rotate(0deg) scale(1, 1);
    }
    25% {
        transform: rotate(10deg) scale(0.8, 0.8);
    }
    50% {
        transform: rotate(0deg) scale(0.9, 0.9);
    }
    75% {
        transform: rotate(-20deg) scale(0.6, 0.6);
    }
    100% {
        transform: rotate(0deg) scale(1, 1);
    }
}

@keyframes twinkle {
    0% {
        transform: rotate(0deg) scale(1, 1);
    }
    25% {
        transform: rotate(10deg) scale(0.8, 0.8);
    }
    50% {
        transform: rotate(0deg) scale(0.9, 0.9);
    }
    75% {
        transform: rotate(-20deg) scale(0.6, 0.6);
    }
    100% {
        transform: rotate(0deg) scale(1, 1);
    }
}

@-webkit-keyframes waving {
    0% {
        transform: rotate(-45deg);
    }
    25% {
        transform: rotate(-55deg);
    }
    50% {
        transform: rotate(-45deg);
    }
    75% {
        transform: rotate(-55deg);
    }
    100% {
        transform: rotate(-45deg);
    }
}

@keyframes waving {
    0% {
        transform: rotate(-45deg);
    }
    25% {
        transform: rotate(-55deg);
    }
    50% {
        transform: rotate(-45deg);
    }
    75% {
        transform: rotate(-55deg);
    }
    100% {
        transform: rotate(-45deg);
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1594224.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

性能测试-数据库优化一(配置参数)

性能测试-数据库优化 数据库的优化方向 1、数据库是安装在操作系统中&#xff0c;是非常追求磁盘的稳定性。MySQL的库是磁盘文件夹&#xff0c;表是磁盘文件所以数据库的优化&#xff1a; 磁盘的性能 1、磁盘的速度&#xff0c;减少同时读写&#xff0c;考虑读写分离&#x…

【Spring Boot】深入解密Spring Boot日志:最佳实践与策略解析

&#x1f493; 博客主页&#xff1a;从零开始的-CodeNinja之路 ⏩ 收录文章&#xff1a;【Spring Boot】深入解密Spring Boot日志&#xff1a;最佳实践与策略解析 &#x1f389;欢迎大家点赞&#x1f44d;评论&#x1f4dd;收藏⭐文章 目录 Spring Boot 日志一. 日志的概念?…

上位机图像处理和嵌入式模块部署(智能硬件的开发)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 目前&#xff0c;用上位机软件虽然可以部署项目&#xff0c;但是它本身有自己的缺点&#xff0c;那就是稳定性差、价格贵。稳定性这部分&#xff0…

c++修炼之路之vector模拟实现

目录 前言&#xff1a; 一&#xff1a;在STL的开源代码中的vector的实现 二&#xff1a;模拟实现 1.数据成员size()capacity() 2.resizereserve 3.构造函数析构函数赋值重载 4.迭代器[] 5.push_backinserterase迭代器失效问题 三&#xff1a;测试用例和全部代码 接下…

【Proteus】51单片机对步进电机的控制

步进电机&#xff1a;将电脉冲信号转变为角位移或线位移的开换控制系统。在非超载的情况下&#xff0c;电机的转速、停止的位置只取决于脉冲信号的频率和脉冲数&#xff0c;而不受负载变化的影响&#xff0c;即给电机加一个脉冲信号&#xff0c;电机则转过一个步距角。 特点&am…

2024蓝桥A组A题

艺术与篮球&#xff08;蓝桥&#xff09; 问题描述格式输入格式输出评测用例规模与约定解析参考程序难度等级 问题描述 格式输入 无 格式输出 一个整数 评测用例规模与约定 无 解析 模拟就好从20000101-20240413每一天计算笔画数是否大于50然后天数&#xff1b; 记得判断平…

【STM32】西南交大嵌入式系统设计实验:环境配置

把走过的坑记录一下&#xff0c;希望后来人避坑 No ST-Link device detected.问题解决 如果跟着指导书出现这个问题&#xff1a; 直接跳过这一步不用再更新固件&#xff0c;后面直接创建项目写程序就行了。 在keil里配置成用DAP_link即可。 详细的可以看这篇文章&#xff1a…

如何进行宏观经济预测

理性预期经济学提出了理性预期的概念&#xff0c;强调政府在制定各种宏观经济政策时&#xff0c;要考虑到各行为主体预期对政策实施有效性的影响&#xff0c;积极促成公众理性预期的形成&#xff0c;从而更好地实现宏观调控的目标。政府统计要深入开展统计分析预测研究&#xf…

实战项目——智慧社区(四)之 系统管理

1、用户管理 提供查询和搜索用户、根据id查询用户信息、添加用户、修改用户、删除用户的功能 界面 添加用户 修改用户信息 2、角色管理 提供查询和搜索角色、根据id查询角色信息、添加角色、修改角色、删除角色的功能 界面 添加角色 修改角色 3、菜单管理 提供查询和搜索菜…

JavaScript(七)-高级技巧篇

文章目录 深浅拷贝浅拷贝深拷贝 异常处理thorw抛异常try/catch捕获异常debugger 处理thisthis指向改变this 性能优化防抖lodash实现防抖手写防抖函数 节流 - throttle 深浅拷贝 浅拷贝 深拷贝 深拷贝有三种方式 通过递归实现深拷贝 一定先写数组再写对象 lodash/cloneDeep …

Gradle 在 Spring 中的使用-ApiHug准备-工具篇-006

&#x1f917; ApiHug {Postman|Swagger|Api...} 快↑ 准√ 省↓ GitHub - apihug/apihug.com: All abou the Apihug apihug.com: 有爱&#xff0c;有温度&#xff0c;有质量&#xff0c;有信任ApiHug - API design Copilot - IntelliJ IDEs Plugin | Marketplace ApiHug …

Linux(Ubuntu) 查看并删除使用【dpkg】安装的软件

目录 ■前言 ■查看安装的软件 ■删除安装的软件 正常删除&#xff08;dpkg -r xxxxName&#xff09; 问题解决&#xff1a;use --purge to remove them too ■其他调查信息 命令 图片1 图片2 图片3 ■前言 安装Mysql8.3失败 我的服务器-CSDN博客 ■查看安装的软…

Linux的学习之路:10、进程(2)

摘要 本章主要是说一下fork的一些用法、进程状态、优先级和环境变量。 目录 摘要 一、fork 1、fork的基本用法 2、分流 二、进程状态 三、优先级 四、环境变量 1、常见环境变量 2、和环境变量相关的命令 3、通过代码如何获取环境变量 五、导图 一、fork 1、fork…

`Object3D.lookAt()` 是 Three.js 中 `Object3D` 类的一个方法,用于让一个对象朝向指定的目标点。

demo案例 方法签名 object.lookAt(target)参数 target&#xff1a;目标点的坐标&#xff0c;可以是一个 Three.js 的 Vector3 对象&#xff0c;也可以是包含 x、y、z 坐标的普通 JavaScript 对象。 返回值 该方法没有返回值。 功能 该方法将当前对象的 z 轴指向目标点&am…

GitHub repository - Pulse - Contributors - Network

GitHub repository - Pulse - Contributors - Network 1. Pulse2. Contributors3. NetworkReferences 1. Pulse 显示该仓库最近的活动信息。该仓库中的软件是无人问津&#xff0c;还是在火热地开发之中&#xff0c;从这里可以一目了然。 2. Contributors 显示对该仓库进行过…

【Golang学习笔记】从零开始搭建一个Web框架(四)

文章目录 模板渲染静态文件支持HTML 模板渲染 错误恢复完结撒花~~ 前情提示&#xff1a; 【Golang学习笔记】从零开始搭建一个Web框架&#xff08;一&#xff09;-CSDN博客 【Golang学习笔记】从零开始搭建一个Web框架&#xff08;二&#xff09;-CSDN博客 【Golang学习笔记】从…

【C++成长记】C++入门 | 类和对象(上) |类的作用域、类的实例化、类的对象大小的计算、类成员函数的this指针

&#x1f40c;博主主页&#xff1a;&#x1f40c;​倔强的大蜗牛&#x1f40c;​ &#x1f4da;专栏分类&#xff1a;C❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ 目录 一、类的作用域 二、类的实例化 三、类对象模型 四、this指针 1、this指针的引出 2 this指针的特…

Linux学习笔记之9(消息队列)

Linux learning 1、引言2、创建一个消息队列3、发送和接受消息3.1、发送消息3.1、接收消息 4、删除一个消息队列5、例程 1、引言 消息队列&#xff08;message queue&#xff09;也是进程之间通信的一种方式&#xff0c;相比于共享内存的通信方式&#xff0c;消息队列也有类型…

如何更好地理解 Vue 3 watch 侦听器的用法

&#x1f90d; 前端开发工程师、技术日更博主、已过CET6 &#x1f368; 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 &#x1f560; 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 &#x1f35a; 蓝桥云课签约作者、上架课程《Vue.js 和 E…

电脑录屏软件哪个好用又免费?市面20款录屏软件测评结果

随着在线教学、远程办公和自媒体创作的兴起&#xff0c;电脑录屏软件逐渐成为了许多用户的必备工具。市面上的录屏软件琳琅满目&#xff0c;但真正既好用又免费的却并不多见。为了帮助大家找到心仪的录屏软件&#xff0c;我们对市面上20款热门免费录屏软件进行了详细的测评。 电…