commit 991cdb70317e227bd3ca700ba9859d6136ad2ba3 Author: tarikjaber <55803936+tarikjaber@users.noreply.github.com> Date: Mon Feb 13 17:25:00 2023 -0500 First commit diff --git a/index.html b/index.html new file mode 100644 index 0000000..262aa0e --- /dev/null +++ b/index.html @@ -0,0 +1,80 @@ + + + +
+ + + +1+
console.log("Hello World!");
+ ${(i + 1).toString().padStart(numLinesDigits)} `;
+ for (let j = 0; j < (lines[i].length) / 98 - 1; j++) {
+ codeLines.innerHTML += `${"".padStart(numLinesDigits)} `;
+ }
+ }
+ codeLines.classList.add("hljs");
+}
+languageSelector.addEventListener('change', () => {
+ code.classList.remove(`language-${selectedLanguage}`);
+ selectedLanguage = languageSelector.value.replace("<", "<").replace(">", ">");
+ code.classList.add(`language-${selectedLanguage}`);
+ localStorage.setItem('language', selectedLanguage);
+ hljs.highlightBlock(code);
+});
+themeSelector.addEventListener('change', () => {
+ themeStylesheet.href = getStylesheet(themeSelector.value);
+ documentTitle.innerHTML = documentNameInput.value;
+ localStorage.setItem('theme', themeSelector.value);
+ hljs.highlightBlock(code);
+});
+function getStylesheet(style) {
+ return `//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/${style}.min.css`;
+}
+window.addEventListener('beforeprint', event => {
+ document.body.classList.add('hljs');
+});
+window.addEventListener('afterprint', event => {
+ document.body.classList.remove('hljs');
+});
diff --git a/styles.css b/styles.css
new file mode 100644
index 0000000..ad58a4d
--- /dev/null
+++ b/styles.css
@@ -0,0 +1,147 @@
+body {
+ font-family: 'Roboto', sans-serif;
+ margin: 0px;
+}
+
+select {
+ padding: 6px;
+ border-radius: 5px;
+}
+
+h1 {
+ margin: 0;
+ padding-bottom: 20px;
+ color: white;
+ background-color: #222831;
+ padding: 20px;
+ margin: -20px -20px 20px -20px;
+}
+
+.options {
+ display: flex;
+ column-gap: 20px;
+ width: 100%;
+ flex-wrap: wrap;
+ row-gap: 14px;
+}
+
+input {
+ padding: 6.5px;
+ border-radius: 5px;
+ border-width: 1px;
+}
+
+.options > * {
+ flex-grow: 2;
+ flex: 1 1 0px;
+}
+
+button {
+ border-width: 0;
+ background-color: dodgerblue;
+ color: white;
+ padding: 6px;
+ min-width: 120px;
+ border-radius: 5px;
+}
+
+button:active {
+ background-color: #5584AC;
+}
+
+textarea {
+ padding: 10px;
+ margin-top: 20px;
+ resize: none;
+ flex-grow: 1;
+ border-radius: 5px;
+}
+
+html, body {
+ height: 100%;
+}
+
+.hide-from-print {
+ height: calc(100% - 40px);
+ padding: 20px;
+ display: flex;
+ flex-direction: column;
+}
+
+pre {
+ margin: 0;
+}
+
+#code-container {
+ display: flex;
+ margin: 0 -20px;
+ font-family: 'Fira Code', monospace;
+}
+
+#document-title {
+ display: none;
+}
+
+code {
+ font-size: 14px;
+ white-space: pre-wrap;
+}
+
+#line-nums {
+ width: auto;
+ font-size: 14px;
+ padding-left: 11px;
+ padding-top: 13px;
+ padding-bottom: 4px;
+ display: inline-block;
+}
+
+#code-div {
+ background-color: #c9d1d9;
+ border-radius: 5px;
+ width: auto;
+ flex: 1;
+ display: inline-block;
+}
+
+#code {
+ margin-left: 2px;
+}
+
+#print-area {
+ padding: 20px;
+ display: none;
+}
+
+a {
+ color: inherit;
+ text-decoration: none;
+}
+
+@media print {
+ body {
+ color-adjust: exact;
+ -webkit-print-color-adjust: exact;
+ }
+
+ #document-title {
+ margin-bottom: 20px;
+ }
+
+ #print-area {
+ display: block;
+ }
+
+ #code-container {
+ margin-top: -20px;
+ }
+
+ .hide-from-print {
+ display: none;
+ }
+}
+
+p {
+ margin-top: 0;
+ margin-bottom: 0;
+}