AI导航 —— HTML源码

1、AI生成完就直接拿来用了,按钮和布局不是很好看,有喜欢魔改的可以调一下css,HTML也可以自己调一下 比如标题的标签

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	<!DOCTYPE html>  
<html>
<head>
<meta charset="UTF-8">
<title>页面标题</title>
<link rel="stylesheet" href="css/styles.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css?v=1.0">
<script src="js/scripts.js"></script>
<style>
</style>
</head>
<body>
<!-- 添加美化后的搜索框和搜索按钮 -->
<div class="search-box">
<input type="text" id="search" placeholder="搜索按钮关键字...">
<button id="search-btn">搜索</button>
</div>

<!-- 添加带竖线的标题 -->
<div class="title-with-line">
<h3>搜索引擎</h2>
</div>

<!-- 定义按钮组 -->
<div>

<button class="btn" onclick="location.href='Google'">https://www.google.com/</button>
<button class="btn" onclick="location.href='必应'">https://www.bing.com/</button>
<button class="btn" onclick="location.href='雅虎'">https://www.yahoo.com/</button>
<button class="btn" onclick="location.href='百度'">https://www.baidu.com/</button>
<button class="btn" onclick="location.href='Fast科技'">https://fastkj.github.io/</button>
<button class="btn" onclick="location.href='Yandex'">https://www.yandex.com/</button>
<button class="btn" onclick="location.href='鸭鸭去'">https://duckduckgo.com/</button>
<button class="btn" onclick="location.href='问'">https://www.ask.com/</button>
<button class="btn" onclick="location.href='美国在线搜索'">https://search.aol.com/</button>
<button class="btn" onclick="location.href='Excite'">https://www.excite.com/</button>
<button class="btn" onclick="location.href='Dogpile'">http://www.dogpile.com/</button>


<!-- 添加带竖线的标题 -->
<div class="title-with-line">
<h3>自定义按钮</h2>
</div>
<button class="btn" onclick="location.href='在线搜索'">https://search.aol.com/</button>
<button class="btn" onclick="location.href='Excite'">https://www.excite.com/</button>
<button class="btn" onclick="location.href='Dogpile'">http://www.dogpile.com/</button>

</div>
</body>
</html>

<script>
// 获取搜索框、搜索按钮和要搜索的按钮
const searchInput = document.getElementById("search");
const searchBtn = document.getElementById("search-btn");
const btns = document.querySelectorAll(".btn");

// 当用户点击搜索按钮时,显示匹配的按钮
searchBtn.addEventListener("click", function() {
const searchText = searchInput.value;
for (let i = 0; i < btns.length; i++) {
const btnText = btns[i].textContent.toLowerCase();
if (btnText.includes(searchText.toLowerCase())) {
btns[i].style.display = "inline-block";
} else {
btns[i].style.display = "none";
}
}
});

// 当用户在搜索框中输入关键词时,显示匹配的按钮
searchInput.addEventListener("input", function() {
const searchText = searchInput.value;
for (let i = 0; i < btns.length; i++) {
const btnText = btns[i].textContent.toLowerCase();
if (btnText.includes(searchText.toLowerCase())) {
btns[i].style.display = "inline-block";
} else {
btns[i].style.display = "none";
}
}
});

</script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* 定义搜索框样式 */
.search-box {
position: relative;
display: inline-block;
margin: 20px;
width: 90%;
}
.search-box input[type="text"] {
width: 100%;
padding: 10px;
border: none;
border-radius: 30px;
background-color: #f2f2f2;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out;
font-size: 16px;
color: #333;
}
.search-box input[type="text"]:focus {
outline: none;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
background-color: #fff;
color: #333;
}
.search-box button {
position: absolute;
top: 0;
right: 0;
padding: 10px 15px;
background-color: #f2f2f2;
border: none;
border-radius: 0px 30px 30px 0px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
cursor: pointer;
font-size: 16px;
color: #333;
}
.search-box button:hover {
background-color: #ddd;
}



/* 定义按钮样式 */
.btn {
display: inline-block;
padding: 10px 20px;
background-color: #ffffff;
border: 2px solid black;
border-radius: 7px;
cursor: pointer;
margin-top: 8px;
}
/* 定义选中按钮样式 */
.btn-selected {
background-color: #ffffff;

}

/* 定义带竖线的标题样式 */
.title-with-line {
position: relative;
padding-left: 20px;
margin-bottom: 20px;
margin-top: 18px;
}

.title-with-line::before {
content: "";
position: absolute;
top: 1;
left: 0;
width: 6px;
height: 100%;
background-color: green;
vertical-align: middle;
}

.title-with-line h3 {
display: inline-block;
vertical-align: middle;
margin: 0;
padding-left: 10px;
}

2、单个替换链接名称太麻烦所以写了个批量生成工具,只需要输入(链接 名称)点击生成复制到代码里即可:批量生成代码

生成后复制替换代码即可