JavaScript totally stuck not showing 'all' items

Hi - I need some quick help. When I copied my code over to WP; suddenly the JavaScript did not operate as in Codepen.

I have buttons for ALL, Videos, and Photos. By default, on page load; all 9 images should display and ALL should be active.

As it is right now, the function is correct but the display is totally off. Please help!

Hi, my suggestion would be, remove and add active classes on click event.
onLoad just show all images and videos.

Check this link —> Filter Gallery

code: Code