{"id":48883,"date":"2020-05-03T03:01:47","date_gmt":"2020-05-02T17:01:47","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=48883"},"modified":"2020-05-02T14:47:30","modified_gmt":"2020-05-02T04:47:30","slug":"css-counters-game-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/css-counters-game-primer-tutorial\/","title":{"rendered":"CSS Counters Game Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flying_number_divs.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"CSS Counters Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flying_number_divs.jpg\" title=\"CSS Counters Game Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">CSS Counters Game Primer Tutorial<\/p><\/div>\n<p>How best to do a tutorial about a CSS feature doing very Javascript&#8217;y things?  Yes, <a target=_blank title='CSS Counters' href='https:\/\/www.w3schools.com\/css\/css_counters.asp'>CSS Counters<\/a> represents a CSS way to create dynamic content, which is usually the domain of Javascript scripting, as a lot of you would know.<\/p>\n<p>We decided to do this by designing a rudimentary Social Distancing Squares Game where &#8230;<\/p>\n<ul>\n<li>a webpage is initiated with the first such square &#8230; and then &#8230;<\/li>\n<li>any other squares are located where the user clicks them (at their top left) &#8230; and &#8230;<\/li>\n<li>as far as scoring goes &#8230;\n<ol>\n<li>a numbered (via CSS Counters) square (perhaps linked to a Name entered in by the user) can score positively by keeping a respectably small distance from others &#8230; but &#8230;<\/li>\n<li>a numbered square can score negatively if too close to another square<\/li>\n<li>a numbered square score will not change if &#8220;out of the loop&#8221; too far away from another<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p> &#8230; so containing a modicum of &#8220;tactics scope&#8221; (yet, mainly luck), for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flying_number_divs.html_GETME\" title=\"Click picture\">flying_number_div.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flying_number_divs.html\" title=\"Click picture\">live run<\/a> link.  Pretty obviously, it would be a doddle for Javascript to do what the CSS Counters are doing, but that is not the point of learning new approaches and ways of achieving HTML content.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d48883' onclick='var dv=document.getElementById(\"d48883\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/gqme\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d48883' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>How best to do a tutorial about a CSS feature doing very Javascript&#8217;y things? Yes, CSS Counters represents a CSS way to create dynamic content, which is usually the domain of Javascript scripting, as a lot of you would know. &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/css-counters-game-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[3291,281,342,476,576,652,997,3292,1319],"class_list":["post-48883","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-counter","tag-css","tag-div","tag-game","tag-html","tag-javascript","tag-programming","tag-social-distancing","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/48883"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=48883"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/48883\/revisions"}],"predecessor-version":[{"id":48887,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/48883\/revisions\/48887"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=48883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=48883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=48883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}