Bleeding

I had sex with my boyfriend a couple of days ago and it was the day after my period and I thought it was over and it already lasted 6 days but apparently I was still on it because after I was bleeding so I put a tampon in and that was the end of it and it has been about three days since that and we did it again and I wasnt bleeding before but again after I started to bleed so I went to the bathroom and I was dripping blood and there was this purple thing in the blood I cleaned everything up and I stopped bleeding sorry if I'm not explaining this well but does anyone know why I'm bleeding?