1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Yjs CodeMirror Example</title>
<link rel=stylesheet href="https://codemirror.net/lib/codemirror.css" async defer>
<style>
.remote-caret {
position: relative;
border-left: 2px solid black;
margin-left: -1px;
margin-right: -1px;
box-sizing: border-box;
}
.remote-caret > div {
white-space: nowrap;
position: absolute;
top: -1.05em;
left: -2px;
font-size: .6em;
background-color: rgb(250, 129, 0);
font-family: serif;
font-style: normal;
font-weight: normal;
line-height: normal;
user-select: none;
color: white;
padding-left: 2px;
padding-right: 2px;
z-index: 3;
transition: opacity .3s ease-in-out;
}
.remote-caret.hide-name > div {
transition-delay: .7s;
opacity: 0;
}
.remote-caret:hover > div {
opacity: 1;
transition-delay: 0s;
}
</style>
</head>
<body>
<button type="button" id="y-connect-btn">Disconnect</button>
<p></p>
<p>
This is a demo of the <a href="https://github.com/yjs/yjs">Yjs</a> ⇔
<a href="https://codemirror.net">CodeMirror</a> binding:
<a href="https://github.com/yjs/y-codemirror">y-codemirror</a>.
</p>
<p>
The content of this editor is shared with every client that visits this
domain.
</p>
<script type="text/javascript" src="../dist/demo.js" async></script>
</body>
</html>
|