在查看网页时,忽然发现了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
发表于2012年01月04日
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 Chrome或Safari(Firefox10 或IE10)。Impress.js在firefox和ie的早起版本将不能完全显示的.
--因为用到了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基本的head和body元素。
<!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=”impress”的div元素
<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
相关推荐
个性化的E-MAIL软件 Icredimail2001b 充满个性化E-MAIL软件,可以选择信纸动画和声音及签名
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
MOCD207M 丝印D207 SOP8 1.25V 150mA晶体管输出光耦
2024年迎接上市公司重组并购浪潮推动出版行业企业数字化转型报告
基于Andorid的闹钟功能设计实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。
电商_微信小程序_学习项目_电商功能演示_1742849441.zip
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
app开发
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
本套课程带领大家零基础入门小程序云开发。摆脱后台自己实现小程序后台,学会音视频小程序的开发,学会小程序图片的上传与管理,学习人工智能识别图片,用小程序模仿微信朋友圈,实现一个云相册。
移动开发_Android_MVC_调试工具框架BeeFram_1742846880.zip
vue3-element-admin基础框架带权限 参考文档:https://vue3-element-admin-site.midfar.com
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
内容概要:本文介绍了Python网页文本爬虫的基本概念及其应用,特别是针对小说网站的爬虫实现。文中详细讲解了爬虫的工作原理和技术要点,如urllib库的使用、字符串操作以及正则表达式的初步应用。此外,还提供了完整的爬虫代码示例,涵盖从HTML页面下载到数据提取和处理的全过程。通过对小说网站的具体案例分析,展示了如何利用Python编写简单的爬虫程序来抓取并保存所需信息。 适合人群:对Python编程有一定基础的学习者,尤其是希望了解和掌握网页爬虫技术的初学者。 使用场景及目标:适用于想要快速入门Python爬虫技术的人群,帮助他们理解爬虫的基本原理和实现方法,为后续深入学习打下坚实基础。具体应用场景包括但不限于自动化数据收集、信息检索系统构建等。 其他说明:虽然本文主要关注于基础爬虫的实现,但同时也提到了一些进阶的技术方向,如HTTP长连接和多线程的应用,供有兴趣进一步探索的读者参考。
jiguang.zip
weifuchenggg_JKBD_1742849495.zip
app开发
app开发