diff --git a/.github/settings.yml b/.github/settings.yml
deleted file mode 100644
index 2e72c25..0000000
--- a/.github/settings.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-labels:
- - name: accepted
- color: 049f10
- - name: deadline-expired
- color: fcd2c7
- - name: half-accepted
- color: ffe100
diff --git a/creationLetter.js b/creationLetter.js
new file mode 100644
index 0000000..889e149
--- /dev/null
+++ b/creationLetter.js
@@ -0,0 +1,148 @@
+const minWordsInLetter = 100;
+const minWordsInLetterTheme = 2;
+const maxWordsInLetterTheme = 5;
+const maxWordsInLetter = 300;
+const signs = [".", "!", "?", "..."];
+
+let letterWords = ["изoбрeтaтeль", "нeизвeстeн", "бeз", "гвoздeй", "нaшa", "цивилизaция", "нaвeрнякa", "бы", "рyхнyлa", "тoчнyю", "дaтy", "пoявлeния", "гвoздeй", "yстaнoвить", "слoжнo", "сeйчaс", "приблизитeльнaя", "дaтa", "сoздaния", "гвoздeй", "нaхoдится", "в", "эпoхe", "брoнзoвoгo", "вeкa", "тo", "eсть", "oчeвиднo", "чтo", "гвoзди", "нe", "мoгли", "пoявиться", "рaньшe", "чeм", "люди", "нayчились", "oтливaть", "и", "фoрмирoвaть", "мeтaлл", "рaньшe", "дeрeвянныe", "кoнстрyкции", "прихoдилoсь", "вoзвoдить", "пo", "бoлee", "слoжным", "тeхнoлoгиям", "испoльзyя", "слoжныe", "гeoмeтричeскиe", "кoнстрyкции", "тeпeрь", "жe", "прoцeсс", "стрoитeльствa", "знaчитeльнo", "yпрoстился", "дo", "1790-х", "и", "нaчaлa", "1800-х", "гoдoв", "жeлeзныe", "гвoзди", "дeлaлись", "врyчнyю", "кyзнeц", "нaгрeвaл", "квaдрaтный", "жeлeзный", "прyт", "a", "зaтeм", "бил", "eгo", "с", "чeтырeх", "стoрoн", "чтoбы", "сoздaть", "oстрый", "кoнeц", "гвoздя", "мaшины", "для", "изгoтoвлeния", "гвoздeй", "пoявились", "мeждy", "1790-ми", "и", "рaнними", "1800-ми", "гoдaми", "тeхнoлoгия", "изгoтoвлeния", "гвoздeй", "прoдoлжaлa", "рaзвивaться", "пoслe", "тoгo", "кaк", "Гeнри", "бeссeмeр", "рaзрaбoтaл", "прoцeсс", "мaссoвoгo", "прoизвoдствa", "стaли", "из", "жeлeзa", "жeлeзныe", "гвoзди", "прoшлых", "лeт", "пoстeпeннo", "тeряли", "пoпyлярнoсть", "и", "к", "1886", "гoдy", "10%", "гвoздeй", "в", "СШA", "были", "сoздaны", "из", "мягкoй", "стaльнoй", "прoвoлoки", "пo", "дaнным", "унивeрситeтa", "Вeрмoнтa", "к", "1913", "гoдy", "90%", "гвoздeй", "прoизвeдeнных", "в", "СШA", "были", "изгoтoвлeны", "из", "стaльнoй", "прoвoлoки", "изoбрeтaтeль", "нeизвeстeн", "идeя", "o", "симмeтричнoм", "кoмпoнeнтe", "движyщeмся", "в", "крyгoвoм", "движeнии", "пo", "oси", "сyщeствoвaлa", "в", "дрeвнeй", "Мeсoпoтaмии", "Eгиптe", "и", "Eврoпe", "рaздeльнo", "в", "рaзныe", "пeриoды", "врeмeни", "тaким", "oбрaзoм", "нeльзя", "yстaнoвить", "ктo", "и", "гдe", "имeннo", "изoбрёл", "кoлeсo", "нo", "этo", "вeликoe", "изoбрeтeниe", "пoявилoсь", "в", "3500", "гoдy", "дo", "нaшeй", "эры", "и", "стaлo", "oдним", "из", "сaмых", "вaжных", "изoбрeтeний", "чeлoвeчeствa", "кoлeсo", "oблeгчилo", "рaбoтy", "в", "oблaстях", "зeмлeдeлия", "и", "трaнспoртa", "a", "тaкжe", "стaлo", "фyндaмeнтoм", "для", "дрyгих", "изoбрeтeний", "нaчинaя", "oт", "кaрeт", "и", "зaкaнчивaя", "чaсaми", "автoр", "изoбрeтeния", "Йoхaннeс", "Гyтeнбeрг", "Йoхaннeс", "Гyтeнбeрг", "изoбрeл", "рyчнoй", "пeчaтный", "стaнoк", "в", "1450", "гoдy", "к", "1500", "гoдy", "в", "Зaпaднoй", "Eврoпe", "былo", "нaпeчaтaнo", "yжe", "двaдцaть", "миллиoнoв", "книг", "В", "19-м", "вeкe", "былa", "прoизвeдeнa", "мoдификaция", "и", "жeлeзныe", "дeтaли", "зaмeнили", "дeрeвянныe", "чтo", "yскoрилo", "прoцeсс", "пeчaти", "кyльтyрнaя", "и", "прoмышлeннaя", "рeвoлюция", "в", "Eврoпe", "былa", "бы", "нeвoзмoжнoй", "eсли", "бы", "нe", "скoрoсть", "с", "кoтoрoй", "типoгрaфия", "пoзвoлялa", "рaспрoстрaнять", "дoкyмeнты", "книги", "и", "гaзeты", "для", "ширoкoй", "ayдитoрии", "пeчaтный", "стaнoк", "пoзвoлил", "рaзвиться", "прeссe", "a", "тaкжe", "дaл", "вoзмoжнoсть", "людям", "сaмooбрaзoвывaться", "пoлитичeскaя", "сфeрa", "тaкжe", "былa", "бы", "нeмыслимa", "бeз", "миллиoнoв", "кoпий", "листoвoк", "и", "плaкaтoв", "чтo", "yжe", "гoвoрить", "o", "гoсyдaрствeннoм", "aппaрaтe", "с", "eгo", "бeскoнeчным", "числoм", "блaнкoв?", "в", "oбщeм", "тo", "пoистинe", "вeликoe", "изoбрeтeниe", "изoбрeтaтeль", "Джeймс", "Уaтт", "хoтя", "пeрвaя", "вeрсия", "пaрoвoгo", "двигaтeля", "oтнoсится", "к", "III", "вeкy", "нэ", "тoлькo", "в", "нaчaлe", "XIX", "вeкa", "с", "пришeствиeм", "индyстриaльнoй", "эпoхи", "пoявилaсь", "сoврeмeннaя", "фoрмa", "двигaтeля", "внyтрeннeгo", "сгoрaния", "пoтрeбoвaлись", "дeсятилeтия", "прoeктирoвaния", "пoслчeгo", "Джeймс", "Уaтт", "сдeлaл", "пeрвыe", "чeртeжи", "сoглaснo", "кoтoрым", "сжигaниe", "тoпливa", "высвoбoждaeт", "высoкoтeмпeрaтyрный", "гaз", "и", "рaсширяясь", "тeм", "сaмым", "oкaзывaeт", "дaвлeниe", "нa", "пoршeнь", "и", "пeрeмeщaeт", "eгo", "этo", "фeнoмeнaльнoe", "изoбрeтeниe", "сыгрaлo", "рeшaющyю", "рoль", "в", "изoбрeтeнии", "дрyгих", "мeхaнизмoв", "тaких", "кaк", "aвтoмoбили", "и", "сaмoлeты", "кoтoрыe", "измeнили", "лицo", "плaнeты", "нa", "кoтoрoй", "мы", "живeм", "изoбрeтaтeль", "Тoмaс", "Aлвa", "Эдисoн", "изoбрeтeниe", "лaмпoчки", "рaзвивaлoсь", "в", "тeчeниe", "1800-х", "гoдoв", "Тoмaсoм", "Эдисoнoм", "eмy", "приписывaют", "звaниe", "глaвнoгo", "изoбрeтaтeля", "лaмпы", "кoтoрaя", "мoглa", "гoрeть", "1500", "чaсoв", "бeз", "выгoрaния", "изoбрёл", "в", "1879", "гoдy", "идeя", "сaмoй", "лaмпoчки", "Эдисoнy", "нe", "принaдлeжит", "и", "выскaзывaлaсь", "мнoгими", "людьми", "нo", "имeннo", "oн", "сyмeл", "прaвильнo", "пoдoбрaть", "мaтeриaлы", "чтoбы", "лaмпoчкa", "гoрeлa", "дoлгo", "и", "стaлa", "дeшeвлe", "свeчeк", "изoбрeтaтeль", "Aлeксaндр", "Флeминг", "пeнициллин", "был", "слyчaйнo", "oбнaрyжeн", "в", "чaшкe", "Пeтри", "Aлeксaндрoм", "Флeмингoм", "в", "1928", "гoдy", "прeпaрaт", "пeнициллинa", "прeдстaвляeт", "сoбoй", "грyппy", "aнтибиoтикoв", "кoтoрaя", "лeчит", "нeскoлькo", "инфeкций", "y", "людeй", "нe", "нaнoся", "им", "врeдa", "пeнициллин", "мaссoвo", "прoизвoдился", "вo", "врeмя", "втoрoй", "мирoвoй", "вoйны", "чтoбы", "избaвить", "вoeннoслyжaщих", "oт", "вeнeричeских", "бoлeзнeй", "и", "всe", "eщё", "испoльзyeтся", "кaк", "стaндaртный", "aнтибиoтик", "прoтив", "инфeкций", "этo", "былo", "oднo", "из", "сaмых", "извeстных", "oткрытий", "сдeлaнных", "в", "oблaсти", "мeдицины", "Aлeксaндр", "Флeминг", "пoлyчил", "в", "1945", "гoдy", "Нoбeлeвскyю", "прeмию", "a", "гaзeты", "тoгo", "врeмeни", "писaли", "для", "рaзгрoмa", "фaшизмa", "и", "oсвoбoждeния", "Фрaнции", "oн", "сдeлaл", "бoльшe", "цeлых", "дивизий", "изoбрeтaтeль", "Aнтoниo", "Мeyччи", "дoлгoe", "врeмя", "считaлoсь", "чтo", "пeрвooткрывaтeлeм", "тeлeфoнa", "являeтся", "Aлeксaндр", "Бeлл", "нo", "в", "2002", "гoдy", "Кoнкгрeсс", "СШA", "пoстaнoвил", "чтo", "прaвo", "пeрвeнствa", "в", "изoбрeтeнии", "тeлeфoнa", "принaдлeжит", "Aнтoниo", "Мeyччи", "В", "1860", "гoдy", "нa", "16", "лeт", "рaньшe", "Грэхeмa", "Бeллa", "Aнтoниo", "Мeyччи", "прoдeмoнстрирoвaл", "aппaрaт", "кoтoрый", "бaл", "спoсoбeн", "пeрeдaвaть", "гoлoс", "пo", "прoвoдaм", "свoй", "изoбрeтeниe", "Aнтoниo", "нaзвaл", "Тeлeктрoфoн", "и", "пoдaл", "зaявкy", "нa", "пaтeнтoвaниe", "в", "1871", "гoдy", "этo", "пoлoжилo", "нaчaлo", "рaбoтe", "нaд", "oдним", "из", "сaмых", "рeвoлюциoнных", "изoбрeтeний", "кoтoрым", "oблaдaeт", "пoчти", "кaждый", "нa", "нaшeй", "плaнeтe", "дeржa", "eгo", "в", "свoих", "кaрмaнaх", "и", "нa", "стoлaх", "тeлeфoн", "кoтoрый", "пoзжe", "тaкжe", "рaзвивaлся", "кaк", "мoбильный", "тeлeфoн", "oкaзaл", "нa", "чeлoвeчeствo", "жизнeннo", "вaжнoe", "влияниe", "oсoбeннo", "в", "oблaсти", "бизнeсa", "и", "кoммyникaции", "рaсширeниe", "слышимoй", "рeчи", "изнyтри", "oднoй", "кoмнaты", "нa", "вeсь", "мир", "—", "этo", "свeршeниe", "нe", "имeющee", "сeбe", "рaвных", "дo", "сeгoдняшнeгo", "дня", "изoбрeтaтeль", "Рoзинг", "Бoрис", "Львoвич", "и", "eгo", "yчeники", "Звoрыкин", "Влaдимир", "Кoнстaнтинoвич", "и", "Кaтaeв", "Сeмён", "Исидoрoвич", "нe", "признaн", "кaк", "пeрвooткрывaтeль", "a", "тaкжe", "Филoн", "Фaрнсyoрт", "Хoтя", "изoбрeтeниe", "тeлeвидeния", "нe", "мoжeт", "быть", "приписaнo", "oднoмy", "чeлoвeкy", "бoльшинствoм", "людeй", "признaётся", "чтo", "изoбрeтeниe", "сoврeмeннoгo", "тeлeвидeния", "былo", "зaслyгoй", "двyх", "людeй", "Влaдимирa", "Кoсмы", "Звoрыкинa", "(1923)", "и", "Филoнa", "Фaрнсyoртa", "(1927)", "Здeсь", "нeoбхoдимo", "oтмeтить", "тo", "чтo", "в", "СССР", "рaзрaбoткoй", "тeлeвизoрa", "пo", "пaрaллeльнoй", "тeхнoлoгии", "зaнимaлся", "Кaтaeв", "Сeмён", "Исидoрoвич", "a", "пeрвыe", "экспeримeнты", "и", "принципы", "рaбoты", "элeктричeскoгo", "тeлeвидeния", "oписaл", "и", "вoвсe", "Рoзинг", "eщё", "в", "нaчaлe", "20-гo", "вeкa", "тeлeвидeниe", "былo", "тaкжe", "oдним", "из", "вeличaйших", "изoбрeтeний", "кoтoрыe", "были", "рaзвиты", "oт", "мeхaничeскoгo", "дo", "элeктрoннoгo", "oт", "чёрнo-бeлoгo", "к", "цвeтнoмy", "oт", "aнaлoгoвoгo", "к", "цифрoвoмy", "oт", "примитивных", "мoдeлeй", "бeз", "пyльтa", "к", "интeллeктyaльнoмy", "a", "тeпeрь", "и", "вoвсe", "к", "3D-вeрсиям", "и", "мaлeньким", "дoмaшним", "кинoтeaтрaм", "Люди", "oбычнo", "прoвoдят", "oкoлo", "4-8", "чaсoв", "в", "дeнь", "смoтря", "тeлeвизoр", "и", "этo", "сильнo", "пoвлиялo", "нa", "сeмeйнyю", "и", "сoциaльнyю", "жизнь", "a", "тaкжe", "измeнилo", "нaшy", "кyльтyрy", "дo", "нeyзнaвaeмoсти", "изoбрeтaтeль", "Чaрльз", "Бэббидж", "Aлaн", "Тьюринг", "и", "дрyгиe", "принцип", "сoврeмeннoгo", "кoмпьютeрa", "впeрвыe", "был", "yпoмянyт", "Aлaнoм", "Тьюрингoм", "a", "пoзжe", "был", "изoбрeтeн", "пeрвый", "мeхaничeский", "кoмпьютeр", "в", "нaчaлe", "19", "вeкa", "этo", "изoбрeтeниe", "дeйствитeльнo", "сoвeршилo", "yдивитeльныe", "вeщи", "в", "бoльшeм", "кoличeствe", "сфeр", "жизни", "в", "тoм", "числe", "филoсoфию", "и", "кyльтyрy", "чeлoвeчeскoгo", "oбщeствa", "Кoмпьютeр", "пoмoг", "взлeтeть", "высoкoскoрoстным", "вoeнным", "лeтaтeльным", "aппaрaтaм", "вывeсти", "кoсмичeский", "кoрaбль", "нa", "oрбитy", "кoнтрoлирoвaть", "мeдицинскoe", "oбoрyдoвaниe", "сoздaвaть", "визyaльныe", "oбрaзы", "хрaнить", "oгрoмнoe", "кoличeствo", "инфoрмaции", "и", "yлyчшил", "фyнкциoнирoвaниe", "aвтoмoбилeй", "тeлeфoнoв", "и", "элeктрoстaнций", "изoбрeтaтeль", "Винтoн", "Сeрф", "и", "Тим", "Бeрнeрс-Ли", "интeрнeт", "был", "впeрвыe", "рaзрaбoтaн", "в", "1973", "гoдy", "Винтoнoм", "Сeрфoм", "при", "пoддeржкe", "Aгeнтствa", "пeрспeктивных", "исслeдoвaний", "Министeрствa", "oбoрoны", "СШA", "(ARPA)", "егo", "пeрвoнaчaльнoe", "испoльзoвaниe", "сoстoялo", "в", "тoм", "чтoбы", "oбeспeчить", "сeть", "связи", "в", "исслeдoвaтeльских", "лaбoрaтoриях", "и", "yнивeрситeтaх", "в", "Сoeдинeнных Штaтaх", "и", "рaсширить", "свeрхyрoчнyю", "рaбoтy", "этo", "изoбрeтeниe", "нaрядy сo Всeмирнoй пayтинoй", "былo", "глaвным", "рeвoлюциoнным", "изoбрeтeниeм", "XX", "вeкa", "В", "1996", "гoдy", "чeрeз", "интeрнeт", "в", "180", "стрaнaх", "былo", "пoдключeнo", "бoлee", "25", "миллиoнoв", "кoмпьютeрoв", "a", "тeпeрь", "нaм", "пришлoсь", "дaжe", "пeрeхoдить", "нa", "IPv6", "чтoбы", "yвeличить", "числo", "IP-aдрeсoв", "тaк", "кaк", "IPv4-aдрeсa", "пoлнoстью", "исчeрпaлись", "a", "их", "былo", "пoрядкa", "422", "миллиaрдa", "всeмирнaя", "пayтинa", "кaк", "мы", "знaeм", "впeрвыe", "былa", "прeдскaзaнa", "Aртyрoм", "Клaркoм", "однaкo", "изoбрeтeниe", "былo", "сдeлaнo", "19", "лeт", "спyстя", "в", "1989", "гoдy", "сoтрyдникoм", "ЦEРН", "Тoмoм", "Бeрнeрсoм", "Ли", "Сeть", "измeнилa", "нaшe", "oтнoшeниe", "к", "рaзличным", "oблaстям", "включaя", "oбрaзoвaниe", "мyзыкy", "финaнсы", "чтeниe", "мeдицинy", "языкy", "и", "сeть", "пoтeнциaльнo", "прeвoсхoдит", "всe", "вeликиe", "изoбрeтeния", "мирa"];
+
+let senders = new Map([
+ ["images/ya-mini-logo.png", "Команда Яндекс.Почты"],
+ ["images/elon_musk.png", "Илон Маск"],
+ ["images/henry_ford.png", "Генри Форд"],
+ ["images/nikola_tesla.png", "Никола Тесла"],
+ ["images/thomas_edison.png", "Томас Едисон"],
+ ["images/albert_einstein.png", "Альберт Эйнштейн"],
+ ["images/abraham_lincoln.png", "Авраам Линкольн"],
+]);
+
+function genSentence(isTheme) {
+ let words = [];
+ let count = 0;
+ if (isTheme) {
+ count = getRandomArbitrary(minWordsInLetterTheme, maxWordsInLetterTheme);
+ } else {
+ count = getRandomArbitrary(minWordsInLetter, maxWordsInLetter);
+ }
+ for (let i = 0; i < count; i++) {
+ words.push(letterWords[getRandomArbitrary(0, letterWords.length - 1)]);
+ }
+ let index = 0;
+ while (index < words.length - 5) {
+ words[index] += ',';
+ index += getRandomArbitrary(5, 15);
+ }
+ words[words.length - 1] += signs[getRandomArbitrary(0, signs.length - 1)];
+ words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1, words[0].length);
+ let sentence = '';
+ for (let i = 0; i < words.length; i++) {
+ sentence += words[i] + ' ';
+ }
+ return sentence;
+}
+
+
+function genLetterText(isTheme) {
+ let count = 0;
+ let letter = '';
+ if (isTheme) {
+ count = 3;
+ } else {
+ count = getRandomArbitrary(minWordsInLetter, maxWordsInLetter);
+ }
+ while (!(letter.split(' ').length >= count)) {
+ letter += genSentence(isTheme);
+ }
+ return letter;
+}
+
+
+function getLetterDate() {
+ let date = new Date();
+ let rusNames = new Map([
+ [0, "января"],
+ [1, "февраля"],
+ [2, "марта"],
+ [3, "апреля"],
+ [4, "мая"],
+ [5, "июня"],
+ [6, "июля"],
+ [7, "августа"],
+ [8, "сентября"],
+ [9, "октября"],
+ [10, "ноября"],
+ [11, "декабря"],
+ ]);
+
+ return date.getDate() + " " + rusNames.get(date.getMonth());
+}
+
+function getRandomKey(collection) {
+ let keys = Array.from(collection.keys());
+ return keys[Math.floor(Math.random() * keys.length)];
+}
+
+function getNewLetter() {
+ let senderImage = getRandomKey(senders);
+ let senderName = senders.get(senderImage);
+ let letterDate = getLetterDate();
+ let letterTheme = genLetterText(true);
+ let letterText = genLetterText(false);
+ let letterTemplate = `
+
+
×
+
` + letterTheme +
+ `
` + letterText +
+ `
+
+
+
+
+

+
+
+
` + senderName +
+ `
+
+
` + letterTheme +
+ `
+
` + letterDate +
+ `
+
+
+
+ `;
+
+ if (letterCounterOnPage >= maxLettersOnPage) {
+ let lastLetter = document.querySelectorAll(".letters-section__letter-wrapper").item(letterCounterOnPage - 1);
+ lastLetter.parentNode.removeChild(lastLetter);
+ stack.push(lastLetter);
+ letterCounterOnPage--;
+ }
+ let lettersSection = document.querySelector('.letters-section');
+ let newLetter = document.createElement('div');
+ newLetter.classList.add('letters-section__letter-wrapper');
+ newLetter.innerHTML = letterTemplate;
+ newLetter.classList.add('letters-section_add-letter-animation');
+ let openedLetter = document.body.querySelectorAll('.opened-letter');
+ if (openedLetter.length !== 0) {
+ for (let i = 0; i < openedLetter.length; i++) {
+ if (!openedLetter[i].classList.contains('non-displayed')) {
+ newLetter.classList.add('non-displayed');
+ }
+ }
+ }
+ lettersSection.insertBefore(newLetter, lettersSection.firstElementChild);
+ newLetter.addEventListener('animationend', () => {
+ newLetter.classList.remove('letters-section_add-letter-animation');
+ });
+ letterCounterOnPage++;
+ if (checkAllBox.checked) {
+ checkAllBox.checked = false;
+ }
+}
\ No newline at end of file
diff --git a/fonts/HelveticaNeueCyr-Bold.ttf b/fonts/HelveticaNeueCyr-Bold.ttf
new file mode 100644
index 0000000..8dcfee9
Binary files /dev/null and b/fonts/HelveticaNeueCyr-Bold.ttf differ
diff --git a/fonts/HelveticaNeueCyr-Light.otf b/fonts/HelveticaNeueCyr-Light.otf
new file mode 100644
index 0000000..7ced49a
Binary files /dev/null and b/fonts/HelveticaNeueCyr-Light.otf differ
diff --git a/fonts/HelveticaNeueCyr-Medium.otf b/fonts/HelveticaNeueCyr-Medium.otf
new file mode 100644
index 0000000..a2cde16
Binary files /dev/null and b/fonts/HelveticaNeueCyr-Medium.otf differ
diff --git a/fonts/YandexSansDisplay-Regular.woff b/fonts/YandexSansDisplay-Regular.woff
new file mode 100644
index 0000000..a1b54f4
Binary files /dev/null and b/fonts/YandexSansDisplay-Regular.woff differ
diff --git a/images/abraham_lincoln.png b/images/abraham_lincoln.png
new file mode 100644
index 0000000..bb7c882
Binary files /dev/null and b/images/abraham_lincoln.png differ
diff --git a/images/albert_einstein.png b/images/albert_einstein.png
new file mode 100644
index 0000000..6053959
Binary files /dev/null and b/images/albert_einstein.png differ
diff --git a/images/check.svg b/images/check.svg
new file mode 100644
index 0000000..92a3485
--- /dev/null
+++ b/images/check.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/closer.png b/images/closer.png
new file mode 100644
index 0000000..b235e49
Binary files /dev/null and b/images/closer.png differ
diff --git a/images/elon_musk.png b/images/elon_musk.png
new file mode 100644
index 0000000..f1c7563
Binary files /dev/null and b/images/elon_musk.png differ
diff --git a/images/henry_ford.png b/images/henry_ford.png
new file mode 100644
index 0000000..0afac35
Binary files /dev/null and b/images/henry_ford.png differ
diff --git a/images/nikola_tesla.png b/images/nikola_tesla.png
new file mode 100644
index 0000000..dd1ef2e
Binary files /dev/null and b/images/nikola_tesla.png differ
diff --git a/images/thomas_edison.png b/images/thomas_edison.png
new file mode 100644
index 0000000..7e93fa6
Binary files /dev/null and b/images/thomas_edison.png differ
diff --git a/images/ya-mini-logo.png b/images/ya-mini-logo.png
new file mode 100644
index 0000000..cdd8941
Binary files /dev/null and b/images/ya-mini-logo.png differ
diff --git a/images/yandex-mail-logo.svg b/images/yandex-mail-logo.svg
new file mode 100644
index 0000000..b76e885
--- /dev/null
+++ b/images/yandex-mail-logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/york-img.png b/images/york-img.png
new file mode 100644
index 0000000..424a426
Binary files /dev/null and b/images/york-img.png differ
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..999217c
--- /dev/null
+++ b/index.html
@@ -0,0 +1,86 @@
+
+
+
+
+
+ Яндекс Почта
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mailController.js b/mailController.js
new file mode 100644
index 0000000..61ccedc
--- /dev/null
+++ b/mailController.js
@@ -0,0 +1,113 @@
+const minTimeFrequencyAppearance = minutesToMillis(5);
+const maxTimeWindow = minutesToMillis(10);
+const maxLettersOnPage = 30;
+
+let stack = [];
+let letterCounterOnPage = 0;
+
+function minutesToMillis(minutes) {
+ return 1000 * 60 * minutes
+}
+
+function getRandomArbitrary(min, max) {
+ return Math.floor(Math.random() * (max - min + 1)) + min
+}
+
+let clock = setTimeout(function newLetter() {
+ getNewLetter();
+ clock = setTimeout(newLetter, minTimeFrequencyAppearance
+ + getRandomArbitrary(0, maxTimeWindow - minTimeFrequencyAppearance));
+}, 1000);
+
+let checkAllBox = document.querySelector('#check-all-letters');
+
+function checkAll() {
+ let checkBoxes = document.body.querySelectorAll('.check-letter_visually-hidden');
+ checkBoxes.forEach(
+ checkBox => {
+ checkBox.checked = checkAllBox.checked;
+ }
+ );
+}
+
+function uncheckAllChecker(currentCheckBox) {
+ if (!currentCheckBox.checked) {
+ checkAllBox.checked = false;
+ }
+}
+
+function getReadLetter(currentReadableLetter) {
+ currentReadableLetter.classList.remove('covered-letter_not-read');
+ currentReadableLetter.classList.add('covered-letter');
+ let needRemoveClassNode = currentReadableLetter.querySelector('.is-read-mark_not-read');
+ needRemoveClassNode.classList.remove('is-read-mark_not-read');
+ needRemoveClassNode.classList.add('is-read-mark');
+}
+
+function removeLetters() {
+ let openedLetters = document.body.querySelectorAll('.opened-letter');
+ for (let i = 0; i < openedLetters.length; i++) {
+ if (!openedLetters[i].classList.contains('non-displayed')) {
+ return
+ }
+ }
+ let checkBoxes = document.body.querySelectorAll('.check-letter_visually-hidden');
+ for (let i = 1; i < checkBoxes.length; i++) {
+ if (checkBoxes[i].checked) {
+ let checkedLetter = checkBoxes[i];
+ while (!checkedLetter.classList.contains('letters-section__letter-wrapper')) {
+ checkedLetter = checkedLetter.parentNode;
+ }
+ checkedLetter.classList.add('letters-section_delete-letter-animation');
+ checkedLetter.addEventListener('animationend', () => {
+ checkedLetter.parentNode.removeChild(checkedLetter);
+ });
+ letterCounterOnPage--;
+ }
+ }
+ if (checkAllBox.checked) {
+ checkAllBox.checked = false;
+ }
+ setTimeout( function () {
+ while (letterCounterOnPage < maxLettersOnPage && stack.length > 0) {
+ let lettersSection = document.querySelector('.letters-section');
+ let newLetter = stack.pop();
+ newLetter.classList.add('letters-section_add-letter-animation');
+ lettersSection.appendChild(newLetter);
+ newLetter.addEventListener('animationend', () => {
+ newLetter.classList.remove('letters-section_add-letter-animation');
+ });
+ letterCounterOnPage++;
+
+ }
+ }, 550);
+
+}
+
+function hideOtherLetters(currentReadableLetter) {
+ let letterSection = document.body.querySelectorAll('.letters-section__letter-wrapper');
+ let wrapperCurLetter = currentReadableLetter.parentNode.parentNode;
+ for (let i = 0; i < letterSection.length; i++) {
+ if (letterSection[i] !== wrapperCurLetter) {
+ letterSection[i].classList.add('non-displayed');
+ } else {
+ letterSection[i].querySelector('.opened-letter').classList.remove('non-displayed');
+ letterSection[i].querySelector('.covered-letter').classList.add('non-displayed');
+ letterSection[i].querySelector('.mail-box__hr-line').classList.add('non-displayed');
+ }
+ }
+}
+
+function showOtherLetters(currentClosableLetter) {
+ let letterSection = document.body.querySelectorAll('.letters-section__letter-wrapper');
+ let wrapperCurLetter = currentClosableLetter.parentNode.parentNode;
+ for (let i = 0; i < letterSection.length; i++) {
+ if (letterSection[i] !== wrapperCurLetter) {
+ letterSection[i].classList.remove('non-displayed');
+ } else {
+ letterSection[i].querySelector('.opened-letter').classList.add('non-displayed');
+ letterSection[i].querySelector('.covered-letter').classList.remove('non-displayed');
+ letterSection[i].querySelector('.mail-box__hr-line').classList.remove('non-displayed');
+ }
+ }
+}
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..5b3fd71
--- /dev/null
+++ b/style.css
@@ -0,0 +1,478 @@
+@font-face {
+ font-family: 'Yandex Sans Text';
+ src: url('fonts/YandexSansDisplay-Regular.woff');
+}
+
+@font-face {
+ font-family: HelveticaNeue;
+ src: url("fonts/HelveticaNeueCyr-Medium.otf");
+}
+
+.yandex-mail {
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ -webkit-user-select: none;
+}
+
+.main-content__distinguished {
+ -moz-user-select: text;
+ -ms-user-select: text;
+ -o-user-select: text;
+ -webkit-user-select: text;
+}
+
+.yandex-mail {
+ background-color: #e5eaf0;
+ margin: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+
+.yandex-mail__header {
+ float: top;
+}
+
+.header {
+ height: 45px;
+ min-width: 800px;
+}
+
+.header__burger-menu {
+ display: inline-block;
+ margin-top: 10px;
+ margin-left: 17px;
+ padding-left: 5px;
+ padding-right: 5px;
+ float: left;
+}
+
+.burger-menu {
+ width: 20px;
+ height: 32px;
+ cursor: pointer;
+}
+
+.burger-menu__stripe {
+ display: inline-block;
+ margin-top: 7px;
+ margin-bottom: 7px;
+ width: 20px;
+ height: 3px;
+ background-color: #000000;
+}
+
+.header__yandex-mail-logo {
+ display: inline-block;
+ float: left;
+ margin-left: 6px;
+ margin-top: 12px;
+ cursor: pointer;
+}
+
+.header__mail-search {
+ padding: 11px 179px 0 320px;
+ min-width: 301px;
+ height: 32px;
+}
+
+.mail-search__input {
+ display: inline-block;
+ border: none;
+ box-sizing: border-box;
+ padding-left: 16px;
+ padding-right: 30px;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2);
+ background-color: #e2e2e2;
+ width: 100%;
+ height: 100%;
+ color: #6287bd;
+ outline: none;
+ font: 15px "YS Text - Regular", sans-serif;
+}
+
+.mail-search__input::placeholder {
+ color: #000000;
+ opacity: 0.3;
+}
+
+.mail-search__clear {
+ display: inline-block;
+ margin-left: -28px;
+ vertical-align: middle;
+ opacity: 0.3;
+ font-size: 22px;
+ cursor: pointer;
+ color: #000000;
+}
+
+.mail-search__clear:hover {
+ opacity: 1;
+}
+
+.mail-search {
+ min-width: 301px;
+ height: 30px;
+}
+
+
+.main-content__nav-menu {
+ display: inline-block;
+ vertical-align: top;
+ margin-left: 22px;
+ float: left;
+}
+
+.nav-menu {
+ font-family: HelveticaNeue, sans-serif;
+ width: 147px;
+ white-space: normal;
+}
+
+.nav-menu__action-button {
+ border: none;
+ outline: none;
+ width: 147px;
+ min-height: 32px;
+ text-align: center;
+ border-radius: 3px;
+ background-color: #6287bd;
+ color: #ffffff;
+ font-size: 12px;
+ font-weight: 500;
+ opacity: 0.95;
+ cursor: pointer;
+}
+
+.nav-menu__action-button:hover {
+ opacity: 1;
+}
+
+.nav-menu__action-button-indent {
+ margin-top: 5px;
+}
+
+.nav-menu__menu-list-tabs {
+ margin-top: 8px;
+ padding: 0;
+}
+
+.menu-list-tabs {
+ width: 147px;
+}
+
+.menu-list-tabs__tab {
+ list-style-type: none;
+ box-sizing: border-box;
+ padding: 7px 10px;
+ width: 147px;
+ min-height: 14px;
+ color: #707070;
+ font-size: 11px;
+ cursor: pointer;
+}
+
+
+.menu-list-tabs__incoming-tab,
+.menu-list-tabs__tab:hover {
+ border-radius: 3px;
+ background-color: #cdd6e4;
+}
+
+
+.mail-content__mail-box {
+ margin: 13px 20px 12px 191px;
+}
+
+.mail-box {
+ min-height: 530px;
+ min-width: 589px;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .34);
+ border-radius: 3px;
+ background-color: #ffffff;
+ font-family: HelveticaNeue, sans-serif;
+}
+
+.mail-box__box-header {
+ display: flex;
+}
+
+.box-header {
+ height: 38px;
+ font-size: 13px;
+ font-weight: 500;
+}
+
+.mail-box__hr-line {
+ height: 1px;
+ border-top: solid 1px #e2e2e2;
+}
+
+.box-header__button {
+ padding: 15px 15px 11px 10px;
+ border: none;
+ outline: none;
+ background-color: inherit;
+ color: inherit;
+ font-family: inherit;
+ font-size: inherit;
+ cursor: pointer;
+}
+
+.box-header__button:hover {
+ color: #000000;
+ opacity: 0.75;
+}
+
+.box-header__button-wrapper {
+ color: #cccccc;
+}
+
+.box-header__check-letter {
+ display: inline-block;
+}
+
+.check-letter {
+ width: 16px;
+ height: 16px;
+}
+
+.box-header__check-all-letters-wrapper {
+ padding: 11px 10px 11px 20px;
+ cursor: pointer;
+}
+
+
+.letters-section {
+ background-color: #ffffff;
+ overflow: hidden;
+ font: 13px HelveticaNeue, sans-serif;
+}
+
+#read-letter-check {
+ display: none;
+}
+
+.opened-letter {
+ background-color: white;
+}
+
+.covered-letter {
+ display: flex;
+}
+
+.opened-letter__closer {
+ float: right;
+ margin-top: 10px;
+ margin-right: 20px;
+ color: #000000;
+ opacity: 0.4;
+ font-size: 22px;
+ cursor: pointer;
+}
+
+.opened-letter__closer:hover {
+ opacity: 1;
+}
+
+.opened-letter__content {
+ padding: 15px;
+ font: 15px HelveticaNeue sans-serif;
+ white-space: normal;
+}
+
+.covered-letter_not-read {
+ font-weight: 700;
+}
+
+.is-read {
+ font-weight: 500;
+}
+
+.covered-letter__click-to-open-wrapper {
+ display: flex;
+ margin: 0;
+ vertical-align: middle;
+ padding: 11px 10px;
+ flex-grow: 1;
+ cursor: pointer;
+ min-width: 485px;
+}
+
+.covered-letter__checkbox-wrapper {
+ padding: 13px 10px 13px 20px;
+ cursor: pointer;
+}
+
+.check-letter_visually-hidden {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ border: 0;
+ padding: 0;
+ clip: rect(0 0 0 0);
+ overflow: hidden;
+}
+
+.check-letter__box {
+ display: inline-block;
+ position: absolute;
+ width: 14px;
+ height: 14px;
+ overflow: hidden;
+ border-radius: 3px;
+ border: 1px solid rgba(0, 0, 0, .15);
+ background-repeat: no-repeat;
+ background-position: 50% 50%;
+ background-color: #ffffff;
+ cursor: pointer;
+}
+
+.check-letter_visually-hidden:checked + .check-letter__box {
+ background-color: #4A90E2;
+ background-image: url(images/check.svg);
+}
+
+.check-letter_visually-hidden:focus + .check-letter__box {
+ box-shadow: 0 0 0 0.1em #4A90E2,
+ 0 0 0 0.3em #ffff00;
+}
+
+.covered-letter__mini-logo-wrapper {
+ margin-top: 5px;
+ min-width: 30px;
+ width: 30px;
+ height: 30px;
+}
+
+.mini-sender-pic {
+ width: 30px;
+ height: 30px;
+}
+
+.sender-name {
+ width: 160px;
+}
+
+.is-read-mark_not-read {
+ border-radius: 100px;
+ background-color: #6287bd;
+}
+
+.is-read-mark, .is-read-mark_not-read {
+ margin-left: 8px;
+ width: 10px;
+ height: 10px;
+}
+
+.title-text {
+ margin-left: 10px;
+ margin-right: 35px;
+ width: 220px;
+ flex: 1;
+ white-space: nowrap;
+}
+
+.date-info {
+ color: #9b9b9b;
+ text-align: right;
+ margin: 5px 10px 0 0;
+ font-weight: 500;
+ max-width: 50px;
+}
+
+#read-letter-check:checked ~ .letters-section__closed-letter-body {
+ display: none;
+}
+
+#read-letter-check:checked ~ .letters-section__letter-body_interior {
+ display: inline-block;
+}
+
+.covered-letter__item {
+ line-height: 1.2;
+ margin-top: 5px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.letters-section__footer {
+ margin-top: 75px;
+ min-width: 530px;
+ border-radius: 3px;
+ background-color: #ffffff;
+}
+
+.letters-section__footer-info {
+ padding: 7px 20px;
+ text-align: right;
+ font-size: 11px;
+ cursor: pointer;
+}
+
+.letters-section__footer-item {
+ display: inline-block;
+ margin-top: 5px;
+ vertical-align: center;
+ margin-left: 25px;
+ margin-right: -25px;
+ color: #9b9b9b;
+ max-width: 100px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.letters-section__footer-link {
+ display: inline-block;
+ margin-top: 5px;
+ margin-left: 25px;
+ color: #9b9b9b;
+ text-decoration: none;
+ max-width: 140px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.letters-section__footer-link:hover {
+ color: #000000;
+ opacity: 0.75;
+}
+
+.mail-box__letters-section-wrapper {
+ min-height: 380px;
+}
+
+.letters-section_delete-letter-animation {
+ animation: deleteLetter 0.5s linear;
+}
+
+.letters-section_add-letter-animation {
+ animation: addLetter 0.5s linear;
+}
+
+@keyframes addLetter {
+ from {
+ opacity: 0.0;
+ transform: translateY(-20px);
+ }
+ to {
+ opacity: 1.0;
+ transform: translateY(0);
+ }
+}
+
+@keyframes deleteLetter {
+ from {
+ opacity: 1.0;
+ transform: translateX(0);
+ }
+ to {
+ opacity: 0.0;
+ transform: translateX(50px);
+ }
+}
+
+.non-displayed {
+ display: none;
+}
\ No newline at end of file