-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (120 loc) · 4.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Online Html Editor v4">
<meta name="keywords" content="code editor, html editor, editor">
<meta name="copyright" content="amit gajare">
<meta name="subtitle" content="Free Html Editor">
<meta name="rating" content="General">
<meta name="owner" content="Amit Gajare">
<meta name="author" content="Amit GAjare">
<title>HTML Editor</title>
<link href="https://fonts.googleapis.com/css2?family=Dosis:wght@300&family=Raleway:wght@300&family=Silkscreen&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.1/css/all.min.css'><link rel="stylesheet" href="./style.css">
<!-- Custom Styles -->
<link rel="stylesheet" href="desktop.css">
</head>
<body>
<!-- header -->
<header class="header">
<input class="input" id="inputFileNameToSaveAs" placeholder="Enter Name" value="index.html" autocomplete="off">
</header>
<!-- main box -->
<section class="main" id="mainbox">
<textarea id="inputTextToSave" class="codebox" placeholder="Write Here Code">
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Project X</title>
<style>
</style>
</head>
<body>
<h1>Hello, Amit</h1>
<script>
</script>
</body>
</html>
</textarea>
<div class="button">
<button class="runbtn" id="runbtn" onclick="runcode()">RUN</button>
<button id="copybtn" onclick="myFunction()">COPY</button>
<button id="downbtn" onclick="saveTextAsFile()">DOWNLOAD</button>
</div>
<div class="loadfile">
<input type="file" id="fileUpload" />
</div>
</section>
<!-- pop box -->
<!-- output display -->
<div id="output">
<button class="backbtn" onclick="back()">Back</button>
<iframe id="display"></iframe>
</div>
<!-- footer -->
<footer id="footer">
<img src="logo.png" alt="logo.png" class="footer_logo">
<div class="copyright" >
<script>
document.write('©' );
document.write(' 2020 - ');
document.write(new Date().getFullYear());
document.write(' Amit Gajare - All Rights Reserved.');
</script>
</div>
</footer>
<div class="fab-wrapper">
<input id="fabCheckbox" type="checkbox" class="fab-checkbox" />
<label class="fab" for="fabCheckbox">
<span class="fab-dots fab-dots-1"></span>
<span class="fab-dots fab-dots-2"></span>
<span class="fab-dots fab-dots-3"></span>
</label>
<div class="fab-wheel">
<a class="fab-action fab-action-1" onclick="darkmod()">
<i class="fas fa-moon"></i>
</a>
<a class="fab-action fab-action-2" href="https://amitgajare.hashnode.dev/" target="_blank">
<i class="fas fa-skull"></i>
</a>
<a class="fab-action fab-action-3" href="https://colorhunt.co/" target="_blank">
<i class="fas fa-palette"></i>
</a>
<a class="fab-action fab-action-4">
<i class="fas fa-share"></i>
</a>
</div>
</div>
<!-- Project -->
<script>
function saveTextAsFile(){
var textToSave = document.getElementById("inputTextToSave").value;
var textToSaveAsBlob = new Blob([textToSave], {type:"text/plain"});
var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
var fileNameToSaveAs = document.getElementById("inputFileNameToSaveAs").value;
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download File";
downloadLink.href = textToSaveAsURL;
downloadLink.onclick = destroyClickedElement;
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
downloadLink.click();
}
function destroyClickedElement(event){
document.body.removeChild(event.target);
}
</script>
<script src="main.js"></script>
</body>
</html>
<!--
font-family: 'Dosis', sans-serif;
font-family: 'Silkscreen', cursive;
font-family: 'Raleway', sans-serif;
-->