Social Networking

Last updated


Three-column creative community/portfolio app (Chinese UI) rendered in JS with PDRenderKit 1.0.1: albums, services, cases, posts, bookmarks, inbox and popups.

Overview


ItemValue
Created2023-07-30
CategoryApp & Platform Examples
HTML filesindex.html
Sourcetarget/20230730

Preview


Social Networking screenshot
Open the example in a new tab

Page Sections


SectionDescription
Top navimage/logo.svg, title '作品分享', '張貼' (post) button and avatar.
Left tab bar (BODY_LEFT / LEFT_TAB)User card and tabs with inline SVG icons: 作品分享, 自我介紹, 案件發包, 社群貼文, 收藏, 通知, 設定, plus a 張貼 button.
Center top carousel (INDEX_TOP)Horizontal strip of album cards (avatar, cover, caption) with left/right arrows and dots.
Center toolbar (INDEX_BUTTON)張貼 / 收藏 / 已張貼 buttons, 活躍度 sort, list/grid toggle, hashtag keyword input.
Center list (INDEX_LIST)Album entries with author, title, count/views/date, a photo collage whose layout depends on photo count ([total], cover styles for 1..6), description, like/bookmark/share buttons.
Right inbox (.right .message)收件匣 header, name search, 全部 / 未讀 tabs and a list of 5 chat contacts.
Popups (.pop)albumPop: single album detail with author contacts (image/icon/contact/*.svg), services and a comment box, with prev/next arrows cycling albums; photoPop: full-screen photo viewer with thumbnails; notification panel.

Interactions


  • js/index.js: mock data arrays chats, albums, services, cases, posts generated at load (albums/services/posts shuffled randomly).
  • albumIndex / serviceIndex / caseIndex / postIndex / bookmarkIndex switch the center column, update the nav title and set LEFT_TAB [index]; albumGrid / serviceGrid toggle grid view.
  • Carousel arrows clamp and write [index] on INDEX_TOP; albumPop/photoPop create .pop overlays closed with a timed removal (400ms); photoPop prev/next update [index] and scrollTo() animates thumbnail scroll with setInterval.
  • notifyList(show) toggles a #pop-notify panel (left tab [index] set to 5), remembering and restoring the previous left-tab index; body[ready] set to 1 after 50ms.

Dependencies


NameVersionSource
Font Awesome Free6.5.2https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css
PDRenderKit1.0.1https://cdn.jsdelivr.net/npm/pdrenderkit@1.0.1/dist/PDRenderKit.js
Noto Sans TC (font-family only)-declared in SCSS; no font stylesheet is linked, so it relies on a locally installed font or the sans-serif fallback

Styling


ItemValue
SCSS entrysass/index.scss
Output CSScss/index.css
Partials_body-left.scss, _body-right.scss, _pop-single.scss, body-center/_index.scss, body-center/_button.scss, body-center/top/_index.scss, body-center/top/_user.scss, body-center/top/_album.scss, body-center/top/_service.scss, body-center/list/_index.scss, body-center/list/_heading.scss, body-center/list/_button.scss, body-center/list/_album.scss, body-center/list/_album-grid.scss, body-center/list/_service.scss, body-center/list/_service-grid.scss, body-center/list/_post.scss, body-center/list/_case.scss, body-center/list/cover/_total-1..6.scss, single/_left.scss, single/_right.scss, animation/_bg-move.scss (not imported), animation/_pie.scss (not imported)

index.scss defines --width-max: 1024px and --bgcolor on :root, then imports body-left (sticky tab bar), body-center (top carousel, toolbar, list types, collage covers per photo count), body-right (sticky inbox) and pop-single (album popup reusing single/_left and single/_right). The animation partials are not imported and do not appear in css/index.css. index.html adds an inline <style> :root block after the stylesheet that sets --width-max: 1440px, the blue --col-brand-1..9 scale, --col-brand-hint-1..9 and --gradient-col.
  1. cd target/20230730
  2. npx sass sass/index.scss css/index.css --no-source-map || exit 1

Techniques


  • PDRenderKit JS DOM building with element ids held in constants (BODY_LEFT, INDEX_TOP, LEFT_TAB...) and "id".$ lookups.
  • Inline SVG icon strings for the tab bar; Font Awesome icons via 'fa-...'.$fa helpers.
  • Attribute selectors drive layout: [total="n"] collage positioning with nth-child, [index] tab highlight via SCSS @for; position: sticky side columns.
  • Breakpoints 360/480/640/800/1024/1280/1440px.

External Assets




中文