Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>BASE 64 ENCODER/DECODER TOOL</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link href="../../../css/style2.css" rel="stylesheet" type="text/css" media="all"/>
- <style>
- body {
- margin:0 calc(50% - 150px);
- background-color:#353535;
- overflow-x:hidden;
- overflow-y:hidden;
- }
- #cont {
- position:absolute;
- width:300px;
- height:100%;
- padding:2px 10px;
- background-color:black;
- margin:0;
- border-right:1px solid #444444;
- border-left:1px solid #444444;
- }
- #cont h1,
- #cont h2 {
- font-family: 'Arial', Helvetica, Sans-Serif;
- font-size:14px;
- font-weight:900;
- text-align:center;
- color:white;
- letter-spacing:1px;
- word-spacing:5px;
- margin:0;
- background-color:blue;
- width:100%;
- }
- #cont h2 {
- font-size:18px;
- background-color:#FE8046;
- color:grey;
- }
- #encoder,
- #coded {
- width:294px;
- height:150px;
- overflow-x:hidden;
- margin:0;
- outline:none;
- }
- .btns {
- position:relative;
- margin-bottom:60px;
- text-align:center;
- padding:0;
- }
- .btns button {
- width:148px;
- height:24px;
- letter-spacing:2px;
- margin:0;
- margin-bottom:5px;
- padding:0;
- font-family:Sans-Serif;
- font-size:16px;
- font-weight:600;
- line-height:24px;
- box-shadow:inset 0 0 7px #000;
- border:none;
- outline:none;
- background-color:#CCCCCC;
- color:#999999;
- }
- .btns button:hover {background-color:yellow;color:#FE8046;}
- .btns button:active {background-color:lime;color:white;}
- hr {
- border: 1px outset yellow;
- width:100%;
- margin:-40px 0 0 0;
- }
- address {
- position:relative;
- margin:0;
- text-align:center;
- color:#EEEEEE;
- letter-spacing:2px;
- }
- .right {float:right;}
- .left {float:left;}
- input:focus {outline:none;}
- </style>
- <script>
- function enCode(){
- var t = document.getElementById('encoder').value;
- document.getElementById('coded').value = btoa(t);
- }
- function deCode(){
- var t = document.getElementById('coded').value;
- document.getElementById('coded').value = atob(t);
- }
- function clearCode(ID){
- document.getElementById(ID).value = "";
- }
- function copyCode(ID){
- var copyText = document.getElementById(ID);
- copyText.select();
- document.execCommand("copy");
- }
- function pasteCode(){
- document.execCommand("paste");
- }
- </script>
- </head>
- <body>
- <div id="cont">
- <h1>BASE 64 ENCODER / DECODER</h1>
- <h2>INPUT</h2>
- <textarea id="encoder" placeholder="Paste text to be processed here."></textarea>
- <div class="btns">
- <button class="left" type="button" onclick="enCode()";>ENCODE</button>
- <button class="right" type="button" onclick="deCode()";>DECODE</button>
- <button class="left" type="button" onclick="copyCode('encoder')";>COPY</button>
- <button class="right" type="button" onclick="clearCode('encoder')";>CLEAR</button>
- </div>
- <h2>OUTPUT</h2>
- <textarea id="coded" placeholder="Encoded/Decoded text appears here."></textarea>
- <div class="btns">
- <button class="left" type="button" onclick="copyCode('coded')";>COPY</button>
- <button class="right" type="button" onclick="clearCode('coded')";>CLEAR</button>
- </div>
- <hr>
- <address>Lionel Mertens ~ 2019</address>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment