Platfrom like yellow platform from Super Mario World

I want to make a platform like the yellow block in super mario world. I mean these ones:
image
image
Both fo them
Edit: The first gros larger and the tinier to the sides, the second one disapperas for a moment