Web Design Technologies — Module 4

Site URL

https://tamato.infinityfree.io

Creating a Function & More Photoshop!

For the function on my site, I created a day of the week tracker. It’s a simple function that gets the current day. If the day is 0 (which is Sunday) or 6 (which is Saturday). It returns a message letting the user know it’s the weekend. Any other day will return a message that it’s a weekday and we need to get stuff done! From taking the Intermediate Programming course and intro to Web Design last semester, creating a new function wasn’t too difficult. I had to shake some of the rust off, but besides that, it was pretty straightforward.

The second part of the assignment this week was to fix the code below.

<!DOCTYPE html>
<html>
<body>
<p id="demo">Display the result here.</p>
<script>
var greeting;
var hour = new Date().getHours();
if (hour < 18) {
greeting = "Good day";
else
greeting = "Good evening";
}
document.getElementById("demo").innerHTML = greeting;
</script>
</body>
</html>

The issue I found with this code was with the if/else statement. For the if/else statement the curly braces need to wrap around each one individually. if{ whatever you are testing } else{ this will happen }. Below is an example of the fixed code.

<!DOCTYPE html>
<html>
<body>
<p id="demo">Display the result here.</p>
<script>
var greeting;
var hour = new Date().getHours();
if (hour < 18) {
greeting = "Good day";
}
else{
greeting = "Good evening";
}
document.getElementById("demo").innerHTML = greeting;
</script>
</body>
</html>

The last part of the assignment was take a picture from the internet. Open it in Photoshop, adjust the size, and use the Export > Save for Web option in the software. The picture I found was of the Cherry Blossoms and the Jefferson Memorial in the background in Washington D.C. The picture originally was a .webp photo. I had to size it down quite a bit so that it could display properly on my page. I used the save for web option and was able to see the whole photo in the preview, I knew then that it was good for me to use. I saved as a JPG then uploaded to my site and it came out really nice. The more I have been using Photoshop the more comfortable I feel with it.

Leave a Reply