- 项目实现:主要是css3,定时器和字符串截取的使用。首先需要在html准备两个标签(
<style>
和<pre>
),一个用来展示css样式,一个用来展示代码。准备好css代码,通过设置定时器每间隔一定的时间,截取css代码写入到准备好的标签里,然后大功告成啦。这里有个小知识点,setInterval这个定时器,设置好间隔时间是没法更改的。可以通过设置两个setTimeout定时器实现setInterval同样的效果,并且是可以调速的(a good programmer told me this)。由于我的css代码过长,即使可以调速,观看整个过程也要耗费一定的时间。这里我设置了一个按钮,点击可以跳过动画,直接查看最终效果。另外,动画中代码部分的高亮用到了prismjs这个库。
pikachu's Introduction
pikachu's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.