This commit is contained in:
alegottu 2020-10-05 15:09:32 -07:00
commit b4da712088
5 changed files with 86 additions and 4 deletions

View file

@ -29,7 +29,7 @@
## Standards & Conventions
1. Use a SCSS compiler, and make sure that a `style.mis.css` file is generated in the same directory as the `style.scss`. For VSCode I recommend `Easy Sass` extension by Wojciech Sura. After installing it, to configure it:
1. Use a SCSS compiler, and make sure that a `style.min.css` file is generated in the same directory as the `style.scss`. For VSCode I recommend `Easy Sass` extension by Wojciech Sura. After installing it, to configure it:
- Navigate to the VSCode settings, `Extensions` section and find `Easy Sass configuration`
- Under the `Formats` group click `edit in settings.json`

View file

@ -384,7 +384,7 @@ a:hover {
grid-template-columns: 1fr 1fr;
gap: 1rem;
align-items: center;
justify-items: center;
justify-items: left;
}
.check {
@ -418,6 +418,40 @@ a:hover {
}
}
}
.typographyCheck {
grid-row: 2;
grid-column: 1/3;
span {
display: block;
font-size: 0.76rem;
color: var(--sub-color);
margin-left: 1.5rem;
}
input {
margin: 0 !important;
cursor: pointer;
width: 0;
height: 0;
display: none;
& ~ .customTextTypographyCheckbox {
width: 12px;
height: 12px;
background: rgba(0, 0, 0, 0.1);
border-radius: 2px;
box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
display: inline-block;
margin: 0 0.5rem 0 0.25rem;
transition: 0.25s;
}
&:checked ~ .customTextTypographyCheckbox {
background: var(--main-color);
}
}
}
}
}
@ -1112,6 +1146,14 @@ key {
// gap: 1rem;
// align-items: center;
// justify-content: flex-end;
.current-theme{
transition: .25s;
text-decoration: none;
&:hover{
color: var(--main-color);
cursor: pointer;
}
}
.discordLink{
transition: .25s;
text-decoration: none;

View file

@ -80,6 +80,14 @@
Word count
<input type="number" value="1" min="1" max="10000" />
</label>
<label class="typographyCheck">
<input type="checkbox" checked />
<div class="customTextTypographyCheckbox"></div>
Remove Fancy Typography
<span>
Standardises typography symbols: “ and ” become " for exmaple.
</span>
</label>
</div>
<div class="button">ok</div>
</div>

View file

@ -91,6 +91,13 @@ const layouts = {
"zZ","xX","cC","vV","bB","jJ","mM",",<",".>","/?",
" "
],
prog_dvorak : [
"$~","[%","[7","{5","}3","(1","=9","*0",")2","+4","]6","!8","#`",
";:",",<",".>","pP","yY","fF","gG","cC","rR","lL","/?","@^","\\|",
"aA","oO","eE","uU","iI","dD","hH","tT","nN","sS","-_",
"'\"","qQ","jJ","kK","xX","bB","mM","wW","vV","zZ",
" "
],
dvorak_L : [
"`~","[{","]}","/?","pP","fF","mM","lL","jJ","4$","3#","2@","1!",
";:","qQ","bB","yY","uU","rR","sS","oO",".>","6^","5%","=+","\\|",

View file

@ -529,8 +529,12 @@ function initWords() {
group = Math.floor(Math.random() * quotes.groups.length);
}
randomQuote = quotes.groups[group][Math.floor(Math.random() * quotes.groups[group].length)];
let w = randomQuote.text.trim().split(" ");
rq = quotes.groups[group][Math.floor(Math.random() * quotes.groups[group].length)];
if (randomQuote != null && rq.id === randomQuote.id) {
rq = quotes.groups[group][Math.floor(Math.random() * quotes.groups[group].length)];
}
randomQuote = rq;
let w = rq.text.trim().split(" ");
for (let i = 0; i < w.length; i++) {
wordsList.push(w[i]);
}
@ -2741,6 +2745,19 @@ function changeCustomText() {
// initWords();
}
function cleanTypographySymbols(textToClean) {
var specials = {
'“': '"', // &ldquo; &#8220;
'”': '"', // &rdquo; &#8221;
'': "'", // &lsquo; &#8216;
'': "'", // &rsquo; &#8217;
',': ",", // &sbquo; &#8218;
'—': "-", // &mdash; &#8212;
'…': "..."// &hellip; &#8230;
}
return textToClean.replace(/[“”’‘—,…]/g, (char) => specials[char] || '');
}
function changePage(page) {
if (pageTransition) {
return;
@ -3516,6 +3533,9 @@ $("#customTextPopup .button").click((e) => {
text = text.trim();
text = text.replace(/[\n\r\t ]/gm, " ");
text = text.replace(/ +/gm, " ");
if($("#customTextPopup .typographyCheck input").prop("checked")) {
text = cleanTypographySymbols(text)
}
text = text.split(" ");
// if (text.length >= 10000) {
// showNotification("Custom text cannot be longer than 10000 words.", 4000);
@ -4801,6 +4821,11 @@ $(document).on("mouseenter", "#resultWordsHistory .words .word", (e) => {
}
});
$(document).on("click", "#bottom .leftright .right .current-theme", (e) => {
currentCommands.push(commandsThemes);
showCommandLine();
});
$(document).on("mouseleave", "#resultWordsHistory .words .word", (e) => {
$(".wordInputAfter").remove();
});