Samsung Galaxy used to have something like this that was in the right direction, but I don’t know if they ever did anything with it.
I mean the first versions are of course not of the best quality. But in maybe 5 years, it would have be an universal feature.
Alas. They discontinued the project.