HTML文字基础
HTML的主要工作之一是提供文本结构和含义(也称为语义),以便浏览器可以正确显示它。本文通过添加标题和段落,强调单词,创建列表等内容,说明了HTML可用于构造文本页面的方式。先决条件:基本的HTML熟悉程度,如HTML入门中所述。
客观的:了解如何标记文本的基本页面以赋予其结构和含义,包括段落,标题,列表,重点和引号。
基础知识:标题和段落无论您是在读故事,报纸,大学教科书,还是杂志等,大多数结构化文本都由标题和段落组成。结构化的内容使阅读体验更加轻松愉快。在HTML中,每个段落都必须包装在一个<p>元素中,如下所示:<p>I am a paragraph, oh yes I am.</p>每个标题都必须包装在一个标题元素中:<h1>I am the title of the story.</h1>有六个标题元素:<h1>,<h2>,<h3>,<h4>,<h5>,和<h6>。每个元素代表文档中不同级别的内容。<h1>代表主标题,<h2>代表子标题,<h3>代表子子标题,依此类推。
实施结构层次例如,在此故事中,<h1> 元素代表故事 的标题, <h2> 元素代表每个章节的标题, <h3> 元素代表每个章节的小节:只要层次结构有意义,取决于您所涉及的元素代表什么。创建此类结构时,您只需要记住一些最佳做法:
[*]最好,<h1>每个页面使用一个标题-这是顶层标题,而所有其他标题则位于层次结构中的该标题之下。
[*]确保在层次结构中以正确的顺序使用标题。不要使用<h3> 元素来表示子标题,然后使用<h2> 元素来表示子子标题-这没有意义,并且会导致奇怪的结果。
[*]在六个可用的标题级别中,除非您认为有必要,否则您应该以每页不超过三个的标题为目标。具有多个级别(即深层标题层次结构)的文档变得笨拙且难以导航。在这种情况下,建议尽可能将内容分布在多个页面上。
我们为什么需要结构?为了回答这个问题,让我们看一下text-start.html-本文正在运行的示例的起点(一个很好的鹰嘴豆泥配方)。您应该将此文件的副本保存在本地计算机上,以备日后练习时使用。该文档的主体当前包含多个内容。它们没有任何标记,但是它们之间用换行符分隔(按Enter / Return键进入下一行)。但是,当您在浏览器中打开文档时,您会看到文本显得很大!这是因为没有提供内容结构的元素,因此浏览器不知道标题是什么,段落是什么。此外:
[*]开始浏览网页的用户倾向于快速扫描以找到相关内容,通常只是阅读标题即可。(我们通常在网页上花费很短的时间。)如果他们在几秒钟之内看不到任何有用的东西,他们可能会感到沮丧,而转到其他地方。
[*]索引页面的搜索引擎将标题的内容视为影响页面搜索排名的重要关键字。如果没有标题,则您的页面在SEO(搜索引擎优化)方面的效果会很差。
[*]视力严重受损的人通常不阅读网页;他们改为听他们的话。这可以通过称为屏幕阅读器的软件来完成。该软件提供了快速访问给定文本内容的方法。在所使用的各种技术中,它们通过读出标题来提供文档的轮廓,从而使用户可以快速找到所需的信息。如果标题不可用,它们将被迫大声朗读整个文档。
[*]要使用CSS设置内容样式或使用JavaScript使其有趣,您需要具有包装相关内容的元素,以便CSS / JavaScript可以有效地将其作为目标。
因此,我们需要对内容进行结构标记。
主动学习:赋予我们的内容结构
让我们直接看一个真实的例子。在下面的示例中,将元素添加到“输入”字段中的原始文本,以使其在输出字段中显示为标题和两个段落。如果输入有误,可以随时使用“重置”按钮将其重置。如果卡住,请按“显示解决方案”按钮以查看答案。
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td><td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
# 运行word程序
word = wc.Dispatch("Word.Application")
# for循环
i = 0
for file in files:
try:
doc = word.Documents.Open(file) #打开word文件
doc.SaveAs("{}x".format(file), 12) #另存为后缀为".docx"的文件,其中参数12指docx文件
doc.Close()#关闭原来word文件
print(file +':转换成功')
i +=1
except:
print(file +':转换[不成功]')
files.append(file)# 若读取文件报错, 则将文件名称添加到files列表中重新读取
pass
print('转换文件%i个'%i)
# 退出word
word.Quit()
<!DOCTYPE html>
<html xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>男某某与女某某日期纪念功能</title>
<link type="text/css" rel="stylesheet" href="./index_files/default.css">
<script type="text/javascript" src="./index_files/jquery.min.js"></script>
<script type="text/javascript" src="./index_files/jscex.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-parser.js"></script>
<script type="text/javascript" src="./index_files/jscex-jit.js"></script>
<script type="text/javascript" src="./index_files/jscex-builderbase.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async-powerpack.min.js"></script>
<script type="text/javascript" src="./index_files/functions.js" charset="utf-8"></script>
<script type="text/javascript" src="./index_files/love.js" charset="utf-8"></script>
<style type="text/css">
<!--
.STYLE1 {color: #666666}
-->
</style>
</head>
<body>
<div id="main">
<div id="error">本页面采用HTML5编辑,目前您的浏览器无法显示,请换成谷歌(<a href="http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh-CN&brand=CHMI">Chrome</a>)或者火狐(<a href="http://firefox.com.cn/download/">Firefox</a>)浏览器,或者其他游览器的最新版本。</div>
<div id="wrap">
<div id="text">
<div id="code">
<span class="say">* 致女某某: *</span><br>
<span class="say"> </span><br>
<span class="say">· 女某某,情人节快乐!</span><br>
<span class="say"> </span><br>
<span class="say">· 不经意相识, 或许是缘分,或许是注定的。</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但依......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......</span><br>
<span class="say"> </span><br>
<span class="say">· 无论如何,只要你我依旧喜欢对方,我会一直陪着你。</span><br>
<span class="say"> </span><br>
<span class="say">· You are my only girlfriend.</span><br>
<span class="say"> </span><br>
<span class="say">· I love you,×××!</span><br>
<span class="say"> </span><br>
<span class="say"><span class="space"></span>--@author 男某某--</span>
</div>
</div>
<div id="clock-box">
<span class="STYLE1">现在是</span>男某某 <span class="STYLE1" style="color: red">❤</span> 女某某<span class="STYLE1" style="color: red">相恋</span>
<div id="clock"></div>
</div>
<canvas id="canvas" width="1100" height="680"></canvas>
</div>
</div>
<script>
</script>
<script>
(function(){
var canvas = $('#canvas');
if (!canvas.getContext) {
$("#error").show();
return false;
}
var width = canvas.width();
var height = canvas.height();
canvas.attr("width", width);
canvas.attr("height", height);
var opts = {
seed: {
x: width / 2 - 20,
color: "rgb(190, 26, 37)",
scale: 2
},
branch: [
[535, 680, 570, 250, 500, 200, 30, 100, [
[540, 500, 455, 417, 340, 400, 13, 100, [
]],
[550, 445, 600, 356, 680, 345, 12, 100, [
]],
,
[546, 397, 413, 247, 328, 244, 9, 80, [
,
]],
[546, 357, 608, 252, 678, 221, 6, 100, [
]]
]]
],
bloom: {
num: 700,
width: 1080,
height: 650,
},
footer: {
width: 1200,
height: 5,
speed: 10,
}
}
var tree = new Tree(canvas, width, height, opts);
var seed = tree.seed;
var foot = tree.footer;
var hold = 1;
canvas.click(function(e) {
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
if (seed.hover(x, y)) {
hold = 0;
canvas.unbind("click");
canvas.unbind("mousemove");
canvas.removeClass('hand');
}
}).mousemove(function(e){
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
canvas.toggleClass('hand', seed.hover(x, y));
});
var seedAnimate = eval(Jscex.compile("async", function () {
seed.draw();
while (hold) {
$await(Jscex.Async.sleep(10));
}
while (seed.canScale()) {
seed.scale(0.95);
$await(Jscex.Async.sleep(10));
}
while (seed.canMove()) {
seed.move(0, 2);
foot.draw();
$await(Jscex.Async.sleep(10));
}
}));
var growAnimate = eval(Jscex.compile("async", function () {
do {
tree.grow();
$await(Jscex.Async.sleep(10));
} while (tree.canGrow());
}));
var flowAnimate = eval(Jscex.compile("async", function () {
do {
tree.flower(2);
$await(Jscex.Async.sleep(10));
} while (tree.canFlower());
}));
var moveAnimate = eval(Jscex.compile("async", function () {
tree.snapshot("p1", 240, 0, 610, 680);
while (tree.move("p1", 500, 0)) {
foot.draw();
$await(Jscex.Async.sleep(10));
}
foot.draw();
tree.snapshot("p2", 500, 0, 610, 680);
canvas.parent().css("background", "url(" + tree.toDataURL('image/png') + ")");
canvas.css("background", "#ffe");
$await(Jscex.Async.sleep(300));
canvas.css("background", "none");
}));
var jumpAnimate = eval(Jscex.compile("async", function () {
var ctx = tree.ctx;
while (true) {
tree.ctx.clearRect(0, 0, width, height);
tree.jump();
foot.draw();
$await(Jscex.Async.sleep(25));
}
}));
//下面修改起始日期
var textAnimate = eval(Jscex.compile("async", function () {
var together = new Date();
together.setFullYear(2020, 1, 2); //时间年月日 月份0~11
together.setHours(22); //小时
together.setMinutes(22); //分钟
together.setSeconds(2); //秒前一位
together.setMilliseconds(2); //秒第二位
$("#code").show().typewriter();
$("#clock-box").fadeIn(500);
while (true) {
timeElapse(together);
$await(Jscex.Async.sleep(1000));
}
}));
var runAsync = eval(Jscex.compile("async", function () {
$await(seedAnimate());
$await(growAnimate());
$await(flowAnimate());
$await(moveAnimate());
textAnimate().start();
$await(jumpAnimate());
}));
runAsync().start();
})();
</script>
<iframe src = "./给你们.mp3" allow = "autoplay" hidden /> //自己修改音乐位置
</body>
</html>
<pre><code><!DOCTYPE html>
<html xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>男某某与女某某日期纪念功能</title>
<link type="text/css" rel="stylesheet" href="./index_files/default.css">
<script type="text/javascript" src="./index_files/jquery.min.js"></script>
<script type="text/javascript" src="./index_files/jscex.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-parser.js"></script>
<script type="text/javascript" src="./index_files/jscex-jit.js"></script>
<script type="text/javascript" src="./index_files/jscex-builderbase.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async-powerpack.min.js"></script>
<script type="text/javascript" src="./index_files/functions.js" charset="utf-8"></script>
<script type="text/javascript" src="./index_files/love.js" charset="utf-8"></script>
<style type="text/css">
<!--
.STYLE1 {color: #666666}
-->
</style>
</head>
<body>
<div id="main">
<div id="error">本页面采用HTML5编辑,目前您的浏览器无法显示,请换成谷歌(<a href="http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh-CN&brand=CHMI">Chrome</a>)或者火狐(<a href="http://firefox.com.cn/download/">Firefox</a>)浏览器,或者其他游览器的最新版本。</div>
<div id="wrap">
<div id="text">
<div id="code">
<span class="say">* 致女某某: *</span><br>
<span class="say"> </span><br>
<span class="say">· 女某某,情人节快乐!</span><br>
<span class="say"> </span><br>
<span class="say">· 不经意相识, 或许是缘分,或许是注定的。</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但依......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......</span><br>
<span class="say"> </span><br>
<span class="say">· 无论如何,只要你我依旧喜欢对方,我会一直陪着你。</span><br>
<span class="say"> </span><br>
<span class="say">· You are my only girlfriend.</span><br>
<span class="say"> </span><br>
<span class="say">· I love you,×××!</span><br>
<span class="say"> </span><br>
<span class="say"><span class="space"></span>--@author 男某某--</span>
</div>
</div>
<div id="clock-box">
<span class="STYLE1">现在是</span>男某某 <span class="STYLE1" style="color: red">❤</span> 女某某<span class="STYLE1" style="color: red">相恋</span>
<div id="clock"></div>
</div>
<canvas id="canvas" width="1100" height="680"></canvas>
</div>
</div>
<script>
</script>
<script>
(function(){
var canvas = $('#canvas');
if (!canvas.getContext) {
$("#error").show();
return false;
}
var width = canvas.width();
var height = canvas.height();
canvas.attr("width", width);
canvas.attr("height", height);
var opts = {
seed: {
x: width / 2 - 20,
color: "rgb(190, 26, 37)",
scale: 2
},
branch: [
[535, 680, 570, 250, 500, 200, 30, 100, [
[540, 500, 455, 417, 340, 400, 13, 100, [
]],
[550, 445, 600, 356, 680, 345, 12, 100, [
]],
,
[546, 397, 413, 247, 328, 244, 9, 80, [
,
]],
[546, 357, 608, 252, 678, 221, 6, 100, [
]]
]]
],
bloom: {
num: 700,
width: 1080,
height: 650,
},
footer: {
width: 1200,
height: 5,
speed: 10,
}
}
var tree = new Tree(canvas, width, height, opts);
var seed = tree.seed;
var foot = tree.footer;
var hold = 1;
canvas.click(function(e) {
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
if (seed.hover(x, y)) {
hold = 0;
canvas.unbind("click");
canvas.unbind("mousemove");
canvas.removeClass('hand');
}
}).mousemove(function(e){
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
canvas.toggleClass('hand', seed.hover(x, y));
});
var seedAnimate = eval(Jscex.compile("async", function () {
seed.draw();
while (hold) {
$await(Jscex.Async.sleep(10));
}
while (seed.canScale()) {
seed.scale(0.95);
$await(Jscex.Async.sleep(10));
}
while (seed.canMove()) {
seed.move(0, 2);
foot.draw();
$await(Jscex.Async.sleep(10));
}
}));
var growAnimate = eval(Jscex.compile("async", function () {
do {
tree.grow();
$await(Jscex.Async.sleep(10));
} while (tree.canGrow());
}));
var flowAnimate = eval(Jscex.compile("async", function () {
do {
tree.flower(2);
$await(Jscex.Async.sleep(10));
} while (tree.canFlower());
}));
var moveAnimate = eval(Jscex.compile("async", function () {
tree.snapshot("p1", 240, 0, 610, 680);
while (tree.move("p1", 500, 0)) {
foot.draw();
$await(Jscex.Async.sleep(10));
}
foot.draw();
tree.snapshot("p2", 500, 0, 610, 680);
canvas.parent().css("background", "url(" + tree.toDataURL('image/png') + ")");
canvas.css("background", "#ffe");
$await(Jscex.Async.sleep(300));
canvas.css("background", "none");
}));
var jumpAnimate = eval(Jscex.compile("async", function () {
var ctx = tree.ctx;
while (true) {
tree.ctx.clearRect(0, 0, width, height);
tree.jump();
foot.draw();
$await(Jscex.Async.sleep(25));
}
}));
//下面修改起始日期
var textAnimate = eval(Jscex.compile("async", function () {
var together = new Date();
together.setFullYear(2020, 1, 2); //时间年月日 月份0~11
together.setHours(22); //小时
together.setMinutes(22); //分钟
together.setSeconds(2); //秒前一位
together.setMilliseconds(2); //秒第二位
$("#code").show().typewriter();
$("#clock-box").fadeIn(500);
while (true) {
timeElapse(together);
$await(Jscex.Async.sleep(1000));
}
}));
var runAsync = eval(Jscex.compile("async", function () {
$await(seedAnimate());
$await(growAnimate());
$await(flowAnimate());
$await(moveAnimate());
textAnimate().start();
$await(jumpAnimate());
}));
runAsync().start();
})();
</script>
<iframe src = "./给你们.mp3" allow = "autoplay" hidden /> //自己修改音乐位置
</body>
</html></code></pre>
<!DOCTYPE html>
<html xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>男某某与女某某日期纪念功能</title>
<link type="text/css" rel="stylesheet" href="./index_files/default.css">
<script type="text/javascript" src="./index_files/jquery.min.js"></script>
<script type="text/javascript" src="./index_files/jscex.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-parser.js"></script>
<script type="text/javascript" src="./index_files/jscex-jit.js"></script>
<script type="text/javascript" src="./index_files/jscex-builderbase.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async-powerpack.min.js"></script>
<script type="text/javascript" src="./index_files/functions.js" charset="utf-8"></script>
<script type="text/javascript" src="./index_files/love.js" charset="utf-8"></script>
<style type="text/css">
<!--
.STYLE1 {color: #666666}
-->
</style>
</head>
<body>
<div id="main">
<div id="error">本页面采用HTML5编辑,目前您的浏览器无法显示,请换成谷歌(<a href="http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh-CN&brand=CHMI">Chrome</a>)或者火狐(<a href="http://firefox.com.cn/download/">Firefox</a>)浏览器,或者其他游览器的最新版本。</div>
<div id="wrap">
<div id="text">
<div id="code">
<span class="say">* 致女某某: *</span><br>
<span class="say"> </span><br>
<span class="say">· 女某某,情人节快乐!</span><br>
<span class="say"> </span><br>
<span class="say">· 不经意相识, 或许是缘分,或许是注定的。</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但依......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......</span><br>
<span class="say"> </span><br>
<span class="say">· 无论如何,只要你我依旧喜欢对方,我会一直陪着你。</span><br>
<span class="say"> </span><br>
<span class="say">· You are my only girlfriend.</span><br>
<span class="say"> </span><br>
<span class="say">· I love you,×××!</span><br>
<span class="say"> </span><br>
<span class="say"><span class="space"></span>--@author 男某某--</span>
</div>
</div>
<div id="clock-box">
<span class="STYLE1">现在是</span>男某某 <span class="STYLE1" style="color: red">❤</span> 女某某<span class="STYLE1" style="color: red">相恋</span>
<div id="clock"></div>
</div>
<canvas id="canvas" width="1100" height="680"></canvas>
</div>
</div>
<script>
</script>
<script>
(function(){
var canvas = $('#canvas');
if (!canvas.getContext) {
$("#error").show();
return false;
}
var width = canvas.width();
var height = canvas.height();
canvas.attr("width", width);
canvas.attr("height", height);
var opts = {
seed: {
x: width / 2 - 20,
color: "rgb(190, 26, 37)",
scale: 2
},
branch: [
[535, 680, 570, 250, 500, 200, 30, 100, [
[540, 500, 455, 417, 340, 400, 13, 100, [
]],
[550, 445, 600, 356, 680, 345, 12, 100, [
]],
,
[546, 397, 413, 247, 328, 244, 9, 80, [
,
]],
[546, 357, 608, 252, 678, 221, 6, 100, [
]]
]]
],
bloom: {
num: 700,
width: 1080,
height: 650,
},
footer: {
width: 1200,
height: 5,
speed: 10,
}
}
var tree = new Tree(canvas, width, height, opts);
var seed = tree.seed;
var foot = tree.footer;
var hold = 1;
canvas.click(function(e) {
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
if (seed.hover(x, y)) {
hold = 0;
canvas.unbind("click");
canvas.unbind("mousemove");
canvas.removeClass('hand');
}
}).mousemove(function(e){
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
canvas.toggleClass('hand', seed.hover(x, y));
});
var seedAnimate = eval(Jscex.compile("async", function () {
seed.draw();
while (hold) {
$await(Jscex.Async.sleep(10));
}
while (seed.canScale()) {
seed.scale(0.95);
$await(Jscex.Async.sleep(10));
}
while (seed.canMove()) {
seed.move(0, 2);
foot.draw();
$await(Jscex.Async.sleep(10));
}
}));
var growAnimate = eval(Jscex.compile("async", function () {
do {
tree.grow();
$await(Jscex.Async.sleep(10));
} while (tree.canGrow());
}));
var flowAnimate = eval(Jscex.compile("async", function () {
do {
tree.flower(2);
$await(Jscex.Async.sleep(10));
} while (tree.canFlower());
}));
var moveAnimate = eval(Jscex.compile("async", function () {
tree.snapshot("p1", 240, 0, 610, 680);
while (tree.move("p1", 500, 0)) {
foot.draw();
$await(Jscex.Async.sleep(10));
}
foot.draw();
tree.snapshot("p2", 500, 0, 610, 680);
canvas.parent().css("background", "url(" + tree.toDataURL('image/png') + ")");
canvas.css("background", "#ffe");
$await(Jscex.Async.sleep(300));
canvas.css("background", "none");
}));
var jumpAnimate = eval(Jscex.compile("async", function () {
var ctx = tree.ctx;
while (true) {
tree.ctx.clearRect(0, 0, width, height);
tree.jump();
foot.draw();
$await(Jscex.Async.sleep(25));
}
}));
//下面修改起始日期
var textAnimate = eval(Jscex.compile("async", function () {
var together = new Date();
together.setFullYear(2020, 1, 2); //时间年月日 月份0~11
together.setHours(22); //小时
together.setMinutes(22); //分钟
together.setSeconds(2); //秒前一位
together.setMilliseconds(2); //秒第二位
$("#code").show().typewriter();
$("#clock-box").fadeIn(500);
while (true) {
timeElapse(together);
$await(Jscex.Async.sleep(1000));
}
}));
var runAsync = eval(Jscex.compile("async", function () {
$await(seedAnimate());
$await(growAnimate());
$await(flowAnimate());
$await(moveAnimate());
textAnimate().start();
$await(jumpAnimate());
}));
runAsync().start();
})();
</script>
<iframe src = "./给你们.mp3" allow = "autoplay" hidden /> //自己修改音乐位置
</body>
</html>
<code>hhhhhhhhhhh</code>
<!DOCTYPE html>
<html xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>男某某与女某某日期纪念功能</title>
<link type="text/css" rel="stylesheet" href="./index_files/default.css">
<script type="text/javascript" src="./index_files/jquery.min.js"></script>
<script type="text/javascript" src="./index_files/jscex.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-parser.js"></script>
<script type="text/javascript" src="./index_files/jscex-jit.js"></script>
<script type="text/javascript" src="./index_files/jscex-builderbase.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async.min.js"></script>
<script type="text/javascript" src="./index_files/jscex-async-powerpack.min.js"></script>
<script type="text/javascript" src="./index_files/functions.js" charset="utf-8"></script>
<script type="text/javascript" src="./index_files/love.js" charset="utf-8"></script>
<style type="text/css">
<!--
.STYLE1 {color: #666666}
-->
</style>
</head>
<body>
<div id="main">
<div id="error">本页面采用HTML5编辑,目前您的浏览器无法显示,请换成谷歌(<a href="http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh-CN&brand=CHMI">Chrome</a>)或者火狐(<a href="http://firefox.com.cn/download/">Firefox</a>)浏览器,或者其他游览器的最新版本。</div>
<div id="wrap">
<div id="text">
<div id="code">
<span class="say">* 致女某某: *</span><br>
<span class="say"> </span><br>
<span class="say">· 女某某,情人节快乐!</span><br>
<span class="say"> </span><br>
<span class="say">· 不经意相识, 或许是缘分,或许是注定的。</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但依......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......,但......!</span><br>
<span class="say"> </span><br>
<span class="say">· 虽然......</span><br>
<span class="say"> </span><br>
<span class="say">· 无论如何,只要你我依旧喜欢对方,我会一直陪着你。</span><br>
<span class="say"> </span><br>
<span class="say">· You are my only girlfriend.</span><br>
<span class="say"> </span><br>
<span class="say">· I love you,×××!</span><br>
<span class="say"> </span><br>
<span class="say"><span class="space"></span>--@author 男某某--</span>
</div>
</div>
<div id="clock-box">
<span class="STYLE1">现在是</span>男某某 <span class="STYLE1" style="color: red">❤</span> 女某某<span class="STYLE1" style="color: red">相恋</span>
<div id="clock"></div>
</div>
<canvas id="canvas" width="1100" height="680"></canvas>
</div>
</div>
<script>
</script>
<script>
(function(){
var canvas = $('#canvas');
if (!canvas.getContext) {
$("#error").show();
return false;
}
var width = canvas.width();
var height = canvas.height();
canvas.attr("width", width);
canvas.attr("height", height);
var opts = {
seed: {
x: width / 2 - 20,
color: "rgb(190, 26, 37)",
scale: 2
},
branch: [
[535, 680, 570, 250, 500, 200, 30, 100, [
[540, 500, 455, 417, 340, 400, 13, 100, [
]],
[550, 445, 600, 356, 680, 345, 12, 100, [
]],
,
[546, 397, 413, 247, 328, 244, 9, 80, [
,
]],
[546, 357, 608, 252, 678, 221, 6, 100, [
]]
]]
],
bloom: {
num: 700,
width: 1080,
height: 650,
},
footer: {
width: 1200,
height: 5,
speed: 10,
}
}
var tree = new Tree(canvas, width, height, opts);
var seed = tree.seed;
var foot = tree.footer;
var hold = 1;
canvas.click(function(e) {
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
if (seed.hover(x, y)) {
hold = 0;
canvas.unbind("click");
canvas.unbind("mousemove");
canvas.removeClass('hand');
}
}).mousemove(function(e){
var offset = canvas.offset(), x, y;
x = e.pageX - offset.left;
y = e.pageY - offset.top;
canvas.toggleClass('hand', seed.hover(x, y));
});
var seedAnimate = eval(Jscex.compile("async", function () {
seed.draw();
while (hold) {
$await(Jscex.Async.sleep(10));
}
while (seed.canScale()) {
seed.scale(0.95);
$await(Jscex.Async.sleep(10));
}
while (seed.canMove()) {
seed.move(0, 2);
foot.draw();
$await(Jscex.Async.sleep(10));
}
}));
var growAnimate = eval(Jscex.compile("async", function () {
do {
tree.grow();
$await(Jscex.Async.sleep(10));
} while (tree.canGrow());
}));
var flowAnimate = eval(Jscex.compile("async", function () {
do {
tree.flower(2);
$await(Jscex.Async.sleep(10));
} while (tree.canFlower());
}));
var moveAnimate = eval(Jscex.compile("async", function () {
tree.snapshot("p1", 240, 0, 610, 680);
while (tree.move("p1", 500, 0)) {
foot.draw();
$await(Jscex.Async.sleep(10));
}
foot.draw();
tree.snapshot("p2", 500, 0, 610, 680);
canvas.parent().css("background", "url(" + tree.toDataURL('image/png') + ")");
canvas.css("background", "#ffe");
$await(Jscex.Async.sleep(300));
canvas.css("background", "none");
}));
var jumpAnimate = eval(Jscex.compile("async", function () {
var ctx = tree.ctx;
while (true) {
tree.ctx.clearRect(0, 0, width, height);
tree.jump();
foot.draw();
$await(Jscex.Async.sleep(25));
}
}));
//下面修改起始日期
var textAnimate = eval(Jscex.compile("async", function () {
var together = new Date();
together.setFullYear(2020, 1, 2); //时间年月日 月份0~11
together.setHours(22); //小时
together.setMinutes(22); //分钟
together.setSeconds(2); //秒前一位
together.setMilliseconds(2); //秒第二位
$("#code").show().typewriter();
$("#clock-box").fadeIn(500);
while (true) {
timeElapse(together);
$await(Jscex.Async.sleep(1000));
}
}));
var runAsync = eval(Jscex.compile("async", function () {
$await(seedAnimate());
$await(growAnimate());
$await(flowAnimate());
$await(moveAnimate());
textAnimate().start();
$await(jumpAnimate());
}));
runAsync().start();
})();
</script>
<iframe src = "./给你们.mp3" allow = "autoplay" hidden /> //自己修改音乐位置
</body>
</html>
————————————————
版权声明:本文为CSDN博主「Himit_ZH」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43853097/article/details/104240158
页:
[1]