Basic (2023-03-12)

Last updated


Product catalogue landing page: search hero, 4-column product grid, custom-site contact bar and 3-column product detail cards.

Overview


ItemValue
Created2023-03-12
CategoryBusiness Examples
HTML filesindex.html
Sourcetarget/20230312

Preview


Basic (2023-03-12) screenshot
Open the example in a new tab

Page Sections


SectionDescription
Top navigationFixed top nav #nav-002: PARDN CHIU logo, ITEM buttons, My Page link (pardn.io), hamburger button
Search hero (header=2)Background-image hero with h1, text and a product-name search input + button to GitHub
Product grid (num=16)Slash-right divider, light-blue band, Web label and text, eight shadowed image tiles with captions in 4 columns
Contact bar (num=8)想製作客製化網站 heading, demo note text, email input and a Line-labelled mailto:dev@pardn.io button
Product details (num=17)Hot label and text, six dark shadowed cards in 3 columns with image, bold title, SVG star rating, 共12個評價 hint and 前往查看 footer
Footer (footer num=1)Dark #15181b footer with slash-left divider and four link columns

Interactions


  • js/index.js: body.onscroll toggles .scroll past 48px on the top-nav id using PDRenderKit string helpers ("top-nav".$._class / class_)
  • js/index.js: converts custom attributes top / bottom / bg-col / col / bg-img into inline padding-top, padding-bottom, background-color, color, background-image (bg-col / col values starting with -- become var(--x))
  • js/index.js: replaces span[mask] (arc / arc-up / arc-down / slash-left / slash-right / wave) with generated inline SVG dividers sized from the viewport width (64/128px above 1024px)
  • js/index.js wraps logic in DOMContentLoaded and relies on PDRenderKit prototype extensions ($all, $attr, _style, $style, $parent, _class, class_)

Dependencies


NameVersionSource
Font Awesome Free6.5.2https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css
PDRenderKit1.5.2https://cdn.jsdelivr.net/npm/pdrenderkit@1.5.2/dist/PDRenderKit.js
Page stylesheet (compiled SCSS)-./css/index.css
Page script-./js/index.js

Styling


ItemValue
SCSS entrysass/index.scss
Output CSScss/index.css
Partialsnav/_001.scss, nav/_002.scss, nav/_body.scss, header/_001.scss, header/_002.scss, header/_003.scss, section/_000.scss ... section/_022.scss, section/_015-top.scss, section/_015-center.scss, section/_015-bottom.scss, footer/_001.scss, comp/_div-info.scss, comp/_innerText.scss, comp/_li-r2.scss, comp/_li-r3.scss, comp/_li-r4.scss, comp/_ul-button.scss, comp/_w-h-rate.scss

Shared section library: index.scss imports every nav/header/section/footer partial inside body; each partial is keyed by an attribute selector (nav[num], section[header=N], section[num=N], footer[num]); comp/* are mixin-like snippets imported inside sections (r2/r3/r4 responsive column widths, div-info title block, w-h-rate in section 021). component/_info.scss and section/_rm-1st-top.scss exist but are not imported. This copy's section/_015-center.scss differs from 20230302 (3-line clamped post text, styling shared by p / a / button).
  1. cd target/20230312
  2. npx sass sass/index.scss css/index.css --no-source-map || exit 1

Techniques


  • Theme via CSS custom properties in an inline <style> :root (--col-nav, --col-system, --col-txt, --col-border, --max-width)
  • Attribute-driven layout: section[num=N] / section[header=N] / nav[num] select a pre-built SCSS block; ul.r2 / .r3 / .r4 pick 2/3/4 column cards
  • Fixed top nav with collapsed hamburger button; media queries at 413/479/639/799/1023/1039/1139px max-width and 480/640/768/1024/1040px min-width
  • JS-generated SVG section dividers (arc / slash / wave) via span[mask]
  • SEO head: Open Graph, Twitter card, canonical, JSON-LD WebPage schema
  • Slash dividers (slash-left / slash-right) filled with their own section's background colour

External Assets


  • https://pardn.io/image/head.png (favicon)
  • https://demo-web.pardn.io/image/20230312.jpg (og:image / twitter:image)
  • https://demo-web.pardn.io/target/20230312/ (canonical / og:url)
  • https://fakeimg.pl/1024/282828/eae0d0/?text=sample (placeholder images)
  • https://fakeimg.pl/1024/282828/000000/?text=sample (hero background)
  • mailto:dev@pardn.io


中文