{"id":36192,"date":"2018-02-15T03:01:01","date_gmt":"2018-02-14T17:01:01","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=36192"},"modified":"2018-02-14T16:15:40","modified_gmt":"2018-02-14T06:15:40","slug":"rainbow-games-background-image-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/rainbow-games-background-image-tutorial\/","title":{"rendered":"Rainbow Games Background Image Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Rainbow Games Background Image Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation_bg.jpg\" title=\"Rainbow Games Background Image Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Rainbow Games Background Image Tutorial<\/p><\/div>\n<p>If you are a regular at this blog, you will know that we are exploring &#8220;in depth&#8221; the implications of discovering what the &#8220;Did you Know?&#8221; section of the recent <a title='Column Intelligence Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/column-intelligence-primer-tutorial'>Column Intelligence Primer Tutorial<\/a> told us about how you can have a background with transparency teamed up with that same HTML element&#8217;s &#8220;foreground&#8221; having full opacity.  We find this very interesting, because time and time again, we&#8217;ve left off doing web design a certain way in ignorance of &#8220;the genius&#8221; of <a target=_blank title='Great link' href='https:\/\/stackoverflow.com\/questions\/7241341\/can-i-set-an-opacity-only-to-the-background-image-of-a-div'>this webpage<\/a>&#8216;s great advice, thanks.<\/p>\n<p>Today, we have another application of that discovery, to brighten up the recent, the whimsical <a title='Rainbow Games PHP Emoji Tutorial' href='#rgphpet'>Rainbow Games PHP Emoji Tutorial<\/a> game(s).  Whimsical it may all seem, but if you are like me and &#8220;graphically challenged&#8221;, emojis and this background image transparency idea and some other CSS background image ideas, today, namely &#8230;<\/p>\n<p><code><br \/>\nCSS <a target=_blank title='CSS background image background-position information from w3schools' href='https:\/\/www.w3schools.com\/cssref\/pr_background-position.asp'>background-position<\/a>: (left)% (top)%; (as applied to background image(s))<br \/>\n<\/code><\/p>\n<p> &#8230; can be powerful countervailing &#8220;friends&#8221;.<\/p>\n<p>If you are familiar with our &#8220;Rainbow Games&#8221; web application, it works via an HTML table element (where today we&#8217;ve specified <a target=_blank title='HTML cellpadding attribute information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_table_cellpadding.asp'>cellpadding<\/a>=0 and <a target=_blank title='HTML cellspacing attribute information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_table_cellspacing.asp'>cellspacing<\/a>=0 to avoid white bits we haven&#8217;t had to worry about before when we didn&#8217;t have any background imagery) that nests an HTML tbody element that nests HTML tr (row) elements (that are the ones we&#8217;re going to &#8220;background semi-transparent image&#8221; style today) which nest individual HTML td (cell) elements that the sportspeople traverse as they sprint or row etcetera etcetera etcetera.<\/p>\n<p>Even though in the CSS styling of all this it is not mentioned, because it is the default, what also makes all this work is &#8230;<\/p>\n<p><code><br \/>\nCSS <a target=_blank title='CSS background image background-repeat information from w3schools' href='https:\/\/www.w3schools.com\/cssref\/pr_background-repeat.asp'>background-repeat<\/a>:repeat;<br \/>\n<\/code><\/p>\n<p> &#8230; and what a good default it is, enabling we &#8220;graphically challenged&#8221; to, sometimes, only have to come up with &#8220;slivers&#8221; of our ghastly graphic elements, but be able to get the wonders of CSS styling to help us out &#8220;filling in&#8221; the repeated &#8220;gaps&#8221; (alas, not in our abilities?!).<\/p>\n<p>Let&#8217;s now talk about another thing in our control for this <i>background-position:<b>(left)%<\/b> <b>(top)%<\/b>;<\/i> &#8230; in our case we develop 8 background images for the sports we have, but they look a lot alike, and Paintbrush and a little GIMP (image editors) suffice for us to get them done, the default one, as shown below, being <a target=_blank title='sprint.jpg' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/sprint.jpg'>sprint.jpg<\/a> &#8230;<\/p>\n<p><img src='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/sprint.jpg' title='sprint.jpg'><\/img><\/p>\n<p> &#8230; see how we have lanes separated top to bottom running left to right.  See the &#8220;baubles&#8221; of interest off the track?  We add interest with these.  We have each runner, and all this is very approximate (and whimsical, remember?!), adopting a lane via different CSS for each lane, the <b>top one<\/b> having (the CSS styling) &#8230;<\/p>\n<p><code><br \/>\n#mytr {<br \/>\n     background-image: linear-gradient(rgba(255,255,255,0.7),rgba(255,255,255,0.7)), url('sprint.jpg');<br \/>\n     background-position: <i>0%<\/i> <b>18%<\/b>;<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; and the <b>bottom one<\/b> having &#8230;<\/p>\n<p><code><br \/>\n#mytr8 {<br \/>\n     background-image: linear-gradient(rgba(255,255,255,0.7),rgba(255,255,255,0.7)), url('sprint.jpg');<br \/>\n     background-position: <i>90%<\/i> <b>58%<\/b>;<br \/>\n}<br \/>\n<\/code><\/p>\n<p>Get it?  Hope so.  Now as far as <i>&#8220;the baubles&#8221;<\/i> go the execution of the race will be made more interesting by each lane seeing different <i>&#8220;bauble detail&#8221;<\/i> because of the <i>(left)%<\/i> differentiation per lane.  Imagine how impactive all this could be with your impeccable graphics skills added into the equation!<\/p>\n<p>The HTML source code for this web application&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.htm\" title=\"Click picture\">live run<\/a>, <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html----GETME\" title=\"emoji_walk_animation.htm\">emoji_walk_animation.htm<\/a> changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html----GETME\" title=\"emoji_walk_animation.html\">this way<\/a> for today&#8217;s background imagery work.  Hope you try it!<\/li>\n<p>We hope we haven&#8217;t <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=KEP1acj29-Y'>assume<\/a>d anything regarding <i>semi-transparent background with less transparent foreground<\/i> that you understand it can be a CSS static arrangement, as in the third and fourth code snippets above, or dynamically controlled in a Javascript DOM way <b>like<\/b> (in our new Javascript function) &#8230;<\/p>\n<p><code><br \/>\nfunction depending() {<br \/>\nvar newbimg='sprint.jpg', trsuff='';<br \/>\nswitch(verb.toLowerCase().replace(\/\\ \/g,'')) {<br \/>\n    case 'row':<br \/>\n    case 'rowing':<br \/>\n        newbimg='row.jpg';<br \/>\n        break;<br \/>\n    case 'cycle':<br \/>\n    case 'biking':<br \/>\n        newbimg='cycle.jpg';<br \/>\n        break;<br \/>\n    case 'climb':<br \/>\n    case 'climbing':<br \/>\n        newbimg='climbing.jpg';<br \/>\n        break;<br \/>\n    case 'juggle':<br \/>\n    case 'juggling':<br \/>\n        newbimg='juggling.jpg';<br \/>\n        break;<br \/>\n    case 'cartwheel':<br \/>\n    case 'cartwheeling':<br \/>\n        newbimg='cartwheeling.jpg';<br \/>\n        break;<br \/>\n    case 'waterpoloplay':<br \/>\n    case 'playingwaterpolo':<br \/>\n        newbimg='waterpolo.jpg';<br \/>\n        break;<br \/>\n    case 'mountaincycle':<br \/>\n    case 'mountainbiking':<br \/>\n        newbimg='mountaincycle.jpg';<br \/>\n        break;<br \/>\n    case 'handballplay':<br \/>\n    case 'playinghandball':<br \/>\n        newbimg='handball.jpg';<br \/>\n        break;<br \/>\n    default:<br \/>\n        newbimg='sprint.jpg';<br \/>\n        break;<br \/>\n}<br \/>\n  if (newbimg != bimg) {<br \/>\n    for (var itr=1; itr<=8; itr++) {\n      <b>document.getElementById('mytr' + trsuff).style.backgroundImage=\"linear-gradient(rgba(255,255,255,0.7),rgba(255,255,255,0.7)), url('\" + newbimg + \"')\";<\/b><br \/>\n      trsuff='' + eval(1 + itr);<br \/>\n    }<br \/>\n    bimg=newbimg;<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/p>\n<hr>\n<p id='rgphpet'>Previous relevant <a target=_blank title='Rainbow Games PHP Emoji Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/rainbow-games-php-emoji-tutorial\/'>Rainbow Games PHP Emoji Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Rainbow Games PHP Emoji Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation_php.jpg\" title=\"Rainbow Games PHP Emoji Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Rainbow Games PHP Emoji Tutorial<\/p><\/div>\n<p>In order to take that further genericization step onto the achievements of yesterday&#8217;s <a title='Rainbow Games Genericization Tutorial' href='#rggt'>Rainbow Games Genericization Tutorial<\/a> to <b>get onto<\/b> (the mathematics Induction principle inspired) &#8230;<\/p>\n<ul>\n<li>prove for the first case<\/li>\n<li>prove for the second case<\/li>\n<li><b>prove for the n<sup>th<\/sup> case<\/b><\/li>\n<\/ul>\n<p> &#8230; we had a choice of &#8230;<\/p>\n<ul>\n<li>continue on (with) the HTML code creation of new &#8220;hardcoded&#8221; arrays (managed by Javascript eval abstractional approach) &#8230; or &#8220;bite the bullet&#8221; and &#8230;<\/li>\n<li>try to work out a generic &#8220;emoji look<font size=1>erer<\/font> up<font size=1>perer<\/font>&#8221; arrangement<\/li>\n<\/ul>\n<p>Guess you can tell we opted for the latter, huh?!  We started the investigation of this by examining our three favourite emoji informational websites, namely &#8230;<\/p>\n<ol>\n<li><a target=_blank title='Emojipedia' href='http:\/\/www.emojipedia.org'>Emojipedia<\/a><\/li>\n<li><a target=_blank title='FileFormation Information website' href='http:\/\/www.fileformat.info'>FileFormat Information<\/a><\/li>\n<li><a target=_blank title='Iemoji website' href='http:\/\/www.iemoji.com'>Iemoji<\/a><\/li>\n<\/ol>\n<p> &#8230; and were a bit surprised that we could not quite swing a generic method to glean the information, so don&#8217;t know whether our new &#8220;player&#8221; is &#8220;Ringo Starr&#8221; or not, but can tell you this, &#8220;its beat is much better than its bite&#8221; &#8230; <font size=1>chortle, chortle<\/font> &#8230;<\/p>\n<p><a target=_blank title='Emoji Terra' href='http:\/\/www.emojiterra.com'>Emoji Terra<\/a> performs similar functionality as Iemoji but has a permalink organization more friendly to an &#8220;emoji search via emoji title&#8221; query, and that suits our purposes today, so, thanks a lot.  Without this query by &#8220;emoji title&#8221; possibility we&#8217;d have been forced to adopt more of those &#8220;hardcoded&#8221; arrays, which would have been alright, but this second approach opens the door to &#8220;sport&#8221; events in &#8220;The Rainbow Games&#8221; web application using emojis of the future (ie. they haven&#8217;t been invented yet).<\/p>\n<p>How to work the interfacing to <a target=_blank title='Emoji Terra' href='http:\/\/www.emojiterra.com'>Emoji Terra<\/a>?<\/p>\n<ul>\n<li>good ol&#8217; PHP serverside language<\/li>\n<li>good ol&#8217; PHP&#8217;s <a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a> (supplemented by)<\/li>\n<li>good newish &#8220;PHP Source File as the Database Source&#8221; we&#8217;ve talked about in the past with <a target=_blank title='PHP Require Database Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-require-database-primer-tutorial\/'>PHP Require Database Primer Tutorial<\/a> and <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/signature-signature-php-tutorial\/' title='Signature Signature PHP Tutorial'>Signature Signature PHP Tutorial<\/a> whereby the PHP Source File updates itself with web application data<\/li>\n<\/ul>\n<p>This new PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_lookup.php_GETME\" title=\"emoji_lookup.php\">emoji_lookup.php<\/a> treats the &#8220;<b>prove for the n<sup>th<\/sup> case<\/b>&#8221; sports as ones to &#8230;<\/p>\n<ul>\n<li>look up the emoji information for (in the order &#8220;PHP Source File as the Database Source&#8221; then try <a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a> of Emoji Terra lookup), and &#8230;<\/li>\n<li>read the HTML partner source code <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.htm\" title=\"Click picture\">live run<\/a>&#8216;s underlying HTML and Javascript and CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html---GETME\" title=\"emoji_walk_animation.htm\">emoji_walk_animation.htm<\/a> (which changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html---GETME\" title=\"emoji_walk_animation.html\">this way<\/a>)<\/li>\n<li>amend that HTML source to supplant the &#8220;Sprint&#8221; default sport for this new nominated sport <font size=1>&#8230; trying not to fall over laughing at some of the new sports we present (inspired by a visit to <a target=_blank title='Emoji Terra' href='http:\/\/www.emojiterra.com\/search\/woman'>Emoji Terra search<\/a>)<\/font><\/li>\n<li>write out that amended HTML code as the web page (the beauty of a serverside language like PHP)<\/li>\n<\/ul>\n<p>The more detailed specifics of the <i><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a> of Emoji Terra lookup<\/i> above are &#8230;<\/p>\n<ul>\n<li>build up a URL starting with <i>HTTP:\/\/emojiterra.com\/<\/i> &#8230; then &#8230;<\/li>\n<li>in emoji<i>land<\/i> arrangements there are two genders (as our prefixes if you will) &#8230; <i>woman-<\/i> and <i>man-<\/i><\/li>\n<li>then add on a &#8220;middle&#8221; sport descriptor (eg. <i>biking<\/i>)<\/li>\n<li>in emoji<i>land<\/i> emoticon<i>land<\/i> arrangements there are five descriptors (as our suffixes if you will) &#8230; <i>-dark-skin-tone<\/i>, <i>-medium-dark-skin-tone<\/i>, <i>-medium-skin-tone<\/i>, <i>-medium-light-skin-tone<\/i>, <i>-light-skin-tone<\/i><\/li>\n<li>for that set of 2x1x5=10 URLs glean what &#8220;HTML dec&#8221; (HTML Entity) information you can glean via the <a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a> call of the Emoji Terra URLs described above (eg. <a target=_blank title='' href='http:\/\/emojiterra.com\/woman-biking-dark-skin-tone'>Emoji: Woman Biking: Dark Skin Tone<\/a>) &#8230; built into a <i>Javascript array<\/i> string to &#8220;plug into&#8221; the previously read HTML partner source code, and amended to output as the web page the user sees<\/li>\n<\/ul>\n<p>Sports of the future in emoji<i>land<\/i>?  Just ask for the equivalent of <i>biking<\/i> (above) off the user via a Javascript prompt window (on the proviso you read <a target=_blank title='Conditional Alternative to Javascript Popup Windows in iOS Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/conditional-alternative-to-javascript-popup-windows-in-ios-tutorial\/'>Conditional Alternative to Javascript Popup Windows in iOS Tutorial<\/a> first please).<\/p>\n<hr>\n<p id='rggt'>Previous relevant <a target=_blank title='Rainbow Games Genericization Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/rainbow-games-genericization-tutorial\/'>Rainbow Games Genericization Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Rainbow Games Genericization Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation_row.jpg\" title=\"Rainbow Games Genericization Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Rainbow Games Genericization Tutorial<\/p><\/div>\n<p>What would help genericize the recent <a title='Rainbow Games Double Transformation Tutorial' href='#rgdtt'>Rainbow Games Double Transformation Tutorial<\/a> &#8220;Rainbow Games&#8221; web application?   How about introducing another sport?<\/p>\n<p>Again, in honour of &#8220;onions of the 4th dimension&#8221; approaches, we mainly, turn to the power of Javascript&#8217;s <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/jsref_eval.asp' title='Javascript eval'>eval<\/a> methodology to achieve this <a target=_blank title='Abstraction information from Wikipedia, thanks.' href='https:\/\/en.wikipedia.org\/wiki\/Abstraction'>abstracted<\/a> feeling to our web application.  Today, with this, we go <b>two thirds<\/b> of the way along the &#8220;Mathematical Induction&#8221; approach &#8230;<\/p>\n<ul>\n<li><b>prove for the first case<\/b><\/li>\n<li><b>prove for the second case<\/b><\/li>\n<li>prove for the n<sup>th<\/sup> case<\/li>\n<\/ul>\n<p>How does this use of Javascript eval manifest itself in this way?<\/p>\n<ul>\n<li>there are two arrays that work with the &#8220;content&#8221; of our &#8220;Rainbow Games&#8221; sport(s) (<font size=1>well, at least, the first &#8220;sprint running&#8221; sport<\/font>) called <i>emoticons[]<\/i> and <i>choices[]<\/i><\/li>\n<li>wherever we find references in the code to either of these two arrays we start to <b>involve<\/b> the global var<font size=1>iable<\/font> <b>verbsuffix<\/b> &#8230;<br \/>\n<code><br \/>\nvar verb='Sprint';<br \/>\nvar verbs=['Sprint','Row'];<br \/>\nvar anotherverb='run';<br \/>\n<b>var verbsuffix='';<\/b><br \/>\n<\/code><br \/>\n &#8230; in <b>altered<\/b> ways like &#8230;<br \/>\n<code><br \/>\nfunction plus(ih,ihep) {<br \/>\n  var outihep=ihep;<br \/>\n  if (<b>eval(\"<\/b>emoticons<b>\" + verbsuffix + \"<\/b>[<b>\" + <\/b>ih<b> + \"<\/b>]<b>\")<\/b>.indexOf('&lt;p&gt;') != -1) {<br \/>\n    outihep += ' (' + <b>eval(\"<\/b>emoticons<b>\" + verbsuffix + \"<\/b>[<b>\" + <\/b>ih<b> + \"<\/b>]<b>\")<\/b>.split('&lt;p&gt;')[1].split('&lt;')[0] + ')';<br \/>\n  }<br \/>\n  return outihep;<br \/>\n}<br \/>\n<\/code><br \/>\n &#8230; in that <i>abstracted<\/i> way &#8230; noting that sometimes you don&#8217;t need the &#8220;eval()&#8221; encasings &#8230;\n<\/li>\n<li>and so, working through the code this way it just falls to the coder to define new members for all the arrays for all the new sports (ours is &#8220;rowing&#8221; today), some of those new arrays (like for rowing are <i>emoticonsrowing[]<\/i> and <i>choicesrowing[]<\/i>) to involve &#8230;<\/li>\n<li>looking up emoji definitions from &#8230;\n<ol>\n<li><a target=_blank title='Emojipedia' href='http:\/\/www.emojipedia.org'>Emojipedia<\/a><\/li>\n<li><a target=_blank title='FileFormation Information website' href='http:\/\/www.fileformat.info'>FileFormat Information<\/a><\/li>\n<li><a target=_blank title='Iemoji website' href='http:\/\/www.iemoji.com'>Iemoji<\/a><\/li>\n<\/ol>\n<p>&#8230; not forgetting to &#8230;\n<\/li>\n<li>make sure the event logics work for multiple sport scenarios &#8230; but mostly they do by sticking to the principles above &#8230; especially for the &#8230;<\/li>\n<li>new HTML select (dropdown) element allows the user to pick a sport<\/li>\n<\/ul>\n<p>Remaining a work in progress, you can try out our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.htm\" title=\"Click picture\">live run<\/a> link that has underlying HTML and Javascript and CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html--GETME\" title=\"emoji_walk_animation.htm\">emoji_walk_animation.htm<\/a>, and which changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html--GETME\" title=\"emoji_walk_animation.html\">this way<\/a> regarding today&#8217;s genericization work.  We hope it gives you food for thought.<\/p>\n<hr>\n<p id='rgdtt'>Previous relevant <a target=_blank title='Rainbow Games Double Transformation Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/rainbow-games-double-transformation-tutorial\/'>Rainbow Games Double Transformation Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Rainbow Games Double Transformation Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation_dt.jpg\" title=\"Rainbow Games Double Transformation Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Rainbow Games Double Transformation Tutorial<\/p><\/div>\n<p>We were on the &#8220;road to personalization&#8221; for the web application game we started with yesterday&#8217;s <a title='Rainbow Games Primer Tutorial' href='#rgpt'>Rainbow Games Primer Tutorial<\/a> when &#8220;an old chestnut&#8221; came up again.  It&#8217;s happened before, the desire to &#8220;double transform&#8221; in CSS came about from our emoji &#8230; <\/p>\n<table>\n<tr>\n<td style='font-size:36px;'>&#127939;&#127998;&#8205;&#9792;&#65039;<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; table cell <i>mirroring<\/i> styling as per &#8230;<\/p>\n<p><code><br \/>\n&lt;style&gt;<br \/>\n* { overflow-x: visible; }<br \/>\n<br \/>\nselect { font-size: 36px; }<br \/>\n<br \/>\ntd.runner { width: 50px; word-wrap: break-word; font-size: 36px;<br \/>\n     <i>transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform:  scale(-1, 1);<\/i><br \/>\n        }   \/\/ <\/p>\n<table>\n<tr>\n<td style='font-size:36px;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform:  scale(-1, 1);'>&#127939;&#127998;&#8205;&#9792;&#65039;<\/td>\n<\/tr>\n<\/table>\n<p>tr { max-height: 40px; }<br \/>\n&lt;\/style&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; necessary to make our running emojis run from left to right (that, alas, also transformed any accompanying &#8230; <\/p>\n<table>\n<tr>\n<td style='font-size:36px;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform:  scale(-1, 1);'>&#127939;&#127998;&#8205;&#9792;&#65039; <\/p>\n<p style=\"display: block; font-size: 12px;-\">Florence<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; name), was added to in <b>this double transformational clause<\/b> to prove what this <a target=_blank title='Great link, thanks' href='https:\/\/stackoverflow.com\/questions\/5406368\/can-you-use-css-to-mirror-flip-text'>wonderful web page<\/a> advice had to say.  In other words, a &#8220;double transform&#8221; CSS styling scenario like the one below &#8230;<\/p>\n<p><code><br \/>\n&lt;style&gt;<br \/>\n* { overflow-x: visible; }<br \/>\n<br \/>\nselect { font-size: 36px; }<br \/>\n<br \/>\ntd.runner { width: 50px; word-wrap: break-word; font-size: 36px;<br \/>\n     <i>transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform:  scale(-1, 1);<\/i><br \/>\n        }<br \/>\ntr { max-height: 40px; }<br \/>\n<br \/>\n<b>p {<br \/>\n    display: block;<br \/>\n    font-size: 12px;<br \/>\n    -webkit-transform: matrix(-1, 0, 0, 1, 0, 0);<br \/>\n    -moz-transform: matrix(-1, 0, 0, 1, 0, 0);<br \/>\n    -o-transform: matrix(-1, 0, 0, 1, 0, 0);<br \/>\n    transform: matrix(-1, 0, 0, 1, 0, 0);<br \/>\n}  <\/b>  \/\/ <\/p>\n<table style='width:50px;'>\n<tr style='width:50px;'>\n<td style='width:50px;font-size:36px;transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform:  scale(-1, 1);'>&#127939;&#127998;&#8205;&#9792;&#65039; <\/p>\n<p style=\"display: block; font-size: 12px;-webkit-transform: matrix(-1, 0, 0, 1, 0, 0);-moz-transform: matrix(-1, 0, 0, 1, 0, 0);-o-transform: matrix(-1, 0, 0, 1, 0, 0);transform: matrix(-1, 0, 0, 1, 0, 0);\">Florence<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p>&lt;\/style&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; works as a &#8220;double transform&#8221; to first &#8230;<\/p>\n<ul>\n<li>mirror (image) flip the table cell (td) emoji data &#8230; but us appending some &#8220;Runner Name&#8221; textual data underneath also, annoyingly, got flipped  until &#8230;<\/li>\n<li>within that (same) table cell (td) element and after the emoji data we append an HTML <a target=_blank title='HTML p tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_p.asp'>p<\/a>(aragraph) element to both &#8230;\n<ol>\n<li>introduce a new HTML element type into the (CSS styling) mix &#8230; and to &#8230;<\/li>\n<li>introduce a new CSS transformation type, the matrix &#8230; perhaps either or both new parts to the problem critical to its success when, believe me, lots of other approaches don&#8217;t work<\/li>\n<\/ol>\n<\/ul>\n<p> &#8230; to personalize the &#8220;runners&#8221; and &#8220;users&#8221;, optionally, &#8220;into the game&#8221;, by allowing the &#8220;user&#8221; to name their &#8220;runners&#8221; and allow for a &#8220;runner energy&#8221; setting be a bit randomized, to add for some other interest &#8220;variety&#8221; to the game&#8217;s workings.  So, still a work in progress that you can try out at our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html\" title=\"Click picture\">live run<\/a> link that has underlying HTML and Javascript and CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html-GETME\" title=\"emoji_walk_animation.html\">emoji_walk_animation.html<\/a>, and which changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html-GETME\" title=\"emoji_walk_animation.html\">this way<\/a> regarding today&#8217;s work.<\/p>\n<hr>\n<p id='rgpt'>Previous relevant <a target=_blank title='Rainbow Games Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/rainbow-games-primer-tutorial\/'>Rainbow Games Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Interesting Places Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.jpg\" title=\"Rainbow Games Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Rainbow Games Primer Tutorial<\/p><\/div>\n<p>It&#8217;s been a while since we&#8217;ve written any conventional HTML and Javascript and CSS game.  Today&#8217;s game uses the &#8220;emoticon&#8221; section of the Emoji character set, defaulting so far, to the &#8220;running woman&#8221; emoji featuring in <a target=_blank title='Compound Emoji WordPress Usage Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/compound-emoji-wordpress-usage-tutorial\/'>Compound Emoji WordPress Usage Tutorial<\/a>.<\/p>\n<p>It&#8217;s the early days of our &#8220;Rainbow Games&#8221; web application, and we&#8217;re starting with the animation featuring horizontal hashtag navigation techniques for a running race start to our game.  Where it finishes?  Hard to say! Today, we&#8217;ve looked at &#8220;splits&#8221; and a finish line.<\/p>\n<p>You can try out our burgeoning <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html\" title=\"Click picture\">live run game concept<\/a> link that has underlying HTML and Javascript and CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_walk_animation.html_GETME\" title=\"emoji_walk_animation.html\">emoji_walk_animation.html<\/a>.<\/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='#d35745' onclick='var dv=document.getElementById(\"d35745\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35745' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d35768' onclick='var dv=document.getElementById(\"d35768\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/transformation\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35768' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d35879' onclick='var dv=document.getElementById(\"d35879\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/eval\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35879' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d35937' onclick='var dv=document.getElementById(\"d35937\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/file_get_contents\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35937' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d36192' onclick='var dv=document.getElementById(\"d36192\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/background-image\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d36192' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you are a regular at this blog, you will know that we are exploring &#8220;in depth&#8221; the implications of discovering what the &#8220;Did you Know?&#8221; section of the recent Column Intelligence Primer Tutorial told us about how you can &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/rainbow-games-background-image-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,14,37],"tags":[2458,126,127,2471,2472,2473,2474,230,281,299,354,385,399,429,446,1839,491,576,577,590,2459,652,2020,2300,2428,876,894,896,917,1512,932,997,1917,1238,1319,2454],"class_list":["post-36192","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-abstraction","tag-background","tag-background-image","tag-background-position","tag-background-repeat","tag-cellpadding","tag-cellspacing","tag-column","tag-css","tag-database-2","tag-dom","tag-emoji","tag-eval","tag-file_get_contents","tag-float","tag-genericization","tag-gimp","tag-html","tag-html-entities","tag-image","tag-induction","tag-javascript","tag-linear-gradient","tag-newspaper","tag-onion","tag-opacity","tag-overlay","tag-paintbrush","tag-permalink","tag-permalinks","tag-php","tag-programming","tag-scroll","tag-table","tag-tutorial","tag-typesetting"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36192"}],"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=36192"}],"version-history":[{"count":13,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36192\/revisions"}],"predecessor-version":[{"id":36205,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36192\/revisions\/36205"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=36192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=36192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=36192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}