diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index fd9eaf1b2..dbd01af2f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,47 +6,44 @@ labels: bug assignees: "" --- - + - +**Describe the bug** + + +Sometimes things work in incognito mode, which allows me to further track down the issue. -**To Reproduce** +--> - +**To Reproduce** 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** +**Expected behavior** - +**Screenshots** -**Screenshots** - - - -**Desktop:** +**Desktop:** - OS: [] - Browser [] - Version [] -**Smartphone:** +**Smartphone:** - Device: [] - OS: [] - Browser [] - Version [] -**Additional context** - - +**Additional context** diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 19adc9d92..85266c6a5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,4 @@ -Adding a language or a theme? Make sure to edit the `_list.json` file and add the `language.json` or `theme.css` as well, otherwise, it will not work! +Adding a language or a theme? For languages, make sure to edit the `_list.json`, `_groups.json` files, and add the `language.json` file as well. For themes, make sure to add the `theme.css` file. It will not work if you don't follow these steps! Please reference any issues related to your pull request. diff --git a/code_r.json b/code_r.json new file mode 100644 index 000000000..07d7151fb --- /dev/null +++ b/code_r.json @@ -0,0 +1,27 @@ +{ + "name": "code_r", + "leftToRight": true, + "words": [ + "if", + "for", + "FALSE", + "NA_integer_", + "return", + "else", + "in", + "NULL", + "NA_real_", + "repeat", + "next", + "Inf", + "NA_complex_", + "while", + "break", + "NaN", + "NA_character_", + "function", + "TRUE", + "NA", + "..." + ] +} diff --git a/src/js/popups/word-filter-popup.js b/src/js/popups/word-filter-popup.js index 79cb583d6..cc1bc9f6c 100644 --- a/src/js/popups/word-filter-popup.js +++ b/src/js/popups/word-filter-popup.js @@ -65,15 +65,15 @@ async function filter(language) { return filteredWords; } -async function apply() { +async function apply(set) { let language = $("#wordFilterPopup .languageInput").val(); let filteredWords = await filter(language); - let customText = ""; - filteredWords.forEach((word) => { - customText += word + " "; - }); + let customText = filteredWords.join(" "); + + $("#customTextPopup textarea").val( + (index, val) => (set ? "" : val + " ") + customText + ); hide(); - $("#customTextPopup textarea").val(customText); } $("#wordFilterPopupWrapper").mousedown((e) => { @@ -90,8 +90,9 @@ $("#wordFilterPopupWrapper .button").mousedown((e) => { $("#wordFilterPopupWrapper .loadingIndicator").removeClass("hidden"); $("#wordFilterPopupWrapper .button").addClass("hidden"); setTimeout(() => { - apply(); - $("#wordFilterPopupWrapper .loadingIndicator").addClass("hidden"); - $("#wordFilterPopupWrapper .button").removeClass("hidden"); + apply($(e.target).is("#set")).then(() => { + $("#wordFilterPopupWrapper .loadingIndicator").addClass("hidden"); + $("#wordFilterPopupWrapper .button").removeClass("hidden"); + }); }, 1); }); diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 02065e9cf..7c87a317b 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -641,8 +641,20 @@ export function restart(withSameWordset = false, nosave = false, event) { let testSeconds = TestStats.calculateTestSeconds(performance.now()); let afkseconds = TestStats.calculateAfkSeconds(); // incompleteTestSeconds += ; - TestStats.incrementIncompleteSeconds(testSeconds - afkseconds); + let tt = testSeconds - afkseconds; + console.log( + `increasing incomplete time by ${tt}s (${testSeconds}s - ${afkseconds}s afk)` + ); + TestStats.incrementIncompleteSeconds(tt); TestStats.incrementRestartCount(); + if (tt > 600) { + Notifications.add( + `Your time typing just increased by ${Misc.roundTo2( + tt / 60 + )} minutes. If you think this is incorrect please contact Miodec and dont refresh the website.`, + -1 + ); + } // restartCount++; } diff --git a/src/sass/style.scss b/src/sass/style.scss index 8becf83c9..d7576aedf 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -156,6 +156,7 @@ html { .select2-selection { background: rgba(0, 0, 0, 0.1); height: fit-content; + height: -moz-fit-content; padding: 5px; border-radius: var(--roundness); color: var(--text-color); @@ -199,6 +200,7 @@ html { .select2-selection:focus { height: fit-content; + height: -moz-fit-content; padding: 5px; border-radius: var(--roundness); color: var(--text-color); @@ -208,6 +210,7 @@ html { } .select2-selection:active { height: fit-content; + height: -moz-fit-content; padding: 5px; border-radius: var(--roundness); color: var(--text-color); @@ -1787,12 +1790,14 @@ key { grid-auto-flow: column; width: fit-content; gap: 1rem; + width: -moz-fit-content; } .right { text-align: right; display: grid; grid-auto-flow: column; width: fit-content; + width: -moz-fit-content; justify-self: right; gap: 1rem; // align-items: center; @@ -2123,6 +2128,7 @@ key { #words { height: fit-content; + height: -moz-fit-content; display: flex; flex-wrap: wrap; width: 100%; @@ -2582,6 +2588,7 @@ key { font-size: 0.75rem; line-height: 0.75rem; height: fit-content; + height: -moz-fit-content; align-self: center; justify-self: right; padding: 0.25rem 0; @@ -3133,6 +3140,7 @@ key { // background: var(--sub-color); color: var(--sub-color); width: fit-content; + width: -moz-fit-content; padding: 0.5rem; border-radius: var(--roundness); cursor: pointer; diff --git a/static/index.html b/static/index.html index 92524f331..080288e45 100644 --- a/static/index.html +++ b/static/index.html @@ -202,10 +202,15 @@ Use the above filters to include and exclude words or characters (separated by spaces) +
+ "Set" replaces the current custom word list with the filter result, + "Add" appends the filter result to the current custom word list +
-
ok
+
set
+
add
+ diff --git a/static/quotes/code_java.json b/static/quotes/code_java.json new file mode 100644 index 000000000..ce6f9db32 --- /dev/null +++ b/static/quotes/code_java.json @@ -0,0 +1,17 @@ +{ + "language": "code_java", + "groups": [ + [0, 100], + [101, 300], + [301, 600], + [601, 9999] + ], + "quotes": [ + { + "text": "public class Main {\\npublic static void main(String[] args) {\\n\\tSystem.out.println(\"Hello World\");\\n\\t}\\n}", + "source": "W3Schools - Java Getting Started", + "id": 1, + "length": 87 + } + ] +} diff --git a/static/quotes/english.json b/static/quotes/english.json index 622c8a5a5..ea628e4fe 100644 --- a/static/quotes/english.json +++ b/static/quotes/english.json @@ -32377,24 +32377,12 @@ "length": 89, "id": 5447 }, - { - "text": "It does not do well to dwell on dreams and forget to live.", - "source": "Harry Potter and the Sorcerer's Stone", - "length": 58, - "id": 5448 - }, { "text": "Have you ever had a dream, Neo, that you seemed so sure it was real? But if were unable to wake up from that dream, how would you tell the difference between the dream world & the real world?", "source": "The Matrix", "length": 191, "id": 5449 }, - { - "text": "If real is what you can feel, smell, taste and see, then 'real' is simply electrical signals interpreted by your brain.", - "source": "The Matrix", - "length": 119, - "id": 5450 - }, { "text": "If you ain’t scared... you ain’t human.", "source": "Alby, The Maze Runner", @@ -32413,12 +32401,6 @@ "length": 55, "id": 5453 }, - { - "text": "Good that.", - "source": "Newt, The Maze Runner", - "length": 10, - "id": 5454 - }, { "text": "Maybe you should just press the button", "source": "The Maze Runner", @@ -32509,12 +32491,6 @@ "length": 154, "id": 5469 }, - { - "text": "You get tough like me and you don't get hurt. You look out for yourself and nothin' can touch you...", - "source": "Dally, The Outsiders", - "length": 100, - "id": 5470 - }, { "text": "Things are rough all over.", "source": "Cherry, The Outsiders" @@ -32537,12 +32513,6 @@ "length": 54, "id": 5473 }, - { - "text": "Destroying things is much easier than making them.", - "source": "The Hunger Games", - "length": 50, - "id": 5474 - }, { "text": "You have only one life, make the most of it.", "source": "Holes", diff --git a/static/quotes/turkish.json b/static/quotes/turkish.json index 225857c8c..69645377d 100644 --- a/static/quotes/turkish.json +++ b/static/quotes/turkish.json @@ -12,6 +12,228 @@ "source": "Jonathan Swift", "length": 45, "id": 1 + }, + { + "text": "Yeryüzünde yalnız benim serseri, yeryüzünde yalnız ben derbederim. Herkesin dünyada varsa bir yeri, ben de bütün dünya benimdir derim.", + "source": "Serseri - Necip Fazıl Kısakürek", + "length": 134, + "id": 2 + }, + { + "text": "Yıllarca gezdirdim hoyrat başımı, aradım bir ömür, arkadaşımı. Ölsem dikecek yok mezar taşımı; Halime ben bile hayret ederim.", + "source": "Serseri - Necip Fazıl Kısakürek", + "length": 125, + "id": 3 + }, + { + "text": "Gönlüm ne dertlidir, ne de bahtiyar; Ne kendisine yar, ne kimseye yar. Bir rüya uğrunda ben diyar diyar, gölgemin peşinden yürür giderim...", + "source": "Serseri - Necip Fazıl Kısakürek", + "length": 139, + "id": 4 + }, + { + "text": "Ne güzel şey hatırlamak seni. Sana tahtadan birşeyler oymalıyım yine: bir çekmece bir yüzük, ve üç metre kadar ince ipekli dokumalıyım. Ve hemen fırlayarak yerimden, penceremde demirlere yapışarak, hürriyetin sütbeyaz maviliğine, sana yazdıklarımı bağıra bağıra okumalıyım... Ne güzel şey hatırlamak seni: ölüm ve zafer haberleri içinde, hapiste ve yaşım kırkı geçmiş iken...", + "source": "Ne Güzel Şey Hatırlamak Seni - Nazım Hikmet", + "length": 371, + "id": 5 + }, + { + "text": "Bileklerimizi morartmış yeni Alman kelepçeleri, otobüsün kaloriferleri bozuldu Kaman’dan sonra. Sekiz saat oluyor karbonatlı bir çay bile içemedik, başımızda prensip sahibi bir başçavuş. Niğde üzerinden Adana Cezaevine gidiyoruz... Bi sen eksiktin ayışığı, gümüş bir tüy dikmek için manzaraya!", + "source": "Bir Sen Eksiktin Ay Işığı - Can Yücel", + "length": 293, + "id": 6 + }, + { + "text": "Artık demir almak günü gelmişse zamandan, meçhule giden bir gemi kalkar bu limandan. Hiç yolcusu yokmuş gibi sessizce alır yol; Sallanmaz o kalkışta ne mendil ne de bir kol. Rıhtımda kalanlar bu seyahatten elemli, günlerce siyah ufka bakar gözleri nemli. Biçare gönüller! Ne giden son gemidir bu! Hicranlı hayatın ne de son matemidir bu! Dünyada sevilmiş ve seven nafile bekler; Bilmez ki giden sevgililer dönmeyecekler. Birçok gidenin her biri memnun ki yerinden, birçok seneler geçti; Dönen yok seferinden.", + "source": "Sessiz Gemi - Yahya Kemal Beyatlı", + "length": 508, + "id": 7 + }, + { + "text": "Ağılda oğlak doğsa ovada otu biter.", + "source": "Atasözü", + "length": 35, + "id": 8 + }, + { + "text": "Kel ölür, sırma saçlı olur; kör ölür, badem gözlü olur.", + "source": "Atasözü", + "length": 55, + "id": 9 + }, + { + "text": "Açık yerde tepecik kendini dağ sanır.", + "source": "Atasözü", + "length": 37, + "id": 10 + }, + { + "text": "Abanın kıymeti yağmurda bilinir.", + "source": "Atasözü", + "length": 32, + "id": 11 + }, + { + "text": "Aç aman bilmez, çocuk zaman bilmez.", + "source": "Atasözü", + "length": 35, + "id": 13 + }, + { + "text": "Adam adama yük değil, can gövdeye mülk değil.", + "source": "Atasözü", + "length": 45, + "id": 14 + }, + { + "text": "Ahmağa yüz, abdala söz vermeye gelmez.", + "source": "Atasözü", + "length": 38, + "id": 15 + }, + { + "text": "Aş taşınca kepçeye paha olmaz.", + "source": "Atasözü", + "length": 30, + "id": 16 + }, + { + "text": "Ağustosta gölge kovan, zemheride karnın ovar.", + "source": "Atasözü", + "length": 45, + "id": 17 + }, + { + "text": "Kalendere kış geliyor demişler, titremeye hazırım diye cevap vermiş.", + "source": "Atasözü", + "length": 45, + "id": 18 + }, + { + "text": "Gölgeyi hoş gören tekneyi boş görür.", + "source": "Atasözü", + "length": 36, + "id": 20 + }, + { + "text": "Göz odur ki dağın arkasını göre, akıl odur ki başa geleceği bile.", + "source": "Atasözü", + "length": 65, + "id": 21 + }, + { + "text": "Verip pişman olmaktan, vermeyip düşman olmak yeğdir.", + "source": "Atasözü", + "length": 52, + "id": 22 + }, + { + "text": "Lafla pilav pişerse deniz kadar yağı benden.", + "source": "Atasözü", + "length": 44, + "id": 23 + }, + { + "text": "Onmadık hacıyı deve üstünde yılan sokar.", + "source": "Atasözü", + "length": 40, + "id": 24 + }, + { + "text": "Oduncunun gözü omcada, dilencinin gözü çömcede.", + "source": "Atasözü", + "length": 47, + "id": 25 + }, + { + "text": "Tarlada izi olmayanın harmanında yüzü olmaz.", + "source": "Atasözü", + "length": 44, + "id": 26 + }, + { + "text": "Topalla gezen, aksamak öğrenir.", + "source": "Atasözü", + "length": 31, + "id": 27 + }, + { + "text": "Tayfanın akıllısı, geminin dümeninden uzak durur.", + "source": "Atasözü", + "length": 49, + "id": 28 + }, + { + "text": "Martta sürmez, eylülde ekmezsen sabanı bırak.", + "source": "Atasözü", + "length": 45, + "id": 29 + }, + { + "text": "Işığını akşamdan önce yakan, sabah çırasına yağ bulamaz.", + "source": "Atasözü", + "length": 55, + "id": 30 + }, + { + "text": "Ahırın avlusunda oynarken aşağıda, gümüş söğütler altında görünmeyen derenin hazin şırıltısını duyardık. Evimiz iç çitin büyük kestane ağaçları arkasında kaybolmuş gibiydi. Annem İstanbul’a gittiği için benden bir yaş küçük kardeşim Hasan’la artık Dadaruh’un yanından hiç ayrılmıyorduk. Bu, babamın seyisi yaşlı bir adamdı. Sabahleyin erkenden ahıra koşuyorduk. En sevdiğimiz şey atlardı. Dadaruh’la beraber onları suya götürmek, çıplak sırtlarına binmek ne doyulmaz bir zevkti. Hasan korkar, yalnız binmezdi. Dadaruh, onu kendi önüne alırdı. Torbalara arpa koymak, yemliklere ot doldurmak, ahırı süpürmek, gübreleri kaldırmak en eğlenceli oyundan bile daha çok hoşumuza gidiyordu. Hele tımar… bu, en zevkli şeydi.", + "source": "Kaşağı - Ömer Seyfettin", + "length": 714, + "id": 31 + }, + { + "text": "At, ahır işlerinde sadece tımarı beceremiyordum. Boyum karnına bile varmıyordu. Ama en keyifli, en eğlenceli şey buydu. Sanki kaşağının muntazam tıkırtısı Tosun’un hoşuna gidiyor, kulaklarını kısıyor, kuyruğunu kocaman bir püskül gibi sallıyordu.", + "source": "Kaşağı - Ömer Seyfettin", + "length": 246, + "id": 32 + }, + { + "text": "Ertesi yıl annem, yaz olunca yine İstanbul'a gitti. Biz yalnız kaldık. Hasan'a ahır hala yasaktı. Geceleri yatakta atların ne yaptıklarını, tayların büyüyüp büyümediğini bana sorardı. Bir gün aniden hastalandı. Kasabaya at gönderildi. Doktor geldi. Kuşpalazı dedi. Çiftlikteki köylü kadınlar eve koştular. Birtakım tekir kuşları getiriyorlar, kesip kardeşimin boynuna sarıyorlardı. Babam yatağının dibinden ayrılmıyordu.", + "source": "Kaşağı - Ömer Seyfettin", + "length": 420, + "id": 33 + }, + { + "text": "Şehirde yaşayan ve bir tüccarla evli olan abla, köydeki kız kardeşini ziyarete gitmişti; kardeşi ise bir köylüyle evliydi. Semaver başında toplandıklarında, abla kent hayatının güzelliklerinden, yaşamlarının ne kadar rahat olduğundan, ne kadar güzel giyindiklerinden, çocukların şık elbiseler giyinip kuşandıklarından, lezzetli yiyecekler yiyip tiyatrolara, eğlencelere nasıl gittiklerinden bire bin katarak söz etmeye başladı.", + "source": "İnsan Ne İle Yaşar - Tolstoy", + "length": 427, + "id": 34 + }, + { + "text": "Fakat unutma, ne kadar büyük bir daire yapsan da, gün batmadan başladığın yere dönmek zorundasın; o zamana dek ne kadar yeri işaretlediysen, kendi malın say.", + "source": "İnsan Ne İle Yaşar - Tolstoy", + "length": 157, + "id": 35 + }, + { + "text": "Yine de 'Bir saat yorul, ömür boyu rahat et...' diye düşünüp yürüdü. Tam sola dönecekti ki bir dere gördü. 'Burayı topraklarıma katmazsam günah olur. Burada pamuk yetiştirebilirim...' diye düşündü.", + "source": "İnsan Ne İle Yaşar - Tolstoy", + "length": 197, + "id": 36 + }, + { + "text": "Ama kente girerken kafasındaki matkapların yerini başka bir şey alıverdi. Sabahın olağan trafik sıkışıklığında beklerken, çevrede garip giyimli bir sürü insan fark etti. Pelerinli insanlar.", + "source": "Harry Potter ve Felsefe Taşı - J. K. Rowling", + "length": 189, + "id": 37 + }, + { + "text": "Her yerdeki kuş meraklıları, ülkedeki bütün baykuşların bugün hiç alışılmadık şeyler yaptığını belirtmektedir. Baykuşlar genellikle geceleri avlanırlar, gün ışığında pek görülmezler, ama sabahtan beri bu kuşların her yöne uçuştuklarına yüzlerce kere tanık olunmuştur. Uzmanlar, baykuşların uyku alışkanlıklarını birden bire neden değiştirdiklerini açıklayamamaktadırlar.", + "source": "Harry Potter ve Felsefe Taşı - J. K. Rowling", + "length": 370, + "id": 38 + }, + { + "text": "Son derece esrarengiz. Şimdi de Jim McGuffin'den hava raporu. Ne dersin, bu gece yine baykuş sağanağı olacak mı, Jim?", + "source": "Harry Potter ve Felsefe Taşı - J. K. Rowling", + "length": 117, + "id": 39 + }, + { + "text": "Kedinin baktığı köşede bir adam belirdi; öylesine ansızın, öylesine sessizce belirmişti ki, sanki yerden fışkırmış gibiydi. Kedinin kuyruğu titredi, gözleri kısıldı.", + "source": "Harry Potter ve Felsefe Taşı - J. K. Rowling", + "length": 165, + "id": 40 } ] } diff --git a/static/themes/_list.json b/static/themes/_list.json index d547ee095..c4477d006 100644 --- a/static/themes/_list.json +++ b/static/themes/_list.json @@ -533,5 +533,10 @@ "name": "bouquet", "bgColor": "#38564a", "textColor": "#ffbdb2" + }, + { + "name": "midnight", + "bgColor": "#0c0e12", + "textColor": "#525f7a" } ] diff --git a/static/themes/midnight.css b/static/themes/midnight.css new file mode 100644 index 000000000..bbef8ccd0 --- /dev/null +++ b/static/themes/midnight.css @@ -0,0 +1,11 @@ +:root { + --bg-color: #0c0e12; + --main-color: #708bc2; + --caret-color: #708bc2; + --sub-color: #29303d; + --text-color: #525f7a; + --error-color: #c27070; + --error-extra-color: #c28b70; + --colorful-error-color: #c27070; + --colorful-error-extra-color: #c28b70; +}