Small black spots in front of your eyes when you close them may be caused by vitreous clouding and fundus hemorrhage.
1-vitreous clouding: it is a common clinical symptom in ophthalmologic diseases, when this situation occurs, you will feel the eyes moving and floating through the black shadow of a dot or strip, which will lead to vision loss in the long run. You can try to treat it with amiodarone eye drops, or go to the ophthalmology department for laser surgery.
2-Floor hemorrhage: this is related to eye lesions, such as retinal detachment, scleritis, trauma, etc.; it may also be related to physical diseases, such as high blood pressure, diabetes. All of these causes can lead to fundus hemorrhage with black spots and blurred vision. It is recommended to treat the cause.
There may also be other reasons for the dark spots before closing the eyes, so it is recommended to consult a doctor in time and improve the examination and treatment under the guidance of the doctor.