Nearly flat Chern band in periodically strained monolayer and bilayer graphene