Coder Social home page Coder Social logo

pikachu's Introduction

在线画皮卡丘

  • 项目实现:主要是css3,定时器和字符串截取的使用。首先需要在html准备两个标签(<style><pre>),一个用来展示css样式,一个用来展示代码。准备好css代码,通过设置定时器每间隔一定的时间,截取css代码写入到准备好的标签里,然后大功告成啦。这里有个小知识点,setInterval这个定时器,设置好间隔时间是没法更改的。可以通过设置两个setTimeout定时器实现setInterval同样的效果,并且是可以调速的(a good programmer told me this)。由于我的css代码过长,即使可以调速,观看整个过程也要耗费一定的时间。这里我设置了一个按钮,点击可以跳过动画,直接查看最终效果。另外,动画中代码部分的高亮用到了prismjs这个库。

pikachu's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.