This project implements a simple web page with credit card selection panels.
- The solution is built using Bootstrap and Angular for scaffolding of the page.
- Uses Angular for implementing the interactive functionality. Currently it uses a single controller in the router to load page templates. Navigation code (incomplete) is tucked in a template file that is included in using ng-include. The main view is loaded by the router. The constructor of the controller also loads in the data json file from the model folder.
- The styling is organised to be scalable using smacss guideline. A simple BEM based naming convention is used for style classes. This runs somewhat against the Bootstrap naming convention. However using flat classes has more benefit in scalability and modularity and avoids the problems associated with specificity.
- The svg icon files provided in the asset folder could not be utilised directly as all the icons were exported in a single file without ids or names. As a workaround I have used the symbol font file from the main CTM website to link the icons to menu items.
Minor build issues were encountered in grunt plugin usemin as it renames image files during minification process. The controller generates the image name for the card from the json property: code but such dynamic name cannot be processed by usemin. The controller implements a workaround to specifically name the known image files in simple hashmap.
- After cloning the repostory first step is to install npm packages:
npm install - This package uses bower to get Bootstrap and Angular libs locally for development. Install using
bower install - If you do not have compass installed locally install it e.g. as a gem:
gem install compass.
- Run
gruntfor building andgrunt servefor preview. - Run
grunt build:distto build the optimized dist folder with minified code and images for uploading to a server manually.
Running grunt test will run the unit tests with karma. Only two test at the moment.