-
-
Save Hajto/58200e676426f6b00535827daac388cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Editor = function(el){ | |
this.element = el | |
this.cursors = [] | |
this.lines = [] | |
} | |
Editor.prototype.creatLine = function (linenum){ | |
var that = this | |
var el = document.createElement("p") | |
el.addEventListener("click",function(){ | |
that.lines.push(el) | |
console.log(that.lines) | |
},true); | |
this.element.appendChild(el) | |
} | |
var edit | |
window.onload = function(){ | |
edit = new Editor(document.getElementsByClassName("editor")[0]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>edytor</title> | |
<link rel="stylesheet" href="style.css"> | |
<meta charset="utf-8"> | |
<script src="editor.js"></script> | |
</head> | |
<body> | |
<div class="editor"> | |
<p>abc</p> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.editor { | |
background-color: #1f1f1f; | |
font-size: 25px; | |
color: #f1f1f1 | |
} | |
.editor p{ | |
min-height: 25px; | |
padding:0 2rem; | |
margin: 0; | |
} | |
body { | |
font-family: "consolas" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment