I’ve been waiting for more details about Final Fantasy XIV’s new summer expansion. The thing is, Square Enix’s baby right now is Final Fantasy VII, so I will have to wait until all the drama dies down before I get any news about XIV. Don’t get me wrong, VII coming out is exciting. However, I’ve been watching Tommy play VII, and we are still working on the first part of the trilogy. And Tommy doesn’t play a game through the first time he plays with it (and yes, I know these games are hours long). He will go in spurts. Play one game for a week or two, then play another game, then another game, and will come back to playing the first game in a few months or longer. So, if you are watching for the storyline, you have to watch a YouTube about what has been going on to catch you up. I already forgot most of the storyline of Final Fantasy XVI. I am just poking fun at him.
I’ve been sitting here for a half hour trying to think of what else to say in this post. Oh, I drove Kel’s car to the post office. Exciting stuff. No, it was alright. I checked the mail also. Her car’s engine and gas lights were on. It made me a little nervous. And how close did I have to be to the steering wheel to reach the pedals? Cause it’s ridiculous. They say your arms should be almost straight when driving. Well, not for me and my short legs!
In about twenty minutes I’m going to ride the bike. Yes, it is bike day. And I need to psyche myself up cause I’ve been feeling lazy lately. So, I will get off the computer and get ready to work out. Oh, and I slipped today on the floor while trying to catch Everest. The side of my leg hurts so much that I know I’m going to bruise. If there isn’t already a bruise there. I haven’t looked yet.
For JavaScript. I finished the music player project since the app said I haven’t finished it. Then I started this football team card project. I first thought it was American football, then quickly found out that we are talking about soccer.
JavaScript notes…
——————————————
Football team cards Step 1 – 15
Step 1
In this project, you will build a set of football team cards and learn about nested objects, object destructuring, default parameters, event listeners, and switch statements. All of the HTML and CSS for this project has been provided for you.
Start by accessing the id called team from the HTML document and storing it in a const variable called teamName.
Remember, you can use the getElementById method for this.
const teamName = document.getElementById('team');
Step 2
Next, access the id called sport from the HTML document and store it in a const variable called typeOfSport. Below that variable, assign the id of year to a const variable called worldCupYear.
const typeOfSport = document.getElementById("sport"); const worldCupYear = document.getElementById("year");
Step 3
Next, access the id called head-coach from the HTML document and store it in a const variable called headCoach. Below that variable, assign the id of player-cards to a const variable called playerCards.
const headCoach = document.getElementById("head-coach"); const playerCards = document.getElementById("player-cards");
Step 4
Create one more const variable called playersDropdownList and assign it the id of players using the getElementById method.
const playersDropdownList = document.getElementById("players");
Step 5
Now it is time to build out the data structure that will hold all of the information for your football team.
Below the variables you just created, create a new const variable called myFavoriteFootballTeam and assign it an empty object.
const myFavoriteFootballTeam = {};
Step 6
Inside the myFavoriteFootballTeam object, add a new property with a key named team and a string value of Argentina.
const myFavoriteFootballTeam = { team : "Argentina" };
Step 7
Below the team property, add a new property with a key named sport and a string value of Football.
const myFavoriteFootballTeam = { team: "Argentina", sport: "Football" };
Step 8
Below the sport property, add a new property with a key named year and a number value of 1986.
const myFavoriteFootballTeam = { team: "Argentina", sport: "Football", year: 1986 };
Step 9
Below the year property, add a new property with a key named isWorldCupWinner and a boolean value set to true.
const myFavoriteFootballTeam = { team: "Argentina", sport: "Football", year: 1986, isWorldCupWinner: true };
Step 10
Below the isWorldCupWinner property, add a new key called headCoach with a value of an empty object. Inside that object, add a property with a key of coachName and a string value of Carlos Bilardo. Below that property, add another key called matches with a number value of 7.
headCoach: { coachName: "Carlos Bilardo", matches: 7 }
Step 11
Below the headCoach property, create a new property with a key named players with the value of an empty array.
headCoach: { coachName: "Carlos Bilardo", matches: 7, }, players: []
Step 12
Inside that players array, create a new object with the following properties:
{ name: "Sergio Almirón", position: "forward", number: 1, isCaptain: false, nickname: null }
Step 13
Below that object, create a new object with the following properties:
name: “Sergio Batista”
position: “midfielder”
number: 2
isCaptain: false
nickname: null
{ name: "Sergio Batista", position: "midfielder", number: 2, isCaptain: false, nickname: null }
Step 14
The rest of the data for the myFavoriteFootballTeam.players array has been filled out for you.
The next step is to ensure that you can’t modify this object by adding or removing any properties. We are going to use a method called Object.freeze(obj) which will freeze this object and prevent any changes being made to it.
Use the Object.freeze() method to freeze the myFavoriteFootballTeam object.
Object.freeze(myFavoriteFootballTeam)
Step 15
The next step is to access the key called sport from the myFavoriteFootballTeam object and assign it to a new const variable called sport.
Remember you can use dot notation for this.
const sport = myFavoriteFootballTeam.sport;