| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- <title>AiEditor Demo</title>
- <script>
- let isDark = false;
- function changeTheme() {
- document.body.style.background = isDark ? "" : "#1a1b1e"
- document.querySelector("#title").style.color = isDark ? "" : "#eee"
- aiEditor.changeTheme();
- isDark = !isDark;
- }
- function changeLang() {
- const lang = localStorage.getItem("lang");
- if (!lang || lang === "zh") {
- aiEditor.changeLang("en");
- localStorage.setItem("lang", "en");
- } else {
- aiEditor.changeLang("zh");
- localStorage.setItem("lang", "zh");
- }
- }
- </script>
- <style>
- .aie-theme-light {
- --my-default-color: #fafafa;
- }
- .aie-theme-dark {
- --my-default-color: #333;
- }
- .aie-container div.default{
- background: var(--my-default-color);
- }
- </style>
- </head>
- <body>
- <div style="padding: 10px 20px;font-size: 30px" id="title">
- AiEditor,一个面向 AI 的下一代富文本编辑器。
- <a href="https://gitee.com/aieditor-team/aieditor" target="_blank">获取源码</a>
- <a href="https://aieditor.dev" target="_blank">访问官网</a>
- <button onclick="changeTheme()">切换主题</button>
- <button onclick="changeLang()">切换语言</button>
- </div>
- <div id="aiEditor" style="height: 450px; margin: 20px"></div>
- <script type="module" src="/src/main.ts"></script>
- </body>
- </html>
|