Skip to content
This repository was archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
slash command fix - removes spaces on click and adds them back on remove
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyhuang07 committed Oct 18, 2022
1 parent 0c72e00 commit 9dda78e
Show file tree
Hide file tree
Showing 14 changed files with 1,144 additions and 1,141 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/node_modules/

/package-lock.json

/node_modules/

/package-lock.json

/package.json
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2022 Anthony Huang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2022 Anthony Huang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# discord-formatter
formatting! Enter any piece of text, choose an option, and get colored text, a timestamp, anything!
# discord-formatter
formatting! Enter any piece of text, choose an option, and get colored text, a timestamp, anything!
220 changes: 110 additions & 110 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Discord Message Formatter</title>
<meta name="google-site-verification" content="zZlQqHj_UFRqv-n1Rw1szukskpRuIi_lxmuiTbuwf9o" />
<meta content="Discord Message Formatter" property="og:title" />
<meta content="A website to help you format your Discord messages!" property="og:description" />
<meta content="https://ah07.xyz/discord-formatter" property="og:url" />
<meta content="https://i.imgur.com/8QaFXJU.png" property="og:image" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css2?family=Aldrich&family=JetBrains+Mono&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicons/favicon-16x16.png">
<link rel="manifest" href="/assets/favicons/site.webmanifest">
<link rel="shortcut icon" href="/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Discord Message Formatter">
<meta name="application-name" content="Discord Message Formatter">
<meta name="msapplication-TileColor" content="#ff7700">
<meta name="msapplication-config" content="/assets/favicons/browserconfig.xml">
<link rel="stylesheet" href="src/styles.css">
</head>

<body>
<main>
<div class="cool">
<h1><span class="date">Discord</span> Formatter!</h1>
</div>
<article>
<select id="dropdown" onchange="dropdown()">
<option value="text">Regular Text</option>
<option value="color">Colored Text</option>
<option value="time">Timestamp</option>
</select>
<button type="button" id="reset" class="resetButton" onclick="resetFn()">Reset</button>
<button type="button" id="copy" class="copyButton" onclick="copyFn()">Copy</button><br><br>
<div>
<textarea placeholder="Your Text Here..." id="textArea" oninput="rmFn()"></textarea>
<input type="datetime-local" step=1 id="datepicker" style="display: none" oninput="main()"><br><br>
<h2>Options</h2>
</div>
<div id="textdiv">
<button type="button" id="bold" onclick="boldFn(textArea.value)">Bold</button>
<button type="button" id="ital" onclick="italFn(textArea.value)">Italic</button>
<button type="button" id="under" onclick="underFn(textArea.value)">Underscore</button>
<button type="button" id="strike" onclick="strikeFn(textArea.value)">Strikethrough</button>
<button type="button" id="spoil" onclick="spoilFn(textArea.value)">Spoiler</button>
<button type="button" id="quote" onclick="quoteFn(textArea.value)">Quote</button>
<button type="button" id="line" onclick="lineFn(textArea.value)">Code Line</button>
<button type="button" id="block" onclick="blockFn(textArea.value)">Code Block</button>
<button type="button" id="slash" onclick="slashFn(textArea.value)">Slash Command</button>
</div>
<div id="colordiv" style="display: none;">
<button type="button" id="red" onclick="redFn(textArea.value)" style="color: #D5322F;">Red</button>
<button type="button" id="orange" onclick="orangeFn(textArea.value)"
style="color: #B7471B;">Orange</button>
<button type="button" id="yellow" onclick="yellowFn(textArea.value)"
style="color: #B18602;">Yellow</button>
<button type="button" id="green" onclick="greenFn(textArea.value)"
style="color: #839701;">Green</button>
<button type="button" id="turq" onclick="turqFn(textArea.value)"
style="color: #2B918A;">Turquoise</button>
<button type="button" id="blue" onclick="blueFn(textArea.value)" style="color: #287AB5;">Blue</button>
<button type="button" id="gray" onclick="grayFn(textArea.value)" style="color: #576D74;">Gray</button>
</div>
<div id="timediv" style="display: none;">
<div style="display: flex; align-items: center;">
<div>
<h3>Short Time (t):</h3>
<code id="datet">HH:MM (AM/PM)</code>
<h3>Long Time (T):</h3>
<code id="dateT">HH:MM:SS (AM/PM)</code>
</div>
<div>
<h3>Short Date (d):</h3>
<code id="dated">MM/DD/YYYY</code>
<h3>Long Date (D):</h3>
<code id="dateD">Mo DD, YYYY</code>
</div>
<div>
<h3>Full Date and Time (f):</h3>
<code id="datef">Mo DD, YYYY HH:MM (AM/PM)</code>
<h3>FD&T w/ Day (F):</h3>
<code id="dateF">Day, Mo DD, YYYY HH:MM (AM/PM)</code>
</div>
<div>
<h3>Relative (R):</h3>
<code id="dateR"># (Unit) Ago</code>
</div>
</div><br>
<div>
<h2>Guide</h2>
<img src="https://i.imgur.com/8KsLNop.jpg" width="500px" style="border-radius: 0.6rem" />
</div>
</article>
<hr>
<footer>
<a href="https://github.com/anthonyhuang07/">Copyright (c) 2022 Anthony Huang</a>
</footer>
</main>
<script src="src/scripts/text.js" defer></script>
<script src="src/scripts/index.js" defer></script>
<script src="src/scripts/color.js" defer></script>
<script src="src/scripts/time.js" defer></script>
</body>

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Discord Message Formatter</title>
<meta name="google-site-verification" content="zZlQqHj_UFRqv-n1Rw1szukskpRuIi_lxmuiTbuwf9o" />
<meta content="Discord Message Formatter" property="og:title" />
<meta content="A website to help you format your Discord messages!" property="og:description" />
<meta content="https://ah07.xyz/discord-formatter" property="og:url" />
<meta content="https://i.imgur.com/8QaFXJU.png" property="og:image" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css2?family=Aldrich&family=JetBrains+Mono&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicons/favicon-16x16.png">
<link rel="manifest" href="/assets/favicons/site.webmanifest">
<link rel="shortcut icon" href="/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Discord Message Formatter">
<meta name="application-name" content="Discord Message Formatter">
<meta name="msapplication-TileColor" content="#ff7700">
<meta name="msapplication-config" content="/assets/favicons/browserconfig.xml">
<link rel="stylesheet" href="src/styles.css">
</head>

