UNPKG

@cocreate/cursors

Version:

Collaborative user cursor position for inputs, textarea's and contenteditable elements.

261 lines (253 loc) 8.05 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>CoCreate-cursor Documentation | CoCreateJS</title> <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico" /> <meta name="description" content="A simple HTML5 and pure javascript component. Easy configuration using HTML5 attributes or Javscript api and highly styleable." /> <meta name="keywords" content="helper classes, utility classes, css framework, css library, inline style classes" /> <meta name="robots" content="index,follow" /> <meta property="og:image" content="https://cdn.cocreate.app/docs/boilerplate.png" /> <link rel="stylesheet" href="../index.css" array="files" object="60888216117c640e7596303f" key="src" type="text/css" save="true" /> <link rel="manifest" href="/manifest.webmanifest" /> </head> <body> <!-- Navbar --> <nav class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px" content_id="content" scroll="sticky-nav," scroll-up="5" scroll-down="5" path="../" src="../components/navbar.html"></nav> <sidenav id="menuL" class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl" resizable resize-query="[content_id='content']" resize-property="margin-left" resize-value="width"> <menu array="files" object="603717b07de7fb350ae9fec8" key="src"></menu> <div resize="right"></div> </sidenav> <main class="padding-top:15px padding:15px@lg@xl" content_id="content" id="cocreate-cursor"> <div class="display:flex flex-wrap:wrap justify-content:space-between"> <div class="display:flex align-items:center"> <h2>CoCreate-cursor</h2> </div> <div class="display:flex align-items:center font-size:20px" share-height="600" share-width="500" share-media="https://via.placeholder.com/300/09f/fff.png"> <a href="https://github.com/CoCreate-app/CoCreate-cursor" target="_blank" class="margin-right:15px" ><i src="/assets/svg/github.svg"></i ></a> <a class="margin-right:15px share" share-network="twitter" title="Share on twitter" ><i src="/assets/svg/twitter.svg"></i ></a> <a class="margin-right:15px share" share-network="facebook" title="Share on Facebook" ><i src="/assets/svg/facebook.svg"></i ></a> <a class="margin-right:15px share" share-network="instagram" title="Share on instagram" ><i src="/assets/svg/instagram.svg"></i ></a> <a class="margin-right:15px share" share-network="share" title="Share on share" ><i src="/assets/svg/share-alt.svg"></i ></a> </div> </div> <p class="max-width:500px margin:20px_0px"> A simple component of HTML5, CSS and pure JavaScript. Easy configuration using data attributes and highly stylizable, whose objective is to provide a shared cursor in an html element (input, textarea or div [content-editable]) </p> <div id="cursor-section" class="display:flex flex-wrap:wrap"> <div class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px"> <h2 class="border-bottom:1px_solid_lightgrey padding:5px_0px"> Install </h2> <pre><code class="language-javascript">npm install cocreate-cursors</code></pre> <p class="padding:10px_0px">Or you can use cdn link:</p> <pre><code class="language-javascript">https://cdn.cocreate.app/CoCreate-cursors.min.js</code></pre> <h2 class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px"> Usage </h2> <div class=""> <p class="padding:10px_0px">This is cursor reference</p> <div class="flex-grow:1 min-width:300px width:100%"> <pre> <code> &lt;form array=&quot;module_activities&quot; class=&quot;margin:20px&quot;&gt; &lt;textarea cursors=&quot;true&quot; array=&quot;module_activities&quot; object=&quot;5edda7608d5c7a7d656edecd&quot; key=&quot;text_area&quot; placeholder=&quot;Text Area&quot; class=&quot;floating-label&quot;&gt; &lt;/textarea&gt; &lt;/form&gt; </code> </pre> </div> <p class="padding:10px_0px">This is cursor reference</p> </div> <h2 class="border-bottom:1px_solid_lightgrey padding:5px_0px"> Attributes </h2> <ul class="list-style-type:none"> <li class="padding:15px_0px border-bottom:1px_solid_lightgrey"> <h4> <span>-</span> <span class="cocreate-badge success" >string</span > <span class="cocreate-badge warning" >optional</span > </h4> <p> It has no data attributes, the cursor starts automatically for elements with realtime = true </p> </li> </ul> </div> <div class="flex-grow:1 width:300px padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey"> <!-- SandBox --> <h2 class="border-bottom:1px_solid_lightgrey padding:5px_0px"> Demo </h2> <div class="position:sticky top:0 padding:15px_0px height:100vh"> <!-- SandBox --> <div class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground"> <div id="demo-code" resizable class="position:relative height:50%"> <textarea type="code" lang="html" array="demos" object="" key="demo" save="false" id="demo" class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea> <div resize="bottom" class="background:lightgrey"></div> </div> <div id="demo-preview" class="position:relative overflow:auto background-color:white"> <div class="demopreview padding:20px"></div> </div> <div class="font-size:20px position:absolute top:10px right:10px opacity:0.6"> <a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-query="#demo-code" ><i class="height:18px" src="/assets/svg/eye.svg"></i ></a> <a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-query="#demo-code" ><i src="/assets/svg/eye-slash.svg"></i ></a> <a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code" ><i src="/assets/svg/code.svg"></i ></a> <a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash" ><i class="height:18px" src="/assets/svg/code.svg"></i ></a> <a class="margin-right:5px" fullscreen fullscreen-query="#playground"></a> </div> </div> <!-- End SandBox --> </div> </div> </div> </main> <script src="https://CoCreate.app/dist/CoCreate.js"></script> </body> </html>