cat.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <div id="hexo-helper-live2d">
  11. <canvas id="live2dcanvas" width="150" height="300"></canvas>
  12. </div>
  13. <style>
  14. #live2dcanvas{
  15. position: fixed;
  16. width: 150px;
  17. height: 300px;
  18. opacity:1;
  19. left: 200px;
  20. z-index: 999;
  21. pointer-events: none;
  22. bottom: -70px;
  23. }
  24. </style>
  25. <script type="text/javascript" src="./live2d/device.min.js"></script>
  26. <script type="text/javascript" src="./live2d/script.js"></script>
  27. <script type="text/javascript">
  28. const loadScript = function loadScript(c,b){var a=document.createElement("script");a.type="text/javascript";"undefined"!=typeof b&&(a.readyState?a.onreadystatechange=function(){if("loaded"==a.readyState||"complete"==a.readyState)a.onreadystatechange=null,b()}:a.onload=function(){b()});a.src=c;document.body.appendChild(a)};
  29. (function(){
  30. if((typeof(device) != 'undefined') && (device.mobile())){
  31. document.getElementById("live2dcanvas").style.width = '75px';
  32. document.getElementById("live2dcanvas").style.height = '150px';
  33. }else
  34. if (typeof(device) === 'undefined') console.error('Cannot find current-device script.');
  35. loadScript("./live2d/script.js", function(){loadlive2d("live2dcanvas", "./live2d/assets/hijiki.model.json", 0.5);});
  36. })();
  37. </script>
  38. </body>
  39. </html>