diff --git a/.gitignore b/.gitignore index 2f65e55b7..9328e9c94 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ pids *.seed *.pid.lock +#Mac files +.DS_Store + # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/package.json b/package.json index 35d9c14af..a1882a523 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "postinstall": "cd functions && npm install", "build": "npx gulp build", "start:dev": "npm run build && concurrently --kill-others \"npx gulp watch\" \"firebase serve\"", - "deploy:live:hosting": "npm run build && firebase deploy -P live --only hosting", - "deploy:live:functions": "npm run build && firebase deploy -P live --only functions", + "deploy:live:hosting": "npm run build && firebase deploy -P monkey-type --only hosting", + "deploy:live:functions": "npm run build && firebase deploy -P monkey-type --only functions", "deploy:live": "npm run build && firebase deploy -P live" }, "engines": { diff --git a/src/js/script.js b/src/js/script.js index 8132181a6..ede313d9f 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -2808,6 +2808,7 @@ function restartTest(withSameWordset = false, nosave = false) { paceCaret = null; if (paceCaret !== null) clearTimeout(paceCaret.timeout); $("#showWordHistoryButton").removeClass("loaded"); + focusWords(); keypressPerSecond = []; lastSecondNotRound = false; currentKeypress = { @@ -4405,6 +4406,41 @@ $(document.body).on("click", "#versionHistoryWrapper", (event) => { }); }); +$(document.body).on("click", "#supportMeButton", (event) => { + $("#supportMeWrapper") + .css("opacity", 0) + .removeClass("hidden") + .animate({ opacity: 1 }, 125); +}); + +$(document.body).on("click", "#supportMeWrapper", (event) => { + $("#supportMeWrapper") + .css("opacity", 1) + .animate({ opacity: 0 }, 125, () => { + $("#supportMeWrapper").addClass("hidden"); + }); +}); + + +$(document.body).on("click", "#supportMeWrapper .button.ads", (event) => { + currentCommands.push(commandsEnableAds); + showCommandLine(); + $("#supportMeWrapper") + .css("opacity", 1) + .animate({ opacity: 0 }, 125, () => { + $("#supportMeWrapper").addClass("hidden"); + }); +}); + +$(document.body).on("click", "#supportMeWrapper a.button", (event) => { + $("#supportMeWrapper") + .css("opacity", 1) + .animate({ opacity: 0 }, 125, () => { + $("#supportMeWrapper").addClass("hidden"); + }); +}); + + $("#wordsInput").keypress((event) => { event.preventDefault(); }); diff --git a/src/sass/style.scss b/src/sass/style.scss index 01febddd9..af2a17edf 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -687,6 +687,69 @@ a:hover { } } +#supportMeWrapper { + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.75); + position: fixed; + left: 0; + top: 0; + z-index: 1000; + display: grid; + justify-content: center; + align-items: center; + padding: 5rem 0; + + #supportMe { + width: 900px; + // height: 400px; + background: var(--bg-color); + border-radius: var(--roundness); + padding: 2rem; + display: grid; + grid-template-rows: auto auto auto; + gap: 2rem; + @extend .ffscroll; + + .title{ + font-size: 2rem; + line-height: 2rem; + color: var(--main-color); + } + + .text{ + color: var(--text-color); + } + + .buttons{ + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + gap: 1rem; + + .button{ + display: block; + width: 100%; + height: 100%; + padding: 2rem 0; + display: grid; + gap: 1rem; + text-decoration: none; + .text{ + transform: .25s; + } + &:hover .text{ + color: var(--bg-color); + } + .icon{ + font-size: 5rem; + line-height: 5rem; + } + } + } + + } +} + #commandLineWrapper { width: 100%; height: 100%; @@ -1261,6 +1324,14 @@ key { margin-bottom: 1rem; } + #supportMeButton{ + transition: .25s; + &:hover{ + color: var(--main-color); + cursor: pointer; + } + } + .leftright { display: grid; grid-template-columns: 1fr 1fr; @@ -2934,6 +3005,17 @@ key { grid-template-rows: 1fr 1fr; } } + #supportMe { + width: 90vw !important; + .buttons{ + .button{ + .icon{ + font-size: 3rem !important; + line-height: 3rem !important; + } + } + } + } } @media only screen and (max-width: 800px) { @@ -2988,6 +3070,21 @@ key { } } + #supportMe { + width: 80vw !important; + .buttons{ + grid-template-columns: none !important; + .button{ + grid-template-columns: auto auto; + align-items: center; + .icon{ + font-size: 2rem !important; + line-height: 2rem !important; + } + } + } + } + #commandLine, #commandLineInput { width: 400px !important; diff --git a/static/index.html b/static/index.html index d9ad7a32c..e2e740579 100644 --- a/static/index.html +++ b/static/index.html @@ -762,6 +762,34 @@ +