cp_excalidraw_frame.html 1.3 KB

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>复制一个frame</title>
  6. <script src="js/util.js"></script>
  7. </head>
  8. <body>
  9. <script>
  10. let str = "{\"type\":\"excalidraw/clipboard\",\"elements\":[{\"type\":\"embeddable\",\"version\":180,\"versionNonce\":1920335448,\"isDeleted\":false,\"id\":\"f9LOsIKv8drPM8aOetFXl\",\"fillStyle\":\"hachure\",\"strokeWidth\":1,\"strokeStyle\":\"solid\",\"roughness\":1,\"opacity\":100,\"angle\":0,\"x\":864.2622041015625,\"y\":232.2603759765625,\"strokeColor\":\"#000000\",\"backgroundColor\":\"transparent\",\"width\":722.40234375,\"height\":318.40625,\"seed\":607107403,\"groupIds\":[],\"frameId\":null,\"roundness\":null,\"boundElements\":[],\"updated\":1704786477631,\"link\":\"https://web.tianyunperfect.cn/simple/edit_online.html?id=667374\",\"locked\":false,\"validated\":true}],\"files\":{}}";
  11. // 时间戳 秒
  12. let timestamp = Date.parse(new Date()) - Date.parse(new Date('2024-01-01 00:00:00'));
  13. timestamp = timestamp / 1000;
  14. str = str.replace(/667374/g, timestamp);
  15. // 复制到剪切板
  16. copyUtil.copyText(str);
  17. setInterval(function () {
  18. copyUtil.getClipboardText().then(function (text) {
  19. if (text.indexOf(timestamp) > -1) {
  20. closeWindow();
  21. }
  22. });
  23. }, 500);
  24. </script>
  25. </body>
  26. </html>