<body>
<main>
<div class="cool">
<h1><span class="date">Discord</span> Formatter!</h1>
</div>
<article>
<select id="dropdown" onchange="dropdown()">
<option value="text">Regular Text</option>
<option value="color">Colored Text</option>
<option value="time">Timestamp</option>
</select>
<button type="button" id="reset" class="resetButton" onclick="resetFn()">Reset</button>
<button type="button" id="copy" class="copyButton" onclick="copyFn()">Copy</button><br><br>
<div>
<textarea placeholder="Your Text Here..." id="textArea" oninput="rmFn()"></textarea>
<input type="datetime-local" step=1 id="datepicker" style="display: none" oninput="main()"><br><br>
<h2>Options</h2>
</div>
<div id="textdiv">
<button type="button" id="bold" onclick="boldFn(textArea.value)">Bold</button>
<button type="button" id="ital" onclick="italFn(textArea.value)">Italic</button>
<button type="button" id="under" onclick="underFn(textArea.value)">Underscore</button>
<button type="button" id="strike" onclick="strikeFn(textArea.value)">Strikethrough</button>
<button type="button" id="spoil" onclick="spoilFn(textArea.value)">Spoiler</button>
<button type="button" id="quote" onclick="quoteFn(textArea.value)">Quote</button>
<button type="button" id="line" onclick="lineFn(textArea.value)">Code Line</button>
<button type="button" id="block" onclick="blockFn(textArea.value)">Code Block</button>
<button type="button" id="slash" onclick="slashFn(textArea.value)">Slash Command</button>
</div>
<div id="colordiv" style="display: none;">
<button type="button" id="red" onclick="redFn(textArea.value)" style="color: #D5322F;">Red</button>
<button type="button" id="orange" onclick="orangeFn(textArea.value)"
style="color: #B7471B;">Orange</button>
<button type="button" id="yellow" onclick="yellowFn(textArea.value)"
style="color: #B18602;">Yellow</button>
<button type="button" id="green" onclick="greenFn(textArea.value)"
style="color: #839701;">Green</button>
<button type="button" id="turq" onclick="turqFn(textArea.value)"
style="color: #2B918A;">Turquoise</button>
<button type="button" id="blue" onclick="blueFn(textArea.value)" style="color: #287AB5;">Blue</button>
<button type="button" id="gray" onclick="grayFn(textArea.value)" style="color: #576D74;">Gray</button>
</div>
<div id="timediv" style="display: none;">
<div style="display: flex; align-items: center;">
<div>
<h3>Short Time (t):</h3>
<code id="datet">HH:MM (AM/PM)</code>
<h3>Long Time (T):</h3>
<code id="dateT">HH:MM:SS (AM/PM)</code>
</div>
<div>
<h3>Short Date (d):</h3>
<code id="dated">MM/DD/YYYY</code>
<h3>Long Date (D):</h3>
<code id="dateD">Mo DD, YYYY</code>
</div>
<div>
<h3>Full Date and Time (f):</h3>
<code id="datef">Mo DD, YYYY HH:MM (AM/PM)</code>
<h3>FD&T w/ Day (F):</h3>
<code id="dateF">Day, Mo DD, YYYY HH:MM (AM/PM)</code>
</div>
<div>
<h3>Relative (R):</h3>
<code id="dateR"># (Unit) Ago</code>
</div>
</div><br>
<div>
<h2>Guide</h2>
<img src="https://i.imgur.com/8KsLNop.jpg" width="500px" style="border-radius: 0.6rem" />
</div>
</article>
<hr>
<footer>
<a href="https://github.com/anthonyhuang07/">Copyright (c) 2022 Anthony Huang</a>
</footer>
</main>
<script src="src/scripts/text.js" defer></script>
<script src="src/scripts/index.js" defer></script>
<script src="src/scripts/color.js" defer></script>
<script src="src/scripts/time.js" defer></script>
</body>

</html>
Loading

0 comments on commit 9dda78e

Please sign in to comment.