Teleporting to which direction I'm facing using command blocks in minecraft?

Nevermind I got it.

Anyhow, The command was simple but hard to implement.

/execute at @e[type=player,x_rotation=-45..45,y_rotation=135..-135] if block ~ ~-3 ~ minecraft:daylight_detector run tp @p ~ ~5 ~

adding the two ".." in between the numbers in the x_rotation and y_rotation allows the player to teleport when the player is looking at a direction BETWEEN -45 to 45 and 135 to -135