Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
hazmi-101 authored Aug 18, 2023
1 parent 52809a6 commit 8e293b8
Showing 1 changed file with 203 additions and 119 deletions.
322 changes: 203 additions & 119 deletions tools/text_tools/index.html
Original file line number Diff line number Diff line change
@@ -1,131 +1,215 @@
<!DOCTYPE html>
<html>
<head>
<title>TEXT TOOLS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- ubah warna address bar -->
<meta content="#343434" name="theme-color" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="#343434" name="apple-mobile-web-app-status-bar-style" />
</head>

<head>
<title>TEXT TOOLS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- ubah warna address bar -->
<meta content='#343434' name='theme-color' />
<meta content='yes' name='apple-mobile-web-app-capable' />
<meta content='#343434' name='apple-mobile-web-app-status-bar-style' />
</head>

<body>
<!--
<body>
<!--
untuk yang ingin copas codenya untuk belajar, boleh :)
-->
<style type="text/css" media="all">
a {
outline: none;
color: #0cceff;
text-decoration: none;
}

body {
margin: 0px;
padding: 0px;
font-family: Sans-Serif;
background-color: #343434;
color: #ffffff;
word-wrap: break-word;
}

.center {
text-align: center;
}

#menu {
margin: 5px;
background-color: #838383;
color: #ffffff;
border: none;
font-size: 30px;
outline: none;
}

#kotak {
width: 300px;
height: 300px;
background-color: #000000;
color: #ffffff;
resize: none;
outline: none;
border: none;
display: block;
margin-left: auto;
margin-right: auto;
}

.bikinregex {
background-color: #000000;
color: #ffffff;
outline: none;
border: none;
}

.footer {
width: 100%;
background-color: #ffffff;
color: #000000;
display: inline-block;
}
</style>
<div class="center">
<h1>TEXT TOOLS BY <a href="https://t.me/hazmi101">@Hazmi101</a> VERSI 2.0</h1><br>
<h2>masukan text dibawah:</h2>
<textarea id="kotak"></textarea>
<h2>menu:</h2>
<button id="menu" onclick="salin()">SALIN</button>
</span>
<button id="menu" onclick="hapustab()">HAPUS TAB</button>
<button id="menu" onclick="h()">HAPUS SEPASI BERLEBIH</button>
<button id="menu" onclick="u()">HAPUS KARAKTER NON-ASCII</button>
<button id="menu" onclick="n()">HAPUS ENTER BERLEBIH</button>
<h2>untuk yang mengerti <a href="https://www.w3schools.com/jsref/jsref_obj_regexp.asp">RegEx</a> bisa custom sendiri sesuai keinginan</h2>
<h1>buat regex sendiri:<br>/<input type="text" class="bikinregex" style="font-size:30px;width:150px;" id="k1">/<input type="text" class="bikinregex" style="font-size:30px;width:50px;" id="k2" value="gi">
<br>ganti dengan:<br>
<input type="text" class="bikinregex" style="font-size:30px;width:150px;" id="k3"><br><button onclick="g()" id="menu">GANTI</button><br></h1>
<div class="footer">
<h3>tools ini dibuat oleh <a href="https://t.me/hazmi101">@Hazmi101</a> untuk tujuan pembelajaran, untuk yang sedang belajar html anda juga boleh menggunakan code dari tools ini untuk belajar</h3>
<style type="text/css" media="all">
a {
outline: none;
color: #0cceff;
text-decoration: none;
}

body {
margin: 0px;
padding: 0px;
font-family: Sans-Serif;
background-color: #343434;
color: #ffffff;
word-wrap: break-word;
}

.center {
text-align: center;
}

#menu {
margin: 5px;
background-color: #838383;
color: #ffffff;
border: none;
font-size: 30px;
outline: none;
}

#kotak {
width: 300px;
height: 300px;
background-color: #000000;
color: #ffffff;
resize: none;
outline: none;
border: none;
display: block;
margin-left: auto;
margin-right: auto;
}

.bikinregex {
background-color: #000000;
color: #ffffff;
outline: none;
border: none;
}

