This Demonstration simulates the orbital motion of the Moon around the Earth, while the Earth is in orbit around the Sun. When the two orbits are aligned just right, a solar eclipse can occur on day zero and a lunar eclipse on day 15. When the orbits are otherwise tilted, eclipses do not occur, but we get new moon and full moon phases.
The drawing is not to scale. The Earth's position is taken as the frame of reference.