|
|
@ -2,16 +2,22 @@ |
|
|
|
|
|
|
|
|
Install required modules: |
|
|
Install required modules: |
|
|
|
|
|
|
|
|
``` |
|
|
```sh |
|
|
npm install |
|
|
npm install |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
Run development environment: |
|
|
Run development environment: |
|
|
|
|
|
|
|
|
``` |
|
|
```sh |
|
|
npm start |
|
|
npm start |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
## How it works |
|
|
|
|
|
|
|
|
|
|
|
The project runs `gulp` and `browsersync` beyond the scenes. |
|
|
|
|
|
Each change in template, styling or script files will reload the page. The idea is to have a comfortable development |
|
|
|
|
|
environment. |
|
|
|
|
|
|
|
|
# Block Structure |
|
|
# Block Structure |
|
|
|
|
|
|
|
|
You will find all the block files in `/src` folder. |
|
|
You will find all the block files in `/src` folder. |
|
|
@ -35,26 +41,31 @@ We have a “blocks system”, means you will have to follow strict rules and us |
|
|
|
|
|
|
|
|
## Template Layout & Data |
|
|
## Template Layout & Data |
|
|
|
|
|
|
|
|
### Handlebars |
|
|
|
|
|
|
|
|
|
|
|
In this project, [Handlebars](https://handlebarsjs.com/guide/ "What is Handlebars") used as a template engine. |
|
|
|
|
|
|
|
|
|
|
|
All the template layout must be in a single `*.hbs` file that located in `/src` folder. |
|
|
|
|
|
|
|
|
|
|
|
### Data |
|
|
### Data |
|
|
|
|
|
|
|
|
You will find multiple `*.json` files in `/data` folder after the first run of `npm start`. |
|
|
You will find multiple `*.json` files in `/data` folder after the first run of `npm start`. |
|
|
|
|
|
|
|
|
These files are used as data sources in layout. By reviewing these files you can understand what parameters you have and |
|
|
These files are used as data sources in layout. By reviewing these files you can understand what parameters you have and |
|
|
how the data is stored. Don't change or edit these files - use the data as it is. |
|
|
how the data is stored. |
|
|
|
|
|
|
|
|
There are multiple data sources since the block can be reused in different situations with different data. We have to |
|
|
There are multiple data sources since the block can be reused in different situations with different data. We have to |
|
|
make sure that the block is always rendered properly. |
|
|
make sure that the block is always rendered properly. |
|
|
|
|
|
|
|
|
|
|
|
> Don't change or edit these files - use the data as it is! |
|
|
|
|
|
|
|
|
|
|
|
### Handlebars |
|
|
|
|
|
|
|
|
|
|
|
[Handlebars](https://handlebarsjs.com/guide/ "What is Handlebars") used as a template engine in the project. |
|
|
|
|
|
|
|
|
|
|
|
All the template layout must be in a single `*.hbs` file that located in `/src` folder. |
|
|
|
|
|
|
|
|
|
|
|
> Use the data that is available in `/data` folder. |
|
|
|
|
|
> Avoid using any kind of "freestyle" input/content. Your template file must contain only HTML tags and Handlebars parameters. |
|
|
|
|
|
|
|
|
### Static Media Files |
|
|
### Static Media Files |
|
|
|
|
|
|
|
|
Use the `/src/images` folder in case you need to upload images or video files to the template. These files will be |
|
|
Use the `/src/images` folder in case you need to upload images or video files to the template. |
|
|
available by the next URL: http://localhost:3000/images/${filename} |
|
|
These files will be available by the next URL: http://localhost:3000/images/${filename} |
|
|
|
|
|
|
|
|
### Class Naming Convention |
|
|
### Class Naming Convention |
|
|
|
|
|
|
|
|
@ -69,10 +80,10 @@ min-width: ...px). |
|
|
|
|
|
|
|
|
### CSS Units |
|
|
### CSS Units |
|
|
|
|
|
|
|
|
Use `rem` units instead of pixels. `1rem = 16pixels`. |
|
|
Use `rem` units instead of pixels. |
|
|
|
|
|
For example, `1rem = 16pixels` depends on project. |
|
|
No need to use rem in situations of `1px` or `2px`. (usually used for borders width). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
No need to use rem in situations of `1px`, `2px` or `3px`. (usually used for borders width). |
|
|
It's important to mention that the block is "elastic". By using `rem` units we are able to scale the layout and keep the |
|
|
It's important to mention that the block is "elastic". By using `rem` units we are able to scale the layout and keep the |
|
|
aspect ratio. |
|
|
aspect ratio. |
|
|
|
|
|
|
|
|
@ -81,7 +92,7 @@ aspect ratio. |
|
|
The development environment includes CSS rules of the original project. This is including fonts, CSS variables, |
|
|
The development environment includes CSS rules of the original project. This is including fonts, CSS variables, |
|
|
container logic etc... |
|
|
container logic etc... |
|
|
|
|
|
|
|
|
The CSS file is embedded in served HTML. |
|
|
The CSS file is already embedded in served HTML. |
|
|
|
|
|
|
|
|
# JavaScript |
|
|
# JavaScript |
|
|
|
|
|
|
|
|
@ -97,6 +108,11 @@ The lib is included in the project and ready for use. Test with `window.Swiper` |
|
|
|
|
|
|
|
|
Use development toolbar to switch between data sources. |
|
|
Use development toolbar to switch between data sources. |
|
|
|
|
|
|
|
|
|
|
|
## Hover/Focus States |
|
|
|
|
|
|
|
|
|
|
|
Make sure all "clickable" elements have `&:hover` & `&:focus` states in CSS rules. |
|
|
|
|
|
This might be related to links, buttons or any other interactive elements. |
|
|
|
|
|
|
|
|
## Responsiveness |
|
|
## Responsiveness |
|
|
|
|
|
|
|
|
Make sure the layout is rendered correctly on all standard breakpoint size: |
|
|
Make sure the layout is rendered correctly on all standard breakpoint size: |
|
|
@ -123,6 +139,5 @@ Compare the final result with provided screenshots. |
|
|
You can use |
|
|
You can use |
|
|
available [Browser Extensions](https://chrome.google.com/webstore/detail/perfectpixel-by-welldonec/dkaagdgjmgdmbnecmcefdhjekcoceebi?hl=en) |
|
|
available [Browser Extensions](https://chrome.google.com/webstore/detail/perfectpixel-by-welldonec/dkaagdgjmgdmbnecmcefdhjekcoceebi?hl=en) |
|
|
or any other tool/approach that you're familiar with. |
|
|
or any other tool/approach that you're familiar with. |
|
|
|
|
|
|
|
|
The idea is to have "pretty close" result to requested design. |
|
|
The idea is to have "pretty close" result to requested design. |
|
|
|
|
|
|
|
|
|