{"id":68611,"date":"2025-06-08T03:01:00","date_gmt":"2025-06-07T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=68611"},"modified":"2025-06-06T12:42:36","modified_gmt":"2025-06-06T02:42:36","slug":"image-flipping-or-flopping-at-speed-browsing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/image-flipping-or-flopping-at-speed-browsing-tutorial\/","title":{"rendered":"Image Flipping or Flopping at Speed Browsing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Flipping or Flopping at Speed Browsing Tutorial\" src=\"\/image_flipping_or_flopping_at_speed_more.gif\" title=\"Image Flipping or Flopping at Speed Browsing Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Flipping or Flopping at Speed Browsing Tutorial<\/p><\/div>\n<p>We&#8217;ve thought of a few ways to improve on the work of yesterday&#8217;s <a title='Image Flipping or Flopping at Speed Primer Tutorial' href='#iffspt'>Image Flipping or Flopping at Speed Primer Tutorial<\/a>, they being &#8230;<\/p>\n<ul>\n<li><font size=1>onto yesterday&#8217;s <i>Image URL<\/i> means of addressing your image <\/font>today we allow for local file browsing of your image file (and transferred into the web application&#8217;s image contents via Javascript &#8230;<br \/>\n<code><br \/>\n  var imgo=null;<br \/>\n  var sxis=1.0, syis=0.0;<br \/>\n  var rpm=eval(300 \/ 10);<br \/>\n  var isecs=eval(30 \/ rpm);     \/\/ 0.1;<br \/>\n  var imagedurl='', theimgurl='http:\/\/www.rjmprogramming.com.au\/Android\/NalaLuna.jpg';<br \/>\n  var theclass=theimgurl.slice(-96).replace(\/\\:\/g,'!').replace(\/\\.\/g,'|'); \/\/'http!\/\/www.rjmprogramming.com.au\/Android\/NalaLuna|jpg';<br \/>\n  var dcbi='', started=false;<br \/>\n<br \/> <br \/>\n  function resultlook() {<br \/>\n    if (document.getElementById('result').innerHTML != '') {<br \/>\n       imagedurl=document.getElementById('result').innerHTML;<br \/>\n       document.getElementById('result').innerHTML='';<br \/>\n       theimgurl=imagedurl;<br \/>\n       theclass=theimgurl.slice(-96).replace(\/\\:\/g,'!').replace(\/\\.\/g,'|');<br \/>\n       document.getElementById('myimg').src=imagedurl;<br \/>\n       imgo=document.getElementById('myimg');<br \/>\n       document.getElementById('myimg').className=theclass;<br \/>\n       document.getElementById('imgurl').placeholder=imagedurl;<br \/>\n       document.getElementById('imgurl').title=imagedurl;<br \/>\n       document.getElementById('imgurl').value='';<br \/>\n       imagedurl='';<br \/>\n       document.getElementById('divcbi').innerHTML=dcbi;<br \/>\n    }<br \/>\n  }<br \/>\n<br \/> <br \/>\n  setInterval(resultlook, 5000);<br \/>\n<\/code><br \/>\n &#8230; teaming up with the HTML access to our inhouse local file browser &#8230;<br \/>\n<code><br \/>\n&lt;div id=divcbi style=display:inline-block;&gt;&lt;iframe scrolling=no frameborder=0 id=cbi data-accept=\"image\/*\" style=\"width:163px;height:228px;margin-top:-204px;display:inline-block;background-color:transparent;\" src=\"\/HTMLCSS\/client_browsing.htm?d=3121605626826&amp;wording=Allimages%20images%2E%20\"&gt;&lt;\/iframe&gt;&lt;\/div&gt;<br \/>\n<\/code><br \/>\n &#8230; allowing for the data URI to be gleaned this way)<\/li>\n<li>allow for a CSS border-radius property be applied to your image via &#8230;<br \/>\n<code><br \/>\n  var brad=\"0\";<br \/>\n  <br \/>\n  function changeradius(tbo) {<br \/>\n    if (eval('' + tbo.value) != brad) {<br \/>\n      brad=('' + tbo.value);<br \/>\n      document.getElementById('myimg').style.borderRadius='' + brad.trim().replace(\/px$\/g,'') + (brad.replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'').replace(\/px\/g,'').trim() == '' ? 'px' : '');<br \/>\n    }<br \/>\n  }<br \/>\n<\/code>\n<\/li>\n<li><font size=1>onto yesterday&#8217;s Flip and Flop transform options <\/font>today we add FlipFlop and FlopFlip options <font color=blue>this way<\/font> &#8230;<br \/>\n<code><br \/>\n  var ffnum=0;<br \/>\n  var flipflops=['scaleX(1) scaleY(1)','scaleX(-1) scaleY(1)','scaleX(-1) scaleY(-1)','scaleX(1) scaleY(-1)'];<br \/>\n  var flopflips=['scaleX(1) scaleY(1)','scaleX(1) scaleY(-1)','scaleX(-1) scaleY(-1)','scaleX(-1) scaleY(1)'];<br \/>\n<br \/> <br \/>\n  function doanim() {<br \/>\n    if (Math.abs(sxis) &gt; 0.5) {<br \/>\n      sxis=eval(-1.0 * sxis);<br \/>\n      imgo.style.transform='scaleX(' + sxis + ')';<br \/>\n    } else if (Math.abs(syis) &gt; 0.5) {<br \/>\n      syis=eval(-1.0 * syis);<br \/>\n      imgo.style.transform='scaleY(' + syis + ')';<br \/>\n    }<font color=blue> else if (Math.abs(sxis) &gt; 0.0) {<br \/>\n      imgo.style.transform=flipflops[ffnum];<br \/>\n      ffnum++;<br \/>\n      if (ffnum >= eval('' + flipflops.length)) {  ffnum=0; }<br \/>\n    } else if (Math.abs(syis) &gt; 0.0) {<br \/>\n      imgo.style.transform=flopflips[ffnum];<br \/>\n      ffnum++;<br \/>\n      if (ffnum >= eval('' + flopflips.length)) {  ffnum=0; }<br \/>\n    }<\/font><br \/>\n    setTimeout(doanim, Math.round(isecs * 1000));<br \/>\n  }<br \/>\n  <br \/>\n  function changef(tbo) {<br \/>\n    if (tbo.value.toLowerCase() == 'flip') {<br \/>\n     imgo.style.transform='scaleY(1)';<br \/>\n     sxis=1.0,<br \/>\n     syis=0.0;<br \/>\n    } else if (tbo.value.toLowerCase() == 'flop') {<br \/>\n     imgo.style.transform='scaleX(1)';<br \/>\n     \/\/alert('here');<br \/>\n     sxis=0.0,<br \/>\n     syis=1.0;<br \/>\n    }<font color=blue> else if (tbo.value.toLowerCase() == 'flipflop') {<br \/>\n     imgo.style.transform='scaleX(1)';<br \/>\n     imgo.style.transform='scaleY(1)';<br \/>\n     \/\/alert('here');<br \/>\n     sxis=0.1,<br \/>\n     syis=0.0;<br \/>\n     ffnum=0;<br \/>\n    } else if (tbo.value.toLowerCase() == 'flopflip') {<br \/>\n     imgo.style.transform='scaleX(1)';<br \/>\n     imgo.style.transform='scaleY(1)';<br \/>\n     \/\/alert('here');<br \/>\n     sxis=0.0,<br \/>\n     syis=0.1;<br \/>\n     ffnum=0;<br \/>\n    }<\/font><br \/>\n  }<br \/>\n<\/code><br \/>\n &#8230; to add to the variety of display possibilities\n<\/li>\n<\/ul>\n<p> &#8230; in <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html-GETME\" rel=\"noopener\">a modified<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html-GETME\" rel=\"noopener\">second draft<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html\" rel=\"noopener\">Image Flipping or Flopping at Speed<\/a> web application you can try, for yourself, also, <a href='#iffid'>below<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/image-flipping-or-flopping-at-speed-browsing-tutorial\/' rel=\"noopener\">Image Flipping or Flopping at Speed Browsing Tutorial<\/a>.<\/p-->\n<hr>\n<p id='iffspt'>Previous relevant <a target=\"_blank\" title='Image Flipping or Flopping at Speed Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-flipping-or-flopping-at-speed-primer-tutorial\/' rel=\"noopener\">Image Flipping or Flopping at Speed Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image Flipping or Flopping at Speed Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.gif\" title=\"Image Flipping or Flopping at Speed Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image Flipping or Flopping at Speed Primer Tutorial<\/p><\/div>\n<p>The &#8220;making of&#8221; the recent <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/select-multiple-webpage-palette-speech-bubble-swipe-tutorial' title='Select Multiple Webpage Palette Speech Bubble Swipe Tutorial' rel=\"noopener\">Select Multiple Webpage Palette Speech Bubble Swipe Tutorial<\/a> inspired us to start down the road of a new &#8230;<\/p>\n<blockquote><p>\nImage Flipping or Flopping at Speed\n<\/p><\/blockquote>\n<p> &#8230; web application.  At first, with it, we wondered, regarding our animation, whether we could &#8230;<\/p>\n<ul>\n<li>create &#8220;smoothed out&#8221; flipping or flopping scenarios via CSS keyframes and transition animations &#8230; or &#8230;<\/li>\n<li>use Javascript DOM<\/li>\n<\/ul>\n<p> &#8230; and sadly the &#8220;CSS keyframes and transition animations&#8221; is a &#8220;no go&#8221; for this project (ie. not every CSS property can be animated this way, as we have alluded to in the past).<\/p>\n<p>Never mind, today we supplied the starting three controls the user has, over to the right of their image &#8230;<\/p>\n<ol>\n<li>image URL (in textbox, in first draft) &#8230;<\/li>\n<li>toggling between Flip and Flop ability &#8230;<\/li>\n<li>revolutions per minute<\/li>\n<\/ol>\n<p> &#8230; settings in this <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html_GETME\" rel=\"noopener\">first draft<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/image_flipping_or_flopping_at_speed.html\" rel=\"noopener\">Image Flipping or Flopping at Speed<\/a> web application you can try, for yourself, also, below &#8230;<\/p>\n<p><iframe id=iffid src=\"\/image_flipping_or_flopping_at_speed.html\" style=\"width:100%;height:9090px;\"><\/iframe><\/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='#d68606' onclick='var dv=document.getElementById(\"d68606\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/transform\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d68606' 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='#d68611' onclick='var dv=document.getElementById(\"d68611\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/browse\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d68611' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve thought of a few ways to improve on the work of yesterday&#8217;s Image Flipping or Flopping at Speed Primer Tutorial, they being &#8230; onto yesterday&#8217;s Image URL means of addressing your image today we allow for local file browsing &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/image-flipping-or-flopping-at-speed-browsing-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":[4,12,14,37],"tags":[5211,84,1798,1993,3531,354,2223,2224,590,652,4772,5213,997,5212,1298,1319],"class_list":["post-68611","post","type-post","status-publish","format-standard","hentry","category-animation","category-elearning","category-event-driven-programming","category-tutorials","tag-animate","tag-animation-2","tag-border-radius","tag-browse","tag-browsing","tag-dom","tag-flip","tag-flop","tag-image","tag-javascript","tag-local-file","tag-local-file-browsing","tag-programming","tag-rpm","tag-transform","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/68611"}],"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=68611"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/68611\/revisions"}],"predecessor-version":[{"id":68614,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/68611\/revisions\/68614"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=68611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=68611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=68611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}