Browse Source

:pencil: demo

Liyuan Li 5 years ago
parent
commit
c0eac593cc
3 changed files with 14 additions and 5 deletions
  1. 7 2
      demo/index.html
  2. 0 1
      demo/index.js
  3. 7 2
      demo/static.html

+ 7 - 2
demo/index.html

@@ -34,14 +34,19 @@
     <meta name="twitter:url" content="https://hacpai.com/tag/vditor"/>
     <meta property="og:image" content="https://cdn.jsdelivr.net/npm/vditor/src/assets/images/logo.png"/>
     <meta name="twitter:image" content="https://cdn.jsdelivr.net/npm/vditor/src/assets/images/logo.png"/>
+    <style>
+        a {
+            color: #4285f4;
+        }
+    </style>
 </head>
 <body>
 <h2>
     <a href="https://hacpai.com/article/1549638745630?r=Vanessa" target="_blank">API</a> |
     <a target="_blank" href="demo/static-preview.html?lang=zh_CN">中文预览</a>
     <a target="_blank" href="demo/static-preview.html?lang=ko_KR">한글预览</a> |
-    <button onclick="window.vditor.setTheme('dark', 'dark',  'native')">Dark Mode</button>
-    <button onclick="window.vditor.setTheme('light', 'light', 'github')">Light Mode</button>
+    <button onclick="window.vditor.setTheme('dark', 'dark',  'native');document.querySelector('body').style.backgroundColor='#2f363d'">Dark Mode</button>
+    <button onclick="window.vditor.setTheme('light', 'light', 'github');document.querySelector('body').style.backgroundColor=''">Light Mode</button>
 </h2>
 <div id="vditor">
 <h1>Vditor</h1>

+ 0 - 1
demo/index.js

@@ -50,7 +50,6 @@ if (window.innerWidth < 768) {
 window.vditor = new Vditor('vditor', {
   toolbar,
   debugger: true,
-  cdn: "http://localhost:9000",
   typewriterMode: true,
   placeholder: 'placeholder',
   preview: {

+ 7 - 2
demo/static.html

@@ -36,14 +36,19 @@
     <meta name="twitter:image" content="https://cdn.jsdelivr.net/npm/vditor/dist/images/logo.png"/>
     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.css"/>
     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js"></script>
+    <style>
+        a {
+            color: #4285f4;
+        }
+    </style>
 </head>
 <body>
 <h2>
     <a href="https://hacpai.com/article/1549638745630?r=Vanessa" target="_blank">API</a> |
     <a href="static-preview.html?lang=zh_CN">中文预览</a>
     <a href="static-preview.html?lang=ko_KR">한글预览</a> |
-    <button onclick="window.vditor.setTheme('dark', 'dark',  'native')">Dark Mode</button>
-    <button onclick="window.vditor.setTheme('light', 'light', 'github')">Light Mode</button>
+    <button onclick="window.vditor.setTheme('dark', 'dark',  'native');document.querySelector('body').style.backgroundColor='#2f363d'">Dark Mode</button>
+    <button onclick="window.vditor.setTheme('light', 'light', 'github');document.querySelector('body').style.backgroundColor=''">Light Mode</button>
 </h2>
 <div id="vditor">
 <h1>Vditor</h1>