Refactor logic_components example to use a viewport