Personal Profile (2023-05-12)

Last updated


Single-page personal résumé site rendered entirely by PDRenderKit from a PDConfig object: Home typing hero, About Me profile/skills, Portfolio grid.

Overview


ItemValue
Created2023-05-12
CategoryPersonal Examples
HTML filesindex.html
Sourcetarget/20230512

Preview


Personal Profile (2023-05-12) screenshot
Open the example in a new tab

Page Sections


SectionDescription
Mobile navnav with #show-nav button toggling body.show to reveal the left bar
Left bar (section.left-bar)Fixed sidebar: avatar, name, Facebook/Instagram/GitHub/LinkedIn links, Home / About Me / Portfolio tabs, copyright footer
Home (section.home)Full-height background photo (local image/cgfaces_*.jpg) with greeting, typing title cycling PDConfig.home.line2.list and intro lines
About Me (section.about)關於我 heading, avatar + info list (age, education, email, phone, site, GitHub), 4 fact tiles, 技能 skill bars by years, 專案 and 報價 timelines
Portfolio (section.portfolio)Grid of 20 generated placeholder cards (image + title) from PDConfig.portfolio

Interactions


  • index.html inline <script> defines global PDConfig (home / about / portfolio data); body is empty and js/index.js builds the whole DOM with PDRenderKit element builder ("tag.class"._([...]), _child, _click, _go, _open)
  • Tab routing via ?page=home|about|portfolio (read with location.href.$url.$query("page"), default home): setHome / setAbout / setPortfolio update the query with $url.__query().__history(), move .sel and replace section.right-body children (__child)
  • On load "button.sel".$.click() renders the page matching the query
  • js/index.js setHome → updateTitle: typing/erasing animation on #typing-area every 8s using setInterval/setTimeout
  • #show-nav toggles body.show to open/close the sidebar on narrow screens

Dependencies


NameVersionSource
Font Awesome Free6.5.2https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css
PDRenderKit1.0.0https://cdn.jsdelivr.net/npm/pdrenderkit@1.0.0/dist/PDRenderKit.js
Page stylesheet (compiled SCSS)-./css/index.css
Page script-./js/index.js
Home background photo-./image/cgfaces_e5d2485f-d7b9-45ba-a525-e45a237fe958.jpg (via css/index.css url(../image/...))
Noto Sans TC (font-family only)-no webfont link; font-family 'Noto Sans TC', sans-serif

Styling


ItemValue
SCSS entrysass/index.scss
Output CSScss/index.css
Partials_left-bar.scss, _home.scss, _about.scss

index.scss holds resets, :root vars (--tab-width 0/240/360px at 800/1024px, --head-width 10rem/12rem at 1024px) and the portfolio grid (--album-row-width 1/2/3 columns at 640/1280px); _left-bar styles the fixed sidebar, _home the background hero with ::before overlay, _about the profile, fact tiles, skill bars ([year=N] loop) and timelines.
  1. cd target/20230512
  2. npx sass sass/index.scss css/index.css --no-source-map || exit 1

Techniques


  • Data-driven SPA: content in a config object, DOM built entirely in JS, no markup in <body>
  • Query-string routing with history update instead of separate HTML files
  • CSS variables redefined inside media queries (800px / 1024px) to resize sidebar and avatar
  • Skill bars via attribute selectors [year=N] generated by SCSS loop and content: attr(skill) / attr(year) "年"
  • Fixed sidebar with responsive breakpoints at 414/480/640/800/1024/1280/1440px

External Assets




中文