{"id":40239,"date":"2018-08-20T03:01:52","date_gmt":"2018-08-19T17:01:52","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=40239"},"modified":"2018-08-20T11:56:30","modified_gmt":"2018-08-20T01:56:30","slug":"emoji-border-or-background-image-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/emoji-border-or-background-image-primer-tutorial\/","title":{"rendered":"Emoji Border or Background Image Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/right_bottom.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Emoji Border or Background Image Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/right_bottom.jpg\" title=\"Emoji Border or Background Image Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Emoji Border or Background Image Primer Tutorial<\/p><\/div>\n<p>Have you ever seen an Emoji you&#8217;d really like to use as either a webpage &#8230;<\/p>\n<ul>\n<li>border image &#8230; and\/or &#8230;<\/li>\n<li>background image<\/li>\n<\/ul>\n<p>?  Well, we&#8217;re here to tell you, thanks to the brilliance of <a target=_blank title='Emoji CSS' href='https:\/\/afeld.github.io\/emoji-css\/'>Emoji CSS<\/a> you may already be familiar with us mentioning at <a target=_blank title='Emoji CSS blog postings here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=Emoji%20CSS'>these blog postings<\/a> &#8230; yes &#8230; this can be done.<\/p>\n<p>Our proof of concept <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/right_bottom.html\" title=\"Click picture\">live run<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/right_bottom.html_GETME\" title=\"right_bottom.html\">right_bottom.html<\/a> HTML and Javascript and CSS most interesting Javascript is &#8230;<\/p>\n<p><code><br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n<br \/>\n var bmode='border';<br \/>\n<br \/>\n function analyze(tvi) {<br \/>\n   if (tvi.textContent != '') {<br \/>\n     if (tvi.textContent.length &lt;= 2) {<br \/>\n     if (bmode == 'border') {<br \/>\n     document.getElementById('myb').style.borderImage='url(\"\/\/twemoji.maxcdn.com\/2\/72x72\/' + tvi.textContent.<a target=_blank title='Javascript codePointAt information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/String\/codePointAt'>codePointAt<\/a>(0).toString(16) + '.png\")';<br \/>\n     } else {<br \/>\n     document.getElementById('myb').style.backgroundImage='url(\"\/\/twemoji.maxcdn.com\/2\/72x72\/' + tvi.textContent.codePointAt(0).toString(16) + '.png\")';<br \/>\n     }<br \/>\n     } else {<br \/>\n     if (bmode == 'border') {<br \/>\n     document.getElementById('myb').style.borderImage='url(\"\/\/twemoji.maxcdn.com\/2\/72x72\/' + tvi.innerHTML.toLowerCase().replace(\/\\&\/g,'').replace(\/\\#\/g,'') + '.png\")';<br \/>\n     } else {<br \/>\n     document.getElementById('myb').style.backgroundImage='url(\"\/\/twemoji.maxcdn.com\/2\/72x72\/' + tvi.innerHTML.toLowerCase().replace(\/\\&\/g,'').replace(\/\\#\/g,'') + '.png\")';<br \/>\n     }<br \/>\n     }<br \/>\n   }<br \/>\n }<br \/>\n&lt;\/script&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; called from the <i>onblur<\/i> event of an HTML div contenteditable=true field there for the user to enter an Emoji of interest ideally via &#8230;<\/p>\n<ul>\n<li>HTML Entity (Hex) value (less the &amp; and # please) &#8230; but should also work for &#8230;<\/li>\n<li>Emoji Placement menu selections that on a MacBook Pro you&#8217;d access via Control-Command-Space<\/li>\n<\/ul>\n<p> &#8230; the toggling between &#8220;border&#8221; and &#8220;background&#8221; available via our oft-used &#8220;-&#8221; sign link in the headers.<\/p>\n<p>Useful, we hope, huh?!<\/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='#d40239' onclick='var dv=document.getElementById(\"d40239\"); dv.innerHTML = \"<iframe width=670 height=600 src=\" + \"\/\/www.rjmprogramming.com.au\/ITblog\/tag\/emoji\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d40239' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever seen an Emoji you&#8217;d really like to use as either a webpage &#8230; border image &#8230; and\/or &#8230; background image ? Well, we&#8217;re here to tell you, thanks to the brilliance of Emoji CSS you may already &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/emoji-border-or-background-image-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,14,37],"tags":[2022,2442,281,385,562,576,2658,652,860,997,1319],"class_list":["post-40239","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-codepoint","tag-contenteditable","tag-css","tag-emoji","tag-hexadecimal","tag-html","tag-html-entity","tag-javascript","tag-onblur","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/40239"}],"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=40239"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/40239\/revisions"}],"predecessor-version":[{"id":40251,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/40239\/revisions\/40251"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=40239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=40239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=40239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}