index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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-slab" href="https://www.slab.com/" target="_blank" title="Slab"></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. 'syntax': true
  200. },
  201. theme: 'bubble'
  202. });
  203. var snowEditor = new Quill('#snow-container .editor', {
  204. bounds: '#snow-container .editor',
  205. modules: {
  206. 'syntax': true,
  207. 'toolbar': '#snow-container .toolbar'
  208. },
  209. theme: 'snow'
  210. });
  211. var fullEditor = new Quill('#full-container .editor', {
  212. bounds: '#full-container .editor',
  213. modules: {
  214. 'syntax': true,
  215. 'toolbar': [
  216. [{ 'font': fonts }, { 'size': [] }],
  217. [ 'bold', 'italic', 'underline', 'strike' ],
  218. [{ 'color': [] }, { 'background': [] }],
  219. [{ 'script': 'super' }, { 'script': 'sub' }],
  220. [{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
  221. [{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
  222. [ {'direction': 'rtl'}, { 'align': [] }],
  223. [ 'link', 'image', 'video', 'formula' ],
  224. [ 'clean' ]
  225. ],
  226. },
  227. theme: 'snow'
  228. });
  229. var editors = [bubbleEditor, snowEditor, fullEditor];
  230. switchEditor(1, snowEditor, true);
  231. var initialContent = snowEditor.getContents();
  232. bubbleEditor.setContents(initialContent);
  233. fullEditor.setContents(initialContent);
  234. $('.camera').click(function() {
  235. var index = $(this).index();
  236. $('#above-container').addClass('demo-active');
  237. switchEditor(index, editors[index]);
  238. });
  239. $('#above-container .prev').click(function() {
  240. var index = editors.indexOf(window.quill) - 1;
  241. switchEditor(index, editors[index]);
  242. });
  243. $('#above-container .next').click(function() {
  244. var index = editors.indexOf(window.quill) + 1;
  245. switchEditor(index, editors[index]);
  246. });
  247. var users = [{
  248. 'Intuit': 'https://www.intuit.com/',
  249. 'LinkedIn': 'https://www.linkedin.com/',
  250. 'Microsoft': 'https://www.microsoft.com/',
  251. 'Salesforce': 'https://www.salesforce.com/',
  252. 'Slack': 'https://slack.com/',
  253. }, {
  254. 'Asana': 'https://asana.com/',
  255. 'Airtable': 'https://airtable.com/',
  256. 'Grammarly': 'https://www.grammarly.com/',
  257. 'Gusto': 'https://www.gusto.com/',
  258. 'Vox Media': 'https://www.voxmedia.com/',
  259. }, {
  260. 'Buffer': 'https://buffer.com/',
  261. 'Front': 'https://frontapp.com/',
  262. 'Lever': 'https://www.lever.co/',
  263. 'Reedsy': 'https://reedsy.com/',
  264. 'Slab': 'https://slab.com/',
  265. }];
  266. // Show users randomly
  267. $('#users-container a').each(function(i, link) {
  268. var bucket = users[i];
  269. var keys = Object.keys(bucket);
  270. var name = keys[Math.floor(Math.random() * keys.length)];
  271. $(link).attr({
  272. href: bucket[name],
  273. title: name,
  274. class: 'user-' + (name.toLowerCase().replace(/\s/g, ''))
  275. });
  276. });
  277. $('#demo-container .ql-editor').one('touchstart', function(event) {
  278. $('#above-container').addClass('demo-active');
  279. event.preventDefault();
  280. });
  281. $('#demo-container .ql-editor').one('focus', function(event) {
  282. if (!$('#above-container').hasClass('demo-active')) {
  283. $('#above-container').addClass('demo-active');
  284. }
  285. });
  286. loadFonts();
  287. $('#carousel-container').animate({ opacity: 1 }, 500);
  288. 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");
  289. });
  290. function loadFonts() {
  291. window.WebFontConfig = {
  292. google: { families: [ 'Inconsolata::latin', 'Ubuntu+Mono::latin', 'Slabo+27px::latin', 'Roboto+Slab::latin' ] }
  293. };
  294. (function() {
  295. var wf = document.createElement('script');
  296. wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  297. wf.type = 'text/javascript';
  298. wf.async = 'true';
  299. var s = document.getElementsByTagName('script')[0];
  300. s.parentNode.insertBefore(wf, s);
  301. })();
  302. }
  303. function switchEditor(i, editor, skip) {
  304. // Expose as global so people can easily try out the API
  305. window.quill = editor;
  306. if (!skip) console.info('window.quill is now bound to', editor);
  307. $('.camera').removeClass('active');
  308. $('.camera:eq(' + i + ')').addClass('active');
  309. $('.prev, .next').css('visibility', 'visible');
  310. if (i === 0) $('.prev').css('visibility', 'hidden');
  311. if (i === 2) $('.next').css('visibility', 'hidden');
  312. $('#carousel-container').css('margin-left', (i*-100) + '%');
  313. }
  314. })();
  315. </script>
  316. <!-- script -->