theme.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!doctype html>
  2. <title>CodeMirror: Theme Demo</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../doc/docs.css">
  5. <link rel="stylesheet" href="../lib/codemirror.css">
  6. <link rel="stylesheet" href="../theme/3024-day.css">
  7. <link rel="stylesheet" href="../theme/3024-night.css">
  8. <link rel="stylesheet" href="../theme/abbott.css">
  9. <link rel="stylesheet" href="../theme/abcdef.css">
  10. <link rel="stylesheet" href="../theme/ambiance.css">
  11. <link rel="stylesheet" href="../theme/ayu-dark.css">
  12. <link rel="stylesheet" href="../theme/ayu-mirage.css">
  13. <link rel="stylesheet" href="../theme/base16-dark.css">
  14. <link rel="stylesheet" href="../theme/bespin.css">
  15. <link rel="stylesheet" href="../theme/base16-light.css">
  16. <link rel="stylesheet" href="../theme/blackboard.css">
  17. <link rel="stylesheet" href="../theme/cobalt.css">
  18. <link rel="stylesheet" href="../theme/colorforth.css">
  19. <link rel="stylesheet" href="../theme/dracula.css">
  20. <link rel="stylesheet" href="../theme/duotone-dark.css">
  21. <link rel="stylesheet" href="../theme/duotone-light.css">
  22. <link rel="stylesheet" href="../theme/eclipse.css">
  23. <link rel="stylesheet" href="../theme/elegant.css">
  24. <link rel="stylesheet" href="../theme/erlang-dark.css">
  25. <link rel="stylesheet" href="../theme/gruvbox-dark.css">
  26. <link rel="stylesheet" href="../theme/hopscotch.css">
  27. <link rel="stylesheet" href="../theme/icecoder.css">
  28. <link rel="stylesheet" href="../theme/isotope.css">
  29. <link rel="stylesheet" href="../theme/juejin.css">
  30. <link rel="stylesheet" href="../theme/lesser-dark.css">
  31. <link rel="stylesheet" href="../theme/liquibyte.css">
  32. <link rel="stylesheet" href="../theme/lucario.css">
  33. <link rel="stylesheet" href="../theme/material.css">
  34. <link rel="stylesheet" href="../theme/material-darker.css">
  35. <link rel="stylesheet" href="../theme/material-palenight.css">
  36. <link rel="stylesheet" href="../theme/material-ocean.css">
  37. <link rel="stylesheet" href="../theme/mbo.css">
  38. <link rel="stylesheet" href="../theme/mdn-like.css">
  39. <link rel="stylesheet" href="../theme/midnight.css">
  40. <link rel="stylesheet" href="../theme/monokai.css">
  41. <link rel="stylesheet" href="../theme/moxer.css">
  42. <link rel="stylesheet" href="../theme/neat.css">
  43. <link rel="stylesheet" href="../theme/neo.css">
  44. <link rel="stylesheet" href="../theme/night.css">
  45. <link rel="stylesheet" href="../theme/nord.css">
  46. <link rel="stylesheet" href="../theme/oceanic-next.css">
  47. <link rel="stylesheet" href="../theme/panda-syntax.css">
  48. <link rel="stylesheet" href="../theme/paraiso-dark.css">
  49. <link rel="stylesheet" href="../theme/paraiso-light.css">
  50. <link rel="stylesheet" href="../theme/pastel-on-dark.css">
  51. <link rel="stylesheet" href="../theme/railscasts.css">
  52. <link rel="stylesheet" href="../theme/rubyblue.css">
  53. <link rel="stylesheet" href="../theme/seti.css">
  54. <link rel="stylesheet" href="../theme/shadowfox.css">
  55. <link rel="stylesheet" href="../theme/solarized.css">
  56. <link rel="stylesheet" href="../theme/the-matrix.css">
  57. <link rel="stylesheet" href="../theme/tomorrow-night-bright.css">
  58. <link rel="stylesheet" href="../theme/tomorrow-night-eighties.css">
  59. <link rel="stylesheet" href="../theme/ttcn.css">
  60. <link rel="stylesheet" href="../theme/twilight.css">
  61. <link rel="stylesheet" href="../theme/vibrant-ink.css">
  62. <link rel="stylesheet" href="../theme/xq-dark.css">
  63. <link rel="stylesheet" href="../theme/xq-light.css">
  64. <link rel="stylesheet" href="../theme/yeti.css">
  65. <link rel="stylesheet" href="../theme/idea.css">
  66. <link rel="stylesheet" href="../theme/darcula.css">
  67. <link rel="stylesheet" href="../theme/yonce.css">
  68. <link rel="stylesheet" href="../theme/zenburn.css">
  69. <script src="../lib/codemirror.js"></script>
  70. <script src="../mode/javascript/javascript.js"></script>
  71. <script src="../addon/selection/active-line.js"></script>
  72. <script src="../addon/edit/matchbrackets.js"></script>
  73. <style>
  74. .CodeMirror {border: 1px solid black; font-size:13px}
  75. </style>
  76. <div id=nav>
  77. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
  78. <ul>
  79. <li><a href="../index.html">Home</a>
  80. <li><a href="../doc/manual.html">Manual</a>
  81. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  82. </ul>
  83. <ul>
  84. <li><a class=active href="#">Theme</a>
  85. </ul>
  86. </div>
  87. <article>
  88. <h2>Theme Demo</h2>
  89. <form><textarea id="code" name="code">
  90. function findSequence(goal) {
  91. function find(start, history) {
  92. if (start == goal)
  93. return history;
  94. else if (start > goal)
  95. return null;
  96. else
  97. return find(start + 5, "(" + history + " + 5)") ||
  98. find(start * 3, "(" + history + " * 3)");
  99. }
  100. return find(1, "1");
  101. }</textarea></form>
  102. <p>Select a theme: <select onchange="selectTheme()" id=select>
  103. <option selected>default</option>
  104. <option>3024-day</option>
  105. <option>3024-night</option>
  106. <option>abbott</option>
  107. <option>abcdef</option>
  108. <option>ambiance</option>
  109. <option>ayu-dark</option>
  110. <option>ayu-mirage</option>
  111. <option>base16-dark</option>
  112. <option>base16-light</option>
  113. <option>bespin</option>
  114. <option>blackboard</option>
  115. <option>cobalt</option>
  116. <option>colorforth</option>
  117. <option>darcula</option>
  118. <option>dracula</option>
  119. <option>duotone-dark</option>
  120. <option>duotone-light</option>
  121. <option>eclipse</option>
  122. <option>elegant</option>
  123. <option>erlang-dark</option>
  124. <option>gruvbox-dark</option>
  125. <option>hopscotch</option>
  126. <option>icecoder</option>
  127. <option>idea</option>
  128. <option>isotope</option>
  129. <option>juejin</option>
  130. <option>lesser-dark</option>
  131. <option>liquibyte</option>
  132. <option>lucario</option>
  133. <option>material</option>
  134. <option>material-darker</option>
  135. <option>material-palenight</option>
  136. <option>material-ocean</option>
  137. <option>mbo</option>
  138. <option>mdn-like</option>
  139. <option>midnight</option>
  140. <option>monokai</option>
  141. <option>moxer</option>
  142. <option>neat</option>
  143. <option>neo</option>
  144. <option>night</option>
  145. <option>nord</option>
  146. <option>oceanic-next</option>
  147. <option>panda-syntax</option>
  148. <option>paraiso-dark</option>
  149. <option>paraiso-light</option>
  150. <option>pastel-on-dark</option>
  151. <option>railscasts</option>
  152. <option>rubyblue</option>
  153. <option>seti</option>
  154. <option>shadowfox</option>
  155. <option>solarized dark</option>
  156. <option>solarized light</option>
  157. <option>the-matrix</option>
  158. <option>tomorrow-night-bright</option>
  159. <option>tomorrow-night-eighties</option>
  160. <option>ttcn</option>
  161. <option>twilight</option>
  162. <option>vibrant-ink</option>
  163. <option>xq-dark</option>
  164. <option>xq-light</option>
  165. <option>yeti</option>
  166. <option>yonce</option>
  167. <option>zenburn</option>
  168. </select>
  169. </p>
  170. <script>
  171. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  172. lineNumbers: true,
  173. styleActiveLine: true,
  174. matchBrackets: true
  175. });
  176. var input = document.getElementById("select");
  177. function selectTheme() {
  178. var theme = input.options[input.selectedIndex].textContent;
  179. editor.setOption("theme", theme);
  180. location.hash = "#" + theme;
  181. }
  182. var choice = (location.hash && location.hash.slice(1)) ||
  183. (document.location.search &&
  184. decodeURIComponent(document.location.search.slice(1)));
  185. if (choice) {
  186. input.value = choice;
  187. editor.setOption("theme", choice);
  188. }
  189. CodeMirror.on(window, "hashchange", function() {
  190. var theme = location.hash.slice(1);
  191. if (theme) { input.value = theme; selectTheme(); }
  192. });
  193. </script>
  194. </article>