Personal Page With Blog

Last updated


Multi-page personal site (home, portfolio, blog, post) from view/*.html partials on PDRenderKit 1.2.0, with JS masonry and Markdown viewer.

Overview


ItemValue
Created2023-06-21
CategoryBlog Examples
HTML filesindex.html, portfolio.html, blog.html, blog-content.html, view/nav.html, view/header.html, view/portfolio.html, view/service.html, view/about.html, view/skill.html, view/client.html, view/contact.html, view/footer.html, view/blog-content.html
Sourcetarget/20230621

Preview


Personal Page With Blog screenshot
Open the example in a new tab

Page Sections


SectionDescription
Nav (view/nav.html)Sticky nav with brand link and :for links HOME / PORTFOLIO / BLOG; hamburger @click=tab toggles the mobile menu below 800px.
Header (view/header.html)Headline with a <strong> emphasized phrase and GitHub / LinkedIn buttons with reveal animation.
Portfolio (view/portfolio.html)JS masonry of placeholder figures from the page's global ary (8 on index, 24 on portfolio.html) with auto-built ALL/TAG1/TAG2/TAG3 filter tabs.
Service (view/service.html)6 icon articles via :for over icon names with interpolated class fa-{{ e }}.
About (view/about.html)Photo with decorative image/about.svg, bio and two 3-item timelines.
Skill (view/skill.html)8 circular pie indicators with shuffled :year values 1..8, animated when revealed.
Client (view/client.html)5 testimonial cards in a horizontal looping carousel with prev/next buttons.
Contact (view/contact.html):model form (name, email, message) with @click=send alert, beside an embedded Google Maps iframe.
Footer (view/footer.html)Copyright and :for icon links (GitHub, LinkedIn, mail).
Blog list (blog.html)Two-column layout: author card, 8 post links to blog-content.html, prev/next page links; sidebar with search, latest 4 posts, topics and tags; mobile floating bottom search bar.
Blog post (blog-content.html + view/blog-content.html)Article header, details/summary table of contents, PDMarkdownKit viewer rendering the PDMarkdownKit README, prev/next post links, same sidebar.

Interactions


  • js/index.js and js/blog.js create new PD({id: "body"}) with nav items; view/*.html scripts create their own PD instances; header, service, about, skill, client and contact register their *.delay elements in next(), and portfolio registers each generated figure, all with the shared delay_observer from js/index.js.
  • Reveal: IntersectionObserver removes .delay, sets done=1 after 700ms (wipe overlay ::after), removes .at after 1300ms; skill pies animate on [done="1"][year].
  • updateShadow(): nav box-shadow and .float-bottom shadow scale with body scroll position (0..32px).
  • view/portfolio.html: absolute-positioned masonry placing each item in the shortest column (1/2/3 columns below 480px / from 480px / from 1024px), tag filter tabs set filter-key and updatePortfolio() re-lays out with opacity, debounced 300ms window.onresize relayout.
  • view/client.html: clones the cards for an endless loop and animates scrollLeft with setInterval (10ms) on prev/next, jumping to the middle copy at either end.
  • js/blog.js (module): fetches https://cdn.jsdelivr.net/npm/pdmarkdownkit@1.6.0/README.md and, on pages with section[name=blog-content], mounts a PDMarkdownKit viewer before section.page; also offsets the sticky sidebar top when taller than the viewport.

Dependencies


NameVersionSource
Font Awesome Free6.5.2https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css
PDRenderKit1.2.0https://cdn.jsdelivr.net/npm/pdrenderkit@1.2.0/dist/PDRenderKit.js
PDMarkdownKit (ES module, blog pages)1.6.0https://cdn.jsdelivr.net/npm/pdmarkdownkit@1.6.0/dist/PDMarkdownKit.module.js
Google Maps embed iframe-https://www.google.com/maps/embed?pb=...
js/index.js (index.html, portfolio.html)-./js/index.js
js/blog.js (blog.html, blog-content.html)-./js/blog.js (type=module)

Styling


ItemValue
SCSS entrysass/index.scss
Output CSScss/index.css
Partialsfunction/_hsbTohsl.scss, _init.scss, _nav.scss, _header.scss, _blog.scss, _portfolio.scss, _service.scss, _about.scss, _skill.scss, _client.scss, _contact.scss, _footer.scss, animation/_section-3.scss, animation/_pie.scss

function/_hsbTohsl defines hsb()/hsba() SCSS functions converting HSB to HSL; _init holds reset, rem size vars also used as breakpoints ($_640: 40rem, $_800: 50rem) and HSB-derived color scales (brand/success/notify/error/info/border). index.scss defines the global .at/.delay/[done] reveal with a gradient wipe ::after and a rotated a.hint watermark. _skill @imports animation/_pie and uses @for over [done][year] for pie rotation; _blog covers list/post/sidebar (sticky), details TOC and .float-bottom; _client handles [row] layouts. Inline <style> sets --col-brand-5 #f1c50e and --gradient-col.
  1. cd target/20230621
  2. npx sass sass/index.scss css/index.css --no-source-map || exit 1

Techniques


  • PDRenderKit PD templating: :path partials, :for, {{ }} incl. inside attributes (:class="... fa-{{ e }}"), :model, @click, next() lifecycle hook.
  • Custom SCSS @function for HSB to HSL color conversion and generated color scales.
  • Shortest-column masonry with absolute positioning computed in JS; filter via opacity/left transitions.
  • Reveal wipe effect: ::after with 300% three-band gradient whose background-position is animated via [done] attribute.
  • details/summary TOC, position: sticky nav and sidebar, backdrop-filter, max-width 799.99px / min-width 480, 640, 800, 1024px breakpoints.

External Assets




中文