Basic (2022-04-13)

Last updated


Purple-themed PDWebsitemplate page (T004, C020-C024, B004) adding a full-screen mobile nav, responsive w_* grids and CSS-only percentage pie charts.

Overview


ItemValue
Created2022-04-13
CategoryBusiness Examples
HTML filesindex.html
Sourcetarget/20220413

Preview


Basic (2022-04-13) screenshot
Open the example in a new tab

Page Sections


SectionDescription
T004 header, nav, heroBackground-image block: top bar with home / blog / store icons and GitHub / Email links; nav with title, ellipsis show button, items and LIST dropdown, HIDE collapse button; hero article with Code / Github buttons.
C023 image cards6 shadow cards with image and caption + arrow icon in a w_3_2_1 grid.
C021 icon featuresBackground-image block with 4 icon + title + text items (w_4_2_1).
C022 pie charts4 circular percentage charts (percent=0/30/60/90) in a w_4_2 grid with MORE buttons.
C020 text cards with iconBackground-image block with 6 article cards each paired with an icon link (w_3_2_1).
C024 call to actionPurple band with heading and My Page button.
B004 footerSocial contact row (Instagram / GitHub), then 4 columns BC006 / BC002 / BC003 contact form / BC004 thumbnails, copyright bar.

Interactions


  • Inline script in T004 nav: #btn-nav-show adds show to the T004 block and sets body overflow to hidden; #btn-nav-collaspe adds collaspe to the nav, then after 300ms removes it and show and sets body overflow to scroll (T004-nav-show / T004-nav-collaspe keyframes).
  • js/PDWebsitemplate.js (IntersectionObserver hover / tap act + unhover helper) is in the folder; index.html does not load it.

Dependencies


NameVersionSource
Font Awesome Free6.5.2https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css
Noto Sans TC (Google Fonts)wght 100;300;400;500;700;900https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700;900&display=swap
js/PDWebsitemplate.js (local, not loaded by the page)-js/PDWebsitemplate.js

Styling


ItemValue
SCSS entrysass/PDWebsitemplate.min.scss
Output CSScss/PDWebsitemplate.min.css
Partials_PDTop.scss (top/_T001-_T004), _PDColum.scss (w_* grid rules + colum/_C001..._C024), _PDBottom.scss (bottom/_B001-_B004, _BC001-_BC006), _PDAnimation.scss, _PDComp.scss (comp/_a[btn], _dev.a[shadow], _div[bg], _img[ic], _to, _wh)

Module library renamed to _PD*.scss; _PDColum adds ul.resize[df=w_2 / w_3_2_1 / w_4_2 / w_4_2_1 / w_5_3_2] responsive column widths; C022 generates percent 1-100 rules with a Sass @for loop.
  1. cd target/20220413
  2. npx sass sass/PDWebsitemplate.min.scss css/PDWebsitemplate.min.css --no-source-map || exit 1

Techniques


  • CSS-only pie chart: two half-circle layers rotated by calc(3.6deg * N) per percent attribute, value shown with content: attr(percent).
  • Responsive column naming df="w_3_2_1" = 3 / 2 / 1 columns across breakpoints using calc(100% / n - 2rem).
  • Theme CSS variables in inline <style> on *: --col-sys rgb(185, 120, 200, 0.9), --default-radius 1rem, --max-width 1140px, --module-hint 1.
  • Full-screen mobile nav with keyframe show / collapse animations and body overflow toggle.

External Assets


  • https://fakeimg.pl/1024/282828/eae0d0/?text=sample
  • https://fakeimg.pl/1024/282828/000000/?text=sample
  • https://pardn.io/image/head.png
  • https://demo-web.pardn.io/image/20220413.jpg
  • / and /blog (root-absolute header icon links)
  • ../icon/watch/1/fff.svg, ../image/bg-l.svg, ../image/bg-m.svg (referenced by compiled CSS)


中文