如何解剖一个网站?
国外有非常多不错的动态网页作品,非常喜欢,请问如果想要分析他的制作过程需要怎么做
回复内容:
謝邀~Html5網頁動畫
其實都是一個一個物體的
某個屬性的改變
通過
Chrome的右鍵→檢查元素
可以看到
一個特定物體的CSS 動畫屬性
是怎麼被編輯的
進而了解這個物體
是怎麼運動的
下面就舉一個解剖網站的例子
有一個 Starbucks Frappuccino® 網站
我很喜歡的動畫是
在移動端上的Toggle導航
右上角的「三」(叫Toggle)在點下去導航列展開後會旋轉變成「X」
代表說再點我一次可以關掉導航
非常有趣
可以點開gif看:
http://manglekuo.com/img/toggle.gif
所以一開始我現在電腦上的Chrome
把Chrome的頁面寬度變窄 讓他出現那個Toggle
然後右鍵點那個Toggle→ 檢查元素

這時候可以看到 開發人員工具
出現在頁面下方
我在這裡為了方便截圖
把它拆了出來
放到了右邊
如下圖:

而當我點擊了那個Toggle之後
我發現那個div的class
從原來的"sbOne mobile"
變成了"sbOne mobile expanded"
如下圖(注意看兩張圖被選擇的那行的上一行的差別)

這是一個網頁動畫很常被使用的技巧
發生一個事件(在這裡是點擊)之後
用Javascript
改變class裡的內容
進而觸發動畫
這時候我們去CSS(在這裡是main.css,隨便點擊截圖中最右邊任意一個main.css?...那一長串就可以去到main.css)裡頭
用ctrl/command + F 找到 ".expanded" Class
如下圖(圖長可能需要點擊一下才能看到全部)

就是我們想要的了。
因為 HTML 5 動畫
還是實驗性的東西
開發者為了要讓各大瀏覽器支持
需要加不同的前綴。
HTML 5 動畫有兩種
一種是Animation,一種就是這個Transition
(感興趣自己查)
Animation是可以指定幀的
比如說時間是0%-20%的時候轉130º,
20%-100%的時候轉50º
而Transition是只能製定屬性和時間
在這裏是all 1s;
也就是 所有屬性 一秒
代表說 假如有任何屬性發生了改變
都用一秒的漸變來完成
而上面用了transform: rotate(-45deg);
所以就會用一秒的時間漸漸轉-45º的角度
再下面的兩段代碼他指定了第一根橫棒和最後一根橫棒的動畫...(下圖)

根據電腦代碼的
後面覆蓋前面 原則
最終會變成
當按下去Toggle之後
第一根橫棒 轉45º
第二根橫棒 轉-45º
第三根橫棒 不轉 透明度變0
三根橫棒的所有屬性發生改變時有1秒漸變
跟我們觀察到的結果一樣!
所以這就是 這個動畫的精髓所在!
我們成功的解剖到了我們想要的東西。
還有什麼問題嗎。。。
我懶得接著寫了。。。
你直接問吧。。。 国外的很多动态网页,通常都是由js生成页面dom并入场,这类网站信息量少,页面数量也少,但是交互性很强。研究这类网站重点看js。 摘出需要的部分,或者删掉不需要的部分。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

H5 page production refers to the creation of cross-platform compatible web pages using technologies such as HTML5, CSS3 and JavaScript. Its core lies in the browser's parsing code, rendering structure, style and interactive functions. Common technologies include animation effects, responsive design, and data interaction. To avoid errors, developers should be debugged; performance optimization and best practices include image format optimization, request reduction and code specifications, etc. to improve loading speed and code quality.

The steps to create an H5 click icon include: preparing a square source image in the image editing software. Add interactivity in the H5 editor and set the click event. Create a hotspot that covers the entire icon. Set the action of click events, such as jumping to the page or triggering animation. Export H5 documents as HTML, CSS, and JavaScript files. Deploy the exported files to a website or other platform.

Yes, H5 page production is an important implementation method for front-end development, involving core technologies such as HTML, CSS and JavaScript. Developers build dynamic and powerful H5 pages by cleverly combining these technologies, such as using the <canvas> tag to draw graphics or using JavaScript to control interaction behavior.

H5 is not a standalone programming language, but a collection of HTML5, CSS3 and JavaScript for building modern web applications. 1. HTML5 defines the web page structure and content, and provides new tags and APIs. 2. CSS3 controls style and layout, and introduces new features such as animation. 3. JavaScript implements dynamic interaction and enhances functions through DOM operations and asynchronous requests.

H5 (HTML5) is suitable for lightweight applications, such as marketing campaign pages, product display pages and corporate promotion micro-websites. Its advantages lie in cross-platformity and rich interactivity, but its limitations lie in complex interactions and animations, local resource access and offline capabilities.

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

H5 pop-up window creation steps: 1. Determine the triggering method (click, time, exit, scroll); 2. Design content (title, text, action button); 3. Set style (size, color, font, background); 4. Implement code (HTML, CSS, JavaScript); 5. Test and deployment.
