search
HomeWeb Front-endHTML Tutorial北港媽祖也懂 Material Design!手機就能跟著媽祖遶境 Live 齊步走_html/css_WEB-ITnose

《TO 導讀》:一個工程師的成就感未必來自於工作,而是能將專業所學投入生活相互呼應,有所貢獻。媽祖繞境在北港人心中不只是民俗活動,而是從小看到大的成長記憶。一位來自北港的工程師便運用所學,為媽祖繞境架設網站,只要透過手機就能參與媽祖遶境盛事。以下是為作者第一人稱描述。

很久沒來版上 PO 文章了 >"

最近忙著幫忙我們家鄉的活動製作網站,基本上我是屬於義務性幫忙、非官方、沒盈利的自主服務 (XD),每一年的製作這個網站我算是不斷自我突破吧 (疑?),從後端、系統、設計、切版、上稿,我嘗試一個人完成!

話題扯遠了,回到正題,這個網站我要分享的是前、後端以及系統部分,

如果內容不 OK 可以跟我講一下喔!

《 笨港迎媽祖 》網站

從設計開始,我參考了 Material Design 的角度去設計版面以及流程,不過當然的,手機與網頁的表現還是會有些許的差異,但是整體我仍然盡量參考規範XD

PHP 這次我就使用了很潮的 php7,跑起來貌似有變快,因為我的爬蟲變快了,所以整體來說算是很滿意,只是有些 function 需要稍做調整,不過大致上都很健康!

JavaScript 這次主力都在 Google Maps API 的運用。因為三年前我將此地圖資訊與廟會遶境路線做了結合,開啟了我對 Google Maps 運用的熱愛,所以今年也是把他當主力,活動當天沒意外的話,我會結合 GPS 線上定位!

CSS 的部分,我則是使用 compass scss 去實作,javascript 的話則是使用 jQuery 以及一些其他的 lib 實作!因為前後端都自己包辦,所以 Framework(CodeIgniter)我做了一些修改,讓這些靜態 css、javascript code 上 production 時候自動的 merge 以及 minify。

在靜態檔案的處理,我利用 S3 強大的空間功能,將網站的圖檔資源、js、css 都上到 S3 以減少 EC2 的 Loading,所以說,S3 上的 js、css 都是已經 minify 的了,而圖片檔若是遇到大檔案,則利用 TinyPNG 去對圖片做壓縮,然後再上傳到 S3,

對了,以上當然是用程式跑的:)

再來則是 HTML,基本上網站前台都是使用大量的文章以及簡介,所以可以做大量的 cache,然後這部分採用 file cache 而已,雖然我有原本打算使用 Redis 去實作,但是我把記憶體留給 MySQL 了..(我沒開 RDS,MySQL 是上在與 Server 同一台的 EC2)

因為有作 output 的 cache,所以我也順便將 HTML minify 囉,因為做 HTML 的 output cache,所以瀏覽人數的紀錄就不能跑 php 做 +1,所以這部分我使用 Ajax 去實作回傳人氣的紀錄!

最後 SEO,以及相關搜尋的設定,robots.txt、Sitemap 不用講,一定會做,這次我還加入了一點點的 schema、Google AMP、JSON-LD 的結構,這些都是去餵 Search Engine 想吃的菜!

其實過程中我學到很多經驗,也嘗試很多架構,這次我使用 AWS 的服務,主要開了一台東京 t2.micro 的 EC2,以及使用 S3 的服務而已,網頁流量,據我看 GA 的即時人數,最高曾經落在 1900 多人,可能有些頁面是使用 S3 吧,所以都撐得住!

這是目前我個人做過最高流量的網站,相對的也是個人里程碑!

以上是我的經驗、心得分享, 回到做網站初衷,我只是個熱愛故鄉的鄉土文化,想為家鄉盡一分力,利用自己的專長技術,支援這個從小的信仰,如此簡單。

文章有點太長,如果看到這裡的朋友,非常感謝您將它看完,如果大家有想要來北港玩的,倒是可以看看網站內容喔!

若是文章不適合再版上討論的話,可以跟我說一下 >"

有問題或疑問的話,非常歡迎各位討論喔:)

(本文發布於 PTT_Soft Job 版,獲作者 吳政賢 授權刊登轉載, 相關作品 , GitHub 資源 ,圖片來源:,未經授權請勿轉載。)

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Give an example of an HTML tag with an attribute.Give an example of an HTML tag with an attribute.May 16, 2025 am 12:02 AM

The usage methods of HTML tags and attributes include: 1. Basic usage: Use tags such as and, and add necessary information through attributes such as src and href. 2. Advanced usage: Use data-* custom attributes to achieve complex interactions. 3. Avoid common mistakes: Make sure the property values ​​are surrounded by quotes. 4. Performance optimization: Keep it simple, use standard attributes and CSS class names to ensure that the image has alt attributes. Mastering these will improve web development skills.

What is the difference between an HTML tag and an HTML attribute?What is the difference between an HTML tag and an HTML attribute?May 14, 2025 am 12:01 AM

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The Future of HTML: Evolution and TrendsThe Future of HTML: Evolution and TrendsMay 13, 2025 am 12:01 AM

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

Why are HTML attributes important for web development?Why are HTML attributes important for web development?May 12, 2025 am 12:01 AM

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

What is the purpose of the alt attribute? Why is it important?What is the purpose of the alt attribute? Why is it important?May 11, 2025 am 12:01 AM

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

HTML, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools