Deck.js 开源项目使用教程
deck.jsModern HTML Presentations项目地址:https://gitcode.com/gh_mirrors/de/deck.js
目录结构及介绍
Deck.js 项目的目录结构如下:
deck.js/
├── boilerplate/
│ └── index.html
├── core/
│ ├── deck.core.css
│ ├── deck.core.js
│ └── ...
├── extensions/
│ ├── deck.menu.js
│ ├── deck.menu.css
│ └── ...
├── themes/
│ ├── css/
│ │ ├── web-2.0.css
│ │ └── ...
│ ├── images/
│ └── ...
├── README.md
└── ...
boilerplate/
:包含一个基本的演示文稿模板文件index.html
。core/
:包含 Deck.js 的核心文件,如deck.core.css
和deck.core.js
。extensions/
:包含各种扩展功能,如菜单、导航等。themes/
:包含不同的主题样式,如web-2.0.css
。README.md
:项目的说明文档。
项目的启动文件介绍
Deck.js 的启动文件是 boilerplate/index.html
。这个文件是一个基本的演示文稿模板,包含了 Deck.js 的核心文件和一些示例内容。你可以通过编辑这个文件来创建你自己的演示文稿。
<!DOCTYPE html>
<html>
<head>
<title>My Presentation</title>
<link rel="stylesheet" href="../core/deck.core.css">
<link rel="stylesheet" href="../themes/css/web-2.0.css">
<script src="../jquery.min.js"></script>
<script src="../modernizr.custom.js"></script>
<script src="../core/deck.core.js"></script>
</head>
<body>
<div class="deck-container">
<section class="slide">
<h1>My Presentation</h1>
</section>
<section class="slide">
<h2>Slide Header</h2>
<p>Here is a list of points:</p>
<ul>
<li>Point 1</li>
<li>Point 2</li>
<li>Point 3</li>
</ul>
</section>
<section class="slide">
<h2>Another Slide</h2>
<blockquote cite="http://example.com">
<p>Lorem ipsum dolor sit amet</p>
<p><cite>Cicero</cite></p>
</blockquote>
</section>
</div>
<script>
$(function() {
$.deck('.slide');
});
</script>
</body>
</html>
项目的配置文件介绍
Deck.js 没有专门的配置文件,它的配置主要通过在 HTML 文件中引入不同的 CSS 和 JavaScript 文件来实现。例如,你可以通过引入不同的主题文件来改变演示文稿的外观,或者通过引入不同的扩展文件来添加额外的功能。
例如,要添加菜单功能,你需要引入 deck.menu.js
和 deck.menu.css
:
<link rel="stylesheet" href="../extensions/menu/deck.menu.css">
<script src="../extensions/menu/deck.menu.js"></script>
通过这种方式,你可以根据需要灵活地配置和扩展你的演示文稿。
deck.jsModern HTML Presentations项目地址:https://gitcode.com/gh_mirrors/de/deck.js