pre-calculate width and height for cards