Skip to content

Commit

Permalink
Fixed known bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwangart committed Apr 3, 2022
1 parent effd07d commit c670371
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 56 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ menu:
excerpt_link: 阅读全文

# Toc
toc: true
toc: false

# MIIT ICP/IP/DOMAIN
beian:
Expand All @@ -33,7 +33,7 @@ hero:
image: /images/banner.jpg
## keen-slider
keen_slider:
enable: true
enable: false

# Slogan
slogan:
Expand Down
94 changes: 53 additions & 41 deletions layout/_partial/after-footer.ejs
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
<%- js('//cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js') %>
<% if (theme.toc){ %>
<%- js('//cdnjs.cloudflare.com/ajax/libs/tocbot/4.11.1/tocbot.min.js') %>
<%- js('//cdnjs.cloudflare.com/ajax/libs/tocbot/4.11.1/tocbot.min.js') %>
<script>
tocbot.init({
// Where to render the table of contents.
tocSelector: '.js-toc',
// Where to grab the headings to build the table of contents.
contentSelector: '.js-toc-content',
// Which headings to grab inside of the contentSelector element.
headingSelector: 'h3, h4, h5',
// For headings inside relative or absolute positioned containers within content.
hasInnerContainers: true,
});
</script>
<% } %>
<% if (theme.keen_slider.enable){ %>
<%- js('//cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.js') %>
<script>
var slider = new KeenSlider(
"#my-keen-slider",
{
loop: true,
},
[
(slider) => {
let timeout
let mouseOver = false
function clearNextTimeout() {
clearTimeout(timeout)
}
function nextTimeout() {
clearTimeout(timeout)
if (mouseOver) return
timeout = setTimeout(() => {
slider.next()
}, 3000)
}
slider.on("created", () => {
slider.container.addEventListener("mouseover", () => {
mouseOver = true
clearNextTimeout()
})
slider.container.addEventListener("mouseout", () => {
mouseOver = false
nextTimeout()
})
nextTimeout()
})
slider.on("dragStarted", clearNextTimeout)
slider.on("animationEnded", nextTimeout)
slider.on("updated", nextTimeout)
},
]
)
</script>
<%- js('//cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.js') %>
<script>
var slider = new KeenSlider(
"#my-keen-slider",
{
loop: true,
},
[
(slider) => {
let timeout
let mouseOver = false
function clearNextTimeout() {
clearTimeout(timeout)
}
function nextTimeout() {
clearTimeout(timeout)
if (mouseOver) return
timeout = setTimeout(() => {
slider.next()
}, 3000)
}
slider.on("created", () => {
slider.container.addEventListener("mouseover", () => {
mouseOver = true
clearNextTimeout()
})
slider.container.addEventListener("mouseout", () => {
mouseOver = false
nextTimeout()
})
nextTimeout()
})
slider.on("dragStarted", clearNextTimeout)
slider.on("animationEnded", nextTimeout)
slider.on("updated", nextTimeout)
},
]
)
</script>
<% } %>
<%- js('/js/mobile-nav') %>
<%- js('/js/script') %>
<%- js('/js/mobile-nav') %>
2 changes: 1 addition & 1 deletion layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<header class="header">
<% } %>
<div class="container">
<nav class="navbar d-flex justify-content-between align-items-center">
<nav class="navbar d-flex align-items-center">
<a class="brand" href="<%- url_for() %>">
<img class="logo" src="<%- url_for(theme.brand) %>" alt="<%= config.title %>" role="img">
</a>
Expand Down
2 changes: 1 addition & 1 deletion layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</section>

<% for (var section in site.data.index){%>
<section class="section py-5 <%=site.data.index[section]['bg_color'] %>">
<section class="section py-5 <%=site.data.index[section]['bg_color'] %>" id="<%=site.data.index[section]['id'] %>">
<div class="container<%=site.data.index[section]['fluid'] %>">
<div class="section-heading text-center mb-5">
<h3><%=site.data.index[section]['title'] %></h3>
Expand Down
11 changes: 0 additions & 11 deletions source/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ document.onscroll = function() {

feather.replace()

tocbot.init({
// Where to render the table of contents.
tocSelector: '.js-toc',
// Where to grab the headings to build the table of contents.
contentSelector: '.js-toc-content',
// Which headings to grab inside of the contentSelector element.
headingSelector: 'h3, h4, h5',
// For headings inside relative or absolute positioned containers within content.
hasInnerContainers: true,
});

var tesObj = document.getElementsByName("carousel");
//设置 value 值为 0 选中
for(var i=0; i < tesObj.length; i++){
Expand Down

0 comments on commit c670371

Please sign in to comment.