jshreyans / frontend-101

Front-end winter assignment for Department of Visual Media. These include tasks based on Vanilla JS and CSS.
0 stars 1 forks source link

B4 Review #11

Closed jshreyans closed 5 years ago

jshreyans commented 5 years ago

Completed B4

https://github.com/jshreyans551/frontend-101/blob/2e18b8bc4c374e3a098aff6ba1704ece0f31718b/B/4.html#L60 Don't know if the logic used here for comparision is the best one but it works well.

sarthak-sehgal commented 5 years ago

@jshreyans551

  1. The page should print "Front-end development is fun" whenever it received "DVM" as input. Your page is only displaying it once. See https://sarthak-sehgal.github.io/frontend-101/B/4.html
  2. The logic you have used seems good. To make it more efficient, you can start checking only when "D" is pressed as "D" marks the start of the string "DVM"
jshreyans commented 5 years ago

Resolved the first problem

jshreyans commented 5 years ago

@sarthak-sehgal I've added the necessary logic as per your second point and there was the text-overlap issue in Firefox, so that's been resolved.

kunal-mohta commented 5 years ago

@jshreyans551 This isn't working for me, in any browser.

jshreyans commented 5 years ago

@kunal-mohta Pls check now. It should work. I'd forgotten to update the gh-pages.

kunal-mohta commented 5 years ago

@jshreyans551 I just found a bug. Use Shift + D for capital D and for capital V & M turn on the Caps Lock. It won't work. :wink:

jshreyans commented 5 years ago

@kunal-mohta I should have guessed that would happen. My logic basically makes a sliced array from the array containing all keydown events. So once you press Caps Lock, it also gets recorded in the sliced array after D, so the condition becomes false and the loop breaks. I'll correct it. Thanks!

jshreyans commented 5 years ago

Should work now