WooCommerce.
Animated one-page landing for the WooCommerce eCommerce platform, built on a Gulp and Webpack starter with mouse parallax, a vertical Swiper slider and fluid Sass scaling.
- Year
- 2021
- Early work
- My part
- Sole developer
I built the WooCommerce landing page in 2021 as an animated one-page site for an eCommerce platform, from a given design. It sits on a ready Gulp and Webpack starter template, so I credit myself with the page markup, the Sass partials for the header, footer and home sections, and the page's own scripts, not with the template's menu, observer and adaptive-markup code.
Patterns and decisions
- Five sections in the markup: a hero, a three-card "made simple" block, a documentation block, a testimonials slider and a support block.
- Four Sass partials, about 1,970 lines in total, with BEM class names and 170 media queries across the home, header and footer partials.
- Colors, fonts and four breakpoints (desktop, tablet, phone and small phone) are variables at the top of the main stylesheet, and the layout goes desktop-first with max-width queries.
- Sizes are fluid: I used the template's value-scaling mixin 94 times, so font sizes and margins glide between the design's desktop and phone values instead of jumping at breakpoints.
- Motion is declared in the markup: 29 elements carry mouse-parallax attributes and ten blocks carry a play-once reveal attribute, while the page's Sass defines the loaded state for the entrance animation.
- Compared with Prime One, this exercise moved from fixed rem values per breakpoint to fluid scaling, and from a static page to one with a slider and layered motion.
Cases
Parallax without writing a parallax script. The hero and the cards have images that drift against the cursor. I used the starter's mouse-parallax library and put the behavior into data attributes on each image, with separate attributes for horizontal-only and vertical-only drift, so every layer moves differently without any page script.
Reveal on scroll. Each section had to appear only when reached, and only once. I marked the sections with the watcher attributes and wrote the hidden and visible states in Sass, so the animation stays in the stylesheet and the markup only says when it applies.
Vertical testimonials slider. The quotes had to switch up and down instead of sideways. I configured a Swiper slider with vertical direction, arrow buttons and keyboard control limited to when the block is on screen, and turned off touch dragging so scrolling the page does not move the slider.