Cara Menggunakannya :
1. Copylah Text Di Bawah ini
2. Setelah
Di Copy , Paste Text Kedalam Addreas Browser
3. Selesai ,
Contoh 1 : Editor Standar
1 | data:text/html, < html contenteditable> |
Copy Paste script diatas ke Address Bar di browser kamu, Setelah itu cobalah mengetik di halaman kosong yang terbentuk, anda bisa melakukan penyimpanan dari apa yang diketik dengan menekan CTRL+S atau MenuFile->Save
Mengubah Tampilan Editor.Ternyata tampilan editor di browsernya pun kita bisa ubah, kita bisa membuatnya mirip dengan notepad, sublime-text dan bahkan bisa kita buat seperti kertas untuk menulis diary.
Contoh 2 : Seperti Notepad
Dengan ini kita bisa menambahkan Teks awalannya.
1 | data:text/html, < html contenteditable>< style >body {color: #333; width: 960px; margin: 0 auto; display: block; height: 100%; font-size: 36px; padding: 20px;}</ style ></ html > |
Contoh 3 : seperti Sublime Text
1 | data:text/html,< title >DoJS</ title >< style type = "text/css" >#e{font-size: 16px; position:absolute;top:0;right:0;bottom:0;left:0;}</ style >< div id = "e" ></ div >< script src = "http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type = "text/javascript" charset = "utf-8" ></ script >< script >var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");</ script > |
Contoh 4 : Diary / Text Notes
Seperti kita sebutkan tadi, kita bisa membuat seolah seperti kertas diary yang siap untuk ditulis, silahkan copy paste script berikut ke URL Address di browser.
1 | data:text/html;charset=utf-8, < title >TextEditor</ title > |
5 | background: -webkit-linear-gradient(#f0f0f0, #fff); |
12 | font: normal 14px "Lucida Grande", arial, sans-serif; |
16 | padding: 6px 5px 4px 42px; |
20 | border: 1px solid #d2d2d2; |
22 | background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; |
23 | background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; |
24 | background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; |
25 | background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; |
26 | background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; |
27 | background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; |
28 | -webkit-background-size: 100% 20px; |
29 | -moz-background-size: 100% 20px; |
30 | -ms-background-size: 100% 20px; |
31 | -o-background-size: 100% 20px; |
32 | background-size: 100% 20px; |
33 | -webkit-border-radius: 3px; |
34 | -moz-border-radius: 3px; |
36 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.07); |
37 | -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.07); |
38 | box-shadow: 0 1px 2px rgba(0,0,0,0.07); |
49 | border-color: transparent #efe4e4; |
60 | background: transparent; |
62 | }">< h1 >Text Editor</ h1 > |
67 | < body OnLoad = 'document.body.focus();' contenteditable spellcheck = "true" class = "paper" > |
Contoh 5 : Mirip Ruby Editor
1 | data:text/html, < style type = "text/css" >#e{position:absolute;top:0;right:0;bottom:0;left:0;}</ style >< div id = "e" ></ div >< script src = "http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type = "text/javascript" charset = "utf-8" ></ script >< script >var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</ script > |
Contoh 6 : Animasi transisi warna ketika mengetik kode
1 | data:text/html, < html >< head >< link href = 'http://fonts.googleapis.com/css?family=Open+Sans' rel = 'stylesheet' type = 'text/css' >< style type = "text/css" > html { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</ style >< script >window.onload=function(){var e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</ script ></ head >< body contenteditable style = "font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;" > |
Contoh 7 : Agar kursor langsung fokus
1 | data:text/html, < textarea style = "font-size: 1.5em; width: 100%; height: 100%; border: none; outline: none" autofocus /> |
Contoh 8 : Ditambah Placeholder
1 | data:text/html, < style >html,body{margin: 0; padding: 0;}</ style >< textarea style = "font-size: 1.5em; line-height: 1.5em; background: %23000; color: %233a3; width: 100%; height: 100%; border: none; outline: none; margin: 0; padding: 90px;" autofocus placeholder = "Dayemdra Editor..." /> |
Contoh 9 : Bisa diberi title
Agar ketika di bookmark ada judul yang bagus, kita bisa tambahkan tag title
1 | data:text/html, < title >Text Editor</ title >< body contenteditable style = "font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;" > |
Contoh 10 : Dengan Merubah Font agar lebih keren
1 | data:text/html;charset=utf-8, < title >TextEditor</ title >< body contenteditable style = "font-size:2rem;font-family:monaco;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;" spellcheck = "false" >< h1 >TWD Editor</ h1 >< p >Start Here. |
Contoh 11 : Kita juga bisa membuat file HTML
Tinggal jalankan, lalu bookmark, untuk mengetik tinggal arahkan kursor
Editor.html |
Demo
3 | < title >html5 notepad</ title > |
6 | var n = document.getElementsByTagName('textarea')[0]; |
7 | n.onchange = function(){localStorage.setItem("n",n.value);} |
8 | n.value = localStorage.getItem("n"); |
1 | data:text/html;charset=utf-8, < title >TextEditor</ title > < link rel = "shortcut icon" href = "http://g.etfv.co/https://docs.google.com" /> < style > html{height: 100%;} body{background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 3%; height: 94%;} .paper { font: normal 12px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-background-size: 100% 20px; -ms-background-size: 100% 20px; -o-background-size: 100% 20px; background-size: 100% 20px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.07); -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.07); box-shadow: 0 1px 2px rgba(0,0,0,0.07); } .paper::before { content: ''; position: absolute; width: 4px; top: 0; left: 30px; bottom: 0; border: 1px solid; border-color: transparent #efe4e4; } textarea{display: block; width:94%;margin:0 auto;padding:3.8% 3%; border: none; outline: none; height: 94%; background: transparent; line-height: 20px;} </ style > < body spellcheck = "false" > < div class = "paper" > < textarea autofocus = "autofocus" ></ textarea > </ div > </ body > </ html > |
Oke sekian trik menarik dari
Dayendra , sebagai catatan, untuk menjalankannya anda cukup melakukan copy paste kode-kode diatas ke Address bar di browser kamu, Disarankan Menggunakan Google Chrome
Cara Membuat Browser Seperti Notepad
4/
5
Oleh
Unknown