`

超强的制作PPT的impress.js

阅读更多

在查看网页时,忽然发现了Impress.js 很强大,很简单的制作PPT的js.

附件是demo

以下是 对官方文档的关键点的中英文翻译

<!--[if gte mso 9]><xml><w:WordDocument><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery><w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery><w:DocumentKind>DocumentNotSpecified</w:DocumentKind><w:DrawingGridVerticalSpacing>7.8</w:DrawingGridVerticalSpacing><w:View>Normal</w:View><w:Compatibility></w:Compatibility><w:Zoom>0</w:Zoom></w:WordDocument></xml><![endif]-->

How To Use Impress.Js

如何使用Impress.js

Posted on January 4, 2012

发表于20120104

Yesterday, I wrote about Impress.js, an awesome JavaScript library for creating online presentations. Since posting online, I’ve had several people ask how exactly to use it, as there’s no set documentation on the actual project page.  This guide will help you get started and allow you to create a simple slideshow, but after completing it please bear in mind that there’s so much more that can be done with it.  The only limit is your creativity!

昨天,我写了一个相当棒用于在线演示的javascript类库--Impress.js。因为在实际的项目页面也没有一套文档,我发帖以 来,有很多人问到底怎么使用。这个指南将帮助你开始创建一个简单的幻灯片。完成之后,请您也记住:它还可以做很多。唯一限制你的是你的创造力。

This tutorial is available for you to view and download on GitHub

Requirements(要求)

To see this tutorial in action, please use Google Chrome or Safari (or Firefox 10 or IE10).  Impress.js is not currently compatible with earlier versions of Firefox or Internet Explorer.

要看到这个文章的效果,请使用Google ChromeSafari(Firefox10 IE10)Impress.jsfirefoxie的早起版本将不能完全显示的.
--因为用到了HTML5+CSS3

 

Setup安装

The first thing you want to do is create a new webpage.  Mine’s index.html and within it setup the basic head and body elements.

你要做的第一件事就是建一个网页。以下是我的页面index.html基本的headbody元素。

<!doctype html>

<html>

    <head>

        <title>Impress Tutorial</title>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    </head>

    <body>

    </body>

</html>

Add the impress.js file before the end of the body element.  This imports the Impress library into your project

body元素结束前增加impress.js文件来将Impress类库导入到你的项目中

<script type="text/javascript" src="impress.js"></script>

Next we’ll create a wrapper which will contain the slideshow.  This is simply a <div> element with an id of ‘impress’

接下来,我们将创建一个包装器来包含幻灯片。这是一个简单的id=impressdiv元素

<div id="impress"></div>

Creating Slides创建幻灯片

Now you’ll see how easy it is to create a new slide in the presentation.  Each slide is a <div> element (within the wrapper) with a class name of ‘step’

现在,你将发现在演示文稿中创建一个幻灯片是多么容易。每个幻灯片都是一个带有step类名的div元素

<div class="step">

    My first slide

</div>

Whilst that creates a simple slide, things are a lot more fun you start adding data properties to your slides.  Data attributes signify properties of your slide for when it’s NOT the active slide.  The following data properties are available to you:
虽然那创建了一个简单的幻灯片,但在你的幻灯片中增加数据属性也是非常有趣的。Data属性标注了当幻灯片不是活动幻灯片是的信息。以下数据为:

· data-x = the x co-ordinate of the slide 幻灯片的x坐标

· data-y = the y co-ordinate of the slide 幻灯片的y坐标

· data-z = the z co-ordinate of the slide (how far/close it appears to the user)幻灯片的z坐标

· data-scale = scales your slide by a factor of this value.  A data-scale of 5 would be 5 times the original size of your slide 缩放幻灯片的因素

· data-rotate = rotates your slide by the specified number of degrees 通过指定的度数旋转你的幻灯片

· data-rotate-x = For 3D slides.  This is the number of degrees it should be rotated about the x-axis.  (Tilt forward/lean back)

· data-rotate-y = For 3D slides. This is the number of degrees it should be rotated about the y-axis (swing in from the left/right)

· data-rotate-z = For 3D slides. This is the number of degrees it should be rotated about the z-axis

 

Data Attributes In Action

The following slide configuration will guide you through each of the data attributes in action.

Let’s start with an initial slide.  This slide has it’s x and y data attributes set to 0, so will appear in the center of the page.

<div class="step" data-x="0" data-y="0">

    This is my first slide

</div>

The second slide will have an x position of 500, but the y position of 0.  This means that it’s going to have to come in 500 pixels across the x-axis (slide left) when it becomes active.

<div class="step" data-x="500" data-y="0">

    This is slide 2

</div>

Easy huh?  The next slide will start with the same x-position as slide 2, but a y position of –400.  This will slide in from the top 400 pixels.

<div class="step" data-x="500" data-y="-400">

    This is slide 3

</div>

Slide 4 uses the scale value to show how a slide can appear to zoom in/out.  It has a scale value of 0.5, meaning that it’s half the size it should be.  When it becomes active the presentation will adjust the scale of ALL the slides by the factor required to make the scale of the active website 1.  What this means in this example is that for this slide to display normally (scale value 1) it will need to be scaled up by a factor of 2 (0.5*2 = 1).  All the other slides will also be scaled up by a factor of two, and become twice the size.

<div class="step" data-x="500" data-y="-800" data-scale="0.5">

    This is slide 4

</div>

The rotate attributes allows you to rotate a slide into view.  Slide 5 is set to rotate by 90 degrees.

<div class="step" data-x="0" data-y="-800" data-rotate="90">

    This is slide 5 and it rotates in.

</div>

Finally, for a 3D transition, you can specify rotate attributes for each dimensional axis (x,y,z).

The x axis is the horizontal axis.  This means that you can make things tilt forwards (positive value) or backwards (negative value).
The y axis is the vertical axis so you can have things swing in from the left (negative value) or right (positive value).
The z axis is the depth axis (the one coming out at you) so rotating things on this would be rotating things up (negative value) and down (positive value).

Combinations

Now that you know all about the data attributes, which is really all you need to animate your slideshow, you can use your imagination to combine these in weird and wonderful ways to create your own style of slideshow.

<div class="step" data-x="-2600" data-y="-800" data-rotate-x="30" data-rotate-y="-60" data-rotate-z="90" data-scale="4">

    This is slide 7 and it has a 3D transition AND a scale.

</div>

Unsupported Browsers

Impress automatically detects whether or not a browser supports it or not, and if it doesn’t then automatically adds a class name called ‘impress-not-supported’ to the wrapper ‘<div>’.  Using some CSS we can show a message to people on browsers which aren’t supported by Impress.

At the start of your <div id=”impress”> add the following:

<div class="no-support-message">

    Your browser doesn't support impress.js.  Try Chrome or Safari.

</div>

Then, create a stylesheet or add this to your existing stylesheet:

.no-support-message { display:none; }

.impress-not-supported .no-support-message { display:block; }

This hides the message by default, but then displays it to browser if the impress-not-supported class is present.

Have fun!

This tutorial covers the fundamentals of using Impress.js to create your very own online presentation.  The entire example is available on Github for you to download and play with.

- See more at: http://www.cubewebsites.com/blog/guides/how-to-use-impress-js/#sthash.eYP2BTAi.dpuf

 

分享到:
评论

相关推荐

    impress.js-master.zip

    impress.js 是一个基于 JavaScript 的开源项目,用于创建极具视觉冲击力的演示文稿。它由 Bartek Szopka 创建,灵感来源于 HTML5 和 CSS3 的强大功能,旨在让网页演示变得如同 Prezi 一样流畅而富有动态感,但又不失...

    前端项目-impress.js.zip

    1. **技术演讲**:在技术会议或研讨会上,使用impress.js制作的演示可以更生动地展示复杂的概念和技术。 2. **教学材料**:教育领域可以利用其交互性,使学生更好地理解和记忆课程内容。 3. **产品介绍**:商业...

    [Impress.js] 构建特炫效果应用 (Impress.js 实现) (英文版)

    [Packt Publishing] 构建特炫效果应用 (Impress.js 实现) (英文版) [Packt Publishing] Building Impressive Presentations with Impress.js (E-Book) ☆ 出版信息:☆ [作者信息] Rakhitha Nimesh Ratnayake ...

    impress.js幻灯片sql分享

    **impress.js幻灯片SQL分享** impress.js是一款基于HTML5和CSS3的开源库,用于创建具有视觉冲击力的、多维度的幻灯片展示。它利用浏览器的3D变换功能,使得幻灯片可以跳出传统的二维平铺模式,实现类似全息投影的...

    impress.js 神器

    impress.js 适用于制作创新的演讲、教程、产品展示等多种场景,尤其适合需要强调视觉效果和互动体验的情况。由于其基于 Web 技术,可以轻松地在线分享和嵌入,为远程协作和在线教育带来了新的可能。 **注意事项** ...

    impress.js

    Impress.js 是国外一位开发者受 Prezi启发,采用 CSS3 与 JavaScript 语言完成的一个可供开发者使用的表现层框架。而 Prezi 是一个颠覆性的在线演示工具,此前我们也曾有过介绍,并得到很多读者的积极反馈。现在普通...

    impress.js高级特效展示 适用于个人介绍 超级酷炫

    impress.js高级特效展示 适用于个人介绍 超级酷炫,js支持键盘方向控制的引导页面模板

    基于impress.js制作炫酷幻灯片-内含源码以及设计说明书(可以自己运行复现).zip

    **基于impress.js制作炫酷幻灯片** impress.js是一个强大的HTML5库,由 Bartek Szopka 创建,用于创建具有视觉冲击力的、基于浏览器的幻灯片演示。这个项目灵感来源于Prezi,但它在网页上实现了类似的效果,无需...

    用impress.js做的关于bitcoin演示稿ppt动画效果下载

    【标题】"用impress.js做的关于bitcoin演示稿ppt动画效果下载" 提示我们这个压缩包内包含一个使用impress.js技术制作的比特币(Bitcoin)主题的演示文稿,其中运用了丰富的动画效果来增强讲解的生动性。impress.js是...

    使用impress.js制作幻灯片

    impress.js是一款强大的JavaScript库,专门用于创建富有视觉冲击力的3D幻灯片演示。它的设计灵感来源于Prezi,但提供了更多的自定义和交互性,尤其适合对Web开发有一定了解的人使用。impress.js利用现代浏览器的CSS3...

    impress.js源码及Demo

    Impress.js是一款基于css3转 换和过渡、工作于现代浏览器(Google Chrome或Safari (或 Firefox...如果你已经厌烦了使用PowerPoint制作PPT,那么impress.js是一个非常 好的选择,用它做的PPT更加直观,效果也非常的不错。

    impressjs基于CSS3的Web幻灯片展示框架

    impress.js是一款强大的JavaScript库,它利用了CSS3的转换和过渡效果,为现代浏览器提供了一种全新的方式来创建极具视觉冲击力的幻灯片演示。这个框架使得开发者可以跳出传统的线性幻灯片模式,打造出立体、动态且...

    impress.js表现层框架(演示工具)-初体验

    impress.js是一个强大的JavaScript和CSS3框架,专用于创建具有惊人视觉效果的演示文稿。它的灵感来源于Prezi,但不同之处...通过深入了解和实践,你将能够利用impress.js的强大功能,制作出超越传统PPT限制的精彩演示。

    impress_demo:impress.js演示

    虽然是使用的impress.js,但是其中原来demo中使用的impress-demo.css已经有所改变,并且命名为了impress_default.css。 该代码只支持Chrome浏览器 因为写的时间比较仓促,所以有些代码是直接从别的地方拷贝过来的,而...

    impress-js-boilerplate:使用impress.js进行演示HTMLCSSJS样板-演示

    3. **JavaScript 动画** - impress.js 使用 JavaScript 实现动画,允许在不同步骤之间平滑地过渡,同时保持对用户输入的响应。 **发布与分享** 这个模板还提供了一个实时演示的链接,意味着你可以方便地将你的演示...

    impress.js CSS3 变换和过渡

    基于 CSS3 变换和过渡的页面效果框架 impress.js It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.

    Impressionist, 创建 impress.js 演示文稿的可视化工具.zip

    Impressionist, 创建 impress.js 演示文稿的可视化工具 印象派印象派是创建 impress.js 演示文稿的可视化工具印象派是以创作共用属性 3.0 Unported ( CC按 3.0 ) ( http://creativecommons.org/licenses/by/3.0/ ) ...

    谈谈impress.js初步理解

    impress.js 是一款基于 CSS3 和 JavaScript 的演示文稿框架,它允许开发者创建具有高度交互性和视觉冲击力的演示效果,类似于 Prezi,但比基于 Flash 的 Prezi 更加高效和现代。impress.js 的核心特性包括对画布的...

Global site tag (gtag.js) - Google Analytics