made opacity frame dynamically for mainPost