Analog is input only. There is no analog out on Arduino boards.
You can lower the frequency of a PWM pin to as low as 30Hz, but I've never tried it. To make a motor "fade" you would need to lower the PWM frequency in a loop. But considering where you are in the project, I would recommend saving this for after everything else is working.
You want to go waaaaay too fast for your skills...
Start small and learn the basics about the language, the various techniques to deal with time and the fundamentals of electronics. You’ll need a very solid base if you want to complete your project
I AM trying to help you one step at a time. I can't if you keep going off on tangents.
Assuming, because you didn't answer my question, that you want the motor to run for 30-seconds after you have pressed and released the button.
When you detect the button is pressed, start the motor and save the current value of millis().
In the loop(), test the elapsed millis:
if ((millis() - saved_time ) >=duration ) {action}
Sorry for late reply. The motor runs for 30 seconds while the button is pressed although I can edit the code to make it work once it is pressed (versus while pressed)
I am going to try the elapsed millis. Thanks!