Yesterday’s Onclick Event Propagation Primer Tutorial approach to harnessing the “powers of propagation” was a bit “scattergun”. We never referenced the very useful …
… global variable that can be used in Javascript event logic to get the element where the event originated, as distinct from function moi‘s “othis” argument, which points at the HTML webpage element calling the “onclick” event logic.
Its use can add nuance to the reworked “onclick” event sharing Javascript function …
A basis for web application event driven programming strategies references …
element nesting and inheritance …
the default event propagation up through the element hierarchy
Of course you can ignore how this event “bubbling” can be harnessed, and indeed, we normally do not harness this event programming abilities in webpages, but not today! Today, we want to harness, via “onclick” event (sharing a common …
A basis for web application event driven programming strategies references …
element nesting and inheritance …
the default event propagation up through the element hierarchy
Of course you can ignore how this event “bubbling” can be harnessed, and indeed, we normally do not harness this event programming abilities in webpages, but not today! Today, we want to harness, via “onclick” event (sharing a common …
It’s another layer of cloning happening today with our new “Emoji Sequence Game” on top of the cloning with yesterday’s Number Sequence Game Primer Tutorial, but there was a minor improvement to the “middleperson” clone before “Hello Dolly” appeared!
We normally involve …
encodeURIComponent() ... to encode data on the way out of the originator web application ... before that data reaches the ... decodeURIComponent() ... to decode at the destination web application
… in both the clientside wooooorrrrllllddd of Javascript and lots of the time in the serverside wooooorrrrllllddd of a language such as PHP, though our plan to improve, below, takes ideas from PHP base64_encode and base64_decode (though “atob” is not as good as base64-decode) alternative ideas.
We don’t use them much but …
btoa ... to encode data (in a base 64 way) on the way out of the originator web application ... before that data reaches the ... atob ... to decode (in a base 64 way) at the destination web application
… has a twofold improvement, to our mind, with that minor improvement to the “middleperson” clone work …
we make the game less obvious to decouple for the recipient of an email or SMS sharing (GET web browser address bar URL) call (starting to encode these means by which to too obviously solve the game’s sequence … doh!) …
very simple output data (like ours, for this lot of web applications) of “atob” already suits “decodeURIComponent”, as does “btoa” already suits “encodeURIComponent” …
<script type='text/javascript'>
// At sender webpage ...
var argstring='';
var atobarg=btoa(argstring); // '';
var encatobarg=encodeURIComponent(btoa(argstring)); //'';
// ... now imagine above passed to receiver.html?sendthis=
// ------------------------------------------------------------------
// At receiver webpage receiver.html ...
var inarg=location.search.split('sendthis=')[1] ? (location.search.split('sendthis=')[1].split('&')[0]) : ""; //
var atobarg=window.atob(inarg); //'';
var deatobarg=decodeURIComponent(window.atob(inarg)); //'';
</script>
…
… but we have to warn with more complex data you need all 4 working together ( btoa -> encodeURIComponent | decodeURIComponent -> atob ) as per …
<script type='text/javascript'>
// At sender webpage ...
var argstring='';
var btoaarg=btoa(argstring); // '';
var encbtoaarg=encodeURIComponent(btoa(argstring)); //'';
// ... now imagine above passed to receiver.html?sendthis=
// ------------------------------------------------------------------
// At receiver webpage receiver.html ...
var inarg=location.search.split('sendthis=')[1] ? decodeURIComponent(location.search.split('sendthis=')[1].split('&')[0]) : ""; //
var deatobarg=window.atob(inarg); //'';
</script>
… and so can be a simple one for one replacement of it, in arrangements … and believe it or not, we have never used it in that way before, to our living memory (but am not vouching for any dead memories here!)
… ideas affecting all of (these web applications inspired by Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) … thanks) …
With all this encoding going on, what is left to ease the burden for the programmer testing the logic, so that they have not “painted themselves into a corner”, so to speak? Well, there is your modern web browser’s (perhaps Develop menu residing) Web Inspector functionality. Of course, to advertise this in your game, is not the best, as it might remove the challenge for the game player, but you, as the coder, will know enough about the game’s innards to be able to “watch” a global variable, and then know how to answer for the scenarios you need to know web application behaviour for, at the very least …
During the day before yesterday’s Card Sequence Game Multicoloured Dropdown and Mobile Tutorial we kept a snapshot of the code aside. Why? Well, it suited as the clone to work with, in order to develop today’s new Number Sequence game we were inspired by Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) to write.
Web application games, even this simple, are a challenge regarding …
the idea for a game
the design of the game
developing media for the game (which we often simplify to the bone)
Again, we’d be giving the game away to say much more about it, though the webpage layout up the top will look familiar to readers following these Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) inspired games of recent times.
Card Sequence Game Multicoloured Dropdown and Mobile Tutorial
We’ve spent a day, onto the progress to yesterday’s Card Sequence Game Sharing Tutorial, with our Card Sequence game web application, improving on the card suit hearts and diamonds suit emojis, fundamentally black, but CSS achievable as red (as we are mostly familiar) …
for non-mobile we could get a better “red hearts and diamonds card suit emoji” result with the dropdown by starting to use the “size” attribute … which unfortunately is a “tutti-frutti dropdown effect” which does not work for mobile … so …
… at least in a display sense, though event logic maps back to the dropdown event logics of yesterday
… as a way forward with improvement on this project.
We also had a look, in the same sense, at changing the alert popup for a successful mapping to an “h4” element content (capable of the red hearts and diamonds card suit emojis), and some new “tooltip” type CSS …
.red2 {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
.red3 {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
option.red3 {
margin-top: -16px;
}
</style>
… to supplement the non-mobile hover “title” attribute “black renditions of the hearts and diamonds card suit emojis” and (document.body onload event logic) Javascript, as below linking up to that arrangement preparing the dropdown (ie. HTML select) element option subelement creating code (which flows through to the overlayed ul -> li mobile arrangement code above) …
The web application of yesterday’s Card Sequence Game Tutorial had a definite feel as if it could represent …
a challenge amongst friends … and as such …
we need to setup a “level playing field” means by which …
we can share via email (“mailto:” link) or SMS (“sms:” link) clickable link URLs
… as a “sharing” (or for your less competitive friends, “collaborative”) approach to playing our Card Sequence Game.
We also start to use emojis both as …
buttons for this sharing functionality (for email 📧 and SMS 📟) … and …
on the card Suit dropdown element content being more Internationally more self-explanatory, the frustration, on some platforms, with a dropdown element being that heart and diamond emojis appear black, and so we added in an HTML span element allowing for these emojis to appear in a more apt red colour, as exemplified by 7♦
We follow up yesterday’s Date Day of the Week Game Primer TutorialDr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) lead with a card sequence game we think might be a challenge for you.
Again, we’ve got hints, but you lose score as you consult them. Again we have …
time (seconds)
score (two plus for correct and one minus for incorrect)
goes
… as “bragging rights” data if you are comparing to friends?!
In the category of “Mind Bender”, today, we took inspiration from Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144), thanks, in creating a Date and Day of the Week web application based on …
Friday the 13th … specifically …
Which years have 2 consecutive Friday the 13ths occurring in subsequent months?
During the day before yesterday’s Card Sequence Game Multicoloured Dropdown and Mobile Tutorial we kept a snapshot of the code aside. Why? Well, it suited as the clone to work with, in order to develop today’s new Number Sequence game we were inspired by Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) to write.
Web application games, even this simple, are a challenge regarding …
the idea for a game
the design of the game
developing media for the game (which we often simplify to the bone)
Again, we’d be giving the game away to say much more about it, though the webpage layout up the top will look familiar to readers following these Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) inspired games of recent times.
Card Sequence Game Multicoloured Dropdown and Mobile Tutorial
We’ve spent a day, onto the progress to yesterday’s Card Sequence Game Sharing Tutorial, with our Card Sequence game web application, improving on the card suit hearts and diamonds suit emojis, fundamentally black, but CSS achievable as red (as we are mostly familiar) …
for non-mobile we could get a better “red hearts and diamonds card suit emoji” result with the dropdown by starting to use the “size” attribute … which unfortunately is a “tutti-frutti dropdown effect” which does not work for mobile … so …
… at least in a display sense, though event logic maps back to the dropdown event logics of yesterday
… as a way forward with improvement on this project.
We also had a look, in the same sense, at changing the alert popup for a successful mapping to an “h4” element content (capable of the red hearts and diamonds card suit emojis), and some new “tooltip” type CSS …
.red2 {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
.red3 {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
option.red3 {
margin-top: -16px;
}
</style>
… to supplement the non-mobile hover “title” attribute “black renditions of the hearts and diamonds card suit emojis” and (document.body onload event logic) Javascript, as below linking up to that arrangement preparing the dropdown (ie. HTML select) element option subelement creating code (which flows through to the overlayed ul -> li mobile arrangement code above) …
The web application of yesterday’s Card Sequence Game Tutorial had a definite feel as if it could represent …
a challenge amongst friends … and as such …
we need to setup a “level playing field” means by which …
we can share via email (“mailto:” link) or SMS (“sms:” link) clickable link URLs
… as a “sharing” (or for your less competitive friends, “collaborative”) approach to playing our Card Sequence Game.
We also start to use emojis both as …
buttons for this sharing functionality (for email 📧 and SMS 📟) … and …
on the card Suit dropdown element content being more Internationally more self-explanatory, the frustration, on some platforms, with a dropdown element being that heart and diamond emojis appear black, and so we added in an HTML span element allowing for these emojis to appear in a more apt red colour, as exemplified by 7♦
We follow up yesterday’s Date Day of the Week Game Primer TutorialDr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) lead with a card sequence game we think might be a challenge for you.
Again, we’ve got hints, but you lose score as you consult them. Again we have …
time (seconds)
score (two plus for correct and one minus for incorrect)
goes
… as “bragging rights” data if you are comparing to friends?!
In the category of “Mind Bender”, today, we took inspiration from Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144), thanks, in creating a Date and Day of the Week web application based on …
Friday the 13th … specifically …
Which years have 2 consecutive Friday the 13ths occurring in subsequent months?
Card Sequence Game Multicoloured Dropdown and Mobile Tutorial
We’ve spent a day, onto the progress to yesterday’s Card Sequence Game Sharing Tutorial, with our Card Sequence game web application, improving on the card suit hearts and diamonds suit emojis, fundamentally black, but CSS achievable as red (as we are mostly familiar) …
for non-mobile we could get a better “red hearts and diamonds card suit emoji” result with the dropdown by starting to use the “size” attribute … which unfortunately is a “tutti-frutti dropdown effect” which does not work for mobile … so …
… at least in a display sense, though event logic maps back to the dropdown event logics of yesterday
… as a way forward with improvement on this project.
We also had a look, in the same sense, at changing the alert popup for a successful mapping to an “h4” element content (capable of the red hearts and diamonds card suit emojis), and some new “tooltip” type CSS …
.red2 {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
.red3 {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
option.red3 {
margin-top: -16px;
}
</style>
… to supplement the non-mobile hover “title” attribute “black renditions of the hearts and diamonds card suit emojis” and (document.body onload event logic) Javascript, as below linking up to that arrangement preparing the dropdown (ie. HTML select) element option subelement creating code (which flows through to the overlayed ul -> li mobile arrangement code above) …
The web application of yesterday’s Card Sequence Game Tutorial had a definite feel as if it could represent …
a challenge amongst friends … and as such …
we need to setup a “level playing field” means by which …
we can share via email (“mailto:” link) or SMS (“sms:” link) clickable link URLs
… as a “sharing” (or for your less competitive friends, “collaborative”) approach to playing our Card Sequence Game.
We also start to use emojis both as …
buttons for this sharing functionality (for email 📧 and SMS 📟) … and …
on the card Suit dropdown element content being more Internationally more self-explanatory, the frustration, on some platforms, with a dropdown element being that heart and diamond emojis appear black, and so we added in an HTML span element allowing for these emojis to appear in a more apt red colour, as exemplified by 7♦
We follow up yesterday’s Date Day of the Week Game Primer TutorialDr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) lead with a card sequence game we think might be a challenge for you.
Again, we’ve got hints, but you lose score as you consult them. Again we have …
time (seconds)
score (two plus for correct and one minus for incorrect)
goes
… as “bragging rights” data if you are comparing to friends?!
In the category of “Mind Bender”, today, we took inspiration from Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144), thanks, in creating a Date and Day of the Week web application based on …
Friday the 13th … specifically …
Which years have 2 consecutive Friday the 13ths occurring in subsequent months?
The web application of yesterday’s Card Sequence Game Tutorial had a definite feel as if it could represent …
a challenge amongst friends … and as such …
we need to setup a “level playing field” means by which …
we can share via email (“mailto:” link) or SMS (“sms:” link) clickable link URLs
… as a “sharing” (or for your less competitive friends, “collaborative”) approach to playing our Card Sequence Game.
We also start to use emojis both as …
buttons for this sharing functionality (for email 📧 and SMS 📟) … and …
on the card Suit dropdown element content being more Internationally more self-explanatory, the frustration, on some platforms, with a dropdown element being that heart and diamond emojis appear black, and so we added in an HTML span element allowing for these emojis to appear in a more apt red colour, as exemplified by 7♦
We follow up yesterday’s Date Day of the Week Game Primer TutorialDr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) lead with a card sequence game we think might be a challenge for you.
Again, we’ve got hints, but you lose score as you consult them. Again we have …
time (seconds)
score (two plus for correct and one minus for incorrect)
goes
… as “bragging rights” data if you are comparing to friends?!
In the category of “Mind Bender”, today, we took inspiration from Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144), thanks, in creating a Date and Day of the Week web application based on …
Friday the 13th … specifically …
Which years have 2 consecutive Friday the 13ths occurring in subsequent months?
We follow up yesterday’s Date Day of the Week Game Primer TutorialDr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144) lead with a card sequence game we think might be a challenge for you.
Again, we’ve got hints, but you lose score as you consult them. Again we have …
time (seconds)
score (two plus for correct and one minus for incorrect)
goes
… as “bragging rights” data if you are comparing to friends?!
In the category of “Mind Bender”, today, we took inspiration from Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144), thanks, in creating a Date and Day of the Week web application based on …
Friday the 13th … specifically …
Which years have 2 consecutive Friday the 13ths occurring in subsequent months?
In the category of “Mind Bender”, today, we took inspiration from Dr Crypton’s Mind Benders, Introduction by Isaac Asimov (ISBN 0207146144), thanks, in creating a Date and Day of the Week web application based on …
Friday the 13th … specifically …
Which years have 2 consecutive Friday the 13ths occurring in subsequent months?