I'm trying to make a sign up and log in button but I cant figure out how to do something that is defined with a function but I'm trying to use a function in another function above the function but I need those functions to stay there but I cant do that
There's a lot going on here.
You have function declarations inside of function declarations, which I'm guessing is not what you're going for. Try separating them into their own thing.
Also, you're using a lot of local variables. Make them global by using declaring them outside of the functions.