Restaurant Introduction (2023-06-04)

Last updated


Single-page landing site for a vegetarian brunch restaurant (耕園7293 / G-Burger) with hero, featured dishes, menu cards and contact footer.

Overview


ItemValue
Created2023-06-04
CategoryBusiness Examples
HTML filesindex.html
Sourcetarget/20230604

Preview


Restaurant Introduction (2023-06-04) screenshot
Open the example in a new tab

Page Sections


SectionDescription
Fixed navBrand 耕園7293 with tagline, 4 tab items (關於耕園 / 熱門介紹 / 店長推薦 / 聯絡我們) and a hamburger button for mobile.
Hero (.top)Headline 素食也能吃得精彩, intro text, Uber Eats order button, burger image, and 4 tiles each cross-fading 5 dish photos.
Featured dishes (.hot)Banner image followed by 6 numbered glass cards (01-06) describing dishes, each with a LEARN MORE button; five of them open Instagram posts.
Manager's picks (.menu)8 menu cards with photo, dish name, price and an order button opening Uber Eats.
Contact (.contact)Image, 最新資訊 email input with SUBMIT button (no handler), Google Maps address link, copyright, and phone / Facebook / Instagram icons.

Interactions


  • js/index.js: scroll listener on body sets #view-tab sel=0..3 based on precomputed section offsets plus an 80px offset (scroll-spy) to highlight the active tab.
  • js/index.js scrollTo(top): custom eased smooth scroll via setInterval (30ms steps, 1/5 of remaining distance) triggered by clicking each tab.
  • #button-tab toggles the .show class on #view-tab to open a full-screen mobile menu; clicking an item closes it.
  • Inline onclick window.open() on buttons to Uber Eats and Instagram.

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
Noto Sans TC (font-family only, not loaded by the page)-none

Styling


ItemValue
SCSS entrysass/index.scss
Output CSScss/index.css
Partials_nav.scss, _top.scss, _hot.scss, _menu.scss

index.scss holds reset, :root vars (--max-width 1024px, --col-sys #FF6B18) and the contact block; partials are @imported nested inside body selectors: _nav (fixed bar, sel-based active tab, mobile .show overlay), _top (hero, rotating bg keyframes, 25s cross-fade tiles), _hot (numbered glass cards via ::before), _menu (menu card grid with hover).
  1. cd target/20230604
  2. npx sass sass/index.scss css/index.css --no-source-map || exit 1

Techniques


  • PDRenderKit 1.0 String-prototype DOM helpers: "id".$, ._attr(), ._click(), ._class(), .class_(), .$$class(), .$child().
  • Attribute-driven state: ul[sel="n"] > li:nth-child(n+1) styles the active tab.
  • Pure-CSS image carousel: stacked images with staggered animation-delay (0/5/10/15/20s) on a 25s opacity keyframe.
  • backdrop-filter blur glass cards; flex-wrap with calc() widths for 1/2/3 columns.
  • Breakpoints 480px, 640px, 768px, 800px; @media (hover: hover) and (pointer: fine) for hover effects.
  • html fixed with body as the scroll container (overflow: hidden scroll), hidden scrollbars.

External Assets




中文