-
-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathcodemirror.html
56 lines (56 loc) · 1.52 KB
/
codemirror.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Yjs CodeMirror Example</title>
<script type="text/javascript" src="./dist/codemirror.bundle.js" async></script>
<link rel=stylesheet href="./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 {
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>
</body>
</html>