konva实现液态名片卡片代码

代码语言:html

所属分类:布局界面

代码描述:konva实现液态名片卡片代码

代码标签: konva实现液态名片卡片代码

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

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

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

  
  
<style>
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f7f8fa;
}
</style>

  
</head>

<body translate="no">
  <div id="business-card"></div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.9/dat.gui.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/konva/7.0.5/konva.min.js'></script>
    <script  >
"use strict";
const PI2 = Math.PI / 2;
class BusinessCard {
    constructor(options = {}) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
        this.touches = [];
        /** While true, a simulated cursor circles the card. Off on first real input. */
        this.demo = true;
        this.mousemove = (e) => {
            // First real cursor movement ends the demo and hands control to the user.
            this.demo = false;
            this.touches = [{ x: e.evt.offsetX, y: e.evt.offsetY, z: 0, force: 1 }];
        };
        this.mouseout = () => {
            if (!this.demo)
                this.touches = [];
        };
        this.name = (_a = options.firstName) !== null && _a !== void 0 ? _a : 'Tamino Martinius';
        this.position = (_b = options.position) !== null && _b !== void 0 ?.........完整代码请登录后点击上方下载按钮下载查看

网友评论0