index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. ---
  2. layout: default
  3. title: Quill - Your powerful rich text editor
  4. bodyClass: 'home'
  5. redirect_from: /latest/
  6. ---
  7. <!-- head -->
  8. <link href="{{site.katex}}/katex.min.css" rel="stylesheet">
  9. <link href="{{site.highlightjs}}/styles/monokai-sublime.min.css" rel="stylesheet">
  10. <link href="{{ site.cdn }}{{ site.version }}/quill.bubble.css" rel="stylesheet">
  11. <link href="{{ site.cdn }}{{ site.version }}/quill.snow.css" rel="stylesheet">
  12. <!-- head -->
  13. <div id="above-container">
  14. <div class="container">
  15. <div id="users-container">
  16. <h2>
  17. <button class="prev">
  18. <span class="arrow">
  19. <span class="tip"></span>
  20. <span class="shaft"></span>
  21. </span>
  22. </button>
  23. Switch Examples
  24. <button class="next">
  25. <span class="arrow">
  26. <span class="tip"></span>
  27. <span class="shaft"></span>
  28. </span>
  29. </button>
  30. </h2>
  31. <h1>Your powerful rich text editor.</h1>
  32. <ul>
  33. <li>Trusted by:</li>
  34. <li>
  35. <a class="user-linkedin" href="https://www.linkedin.com/" title="LinkedIn" target="_blank"></a>
  36. </li>
  37. <li>
  38. <a class="user-slack" href="https://slack.com/" target="_blank" title="Slack"></a>
  39. </li>
  40. <li>
  41. <a class="user-voxmedia" href="https://www.voxmedia.com/" target="_blank" title="Vox Media"></a>
  42. </li>
  43. </ul>
  44. </div>
  45. <div id="laptop-container">
  46. <div id="camera-container">
  47. <span class="camera"></span>
  48. <span class="camera active"></span>
  49. <span class="camera"></span>
  50. </div>
  51. <div id="demo-container">
  52. <div id="carousel-container">
  53. <div id="bubble-wrapper">
  54. <div id="bubble-container">
  55. <div class="editor"></div>
  56. </div>
  57. </div>
  58. <div id="snow-wrapper">
  59. <div id="snow-container">
  60. <div class="toolbar">
  61. <span class="ql-formats">
  62. <select class="ql-header">
  63. <option value="1">Heading</option>
  64. <option value="2">Subheading</option>
  65. <option selected>Normal</option>
  66. </select>
  67. <select class="ql-font">
  68. <option selected>Sailec Light</option>
  69. <option value="sofia">Sofia Pro</option>
  70. <option value="slabo">Slabo 27px</option>
  71. <option value="roboto">Roboto Slab</option>
  72. <option value="inconsolata">Inconsolata</option>
  73. <option value="ubuntu">Ubuntu Mono</option>
  74. </select>
  75. </span>
  76. <span class="ql-formats">
  77. <button class="ql-bold"></button>
  78. <button class="ql-italic"></button>
  79. <button class="ql-underline"></button>
  80. </span>
  81. <span class="ql-formats">
  82. <button class="ql-list" value="ordered"></button>
  83. <button class="ql-list" value="bullet"></button>
  84. <select class="ql-align">
  85. <option label="left" selected></option>
  86. <option label="center" value="center"></option>
  87. <option label="right" value="right"></option>
  88. <option label="justify" value="justify"></option>
  89. </select>
  90. </span>
  91. <span class="ql-formats">
  92. <button class="ql-link"></button>
  93. <button class="ql-image"></button>
  94. <button class="ql-video"></button>
  95. </span>
  96. <span class="ql-formats">
  97. <button class="ql-formula"></button>
  98. <button class="ql-code-block"></button>
  99. </span>
  100. <span class="ql-formats">
  101. <button class="ql-clean"></button>
  102. </span>
  103. </div>
  104. <div class="editor">
  105. <h1 class="ql-align-center">Quill Rich Text Editor</h1>
  106. <p><br></p>
  107. <p>Quill is a free, <a href="https://github.com/quilljs/quill/">open source</a> WYSIWYG editor built for the modern web. With its <a href="https://quilljs.com/docs/modules/">modular architecture</a> and expressive <a href="https://quilljs.com/docs/api/">API</a>, it is completely customizable to fit any need.</p>
  108. <p><br></p>
  109. <iframe class="ql-video ql-align-center" src="https://player.vimeo.com/video/253905163" width="500" height="280" allowfullscreen></iframe>
  110. <p><br></p>
  111. <h2 class="ql-align-center">Getting Started is Easy</h2>
  112. <p><br></p>
  113. <pre class="ql-syntax" spellcheck="false"><span class="hljs-comment">// &lt;link href="https://cdn.quilljs.com/1.2.6/quill.snow.css" rel="stylesheet"&gt;</span>
  114. <span class="hljs-comment">// &lt;script src="https://cdn.quilljs.com/1.2.6/quill.min.js"&gt;&lt;/script&gt;</span>
  115. <span class="hljs-keyword">var</span> quill = <span class="hljs-keyword">new</span> Quill(<span class="hljs-string">'#editor'</span>, {
  116. modules: {
  117. toolbar: <span class="hljs-string">'#toolbar'</span>
  118. },
  119. theme: <span class="hljs-string">'snow'</span>
  120. });
  121. <span class="hljs-comment">// Open your browser's developer console to try out the API!</span>
  122. </pre>
  123. <p><br></p>
  124. <p><br></p>
  125. <p class="ql-align-center"><strong>Built with</strong></p>
  126. <p class="ql-align-center"><span class="ql-formula" data-value="x^2 + (y - \sqrt[3]{x^2})^2 = 1"></span></p>
  127. <p><br></p>
  128. </div>
  129. </div>
  130. </div>
  131. <div id="full-wrapper">
  132. <div id="full-container">
  133. <div class="editor"></div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div id="detail-container">
  142. <div class="container">
  143. <a class="action" href="/docs/download/">Download Now</a>
  144. <h1>An API Driven Rich Text Editor</h1>
  145. </div>
  146. </div>
  147. <div id="features-container">
  148. <div class="container">
  149. <div class="row">
  150. <div class="feature columns">
  151. {% include svg/features/developers.svg %}
  152. <div class="details">
  153. <h2>Built for Developers</h2>
  154. <span>Granular access to the editor's content, changes and events through a simple API. Works consistently and deterministically with JSON as both input and output.</span>
  155. <a class="action-link" href="/docs/">View documentation</a>
  156. </div>
  157. </div>
  158. <div class="feature columns">
  159. {% include svg/features/cross-platform.svg %}
  160. <div class="details">
  161. <h2>Cross Platform</h2>
  162. <span>Supports all modern browsers on desktops, tablets and phones. Experience the same consistent behavior and produced HTML across platforms.</span>
  163. <a class="action-link" href="//github.com/quilljs/quill/#readme">See the Chart</a>
  164. </div>
  165. </div>
  166. </div>
  167. <div id="github-wrapper">
  168. <div id="github-container">
  169. {% include github.html %}
  170. </div>
  171. </div>
  172. <hr>
  173. <div class="feature row">
  174. <div class="columns details">
  175. <h2>Fits Like a Glove</h2>
  176. <span>Used in small projects and giant Fortune 500s alike. Start simple with the Quill core then easily customize or add your own extensions later if your product needs grow.</span>
  177. <a class="action-link" href="/docs/">Learn More</a>
  178. </div>
  179. <div class="columns">
  180. {% include svg/features/scale.svg %}
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. <!-- script -->
  186. <script src="{{site.katex}}/katex.min.js"></script>
  187. <script src="{{site.highlightjs}}/highlight.min.js"></script>
  188. <script src="{{ site.cdn }}{{ site.version }}/{{ site.quill }}"></script>
  189. <script>
  190. (function() {
  191. $(document).ready(function() {
  192. var fonts = ['sofia', 'slabo', 'roboto', 'inconsolata', 'ubuntu'];
  193. var Font = Quill.import('formats/font');
  194. Font.whitelist = fonts;
  195. Quill.register(Font, true);
  196. var bubbleEditor = new Quill('#bubble-container .editor', {
  197. bounds: '#bubble-container .editor',
  198. modules: {
  199. 'formula': true,
  200. 'syntax': true
  201. },
  202. theme: 'bubble'
  203. });
  204. var snowEditor = new Quill('#snow-container .editor', {
  205. bounds: '#snow-container .editor',
  206. modules: {
  207. 'formula': true,
  208. 'syntax': true,
  209. 'toolbar': '#snow-container .toolbar'
  210. },
  211. theme: 'snow'
  212. });
  213. var fullEditor = new Quill('#full-container .editor', {
  214. bounds: '#full-container .editor',
  215. modules: {
  216. 'formula': true,
  217. 'syntax': true,
  218. 'toolbar': [
  219. [{ 'font': fonts }, { 'size': [] }],
  220. [ 'bold', 'italic', 'underline', 'strike' ],
  221. [{ 'color': [] }, { 'background': [] }],
  222. [{ 'script': 'super' }, { 'script': 'sub' }],
  223. [{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
  224. [{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
  225. [ 'direction', { 'align': [] }],
  226. [ 'link', 'image', 'video', 'formula' ],
  227. [ 'clean' ]
  228. ],
  229. },
  230. theme: 'snow'
  231. });
  232. var editors = [bubbleEditor, snowEditor, fullEditor];
  233. switchEditor(1, snowEditor, true);
  234. var initialContent = snowEditor.getContents();
  235. bubbleEditor.setContents(initialContent);
  236. fullEditor.setContents(initialContent);
  237. $('.camera').click(function() {
  238. var index = $(this).index();
  239. $('#above-container').addClass('demo-active');
  240. switchEditor(index, editors[index]);
  241. });
  242. $('#above-container .prev').click(function() {
  243. var index = editors.indexOf(window.quill) - 1;
  244. switchEditor(index, editors[index]);
  245. });
  246. $('#above-container .next').click(function() {
  247. var index = editors.indexOf(window.quill) + 1;
  248. switchEditor(index, editors[index]);
  249. });
  250. var users = [{
  251. 'Intuit': 'https://www.intuit.com/',
  252. 'LinkedIn': 'https://www.linkedin.com/',
  253. 'Microsoft': 'https://www.microsoft.com/',
  254. 'Salesforce': 'https://www.salesforce.com/',
  255. 'Slack': 'https://slack.com/',
  256. }, {
  257. 'Asana': 'https://asana.com/',
  258. 'Gannett': 'http://www.gannett.com/',
  259. 'Gusto': 'https://www.gusto.com/',
  260. 'Hubspot': 'https://www.hubspot.com/',
  261. 'Mode Analytics': 'https://modeanalytics.com/',
  262. 'USA Today': 'https://www.usatoday.com/',
  263. }, {
  264. 'Buffer': 'https://buffer.com/',
  265. 'Front': 'https://frontapp.com/',
  266. 'Lever': 'https://www.lever.co/',
  267. 'Reedsy': 'https://reedsy.com/',
  268. 'Slab': 'https://slab.com/',
  269. 'Vox Media': 'https://www.voxmedia.com/'
  270. }];
  271. // Show users randomly
  272. $('#users-container a').each(function(i, link) {
  273. var bucket = users[i];
  274. var keys = Object.keys(bucket);
  275. var name = keys[Math.floor(Math.random() * keys.length)];
  276. $(link).attr({
  277. href: bucket[name],
  278. title: name,
  279. class: 'user-' + (name.toLowerCase().replace(/\s/g, ''))
  280. });
  281. });
  282. $('#demo-container .ql-editor').one('touchstart', function(event) {
  283. $('#above-container').addClass('demo-active');
  284. event.preventDefault();
  285. });
  286. $('#demo-container .ql-editor').one('focus', function(event) {
  287. if (!$('#above-container').hasClass('demo-active')) {
  288. $('#above-container').addClass('demo-active');
  289. }
  290. });
  291. loadFonts();
  292. $('#carousel-container').animate({ opacity: 1 }, 500);
  293. console.log("Welcome to Quill!\n\nThe editor on this page is available via `quill`. Give the API a try:\n\n\tquill.formatText(11, 4, 'bold', true);\n\nVisit the API documenation page to learn more: https://quilljs.com/docs/api/\n");
  294. });
  295. function loadFonts() {
  296. window.WebFontConfig = {
  297. google: { families: [ 'Inconsolata::latin', 'Ubuntu+Mono::latin', 'Slabo+27px::latin', 'Roboto+Slab::latin' ] }
  298. };
  299. (function() {
  300. var wf = document.createElement('script');
  301. wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  302. wf.type = 'text/javascript';
  303. wf.async = 'true';
  304. var s = document.getElementsByTagName('script')[0];
  305. s.parentNode.insertBefore(wf, s);
  306. })();
  307. }
  308. function switchEditor(i, editor, skip) {
  309. // Expose as global so people can easily try out the API
  310. window.quill = editor;
  311. if (!skip) console.info('window.quill is now bound to', editor);
  312. $('.camera').removeClass('active');
  313. $('.camera:eq(' + i + ')').addClass('active');
  314. $('.prev, .next').css('visibility', 'visible');
  315. if (i === 0) $('.prev').css('visibility', 'hidden');
  316. if (i === 2) $('.next').css('visibility', 'hidden');
  317. $('#carousel-container').css('margin-left', (i*-100) + '%');
  318. }
  319. })();
  320. </script>
  321. <!-- script -->