Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- copier = {};
- function encodeFile(){
- var filesSelected = document.getElementById("inputFileToLoad").files;
- if (filesSelected.length > 0){
- var fileToLoad = filesSelected[0];
- var fileReader = new FileReader();
- fileReader.onload = function(fileLoadedEvent) {
- let src = fileLoadedEvent.target.result;
- copier.src = src;
- document.getElementById("result").innerHTML = src;
- };
- }
- fileReader.readAsDataURL(fileToLoad);
- }
- (function styleInit() {
- var head=document.getElementsByTagName('head')[0];
- if (!head) {
- return;
- }
- addGlobalStyle(`#styleSetting{padding: 0.2em; margin:0.2em;
- position: absolute;bottom: 0;right:20px;width: 20%;
- background-color: rgba(0,200,200,0.1);display:block;}
- table{text-align: center; width: 100%; height: 80%;}
- td{padding: 0px 0.3em;border: 1px solid black;}`);
- function addGlobalStyle(css) {
- style = document.createElement('style');
- style.type = 'text/css';
- style.innerHTML = css;
- head.appendChild(style);
- }
- })();
- </script>
- <center>
- <h2><i>B64 Encoder</i></h2>
- <input id="inputFileToLoad" type="file" onchange="encodeFile();" />
- <br><br><br>
- <textarea readonly id="result" rows="20" cols="50"></textarea>
- <br><br><br><br><p>made by memesbruh03 <img src="https://memesbruh03.neocities.org/files/images/main/demi.ico"></img></p>
- </center>
- <script>
- document.getElementById("inputFileToLoad").onchange=encodeFile;
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement