原作者是@37tt,抖音名叫汤汤好梦,因为原作者的github被封了所以找不到仓库
- 确保你已经安装了一个现代浏览器(如 Chrome, Firefox)。
- 确保你已经下载了项目的所有文件,并且文件结构完整。
- 打开项目文件夹 。
- 找到
index.html文件。 - 双击
index.html文件,使用浏览器打开它。 - 你将看到一个包含 Yes 和 No 按钮的页面,点击按钮体验互动效果。
index.html: 项目的主页面。script.js: 包含按钮点击事件的逻辑。styles.css: 页面样式文件。images/: 存放项目中使用的图片资源。
- 确保
script.js和styles.css文件在index.html中正确引用。 - 确保
images文件夹中的图片路径正确。
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表白页面</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<div id="mainContent">
<h1 id="question">你愿意做我的女朋友吗?</h1>
<button id="yes">Yes</button>
<button id="no">No</button>
<img id="mainImage" src="./images/default.png" alt="表情图片">
</div>
<script src="./script.js"></script>
</body>
</html>