商店頁面
最後更新
源碼展示形象頁:搜尋主視覺、波浪分隔源碼展示、精選與最新產品網格及圖文列。
概要
| 項目 | 內容 |
|---|---|
| 製作日期 | 2023-03-14 |
| 分類 | 商業網站範例 |
| HTML 檔案 | index.html |
| 原始碼 | target/20230314 |
預覽

在新分頁開啟範例
頁面區塊
| 區塊 | 說明 |
|---|---|
| 頂部導覽列(nav num=2) | #top-nav 採純色+底線樣式(nav/_002):PARDN CHIU logo、四個 ITEM 按鈕、My Page 連結、漢堡按鈕 |
| 搜尋主視覺(header=2) | 背景圖主視覺加藍色遮罩,白色標題、Search 輸入框與「搜尋」按鈕 |
| 源碼展示(num=22) | 波浪分隔、「其他源碼」標題、三欄共六張含說明的 figure 卡片,混用矮(a.s)與高(a.l)兩種高度 |
| 精選內容(num=21) | 「精選內容」標題列含 MORE 按鈕,三欄三張產品卡 |
| 最新內容(num=21) | #4200d0 紫色區塊、「最新內容」標題與四欄四張卡 |
| 圖片卡(num=5) | 波浪分隔與兩張圖片卡 |
| 圖示文字卡(num=6) | 弧形分隔與兩欄兩張圖示卡 |
| 頁尾(footer num=1) | 上框線淺色頁尾,含品牌欄與四欄連結 |
互動行為
js/index.js:body.onscroll超過 48px 時呼叫 PDRenderKit 字串擴充"top-nav".$._class/class_切換#top-nav的.scrolljs/index.js:將自訂屬性 top / bottom / bg-col / col / bg-img 轉為 inline padding、背景色、文字色、背景圖(-- 開頭值轉為 var(--x))js/index.js:把span[mask=arc|arc-up|arc-down|slash-left|slash-right|wave]替換成依 viewport 寬度產生的 inline SVG 分隔曲線(>1024px 時 64/128px)js/index.js:帶unhover="1"的元素在 mouseleave 時加上.unhover500msjs/index.js包在 DOMContentLoaded 內,依賴 PDRenderKit 原型擴充($all、$attr、_style、$style、$parent、_class、class_)
相依資源
| 名稱 | 版本 | 來源 |
|---|---|---|
| Font Awesome Free | 6.5.2 | https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css |
| PDRenderKit | 1.0.0 | https://cdn.jsdelivr.net/npm/pdrenderkit@1.0.0/dist/PDRenderKit.js |
| 頁面樣式(SCSS 編譯) | - | ./css/index.css |
| 頁面腳本 | - | ./js/index.js |
樣式
| 項目 | 內容 |
|---|---|
| SCSS 入口 | sass/index.scss |
| 輸出 CSS | css/index.css |
| Partials | nav/_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 |
共用區塊庫:
index.scss 在 body 內 import 全部 nav/header/section/footer partial(nav/_body.scss 由 nav partial 引入,015-top/center/bottom 由 section/_015.scss 引入),以屬性選擇器(nav[num]、section[header=N]、section[num=N]、footer[num])對應;comp/* 為在 section 內 import 的片段(r2/r3/r4 響應式欄寬、div-info 標題區、section 021 使用的 w-h-rate)。component/_info.scss、section/_rm-1st-top.scss 存在但未被 import。本份 header/_002.scss 與 section/_015-center.scss 與 20230302 不同。image/full.svg、half.svg 存在但未被引用。- cd target/20230314
- npx sass sass/index.scss css/index.css --no-source-map || exit 1
使用技巧
- inline
<style>:root 以 CSS 變數設定主題(--col-nav、--col-system、--col-txt、--col-border、--max-width) - 屬性驅動版型:section[num=N] / section[header=N] / nav[num] 對應預製 SCSS 區塊;ul.r2/.r3/.r4 選 2/3/4 欄卡片
- 固定頂部導覽列與漢堡按鈕;media query 斷點 max-width 413/479/639/799/1023/1039/1139px、min-width 480/640/768/1024/1040px
- 以 span[mask] 由 JS 產生 SVG 區塊分隔(弧形 / 斜切 / 波浪)
- SEO head:Open Graph、Twitter card、canonical、JSON-LD WebPage schema
- 同一 section num(21)以不同 bg-col 重複使用兩次
外部資源
- https://pardn.io/image/head.png (favicon)
- https://demo-web.pardn.io/image/20230314.jpg (og:image / twitter:image / JSON-LD image)
- https://demo-web.pardn.io/target/20230314/ (canonical / og:url / twitter:url / JSON-LD url)
- https://fakeimg.pl/1024/282828/eae0d0/?text=sample(佔位圖片)