html添加下方导航条;添加B站热搜页
This commit is contained in:
72
index.html
72
index.html
@@ -17,11 +17,81 @@
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr 50px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#float-container.bt {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
background-color: #fdfdfd;
|
||||
box-shadow: 0 -2px 10px 0 rgb(0 0 0 / 10%);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
#float-container.bt .navbar-item {
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#float-container.bt .navbar-item .navbar-image {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
filter: grayscale(1);
|
||||
}
|
||||
|
||||
#float-container.bt .navbar-item .navbar-title {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
#float-container.bt .navbar-item.active .navbar-image {
|
||||
filter: initial;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe src="html/index.html" frameborder="0" style="width: 100%; height: 100%"></iframe>
|
||||
<div class="container">
|
||||
<iframe src="html/weibo.html" frameborder="0" style=""></iframe>
|
||||
<div id="float-container" class="bt">
|
||||
<div class="navbar-item active" targetPage="html/weibo.html">
|
||||
<img class="navbar-image" src="./html/assets/image/weibo.svg" />
|
||||
<p class="navbar-title">微博</p>
|
||||
</div>
|
||||
<div class="navbar-item" targetPage="html/bilibili.html">
|
||||
<img class="navbar-image" src="./html/assets/image/bilibili.svg" style="transform: scale(0.84);" />
|
||||
<p class="navbar-title">B站</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let navbarItems = document.querySelectorAll('.navbar-item');
|
||||
let iframe = document.querySelector('iframe');
|
||||
navbarItems.forEach(item => {
|
||||
item.addEventListener('click', () => {
|
||||
navbarItems.forEach(item => {
|
||||
item.classList.remove('active');
|
||||
});
|
||||
item.classList.add('active');
|
||||
iframe.src = item.getAttribute('targetPage');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user