{"id":890,"date":"2021-03-28T14:28:30","date_gmt":"2021-03-28T14:28:30","guid":{"rendered":"https:\/\/ld-wp73.template-help.com\/wordpress\/prod_31126\/v1\/?p=890"},"modified":"2026-04-30T19:46:07","modified_gmt":"2026-04-30T19:46:07","slug":"atividade-7","status":"publish","type":"post","link":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/atividade-7\/","title":{"rendered":"Typing Speed \u2328\ufe0f"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"890\" class=\"elementor elementor-890\">\n\t\t\t\t<div class=\"elementor-element elementor-element-15822d17 e-flex e-con-boxed e-con e-parent\" data-id=\"15822d17\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;jet_parallax_layout_list&quot;:[]}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-41f83c1 elementor-widget elementor-widget-html\" data-id=\"41f83c1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<style>\r\n\r\n\/* Estilo geral *\/\r\nbody{\r\nfont-family: Arial;\r\ntext-align:center;\r\nbackground:#0a0f1c;\r\ncolor:white;\r\n}\r\n\r\n\/* Caixa principal *\/\r\n.game{\r\nmargin-top:20px;\r\n}\r\n\r\n\/* Palavra *\/\r\n.word{\r\nfont-size:32px;\r\nmargin:20px;\r\ncolor:#00ffcc;\r\n}\r\n\r\n\/* Input *\/\r\ninput{\r\npadding:10px;\r\nfont-size:18px;\r\nborder-radius:5px;\r\nborder:none;\r\noutline:none;\r\n}\r\n\r\n\/* Info *\/\r\n.info{\r\nmargin:10px;\r\nfont-size:18px;\r\n}\r\n\r\n\/* Bot\u00f5es *\/\r\nbutton{\r\npadding:8px 15px;\r\nmargin:5px;\r\nborder:none;\r\nborder-radius:5px;\r\nbackground:#3498db;\r\ncolor:white;\r\ncursor:pointer;\r\n}\r\n\r\n\/* Mensagem *\/\r\n.msg{\r\nmargin-top:20px;\r\nfont-size:20px;\r\ndisplay:none;\r\ncolor:#00ff99;\r\n}\r\n\r\n<\/style>\r\n\r\n\r\n<div class=\"info\">\r\nPontua\u00e7\u00e3o: <span id=\"score\">0<\/span> |\r\nTempo: <span id=\"time\">30<\/span>s\r\n<\/div>\r\n\r\n<button onclick=\"startGame()\">Jogar<\/button>\r\n<button onclick=\"startGame()\">Reiniciar<\/button>\r\n\r\n<div class=\"game\">\r\n<div class=\"word\" id=\"word\">---<\/div>\r\n<input type=\"text\" id=\"input\" placeholder=\"Escreve aqui...\" disabled>\r\n<\/div>\r\n\r\n<div class=\"msg\" id=\"msg\"><\/div>\r\n\r\n<script>\r\n\r\n\/* Lista de palavras *\/\r\nconst words = [\r\n\"computador\",\"teclado\",\"rato\",\"janela\",\"internet\",\r\n\"jogo\",\"escola\",\"bicicleta\",\"cenas\",\"coisas\",\"teste\",\"elementor\",\"porta\",\"informatica\",\"professor\",\"carro\",\"mota\",\"livro\",\r\n\"estudar\",\"velocidade\",\"precisao\",\"memoria\",\"nivel\"\r\n];\r\n\r\n\/* Vari\u00e1veis *\/\r\nlet score = 0;\r\nlet timeLeft = 30;\r\nlet currentWord = \"\";\r\nlet timer;\r\n\r\n\/* Iniciar jogo *\/\r\nfunction startGame(){\r\n\r\nscore = 0;\r\ntimeLeft = 30;\r\n\r\ndocument.getElementById(\"msg\").style.display = \"none\";\r\n\r\nlet input = document.getElementById(\"input\");\r\ninput.disabled = false;\r\ninput.value = \"\";\r\ninput.focus();\r\n\r\nupdateUI();\r\nnewWord();\r\n\r\n\/* Timer *\/\r\nclearInterval(timer);\r\ntimer = setInterval(()=>{\r\ntimeLeft--;\r\nupdateUI();\r\n\r\nif(timeLeft <= 0){\r\nendGame();\r\n}\r\n\r\n},1000);\r\n\r\n}\r\n\r\n\/* Nova palavra *\/\r\nfunction newWord(){\r\n\r\ncurrentWord = words[Math.floor(Math.random()*words.length)];\r\ndocument.getElementById(\"word\").textContent = currentWord;\r\n\r\n}\r\n\r\n\/* Verificar input *\/\r\ndocument.getElementById(\"input\").addEventListener(\"input\", function(){\r\n\r\nif(this.value === currentWord){\r\n\r\n\/* Pontos *\/\r\nscore += currentWord.length;\r\n\r\n\/* Limpar e nova palavra *\/\r\nthis.value = \"\";\r\nnewWord();\r\n\r\nupdateUI();\r\n\r\n}\r\n\r\n});\r\n\r\n\/* Fim *\/\r\nfunction endGame(){\r\n\r\nclearInterval(timer);\r\n\r\nlet input = document.getElementById(\"input\");\r\ninput.disabled = true;\r\n\r\nlet msg = document.getElementById(\"msg\");\r\nmsg.style.display = \"block\";\r\n\r\nmsg.innerHTML = `\r\n\ud83c\udf89 Fim do jogo<br>\r\nPontua\u00e7\u00e3o: ${score}\r\n`;\r\n\r\n}\r\n\r\n\/* UI *\/\r\nfunction updateUI(){\r\ndocument.getElementById(\"score\").textContent = score;\r\ndocument.getElementById(\"time\").textContent = timeLeft;\r\n}\r\n\r\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-54b228fd elementor-widget elementor-widget-text-editor\" data-id=\"54b228fd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Escreve a palavra o mais r\u00e1pido que conseguires!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Velocidade vs precis\u00e3o \u2014 quem ganha?<\/p>\n","protected":false},"author":1,"featured_media":1796,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-novidades","category-quebra-cabecas"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/comments?post=890"}],"version-history":[{"count":18,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/posts\/890\/revisions"}],"predecessor-version":[{"id":1839,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/posts\/890\/revisions\/1839"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/media\/1796"}],"wp:attachment":[{"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/media?parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/categories?post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/informatica-aesv.pt\/cantinho-aesv\/wp-json\/wp\/v2\/tags?post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}