Haiku Animated Gif Creator Tutorial

Haiku Animated Gif Creator Tutorial

Haiku Animated Gif Creator Tutorial

Today, we’re coming at Haiku creation from a different place to …

These two ideas suit, as with the recent progress we made regarding watermarks and animated GIFs we started talking about with Animated GIF Watermark Comments Personalization Tutorial we can value add to the idea of …

  • a user creating Haikus … with …
  • a more interesting way of displaying those Haikus (albeit debatably) … as well as …
  • a client (Javascript) way of sharing (and collaborating perhaps) via either …
    1. email (via “a” “mailto:” link)
    2. SMS (via “a” “sms:” link)

… possible because the amount of data involved in a (5 syllable line, 7 syllable line, 5 syllable line) Haiku (if you obey the rules strictly) allows for client ?/& argument URLs nicely (with enough room to also suggest a collaboration return URL).

We offer, on top of …

  • the user’s creativity in Haiku words (they place into an HTML textarea element) … the chance for the user to additionally define …
    1. Background image URL
    2. Font Colour
    3. Font Size (px)
    4. Fontname (default Arial … but you could try DejaVuSansMono)
  • delay between slides (where if you enter something like 0,0,1000 you can avoid the “teletext type” animation, if it grates with you)

You can try the HTML/Javascript haiku_animated_gif.html‘s live run link is helped out by a changed tutorial_to_animated_gif.php (with its own animated GIF creator web application live run link).

Did you know?

What do you make of our CSS today …


<style>

.hrcolbelow:andbelow { background-color: rgba(255,255,0,0.5); }

</style>

? If your reaction is …

It makes no sense, as there is no such CSS pseudo-element as “:andbelow” and so will be ineffective.

… you’re correct. However, we “invent” a use via the inhouse Javascript “function lookforinhousestyle” as per …


function docgetclass(inc, intag) {
if (document.getElementsByClassName) {
return document.getElementsByClassName(inc);
} else {
var ijl;
var anarris=[];
var huhs=document.getElementsByTagName(intag);
for (ijl=0; ijl<huhs.length; ijl++) {
if (huh[ijl].className.indexOf(inc) != -1) {
anarris.push(huhs[ijl]);
}
}
return anarris;
}
}

function lookforinhousestyle() {
var cssis='', findbasis='', findbs=[null], ifb=0, jfb=0, myrect=null, osuffix='', nsuffix=0;
var bits=(document.head.innerHTML + document.body.innerHTML).split(':and' + 'below');
if (bits.length > 1) {
if ((bits[1].trim() + ' ').substring(0,1) == '{') {
cssis=bits[1].trim().substring(1).split('}')[0] + ' z-index:-20; ';
findbasis=bits[0].split(String.fromCharCode(10))[eval(-1 + bits[0].split(String.fromCharCode(10)).length)].split(' ')[eval(-1 + bits[0].split(String.fromCharCode(10))[eval(-1 + bits[0].split(String.fromCharCode(10)).length)].split(' ').length)].trim();
if ((findbasis.trim() + ' ').substring(0,1) == '.') {
findbs=docgetclass(findbasis.trim().substring(1), '*');
} else if ((findbasis + ' ').substring(0,1) == '#') {
findbs[0]=document.getElementById(findbasis);
} else {
findbs=document.getElementsByTagName(findbasis);
}
for (jfb=0; jfb<findbs.length; jfb++) {
if (findbs[jfb]) {
myrect=findbs[jfb].getBoundingClientRect();
if (document.getElementById('bpalette' + osuffix)) {
nsuffix++;
osuffix='' + nsuffix;
while (document.getElementById('bpalette' + osuffix)) {
nsuffix++;
osuffix='' + nsuffix;
}
}
document.body.innerHTML+='<div id=bpalette' + osuffix + ' style="' + cssis + ' position: absolute; top: ' + ('' + myrect.top).split('.')[0] + 'px;' + 'width: ' + ('' + myrect.width).split('.')[0] + 'px;' + 'left: ' + ('' + myrect.left).split('.')[0] + 'px;' + 'height: calc(100% - ' + ('' + myrect.top).split('.')[0] + 'px); "></div>';
}
}
}
}
}

… for our new “inhouse” CSS pseudo-element “:andbelow” to introduce a co-ordinate based CSS usage into play, combining CSS calc and Javascript getBoundingClientRect, in order to be able to place a colour (HTML div element) overlay below a “line”, that being an HTML hr element (as our way to differentiate user interactive input above from the resultant animated GIF created below), in our case today.


Previous relevant Speech to Text ESL Tutorial is shown below.

Speech to Text ESL Tutorial

Speech to Text ESL Tutorial

When you involve audio input into a web application it is likely that that web application can become useful with learning a language, such as with ESL (English as a second or foreign language) usage, especially as such learning has …

  • spoken
  • reading
  • writing

… components to it. As you would appreciate, once the learner is speaking and then that (spoken content) is written out (as a transcript), and the learner is then reading that content, the web application can be a “double whammy” effective learning tool.

We extend the web application’s functionality from yesterday’s Speech to Text Primer Tutorial using a technique we often use, that being changing the original (guinea pig usage) word “Quiz” into it plus other options presented in a …

  • HTML select (dropdown) element … as per HTML “onload” event …

    <body onload="document.getElementById('preq').innerHTML=dds('Quiz'); document.getElementById('kb').focus(); pickq();">

    … call of the Javascript …

    function dds(qwhat) {
    var selbit="<select id=selbit onchange=' location.href=document.URL.split(\"#\")[0].split(\"?\")[0] + \"?mode=\" + this.value; '><option value=0>" + modes[0] + "</option></select>";
    for (var iselbit=1; iselbit<modes.length; iselbit++) {
    if (mode == iselbit) {
    selbit=selbit.replace("</select>", "<option value=" + iselbit + " selected>" + modes[iselbit] + "</option></select>");
    } else {
    selbit=selbit.replace("</select>", "<option value=" + iselbit + ">" + modes[iselbit] + "</option></select>");
    }
    }
    return qwhat.replace('Quiz',selbit);
    }


    … that sets off onchange event logic to …

  • reload the webpage with a URL ?mode= argument flagging this that is …
  • detected via

    var mode=location.search.split('mode=')[1] ? eval(decodeURIComponent(location.search.split('mode=')[1].split('&')[0])) : 0;
    var modes=["Quiz","Tongue Twisters","Haiku"];
    var arraynames=["questions","tongue_twisters","haiku"];
    var delims=["?","~","`"];
    var bcols=["yellow","lightgreen","lightblue"];

    … enabling, as necessary the …
  • “mapping” of other usage arrays (we are responsible for garnering) onto the original (guinea pig) array “questions” (within “dds” function above) via

    if (mode != 0) {
    eval(arraynames[0] + "=" + arraynames[mode]);

    document.getElementById('tdm').style.backgroundColor=bcols[mode];
    }

That leaves, apart from the extra content duties, a new scoring mechanism, one new one of which analyzes question words against answer words and scores positive word length score components for answer words found in question words and negative word length score components for question words not found in answer words.

Again, feel free to have a look at today’s changed PHP code of speech_supervisor.php‘s “Speaking Quiz plus ESL Others”.


Previous relevant Speech to Text Primer Tutorial is shown below.

Speech to Text Primer Tutorial

Speech to Text Primer Tutorial

There was some great advice that had us dipping our toes into “Speech to Text” web application thoughts. You probably know yourself about the brilliant Google Translate and its “Text to Speech’ capabilities (or read some of our postings here such as Italian French Spanish Verb Conjugation Text to Speech Tutorial)? Well, it’s Google again supplying the brilliance for the obverse ideas used today in our “Speaking Quiz” web application idea.

“Speaking”, that is, if you are using a recent enough version of the Google Chrome web browser, some HTML aspects of which are eloquently explained by this very useful link utilizing the wonderful Google Speech to Text API.

If you are interested in “Speech to Text” you should also check out the very interesting Diagflow … Speech to Text.

Thanks everyone, for these artificial intelligence “dipping our toes” encouragement. Feel free to have a look at today’s PHP code of speech_supervisor.php‘s “Speaking Quiz”.


Previous relevant Italian French Spanish Verb Conjugation Text to Speech Tutorial is shown below.

Italian French Spanish Verb Conjugation Text to Speech Tutorial

Italian French Spanish Verb Conjugation Text to Speech Tutorial

