First week of October is almost over, and did it fly by fast.

Looking for an issue for HacktoberFEST was rougher than expected, while I appreciate the many repositories geared towards getting people to join, they were not the sort of repositories I was interested in.

And don’t get me started on the emoji ones…

Whatismyviewport

Links: Repository | Issue | Pull-Request

In the end, I was able to find an issue that I was both interested in working on AND was capable of fixing. This issue was brought to my attention to by a friend of mine.

The Issue:

The issue did not require a lot of code, most of it was css, and I probably spent most of my time trying to figure out what the difference between viewport and resolution was than actually coding.

<button onclick="explanation()" id="Toggle-Explanation">Is this my screen resolution?</button>
<div id="Explanation"></div>

That was the total amount in the main file, while the function code was not any more complex.

function explanation() {
  var x = document.getElementById("Explination");
  if (x.innerHTML == "") {
    x.innerHTML = "Screen resolution is not the same as viewport size. Viewport refers to the visible area of a webpage on a device, while Screen resolution is the amount of pixels a device has";
  } else {
    x.innerHTML = "";
  }
} 

Basically, if the div is empty, innerHTML will add the explanation when the button is pressed. Once it’s pressed again, it will clear it.

One thought on “27 Days Left: 1 Issue Down

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s