把照片做成一本可以翻的電子相冊,比呆板的網頁相簿有趣得多。這個效果以 Canvas 模擬真實書頁的翻動弧線與陰影,支援滑鼠拖曳翻頁,適合做成回憶集、產品型錄或電子雜誌。
體驗效果:https://hovertree.com/texiao/html5/37/
原始碼下載:https://hovertree.com/h/bjaf/komyoiki.htm

每個 section.page 就是一頁,封面與封底頁額外放了一張釘書孔圖片,並用 left 或 right 定位到書脊那一側,讓它看起來像被裝訂起來的一本書。
<div id="shineflip">
<div id="shineflip-pages">
<canvas id="shineflip-canvas"></canvas>
<canvas id="shineflip-page-mid-canvas"></canvas>
<section class="page">
<div><img src="images/0.jpg" width="475" height="482" /></div>
<span style="left:18px;"><img src="images/zh.png" height="482" /></span>
</section>
<section class="page" style="background:url(images/left_pk.jpg)">
<div><img src="images/1.jpg" width="466" height="463" style="float:right;margin-top:9px;" /></div>
</section>
<section class="page">
<div><img src="images/2.jpg" width="466" height="463" style="float:left;margin-top:9px;" /></div>
</section>
<!-- 中間頁面省略 -->
<section class="page">
<div><img src="images/24.jpg" width="475" height="482" /></div>
<span style="right:18px;"><img src="images/zh.png" height="482" /></span>
</section>
</div>
</div>
<script type="text/javascript" src="js/shineflip_min.js"></script>
<script type="text/javascript">
var shineFlip = new ShineFlip({
// autoFitScreen: true,
width : 950,
height : 482,
page_width : 475,
page_height: 482
});
</script>
只要把 images 資料夾裡的圖片替換掉即可,要注意的是單頁寬度需與 page_width 一致、整本書寬度則是 page_width 的兩倍,否則翻頁時會出現錯位。若想讓相冊自動適配螢幕尺寸,可以把 autoFitScreen 的註解打開。
適用瀏覽器:360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗;不支援 IE8 及以下版本。