In following up on Italian and French and Spanish Verb Conjugation Event Tutorial as shown below we’ve increased functionality of English translations by adding Google Translate Text to Speech capabilities to …

  • Italian
  • French
  • Spanish

… via a new “loudspeaker” icon.

Some of the talking points with today’s changes involve …

  • a “reveal” idea whereby the showing of an HTML element is controlled by its Javascript DOM [element].style.width CSS property, whereby the element is effectively invisible at width:1px and in our case today becomes visible, at width:20px, and, thus, clickable, for Google Translate popup window translation and text to speech capabilities via the control of …
  • binary decision making GUI ease of using HTML input tag type=checkbox and the associated Javascript DOM document.getElementById([element]).checked … because …
  • UX-wise it is good to forewarn users with an option when it comes to functionality involving sound
  • use of Javascript DOM document.getElementsByTagName(‘img’) as a means by which to manipulate HTML elements that are not necessarily provided with an ID global property

As per the other tutorials in this thread, even with new Google Translate Text to Speech and Translation capabilities, nothing changes today about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish tense contextual verb conjugations in this way, with this live run link.


Previous relevant Italian and French and Spanish Verb Conjugation Event Tutorial is shown below.

Italian and French and Spanish Verb Conjugation Event Tutorial

Italian and French and Spanish Verb Conjugation Event Tutorial

In following up on Italian and French and Spanish Verb Conjugation Tense Tutorial as shown below we’ve increased functionality of English translations to …

  • Italian
  • French
  • Spanish

… and the conjugations from WordReference.com by offering onmouseover (ie. hover) or onclick (or mobile touch) event logic for conjugations offered by using the wonderful MyMemory resource to translate these verb conjugations back into English, and present them in an additional column with a different background colour.

You may recall us using MyMemory once before when we presented HTML/Javascript Hearing and Listening Primer Tutorial earlier on.

As per the other tutorials in this thread, but even more so with gleaning information from the MyMemory API via a get method, nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish tense contextual verb conjugations in this way, with this live run link.

Hope you try out this new functionality.


Previous relevant Italian and French and Spanish Verb Conjugation Tense Tutorial is shown below.

Italian and French and Spanish Verb Conjugation Tense Tutorial

Italian and French and Spanish Verb Conjugation Tense Tutorial

We’ve followed up on Italian Verb Conjugation and Tense Tutorial as shown below with “tense” context to some of the conjugations of …

  • Italian
  • French
  • Spanish

Say “some of the” because …

Even amongst the conjugating language “triplets” above, noticed that when it comes to the “tense” involved, there can be variations, but don’t need to tell a lot of you this old news. Did set me to thinking a bit about the The Tower of Babel story from the Bible, though. What would the world be like if we all spoke the one language? Esperanto, everyone?

There’s a link between “language” and “life”. That’s why a language without “verbs” is not a language. And the Earth back in those dark days before any life, had no conduits for “language”. And it’s hard to see how “life” sort of started up? But I guess chemistry experts might be able to tell us how this might have come about.

“Language” is all about patterns, and mirrors human progress with its “pattern” and “organization” and “flexibility” as a huge part of why we as “humans” got to be such agents of change on Earth. Just wish there had really been a more successful Doctor Dolittle in human history that could have got the “inside goss” (so to speak) on what we could have done better to protect the world’s environments.

As per the other tutorials in this thread, nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish tense contextual verb conjugations in this way, with this live run link.

Hope you try it out, and even contemplate sending us some feedback.


Previous relevant Italian Verb Conjugation and Tense Tutorial is shown below.

Italian Verb Conjugation and Tense Tutorial

Italian Verb Conjugation and Tense Tutorial

Again, we saw that we could extend the functionality of the recent Italian and French and Spanish Verb Conjugation Tutorial as shown below, by, for Italian, to start with, trying to help the native English speaker out for where to look on the “conjugation” table presented for the English verb of interest, regarding conjugation information that might match their (verb) tense of interest.

As you probably well know, every language on Earth has its peculiarities regarding how we express ourselves with regard to time, and a lot of that is associated with the verbs, or action words we use, and in the case of …

  • Italian
  • French
  • Spanish

