Trouble controlling Fade amount using proximity sensor as input and LED output

Hello! I was wondering if anyone had any pointers or advice to make this project work. Essentially I would like to have the LED fade (meaning like fade on and off at a calm rate) at one rate when there is nothing close to the proximity sensor, and then to speed up the fade amount when there is something close to the sensor.

https://github.com/sanaalla/Fade-LED-with-Proximity-sensor

Above is my code, which is not working. I am fairly new to Arduino and so would greatly appreciate some more seasoned wisdom!

Thanks!