.footer {
width: 100%;
background-color: #ffffff;
color: #000000;
display: inline-block;
}
</style>
<div class="center">
<h1>
TEXT TOOLS BY <a href="https://t.me/hazmi101">@Hazmi101</a> VERSI 2.5
</h1>
<br />
<h2>masukan text dibawah:</h2>
<textarea id="kotak"></textarea>
<h2>menu:</h2>
<button id="menu" onclick="salin()">SALIN</button>
<button id="menu" onclick="hapustab()">HAPUS TAB</button>
<button id="menu" onclick="h()">HAPUS SEPASI BERLEBIH</button>
<button id="menu" onclick="u()">HAPUS KARAKTER NON-ASCII</button>
<button id="menu" onclick="n()">HAPUS ENTER BERLEBIH</button>
<button id="menu" onclick="simpan()">SIMPAN</button>
<button id="menu" onclick="muat()">MUAT</button>
<button id="menu" onclick="kosong()">KOSONGKAN</button>
<h2>
untuk yang mengerti
<a href="https://www.w3schools.com/jsref/jsref_obj_regexp.asp">RegEx</a>
bisa custom sendiri sesuai keinginan
</h2>
<h1>
buat regex sendiri:<br />/<input
type="text"
class="bikinregex"
style="font-size: 30px; width: 150px"
id="k1"
/>/<input
type="text"
class="bikinregex"
style="font-size: 30px; width: 50px"
id="k2"
value="gi"
/>
<br />ganti dengan:<br />
<input
type="text"
class="bikinregex"
style="font-size: 30px; width: 150px"
id="k3"
/><br /><input
type="checkbox"
id="aktif1"
style="width: 24px; height: 24px"
checked="checked"
/><span> Escape</span><br /><button onclick="g()" id="menu">
GANTI</button
><br />
</h1>
<div class="footer">
<h3>
tools ini dibuat oleh
<a href="https://t.me/hazmi101">@Hazmi101</a> untuk tujuan
pembelajaran, untuk yang sedang belajar html anda juga boleh
menggunakan code dari tools ini untuk belajar
</h3>
</div>
</div>
</div>
<script>
function g() {
try {
document.getElementById("kotak").value = document.getElementById("kotak").value.replace(new RegExp(document.getElementById("k1").value, document.getElementById("k2").value), document.getElementById("k3").value.toString())
}
catch (e) {
alert("PESAN ERROR:\n" + e.toString());
}
}

function n() {
document.getElementById("kotak").value = document.getElementById("kotak").value.replace(/\n+/g, "\n").replace(/^\n|\n$/g, "")
};

function u() {
document.getElementById("kotak").value = document.getElementById("kotak").value.replace(/[^\x00-\x7F]/g, "")
};

function h() {
document.getElementById("kotak").value = document.getElementById("kotak").value.replace(/\ +/gi, " ")
};

function hapustab() {
document.getElementById("kotak").value = document.getElementById("kotak").value.replace(/^(\u0009+)?( +)?/gim, "").replace(/(\u0009+)?( +)?$/gim, "")
};

function salin() {
var dom = document.getElementById("kotak");
dom.select();
dom.setSelectionRange(0, dom.value.length)
document.execCommand("copy");
};
</script>
</body>
<script>
function simpan() {
document.cookie =
"50164a16-f0f9-4162-abea-18cf997819fc=" +
encodeURIComponent(document.getElementById("kotak").value);
}
function muat() {
var name = "50164a16-f0f9-4162-abea-18cf997819fc";
var value = `; ${document.cookie}`;
var parts = value.split(`; ${name}=`);
if (parts.length === 2) {
const cookieValue = parts.pop().split(";").shift();
document.getElementById("kotak").value =
decodeURIComponent(cookieValue);
}
}

function kosong() {
document.getElementById("kotak").value = "";
document.getElementById("k1").value = "";
document.getElementById("k2").value = "gi";
document.getElementById("k3").value = "";
document.getElementById("aktif1").checked = true;
}

function g() {
try {
var dengan = eval(
'"' + String(document.getElementById("k3").value) + '"'
);
if (document.getElementById("aktif1").checked == false) {
dengan = String(document.getElementById("k3").value);
}
document.getElementById("kotak").value = document
.getElementById("kotak")
.value.replace(
new RegExp(
document.getElementById("k1").value,
document.getElementById("k2").value
),
dengan
);
} catch (e) {
alert("PESAN ERROR:\n" + e.toString());
}
}

function n() {
document.getElementById("kotak").value = document
.getElementById("kotak")
.value.replace(/\n+/g, "\n")
.replace(/^\n|\n$/g, "");
}

function u() {
document.getElementById("kotak").value = document
.getElementById("kotak")
.value.replace(/[^\x00-\x7F]/g, "");
}

function h() {
document.getElementById("kotak").value = document
.getElementById("kotak")
.value.replace(/\ +/gi, " ");
}

function hapustab() {
document.getElementById("kotak").value = document
.getElementById("kotak")
.value.replace(/^(\u0009+)?( +)?/gim, "")
.replace(/(\u0009+)?( +)?$/gim, "");
}

function salin() {
var dom = document.getElementById("kotak");
dom.select();
dom.setSelectionRange(0, dom.value.length);
document.execCommand("copy");
}
</script>
</body>
</html>

0 comments on commit 8e293b8

Please sign in to comment.