… that expression of the context of time in the grammatical usage, especially for people speaking the language, is reflected by conjugations made to the verb. Conversely, as I, a native English speaker, got to think about as this web application proceeded, English has words like “am” and “have” and “having” and “been” and “will” and “shall” and “is” and “are” and “was” and “were” and “would” and “should” and “has” and “had” and “to” and ‘”be” and “being” preceeding verbs, which can have, basically, two suffixes “-ing” and “-ed” (expressing present participles and past participles respectively) to try to do what conjugation does for Italian (we program for today) and French and Spanish languages.

But there’s more to “tense” than Past, Present and Future as you well can imagine should you learn a language other than your native tongue, which you tend to “go along with the flow” perhaps unaware that “tense” exists, for some learners. There are concepts as layers on top about the context of the time the person is speaking relative to the time they are or were talking about … it gets complex … so you get concepts like “Present Perfect Progressive” (which we did a tutorial about at HTML/Javascript Present Perfect Progressive Primer Tutorial) if you get right into the ins and outs of all this grammar … which you might need to do to master that second language.

Yet again, nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in Italian “tense” thoughts in this way, with this live run link.

Again, we hope you try some Italian, with specified “tense” prefix words and suffix endings, to see how the new functionality helps you out with Italian verb conjugations.


Previous relevant Italian and French and Spanish Verb Conjugation Tutorial is shown below.

Italian and French and Spanish Verb Conjugation Tutorial

Italian and French and Spanish Verb Conjugation Tutorial

We saw that we could extend the functionality of yesterday’s Italian Verb Conjugation Primer Tutorial as shown below, by accessing other resources from the great WordReference.com, adding French and Spanish verb conjugation to yesterday’s Italian verb conjugation.

As a rule we tend to find that replacing text with HTML select “dropdown” menus can help out this adaption pretty effectively. The other feature of today’s Javascript coding is the use of eval to team with the language code to direct user traffic to the correct parts of the WordReference.com website.

Along the way we added some background “flag” imagery we found at Science Kids … thanks, heaps.

Down the little brick road we also added a couple of hashtag navigators, HTML a links that just navigate within the page, allowing the user to move from the conjugation yellow zone to the translation zone (if you translated from English), as much as anything because the conjugation may need to be prompted by picking the “verb” amongst the list of “translated” possibilities, which you can then feed into the rightmost HTML input type=text textbox to, more than likely, get the (verb) conjugation you may have missed with the first pass.

Nothing changes about the techniques used today doing away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html, which changed to add in French and Spanish in this way, with this live run link.

Hope you try it out.


Previous relevant Italian Verb Conjugation Primer Tutorial is shown below.

Italian Verb Conjugation Primer Tutorial

Italian Verb Conjugation Primer Tutorial

Learning Italian as a native English speaker is best done when you are young, and beginning recently on this quest, I learnt a bit of this.

To me, what stuck out, was how easy we get it in English with regard to (the lack of) conjugating verbs, or articles, or adjectives, in our grammar.

Is it that, in English, we can say something in a hurry and, sort of, wait to fix it up later, because we don’t conjugate verbs in our mind, or is this not how it works in other languages? Actually, am pretty sure no, because conjugation is done so fast in the minds of Italian speakers that it is no issue … hard to imagine, though, from where I’m standing … well, actually, sitting. Am not here to say, but know it is this, that teachers of Italian to English native speakers, concentrate on in early lessons.

With this in mind, we don’t for one second pretend we are not using the wonderful resources at WordReference.com with today’s web application, but we thank them for their brilliance, and just rearrange things that you could glean perfectly well from here but need to take a few more steps to reach the conjugation (today it’s just verbs) web page bits, whereas we throw the conjugation bits straight at you. And yes, we do try to cater for the irregular verbs, and where they are regular you should see the word “regular” mentioned in the yellow zone conjugation areas … because we all know … well, you know what we mean?!

The techniques used today do away with any need for a server side language by channelling the Ajax jQuery thoughts we presented with Ajax jQuery Primer Tutorial to make the most of the great resource that WordReference.com is. This happens in our HTML and Javascript programming source code you could call italian_conjugation.html with this live run link.

So we hope you enjoy this break from our usual (other way around) ESL game (if it’s a game) to some “Conjugate, Italian Style” play.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>