From d4f4156ecfa77b67b92dd2a9cc4bf55fd2513da4 Mon Sep 17 00:00:00 2001 From: Offroaders123 <65947371+Offroaders123@users.noreply.github.com> Date: Tue, 26 May 2020 14:24:17 -0700 Subject: [PATCH] First Upload! This is the most up to date version of my text editor as of May 26, 2020. I plan to add more changes as time goes on! --- README.md | 11 + Smart Text Editor.html | 442 +++++++++++++++++++++++++---------------- 2 files changed, 284 insertions(+), 169 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d536ada --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Smart Text Editor +The text editor that requires only a browser and a keyboard! + +This is a project that I am working on in my free time, and it has turn into something really useful! + +## How to Use +This project can be opened with GitHub Pages, as well as downloaded to your device if you would like it to access local files for building HTML projects. + +[Run the text editor with GitHub Pages](https://offroaders123.github.io/Smart-Text-Editor/Smart%20Text%20Editor.html) + +I have plans to add more information here in the future! diff --git a/Smart Text Editor.html b/Smart Text Editor.html index 53dda9e..c788c78 100644 --- a/Smart Text Editor.html +++ b/Smart Text Editor.html @@ -7,9 +7,10 @@ + @@ -31,8 +32,8 @@ } html { --body: #111111; - --font-family-sans-serif: "Arial", sans-serif; - --font-family-monospace: "Consolas", monospace; + --font-family-sans-serif: "Rubik", sans-serif; + --font-family-monospace: "Cousine", monospace; --container-dark: #171717; --container-medium: #1c1c1c; @@ -56,10 +57,11 @@ --textarea-drag-light-background: #aaaaea; --textarea-drag-border: #0000ff; - --border-radius: min(1vw, 4px); + --card-background: #17171760; + + --border-radius: min(1.25vw, 5px); --box-shadow-color: #000000bf; --outline: var(--text-medium); - --modal-blur: blur(4px); --text-super-dark: #000000; --text-dark: #aaaaaa; @@ -67,6 +69,8 @@ --text-info: #777777; --text-light: #ffffff; --text-hover: #ffffff; + --text-selection-color: var(--text-super-dark); + --text-selection-background: #b4d5ffbf; --scrollbar: #7a7a7a; --scrollbar-hover: #9a9a9a; @@ -75,15 +79,12 @@ --transition-medium: 0.25s; --transition-fast: 0.125s; - background: #808080; - transition: opacity 0.25s; + --fade-opacity: 0; + --fade-pointer-events: none; } - @media (prefers-reduced-motion: reduce), (update: slow) { - html { - --transition-slow: 0s; - --transition-medium: 0s; - --transition-fast: 0s; - } + html.fade { + --fade-opacity: 1; + --fade-pointer-events: all; } body { width: 100vw; @@ -94,21 +95,35 @@ overflow: hidden; user-select: none; } + body::after { + content: ""; + position: absolute; + width: 100%; + height: 100%; + background: var(--container-medium); + opacity: var(--fade-opacity); + pointer-events: var(--fade-pointer-events); + z-index: 3; + transition: opacity 0.25s; + } button { padding: min(0.5vw, 2px) min(1vw, 8px); min-width: min(8vw, 75px); color: var(--text-dark); - font-size: min(2.5vw, 14px); + font-size: min(2.5vw, 14.5px); background: var(--button); border: none; border-radius: var(--border-radius); - box-shadow: 0 min(0.5vw, 2px) min(2vw, 8px) var(--box-shadow-color), 0 0 0 min(0.25vw, 1px) var(--focus-border) inset; + box-shadow: 0 min(0.75vw, 3px) min(1vw, 4px) calc(min(0.5vw, 2px) * -1) var(--box-shadow-color), 0 0 0 min(0.25vw, 1px) var(--focus-border) inset; --focus-border: transparent; cursor: pointer; outline: none; transition: var(--transition-fast); transition-property: color, background; } + button::-moz-focus-inner { + border: none; + } button:hover, button:focus { color: var(--text-hover); background: var(--button-hover); @@ -117,14 +132,26 @@ --focus-border: var(--outline); } textarea, [type="text"] { + --color: var(--text-super-dark); + color: var(--color); font-size: 13px; border: none; outline: none; } textarea { + font-family: var(--font-family-sans-serif); white-space: pre; resize: none; } + ::placeholder { + color: var(--color); + opacity: 0.55; + white-space: pre-wrap; + } + ::selection { + color: var(--text-selection-color); + background: var(--text-selection-background); + } [type="range"] { margin-bottom: min(1vw, 4px); width: min(25vw, 130px); @@ -148,9 +175,22 @@ transition: background var(--transition-fast); -webkit-appearance: none; } + ::-moz-range-thumb { + margin-top: calc(min(1.75vw, 7px) * -1); + width: min(2.75vw, 12px); + height: min(5vw, 20px); + background: var(--range-thumb); + border: none; + border-radius: var(--border-radius); + box-shadow: 0 min(0.5vw, 2px) min(2vw, 8px) var(--box-shadow-color); + transition: background var(--transition-fast); + } :hover::-webkit-slider-thumb, :focus::-webkit-slider-thumb { background: var(--range-thumb-hover); } + :hover::-moz-range-thumb, :focus::-moz-range-thumb { + background: var(--range-thumb-hover); + } ::-webkit-slider-runnable-track { height: min(1.5vw, 6px); background: var(--range-track); @@ -158,9 +198,19 @@ box-shadow: 0 min(0.5vw, 2px) min(2vw, 8px) var(--box-shadow-color); transition: background var(--transition-fast); } + ::-moz-range-track { + height: min(1.5vw, 6px); + background: var(--range-track); + border-radius: var(--border-radius); + box-shadow: 0 min(0.5vw, 2px) min(2vw, 8px) var(--box-shadow-color); + transition: background var(--transition-fast); + } :hover::-webkit-slider-runnable-track, :focus::-webkit-slider-runnable-track { background: var(--range-track-hover); } + :hover::-moz-range-track, :focus::-moz-range-track { + background: var(--range-track-hover); + } svg.button { fill: var(--text-dark); cursor: pointer; @@ -205,7 +255,7 @@ top: calc(min(3vw, 12px) * -1); border: min(3vw, 12px) solid transparent; border-top-color: var(--container-medium-hover); - filter: drop-shadow(0 min(0.5vw, 2px) min(1vw, 4px) var(--box-shadow-color)); + filter: drop-shadow(0 min(0.5vw, 2px) min(0.25vw, 1px) var(--box-shadow-color)); transform-origin: top center; } [data-tooltip]:hover::before, [data-tooltip]:hover::after { @@ -231,7 +281,7 @@ ::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-hover); } - #icons { + #logo, #icons { position: absolute; } #header { @@ -314,7 +364,7 @@ } #header .attribution span, #header .attribution a { color: var(--text-dark); - font-size: min(2vw, 14px); + font-size: min(2vw, 14.5px); } #header .attribution a { border-radius: calc(var(--border-radius) * 0.5); @@ -352,13 +402,13 @@ } #userInput.text { --size: 100%; - color: var(--text-super-dark); + --color: var(--text-super-dark); background: var(--textarea-light); border-color: var(--textarea-light); - white-space: normal; + white-space: pre-wrap; } #userInput.code, #userInput.split, #userInput.preview { - color: var(--text-light); + --color: var(--text-light); background: var(--textarea-dark); border-color: var(--textarea-dark); } @@ -386,11 +436,11 @@ transition: var(--transition-medium); } #userInput.text.drag { - color: var(--textarea-drag-light-color); + --color: var(--textarea-drag-light-color); background: var(--textarea-drag-light-background); } #userInput.code.drag, #userInput.split.drag, #userInput.preview.drag { - color: var(--textarea-drag-dark-color); + --color: var(--textarea-drag-dark-color); background: var(--textarea-drag-dark-background); } #scaler { @@ -485,35 +535,43 @@ box-shadow: 0 min(0.5vw, 2px) min(1vw, 4px) var(--box-shadow-color); white-space: nowrap; visibility: hidden; - opacity: 0; pointer-events: none; transition: var(--transition-medium); transition-property: visibility, opacity, transform; } - .card.widget { - margin: min(2vw, 10px); + .card.widget, .card.modal { + opacity: 0; + } + .card.widget, .card.notification { padding: min(2vw, 10px); position: absolute; right: 0; - top: 0; min-width: min(50vw, 250px); max-height: calc(100% - min(3vw, 20px)); border-radius: var(--border-radius); overflow-y: auto; + } + .card.widget { + margin: min(2vw, 10px); + top: 0; transform: scaleY(0); transform-origin: top center; } + .card.notification { + margin: min(4vw, 20px); + bottom: 0; + z-index: 2; + transform: translateX(calc(100% + min(8vw, 40px))); + } .card.modal { + padding: min(2.6vw, 16px); position: fixed; left: 50%; top: 50%; - z-index: 1; - transform-origin: center center; - } - .card.modal { - padding: min(2.6vw, 16px); min-width: min(35vw, 225px); + z-index: 1; border-radius: calc(var(--border-radius) * 2); + transform-origin: center center; transform: translate(-50%,-50%) scale(0); } .card.modal.scale { @@ -522,13 +580,13 @@ z-index: 2; transform: translate(-50%,50vh) scale(1); } - #cardBlur { + #cardBackground { position: fixed; left: 0; top: 0; width: 100%; height: 100%; - backdrop-filter: var(--modal-blur); + background: var(--card-background); visibility: hidden; opacity: 0; pointer-events: none; @@ -536,7 +594,7 @@ transition: var(--transition-medium); transition-property: visibility, opacity; } - .card.active, #cardBlur.active { + .card.active, #cardBackground.active { visibility: visible; opacity: 1; pointer-events: all; @@ -544,6 +602,15 @@ .card.widget.active { transform: scaleY(1); } + .card.notification.active { + animation: notification var(--transition-medium) ease var(--transition-medium); + transform: translateX(0); + } + @keyframes notification { + 50% { + transform: scale(1.1); + } + } .card.modal.active { transform: translate(-50%,-50%) scale(1); } @@ -554,7 +621,7 @@ justify-content: center; align-items: center; } - .card.widget .header { + .card.widget .header, .card.notification .header { margin-bottom: min(1.5vw, 10px); } .card.modal .header { @@ -563,7 +630,7 @@ .card.modal.scale .header { margin-bottom: min(5.25vh, 1.75vw); } - .card.widget .header section { + .card.widget .header section, .card.notification .header section { font-size: min(3vw, 16px); } .card.modal .header section { @@ -575,15 +642,15 @@ } .card .header .pencil { margin-right: min(3vw, 10px); - width: min(3vw, 40px); - height: min(3vw, 40px); + width: min(5vw, 24px); + height: min(5vw, 24px); } .card.modal.scale .header .pencil { margin-right: min(3vh, 1vw); width: min(15vh, 5vw); height: min(15vh, 5vw); } - .card.widget svg.button.close { + .card.widget svg.button.close, .card.notification svg.button.close { width: min(2.75vw, 12px); height: min(2.75vw, 12px); } @@ -605,7 +672,7 @@ font-size: min(3.25vw, 18px); } .card.modal .content span { - font-size: min(2vw, 14px); + font-size: min(2vw, 14.5px); } .card.modal.scale .content span { font-size: min(4.5vh, 1.5vw); @@ -617,7 +684,7 @@ flex-direction: column; align-items: center; color: var(--text-dark); - font-size: min(3vw, 14px); + font-size: min(3vw, 14.5px); } .card .content .item:last-child { margin-right: 0; @@ -636,7 +703,7 @@ } .card textarea, .card [type="text"] { padding: 4px; - color: var(--text-light); + --color: var(--text-light); background: var(--textarea-medium); border-radius: var(--border-radius); box-shadow: 0 2px 4px var(--box-shadow-color) inset; @@ -664,23 +731,11 @@ #colorInput { width: min(20vw, 86px); } - #red { - --range-thumb-hover: #bb2222; - --range-track-hover: #660000; - } - #green { - --range-thumb-hover: #22bb22; - --range-track-hover: #006600; - } - #blue { - --range-thumb-hover: #2222bb; - --range-track-hover: #000066; - } .card .toolbar { display: flex; justify-content: center; } - .card.widget .toolbar { + .card.widget .toolbar, .card.notification .toolbar { margin-top: min(2vw, 10px); } .card.modal .toolbar { @@ -718,7 +773,7 @@ justify-content: space-between; align-items: center; color: var(--text-medium); - font-size: min(2.75vw, 12px); + font-size: min(2.75vw, 12.5px); border-radius: var(--border-radius); white-space: nowrap; cursor: pointer; @@ -751,8 +806,8 @@ position: absolute; left: 100%; top: 0; - transform: scaleX(0); - transform-origin: left center; + transform: scale(0); + transform-origin: left top; } @media (max-width: 550px), (max-height: 375px){ .dropdown ul ul { @@ -805,7 +860,7 @@ justify-content: center; align-items: center; color: var(--text-medium); - font-size: min(2vw, 14px); + font-size: min(2vw, 14.5px); cursor: pointer; transition: color var(--transition-fast); } @@ -814,10 +869,11 @@ padding: min(0.25vw, 1px); width: min(2.5vw, 18px); height: min(2.5vw, 18px); + fill: transparent; background: var(--container-medium); border: min(0.25vw, 2px) solid var(--text-dark); border-radius: var(--border-radius); - fill: transparent; + box-shadow: 0 min(0.75vw, 3px) min(1vw, 4px) calc(min(0.5vw, 2px) * -1) var(--box-shadow-color); } .checkbox [type="checkbox"]:hover + label { color: var(--text-hover); @@ -845,38 +901,38 @@ - + + @@ -940,11 +998,12 @@ @@ -963,12 +1022,12 @@
- +

-
+
-
+
@@ -1102,23 +1161,27 @@
- ⚠ At the moment, these only
take effect on page reload
+
+
+
Reset Settings
+
+
+
Your settings have been reset!
+
+