App 介紹 230306

最後更新


紅色主色企業形象頁:筆電外框展示、特色網格、圖文分欄、深色推廣區與 Email 訂閱列。

概要


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

預覽


App 介紹 230306 截圖
在新分頁開啟範例

頁面區塊


區塊說明
頂部導覽列固定頂部導覽 #nav-002:PARDN CHIU logo、首頁 / 列表 按鈕、我的頁面連結(pardn.io)、漢堡按鈕
主視覺(header=1)白底主視覺,標題、文字、--col-system 主色「查看原碼」按鈕(GitHub repo)與「我的頁面」連結
筆電展示(num=9)span.laptop 筆電外框內 16:10 螢幕放置示意截圖,下弧分隔
特色圖示(num=1)上弧分隔與四欄圖示卡
特色卡片(num=7)淺藍區塊,含 h2 標題與四張卡片
圖文分欄(num=2)陰影圖片搭配標題與四個含 MORE 連結的列表項
深色推廣(num=4)#212831 背景、兩欄項目與連到 joball.tw 的 MORE 按鈕
圖片橫幅30rem bg-img 背景圖區塊,含連到 joball.tw 的半透明覆蓋連結
圖示亮點卡(num=6)兩張陰影卡片,漸層圖示,上移 -4rem
訂閱列(num=8)標題、Email 輸入框與 SEND 按鈕(無處理邏輯)
頁尾(footer num=1)站名、社群圖示(Instagram/Facebook/GitHub)、ABOUT / PRODUCTS / TECHNICAL / LEGAL 四欄連結、版權列

互動行為


  • js/index.js:body.onscroll 在 scrollTop > 48px 時對第一個 <nav> 加上 .scroll,低於時移除(原生 DOM)
  • 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 為原生 DOM(querySelectorAll / getAttribute);雖載入 PDRenderKit,但頁面腳本未使用

相依資源


名稱版本來源
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/20230306
  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
  • 以 CSS 製作筆電外框(section[num=9] > span.laptop)與 16:10 比例容器(rate="16-10")

外部資源


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

相關頁面


EN