All posts by gbushta

More Reading – HTML5, CSS3 and Javascript

I mashed on the code today a lot. Added HTML elements through Javascript code and changed the HTML interactively. I can’t believe how easy it really is.
I did run into a wall for a few minutes before retiring for the night. backgroundColor has a capital C in Color. When I couldn’t get the background color to change within a defined 400×300 rectangle I had to re-check the code. I was missing that C in two spots. What a relief to find that. It is always the simple syntax errors that cause the most damage.
Tomorrow is another day of working on the house, playing music and programming.
Today I tried my hand at crocheting. My stitches were way too tight. It took mw about six or seven times to get them loose enough. Trying to make a Cat Bus for Emily. I am working out the style of one of the legs.

Oh, since I can include code, here is the code from today. This first part is for the HTML part. The second part will the the Javascript.

var myButton = document.querySelector(“button”);
myButton.addEventListener(“click”, myClickHandler, false);
var whatColor = 0;
var body = document.querySelector(“body”);
var score = 0;

function myClickHandler()
{
score ++;
var output = document.querySelector(“#output”);
var divColor = document.querySelector(“div”);
if (score === 1)
{
output.innerHTML = “The button was clicked ” + score + ” time.”;
}
else
{
output.innerHTML = “The button was clicked ” + score + ” times.”;
}
output.style.fontSize = “50px”;
output.style.textDecoration = “underline”;
if(whatColor === 0)
{
output.style.color = “red”;
whatColor = 1;
myButton.style.color = “brown”;
myButton.style.backgroundColor = “#aaaaaa”;
body.style.backgroundColor = “#2222cc”;
divColor.style.backgroundColor = “#5555ff”;
}
else
{
output.style.color = “blue”;
whatColor = 0;
myButton.style.color = “#ff3333”;
myButton.style.backgroundColor = “#cccccc”;
body.style.backgroundColor = “#5555ff”;
divColor.style.backgroundColor = “#2222cc”;
}
}

Well, that didn’t work out quite well enough. The HTML stuff rendered instead of listed. I can fix it in the morning.
Using the code tag doesn’t work. Some stuff gets stripped out and some of the HTML gets rendered, and changed. I have read a few posts through google. I may need to install a plugin.

I ended up adding to Simple Custom CSS and having to force some inline styles to get the section showing code how I wanted it. I wanted non-horizontal wrapping and vertical scrolling, with horizontal scrolling if needed for long lines.
I accidentally hit publish which took it out of draft mode. Bother!

Reading and Reading and Reading

I have been reading HTML5, CSS3, WordPress books from the Upper Lake Library and from Kindle. There is a lot of information for me to process. I have been taking lots of notes. Once I return the books to the library I won’t have them as a quick reference.

One of the things that really caught my eye is the jquery file to include in a web page in case someone is using an older browser to help it display your page correctly. You can also do this with javascript. Using javascript will be quicker if you only have a few things that the older browsers don’t have already built into them. This is because they won’t have to download the full helper file.

Happy New Year 2015

It is almost midnight.  Linda is sleeping heavily.  I am very sleepy.  At one point I wanted to get coffee.  I stayed awake anyway on the way home from Operation Andrew. Emily said that Chris is really happy and appreciates it.  I went to Santa Rosa after noon and picked up Chris’s brother Andrew.  Then I drove up to Garberville to meet Chris and hand off Andrew.  Chris was so happy at the time.  He said, “I don’t know if I should hug you or hit you.”  I am sure they will be up for hours touching base with each other.  Andrew has to leave on Saturday to get home on time for work on Monday.

I only added colors to the text because there is an option to do that.  Checking upon it on the Text tab shows that inline <span style=””> </span> is used.

Third Raspberry Pi.

For Christmas Emily and Chris gave me a third Raspberry Pi.  This one is a B+.  It was made in the UK.  The other two are both regular B models.  The first one was made in China.  The second one was made in the UK.

I have to get another SD card for the B+.  Then I’ll get it up and running.  I guess I should start a Raspberry Pi group in the area.

Jovian Laser app sales so far

I checked this morning and there were 16 sales over the three days.  11 on the first day.  So, there is a difference in the look on the iPhone app and the web site.  The web site is a lot easier to view and seems to have a lot more information.  Also, floating over with the mouse displays some more information.  You can’t float over on the touch screen.  Maybe someone has figured out how to include mouseover on a touch screen, but a web page would have to have that coding included within.

Today I stopped by a friends’ house and had a cup of tea before heading home.  They asked to see the app.  I went out to the truck to get my iPhone and brought it in to let them play.  The man of the house played with it the longest all the while attempting to get a high score.  His wife was laughing and really enjoying him playing on the iPhone.

They enjoyed the simplicity of the game.  I read a message from my niece saying that her two daughters (2 and 4) enjoy playing the game.

Pew Pew

Jovian Laser did go live somewhere around midnight betwixt Monday and Tuesday.  It is not working on devices with iOS 6 and 7.0.x.  Devices running 7.1 and up are OK.  I think the error has something to do with not being able to find a picture.  Perhaps it is the start up screen.  The launch screen displays and then >crash< out to the icon screen.
  This morning, Friday the19th, I checked how many sold in two days and it shows 20.  Tuesday’s sales was 11.  Yesterday was 5.  So, Wednesday, which I didn’t check, must have been 4.  Since I really only expected to sell 10, it is pretty good.  But, I still have to find that crashing problem on the earlier iOS versions.
Also, yesterday I checked out a book from Upper Lake Library on WordPress.  I’ll be reading this book to help me navigate this blog site much more efficiently.  I am sure there will be some “so that’s how you do that”, and “I didn’t know I could do that” moments.  Someone left their card with notes on it in the book showing they had some of those kind of moments already.

Still awaiting a reply

Jovian Laser is still in the queue of “waiting for review.”  It has only been five and a half days since I uploaded it.  Perhaps I’ll hear something by Monday.

Magic Square
Magic square.

I went on working on another little game that I used to play on Merlin.  It is a 3×3 square that you have to get the outer panels on and only the center one off.  I selected red and blue as the colors.  So, a red one in the center and blue ones going around the outside would constitute a “win.”  It is a simple puzzle game.

This morning I added sounds, created in Garageband, for the touching to change the colors and one for winning.  I made this one in Swift.  I decided to not use sprite kit.  I was beginning to think I should drop back down to xCode 5.  I know that one a lot better.

(OK.  I tried to put the picture up within the text and have it flow around the picture.  Now to search for the option to do that. I finally got it moved up into the text now to put a border around it.  I had to adjust the CSS file.)

I am going to test out this little puzzle on my phone a little bit more and then prepare it for uploading to the iTunesConnect site and get it into the queue.  I think this one will be free.  I liked that game when I was young.  I am glad to get a chance to share.

Waiting for Review

Last night I went through the “paperwork” to be able to upload the space ship app, Jovian Laser, to iTunWaiting for review.es.  Afterward I received, rather quickly I might add, an email from Apple saying the app had been received and is waiting for review.  Of course, I was excited to be able to make it this far.  It took a long time to go to sleep.

A while back I had shown it to a couple of co-workers and they said they wanted to play it.  They would pay 99 cents for it.  They also wanted to see how low of a score they could get.  So far, in testing, I have gotten to -558.  You get a negative point for missing the space ship from your laser shots.

Now the waiting begins.  Well, continues, since the waiting started last night.  Wish me luck.

Now to continue with the pirate ship game, and start the magic square puzzle.

Greg