forked from LeaVerou/conic-gradient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (17 loc) · 631 Bytes
/
index.js
File metadata and controls
22 lines (17 loc) · 631 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function $$(selector) {
return Array.prototype.slice.call(document.querySelectorAll(selector));
}
$$("#examples article").forEach(function (article, i) {
var style = article.getAttribute("style");
article.removeAttribute("style");
var div = document.createElement("div");
article.appendChild(div);
var textarea = document.createElement("textarea");
textarea.textContent = style;
(textarea.oninput = function() {
var fixed = StyleFix.fix(this.value);
div.setAttribute("style", fixed);
}).call(textarea);
new Incrementable(textarea);
article.appendChild(textarea);
});