基礎版型 230310

最後更新


綠色主機服務形象頁:漸層主視覺含聯絡表單、VPS 方案價目、背景圖特色網格與行動呼籲。

概要


項目內容
製作日期2023-03-10
分類商業網站範例
HTML 檔案index.html
原始碼target/20230310

預覽


基礎版型 230310 截圖
在新分頁開啟範例

頁面區塊


區塊說明
頂部導覽列固定頂部導覽 #nav-002:PARDN CHIU logo、ITEM 按鈕、My Page 連結(pardn.io)、漢堡按鈕
表單主視覺(header=3)漸層背景,示範表單(姓氏/名稱/信箱輸入欄、有主機/無主機單選)與開啟 GitHub repo 的按鈕,旁為「立即了解」標籤、h1 與內文
方案價目(num=3)左斜分隔、「租用VPS / 網站代管」標題、三欄陰影方案卡,規格項目以勾選/未勾圖示呈現
特色網格(num=7)背景圖區塊覆深色遮罩,含白色 h2 與兩欄靠左的四個陰影項目
行動呼籲(num=8)左斜分隔、標題、內文與按鈕
頁尾(footer num=1)上框線淺色頁尾,同樣四欄連結與社群圖示

互動行為


  • js/index.js:body.onscroll 超過 48px 時以 PDRenderKit 字串擴充("nav-002".$._class / class_)切換 #nav-002 的 .scroll
  • js/index.js:將自訂屬性 top / bottom / bg-col / col / bg-img 轉為 inline padding、背景色、文字色、背景圖(bg-col / col 以 -- 開頭的值轉為 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 包在 DOMContentLoaded 內,依賴 PDRenderKit 原型擴充($all、$attr、_style、$style、$parent、_class、class_)
  • 主視覺表單按鈕以 window.open 開啟 GitHub repo;表單標題註明為純範例展示

相依資源


名稱版本來源
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
頁面樣式(SCSS 編譯)-./css/index.css
頁面腳本-./js/index.js

樣式


項目內容
SCSS 入口sass/index.scss
輸出 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

共用區塊庫:index.scss 在 body 內 import 全部 nav/header/section/footer partial,以屬性選擇器(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。
  1. cd target/20230310
  2. 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
  • 方案清單以 li.checked 切換勾選圖示(far fa-check-circle / fa-circle)

外部資源


  • https://pardn.io/image/head.png(favicon)
  • https://demo-web.pardn.io/image/20230310.jpg(og:image / twitter:image)
  • https://demo-web.pardn.io/target/20230310/(canonical / og:url)
  • https://fakeimg.pl/1024/282828/eae0d0/?text=sample(佔位圖片)

相關頁面


EN