refactor css code , recalculate wrapper size when window resize