mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-21 22:36:16 +01:00
commit
7ff5ef43aa
14 changed files with 24 additions and 25 deletions
|
@ -52,11 +52,11 @@
|
|||
.page {
|
||||
width: 100%;
|
||||
|
||||
[header-mobile] & {
|
||||
[data-header-mobile] & {
|
||||
padding-top: $header-height;
|
||||
}
|
||||
|
||||
[header-mobile=normal] & {
|
||||
[data-header-mobile=normal] & {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.home[posts] {
|
||||
.home[data-home=posts] {
|
||||
.home-profile {
|
||||
@include transform(translateY(0));
|
||||
padding-top: 2rem;
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
width: 60%;
|
||||
margin: 0 auto;
|
||||
|
||||
[header-desktop] & {
|
||||
[data-header-desktop] & {
|
||||
padding-top: $header-height;
|
||||
}
|
||||
|
||||
[header-desktop=normal] & {
|
||||
[data-header-desktop=normal] & {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ header {
|
|||
height: $header-height;
|
||||
line-height: $header-height;
|
||||
|
||||
[header-desktop=normal] & {
|
||||
[data-header-desktop=normal] & {
|
||||
position: static;
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ header {
|
|||
height: $header-height;
|
||||
line-height: $header-height;
|
||||
|
||||
[header-mobile=normal] & {
|
||||
[data-header-mobile=normal] & {
|
||||
position: static;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
left: 0;
|
||||
visibility: hidden;
|
||||
|
||||
[header-desktop=normal] & {
|
||||
[data-header-desktop=normal] & {
|
||||
top: 5rem;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@
|
|||
display: none;
|
||||
margin: .8rem 0;
|
||||
|
||||
&[kept=true] {
|
||||
&[data-kept=true] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
|
4
assets/js/theme.min.js
vendored
4
assets/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -6,7 +6,6 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noodp" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<title>
|
||||
{{- block "title" . }}{{ .Site.Title }}{{ end -}}
|
||||
</title>
|
||||
|
@ -15,7 +14,7 @@
|
|||
{{- partial "head/link.html" . -}}
|
||||
{{- partial "head/seo.html" . -}}
|
||||
</head>
|
||||
<body header-desktop="{{ .Site.Params.header.desktopMode }}" header-mobile="{{ .Site.Params.header.mobileMode }}">
|
||||
<body data-header-desktop="{{ .Site.Params.header.desktopMode }}" data-header-mobile="{{ .Site.Params.header.mobileMode }}">
|
||||
{{- /* Check theme isDark before body rendering */ -}}
|
||||
{{- $theme := .Site.Params.defaulttheme -}}
|
||||
<script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{- $profile := .Site.Params.home.profile -}}
|
||||
{{- $posts := .Site.Params.home.posts -}}
|
||||
|
||||
<div class="page home"{{ if ne $posts.enable false }} posts{{ end }}>
|
||||
<div class="page home"{{ if ne $posts.enable false }} data-home="posts"{{ end }}>
|
||||
{{- /* Profile */ -}}
|
||||
{{- if ne $profile.enable false -}}
|
||||
{{- partial "home/profile.html" . -}}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<div class="footer-line">
|
||||
<div class="footer-line" itemscope itemtype="http://schema.org/CreativeWork">
|
||||
{{- /* Copyright year */ -}}
|
||||
{{- if ne .Site.Params.footer.copyright false -}}
|
||||
<i class="far fa-copyright fa-fw"></i>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- with $profile.subtitle -}}
|
||||
<h2 class="home-subtitle">
|
||||
<div class="home-subtitle">
|
||||
{{- if $profile.typeit -}}
|
||||
{{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}}
|
||||
<div id="{{ $id }}" class="typeit"></div>
|
||||
|
@ -36,7 +36,7 @@
|
|||
{{- else -}}
|
||||
{{- . -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $profile.social -}}
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
{{- /* Static TOC */ -}}
|
||||
{{- if ne $toc.enable false -}}
|
||||
<div class="details toc" id="toc-static" kept="{{ if $toc.keepStatic }}true{{ end }}">
|
||||
<div class="details toc" id="toc-static" data-kept="{{ if $toc.keepStatic }}true{{ end }}">
|
||||
<div class="details-summary toc-title">
|
||||
<span>{{ T "contents" }}</span>
|
||||
<span><i class="details-icon fas fa-angle-right"></i></span>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -397,7 +397,7 @@ class Theme {
|
|||
initToc() {
|
||||
const $tocCore = document.getElementById('TableOfContents');
|
||||
if ($tocCore === null) return;
|
||||
if (document.getElementById('toc-static').getAttribute('kept') || this.util.isTocStatic()) {
|
||||
if (document.getElementById('toc-static').getAttribute('data-kept') || this.util.isTocStatic()) {
|
||||
const $tocContentStatic = document.getElementById('toc-content-static');
|
||||
if ($tocCore.parentElement !== $tocContentStatic) {
|
||||
$tocCore.parentElement.removeChild($tocCore);
|
||||
|
@ -419,7 +419,7 @@ class Theme {
|
|||
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
|
||||
const $tocLiElements = $tocCore.getElementsByTagName('li');
|
||||
const $headerLinkElements = document.getElementsByClassName('headerLink');
|
||||
const headerIsFixed = document.body.getAttribute('header-desktop') !== 'normal';
|
||||
const headerIsFixed = document.body.getAttribute('data-header-desktop') !== 'normal';
|
||||
const headerHeight = document.getElementById('header-desktop').offsetHeight;
|
||||
const TOP_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
|
||||
const minTocTop = $toc.offsetTop;
|
||||
|
@ -632,8 +632,8 @@ class Theme {
|
|||
|
||||
onScroll() {
|
||||
const $headers = [];
|
||||
if (document.body.getAttribute('header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
|
||||
if (document.body.getAttribute('header-mobile') === 'auto') $headers.push(document.getElementById('header-mobile'));
|
||||
if (document.body.getAttribute('data-header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
|
||||
if (document.body.getAttribute('data-header-mobile') === 'auto') $headers.push(document.getElementById('header-mobile'));
|
||||
if (document.getElementById('comments')) {
|
||||
const $viewComments = document.getElementById('view-comments');
|
||||
$viewComments.href = `#comments`;
|
||||
|
|
Loading…
Reference in a new issue