-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtyper.html
135 lines (124 loc) · 3.28 KB
/
typer.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
135
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>ShevamV@Terminal $ Typer</title>
<style id="webmakerstyle">
body {
padding: 5px;
margin: 0;
color: green;
font-family: monospace;
font-size: 15px;
background: black;
}
.options {
border: 1px solid green;
margin: 5px;
border-radius: 15px;
}
textarea {
color: green;
margin: 5px;
font-family: monospace;
font-size: 15px;
background: black;
padding: 8px;
width: 100%;
height: auto;
min-height: 400px;
border: 0;
outline: 0;
}
button {
border: 0;
border-radius: 25px;
background: green;
padding: 5px;
margin: 5px;
font-size: 15px;
width: 100px;
cursor: pointer; /* Added cursor style to indicate clickability */
}
#filen {
margin: 5px;
margin-left: 15px;
margin-right: 20%;
border: 0;
background: 0;
color: green;
font-family: monospace;
font-size: 15px;
cursor: text; /* Added cursor style for text input */
}
textarea:focus, #filen:focus {
outline: none;
border: none;
background: 0;
}
textarea::selection {
color: black;
background-color: green;
}
a {
margin: 10px;
color: green;
font-size: 25px;
font-family: monospace;
text-decoration: none; /* Added to remove underline from link */
}
::placeholder {
color: green;
}
::-webkit-scrollbar {
width: 0;
}
</style>
</head>
<body>
<div>
<a href="index.html">ShevamV@Terminal $</a>
<!--ShevamV@Terminal $ Typer
Version 1.0.2 -->
<div class="options" align="center">
<input id="filen" value="index.txt" placeholder="filename" />
<button onclick="downloadText()">Download</button>
</div>
</div>
<textarea
placeholder="Type Command..."
id="data"
oninput="autoSave()"
></textarea>
<script>
// Function to automatically save text to local storage on input
function autoSave() {
const textToSave = document.getElementById("data").value;
localStorage.setItem("savedText", textToSave);
}
// Function to load text from local storage on page startup
window.onload = function () {
const savedText = localStorage.getItem("savedText");
if (savedText !== null) {
document.getElementById("data").value = savedText;
}
};
function downloadText() {
try {
const textToDownload = document.getElementById("data").value;
const fileName = document.getElementById("filen").value || "index.txt";
const blob = new Blob([textToDownload], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
} catch (error) {
console.error(error);
}
}
</script>
</body>
</html>