基礎版型 220413
紫色主題 PDWebsitemplate 頁面(T004、C020-C024、B004),新增全螢幕行動選單、響應式 w_* 格線與純 CSS 百分比圓餅圖。
概要
即時預覽
在新分頁開啟範例
頁面區塊
互動行為
- T004 導覽列 inline script:#btn-nav-show 對 T004 區塊加 show 並鎖定 body 捲動;#btn-nav-collaspe 加上 collaspe,300ms 後移除它與 show 並恢復捲動(搭配 T004-nav-show / T004-nav-collaspe keyframes)。
- 資料夾內有 js/PDWebsitemplate.js(IntersectionObserver 的 hover/點擊 act 與 unhover 輔助),但 index.html 並未載入。
相依資源
樣式
模組庫改名為 _PD*.scss;_PDColum 新增 ul.resize[df=w_2 / w_3_2_1 / w_4_2 / w_4_2_1 / w_5_3_2] 響應式欄寬;C022 以 Sass @for 產生 percent="1..100" 規則。
cd target/20220413
npx sass sass/PDWebsitemplate.min.scss css/PDWebsitemplate.min.css --no-source-map || exit 1
使用技巧
- 純 CSS 圓餅圖:依 percent 屬性以 calc(3.6deg * N) 旋轉兩個半圓層,數值以 content: attr(percent) 顯示。
- 響應式欄位命名 df="w_3_2_1" = 各斷點 3 / 2 / 1 欄,寬度為 calc(100% / n - 2rem)。
- inline <style> 於 * 設定主題變數:--col-sys rgb(185,120,200)、--default-radius 1rem、--max-width 1140px、--module-hint 1。
- 全螢幕行動選單,keyframe 展開/收合動畫並鎖定 body 捲動。
外部資源
https://fakeimg.pl/1024/282828/eae0d0/?text=sample
https://fakeimg.pl/1024/282828/000000/?text=sample
https://pardn.io/image/head.png
https://pardn.io/web-template/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, not present in the folder)
已知問題
- Header icon links href="/" and href="/blog" are root-absolute and go to the host site root instead of the example. CSS url(../icon/watch/1/fff.svg), url(../image/bg-l.svg), url(../image/bg-m.svg) point to folders that do not exist in 20220413.
相關頁面