12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Document</title>
- <style>
- html,
- body {
- width: 100%;
- height: 100%;
- margin: 0;
- overflow: hidden;
- }
- .scene {
- width: 100%;
- height: 100%;
- }
- #toolbar {
- position: absolute;
- left: 50%;
- top: 0;
- z-index: 10000;
- }
- [xui_tags_view] .tag-body {
- position: absolute;
- left: 50%;
- bottom: 50px;
- width: 100px;
- height: 100px;
- background-color: bisque;
- transform: translateX(-50%) scale(0);
- transform-origin: bottom;
- transition: all 0.3s cubic-bezier(0.35, 0.32, 0.65, 0.63);
- pointer-events: none;
- }
- [xui_tags_view] .tag-body.show {
- transform: translateX(-50%) scale(1);
- }
- </style>
- </head>
- <body>
- <div id="scene" class="scene"></div>
- <div id="toolbar">
- <button id="save" onclick="save()">保存初始画面</button>
- <button id="publish" onclick="publish()">发布</button>
- </div>
- <script src="../../dist/sdk/kankan-sdk-deps.js"></script>
- <script src="../../dist/sdk/kankan-sdk.js"></script>
- <script>
- localStorage.setItem('token','eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxODgxOTI3MjIwOCIsInVzZXJOYW1lIjoiMTg4MTkyNzIyMDgiLCJpYXQiOjE2NjAwMzU5MTUsImp0aSI6IjJiNTc5Zjc1LWI3MTAtNDczOC04MjIyLTcwNzQ2NDVkMjU1ZiJ9.kplYeAbSbhnLD_iLkMuWY_4f8s2MgHr9fbUGpZeaDag')
- var kankan = new KanKan({
- dom: '#scene',
- num: 't-JKNqv1o'
- })
- kankan.render()
- function save() {
- kankan.Editor.saveEntry()
- .then(response => console.log(response))
- .catch(error => console.error(error))
- }
- function publish() {
- kankan.Editor.publish()
- .then(response => console.log(response))
- .catch(error => console.error(error))
- }
- </script>
- </body>
- </html>
|