mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-12 16:19:45 +00:00
style: images in figure will be centered when {{figure src="center" ... }}
is used
This commit is contained in:
parent
758f15746a
commit
8cd3af6331
5 changed files with 33 additions and 28 deletions
|
@ -100,10 +100,15 @@
|
|||
content: ':';
|
||||
}
|
||||
|
||||
figure figcaption h4 {
|
||||
color: #b5b5b5;
|
||||
font-size: 0.9rem;
|
||||
text-align: center;
|
||||
figure {
|
||||
&.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
figcaption h4 {
|
||||
color: #b5b5b5;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
.task-list {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
'use strict'
|
||||
|
||||
var Even = {}
|
||||
const Even = {}
|
||||
|
||||
Even.backToTop = function () {
|
||||
var $backToTop = $('#back-to-top')
|
||||
const $backToTop = $('#back-to-top')
|
||||
|
||||
$(window).scroll(function () {
|
||||
if ($(window).scrollTop() > 100) {
|
||||
|
@ -19,9 +19,9 @@ Even.backToTop = function () {
|
|||
}
|
||||
|
||||
Even.mobileNavbar = function () {
|
||||
var $mobileNav = $('#mobile-navbar')
|
||||
var $mobileNavIcon = $('.mobile-navbar-icon')
|
||||
var slideout = new Slideout({
|
||||
const $mobileNav = $('#mobile-navbar')
|
||||
const $mobileNavIcon = $('.mobile-navbar-icon')
|
||||
const slideout = new Slideout({
|
||||
'panel': document.getElementById('mobile-panel'),
|
||||
'menu': document.getElementById('mobile-menu'),
|
||||
'padding': 180,
|
||||
|
@ -49,15 +49,15 @@ Even.mobileNavbar = function () {
|
|||
}
|
||||
|
||||
Even._initToc = function () {
|
||||
var SPACING = 20
|
||||
var $toc = $('.post-toc')
|
||||
var $footer = $('.post-footer')
|
||||
const SPACING = 20
|
||||
const $toc = $('.post-toc')
|
||||
const $footer = $('.post-footer')
|
||||
|
||||
if ($toc.length) {
|
||||
var minScrollTop = $toc.offset().top - SPACING
|
||||
var maxScrollTop = $footer.offset().top - $toc.height() - SPACING
|
||||
const minScrollTop = $toc.offset().top - SPACING
|
||||
const maxScrollTop = $footer.offset().top - $toc.height() - SPACING
|
||||
|
||||
var tocState = {
|
||||
const tocState = {
|
||||
start: {
|
||||
'position': 'absolute',
|
||||
'top': minScrollTop
|
||||
|
@ -73,7 +73,7 @@ Even._initToc = function () {
|
|||
}
|
||||
|
||||
$(window).scroll(function () {
|
||||
var scrollTop = $(window).scrollTop()
|
||||
const scrollTop = $(window).scrollTop()
|
||||
|
||||
if (scrollTop < minScrollTop) {
|
||||
$toc.css(tocState.start)
|
||||
|
@ -85,21 +85,21 @@ Even._initToc = function () {
|
|||
})
|
||||
}
|
||||
|
||||
var HEADERFIX = 30
|
||||
var $toclink = $('.toc-link')
|
||||
var $headerlink = $('.headerlink')
|
||||
const HEADERFIX = 30
|
||||
const $toclink = $('.toc-link')
|
||||
const $headerlink = $('.headerlink')
|
||||
|
||||
var headerlinkTop = $.map($headerlink, function (link) {
|
||||
const headerlinkTop = $.map($headerlink, function (link) {
|
||||
return $(link).offset().top
|
||||
})
|
||||
|
||||
$(window).scroll(function () {
|
||||
var scrollTop = $(window).scrollTop()
|
||||
const scrollTop = $(window).scrollTop()
|
||||
|
||||
for (var i = 0; i < $toclink.length; i++) {
|
||||
var isLastOne = i + 1 === $toclink.length
|
||||
var currentTop = headerlinkTop[i] - HEADERFIX
|
||||
var nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX
|
||||
for (let i = 0; i < $toclink.length; i++) {
|
||||
const isLastOne = i + 1 === $toclink.length
|
||||
const currentTop = headerlinkTop[i] - HEADERFIX
|
||||
const nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX
|
||||
|
||||
if (currentTop < scrollTop && scrollTop <= nextTop) {
|
||||
$($toclink[i]).addClass('active')
|
||||
|
|
2
static/dist/even.min.css
vendored
2
static/dist/even.min.css
vendored
File diff suppressed because one or more lines are too long
2
static/dist/even.min.css.map
vendored
2
static/dist/even.min.css.map
vendored
File diff suppressed because one or more lines are too long
2
static/dist/even.min.js.map
vendored
2
static/dist/even.min.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue