This commit is contained in:
MeiK
2020-12-14 15:59:49 +08:00
parent 76202bfc51
commit 5dbda5af86
18 changed files with 566 additions and 395 deletions

View File

@@ -7,6 +7,15 @@
- header 栏(还没有移动端的样式切换) - header 栏(还没有移动端的样式切换)
- light/dark 模式切换 - light/dark 模式切换
TODO:
- 根据当前页面切换 `selected` 的菜单项。
已知问题:
- 因为没有服务器,无法在页面加载前就确定 light/dark 模式,因此需要尽早在 JS 中确认 theme。
- light/dark 切换按钮点击时会出现蓝色边框。
## Init hugo site ## Init hugo site
```bash ```bash

View File

@@ -4,7 +4,7 @@
<body> <body>
{{ partial "header" . }} {{ partial "header" . }}
<!-- {{ block "content" . }}{{ end }} --> {{ block "content" . }}{{ end }}
<!-- {{ partial "footer.html" . }} --> <!-- {{ partial "footer.html" . }} -->
</body> </body>

View File

@@ -1,12 +1,8 @@
{{ define "content" }} {{ define "content" }}
<div class="application-main " data-commit-hovercards-enabled> <div class="application-main">
<main> <main>
<div class="container-xl clearfix px-3 mt-4">
{{ partial "user-profile.html" . }} {{ partial "user-profile.html" . }}
{{ partial "posts.html" .}} {{ partial "posts.html" .}}
</main>
</div> </div>
{{end }} {{end }}

View File

@@ -8,8 +8,7 @@
<a aria-label="Homepage" title="{{ .Site.Title }}" class="footer-octicon d-none d-lg-block mx-lg-4" <a aria-label="Homepage" title="{{ .Site.Title }}" class="footer-octicon d-none d-lg-block mx-lg-4"
href="{{ .Site.BaseURL }}"> href="{{ .Site.BaseURL }}">
<svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24" <svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24">
aria-hidden="true">
<path fill-rule="evenodd" <path fill-rule="evenodd"
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"> d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z">
</path> </path>

View File

@@ -1,6 +1,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<script type="application/javascript" src="{{ "js/theme-mode.js" | absURL }}"></script>
<link rel="stylesheet" href="{{ "css/frameworks.min.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/github.min.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/github-style.css" | absURL }}" /> <link rel="stylesheet" href="{{ "css/github-style.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/light.css" | absURL }}" /> <link rel="stylesheet" href="{{ "css/light.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/dark.css" | absURL }}" /> <link rel="stylesheet" href="{{ "css/dark.css" | absURL }}" />

View File

@@ -21,9 +21,9 @@
</div> </div>
</div> </div>
<div class="Header-item" style="margin-right: 0;"> <div class="Header-item" style="margin-right: 0;">
<a href="javascript:void(0)" class="Header-link" onclick="switchTheme()"> <a href="javascript:void(0)" class="Header-link no-select" onclick="switchTheme()">
<svg style="fill: var(--color-profile-color-modes-toggle-moon);" viewBox="0 0 16 16" version="1.1" width="16" <svg style="fill: var(--color-profile-color-modes-toggle-moon);" class="no-select" viewBox="0 0 16 16"
height="16" aria-hidden="true"> version="1.1" width="16" height="16">
<path fill-rule="evenodd" clip-rule="evenodd" <path fill-rule="evenodd" clip-rule="evenodd"
d="M4.52208 7.71754C7.5782 7.71754 10.0557 5.24006 10.0557 2.18394C10.0557 1.93498 10.0392 1.68986 10.0074 1.44961C9.95801 1.07727 10.3495 0.771159 10.6474 0.99992C12.1153 2.12716 13.0615 3.89999 13.0615 5.89383C13.0615 9.29958 10.3006 12.0605 6.89485 12.0605C3.95334 12.0605 1.49286 10.001 0.876728 7.24527C0.794841 6.87902 1.23668 6.65289 1.55321 6.85451C2.41106 7.40095 3.4296 7.71754 4.52208 7.71754Z"> d="M4.52208 7.71754C7.5782 7.71754 10.0557 5.24006 10.0557 2.18394C10.0557 1.93498 10.0392 1.68986 10.0074 1.44961C9.95801 1.07727 10.3495 0.771159 10.6474 0.99992C12.1153 2.12716 13.0615 3.89999 13.0615 5.89383C13.0615 9.29958 10.3006 12.0605 6.89485 12.0605C3.95334 12.0605 1.49286 10.001 0.876728 7.24527C0.794841 6.87902 1.23668 6.65289 1.55321 6.85451C2.41106 7.40095 3.4296 7.71754 4.52208 7.71754Z">
</path> </path>

View File

@@ -1,10 +1,7 @@
<div class="application-main " data-commit-hovercards-enabled> <div class="application-main">
<main> <main>
<div class="container-xl clearfix px-3 mt-4">
{{ partial "user-profile.html" . }} {{ partial "user-profile.html" . }}
{{ partial "overview.html" .}} <!-- {{ partial "overview.html" .}} -->
</main> </main>
</div> </div>

152
layouts/partials/menus.html Normal file
View File

@@ -0,0 +1,152 @@
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
{{ $section_count := len $section }}
<div class="mt-4 position-sticky top-0 d-none d-md-block bg-white width-full border-bottom color-border-secondary"
style="z-index:3;">
<div class="container-xl px-3 px-md-4 px-lg-5">
<div class="gutter-condensed gutter-lg flex-column flex-md-row d-flex">
<div class="flex-shrink-0 col-12 col-md-3 mb-4 mb-md-0">
</div>
<div class="flex-shrink-0 col-12 col-md-9 mb-4 mb-md-0">
<div class="UnderlineNav width-full box-shadow-none hx_UnderlineNav-with-profile-color-modes-banner">
<nav class="UnderlineNav-body">
<a class="UnderlineNav-item {{ if .IsHome }} selected {{ end }}" href="{{ .Site.BaseURL }}">
<svg class="octicon octicon-book UnderlineNav-octicon hide-sm" height="16" viewBox="0 0 16 16"
version="1.1" width="16">
<path fill-rule="evenodd"
d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z">
</path>
</svg>
Overview
</a>
<a class="UnderlineNav-item {{ if .IsSection }} selected {{ end }}" href="/post/">
<svg class="octicon octicon-repo UnderlineNav-octicon hide-sm" height="16" viewBox="0 0 16 16"
version="1.1" width="16">
<path fill-rule="evenodd"
d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z">
</path>
</svg>
Posts
<span class="Counter">{{ $section_count}}</span>
</a>
</nav>
<div class="profile-color-modes js-promo-color-modes-banner-profile isInitialToggle">
<svg width="106" height="60" viewBox="0 0 106 60" fill="none" stroke-width="3" stroke-linecap="round"
stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
<g class="profile-color-modes-illu-group profile-color-modes-illu-red">
<path d="M37.5 58.5V57.5C37.5 49.768 43.768 43.5 51.5 43.5V43.5C59.232 43.5 65.5 49.768 65.5 57.5V58.5">
</path>
</g>
<g class="profile-color-modes-illu-group profile-color-modes-illu-orange">
<path
d="M104.07 58.5C103.401 55.092 97.7635 54.3869 95.5375 57.489C97.4039 54.6411 99.7685 48.8845 94.6889 46.6592C89.4817 44.378 86.1428 50.1604 85.3786 54.1158C85.9519 50.4768 83.7226 43.294 78.219 44.6737C72.7154 46.0534 72.7793 51.3754 74.4992 55.489C74.169 54.7601 72.4917 53.3567 70.5 52.8196">
</path>
</g>
<g class="profile-color-modes-illu-group profile-color-modes-illu-purple">
<path
d="M5.51109 58.5V52.5C5.51109 41.4543 14.4654 32.5 25.5111 32.5C31.4845 32.5 36.8464 35.1188 40.5111 39.2709C40.7212 39.5089 40.9258 39.7521 41.1245 40">
</path>
<path d="M27.511 49.5C29.6777 49.5 28.911 49.5 32.511 49.5"></path>
<path d="M27.511 56.5C29.6776 56.5 26.911 56.5 30.511 56.5"></path>
</g>
<g class="profile-color-modes-illu-group profile-color-modes-illu-green">
<circle cx="5.5" cy="12.5" r="4"></circle>
<circle cx="18.5" cy="5.5" r="4"></circle>
<path d="M18.5 9.5L18.5 27.5"></path>
<path d="M18.5 23.5C6 23.5 5.5 23.6064 5.5 16.5"></path>
</g>
<g class="profile-color-modes-illu-group profile-color-modes-illu-blue">
<g class="profile-color-modes-illu-frame">
<path
d="M40.6983 31.5C40.5387 29.6246 40.6456 28.0199 41.1762 27.2317C42.9939 24.5312 49.7417 26.6027 52.5428 30.2409C54.2551 29.8552 56.0796 29.6619 57.9731 29.6619C59.8169 29.6619 61.5953 29.8452 63.2682 30.211C66.0833 26.5913 72.799 24.5386 74.6117 27.2317C75.6839 28.8246 75.0259 33.7525 73.9345 37.5094C74.2013 37.9848 74.4422 38.4817 74.6555 39">
</path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39">
</path>
<path d="M49.4996 33V35.6757"></path>
<path d="M67.3375 33V35.6757"></path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39">
</path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39">
</path>
<path d="M49.4996 33V35.6757"></path>
<path d="M67.3375 33V35.6757"></path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39">
</path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39">
</path>
<path d="M49.4996 33V35.6757"></path>
<path d="M67.3375 33V35.6757"></path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M73.4999 40.2236C74.9709 38.2049 75.8108 35.5791 75.8108 32.2283C75.8108 29.2229 75.1351 26.6488 73.9344 24.5094C75.0258 20.7525 75.6838 15.8246 74.6116 14.2317C72.7989 11.5386 66.0832 13.5913 63.2681 17.211C61.5952 16.8452 59.8167 16.6619 57.973 16.6619C56.0795 16.6619 54.2549 16.8552 52.5427 17.2409C49.7416 13.6027 42.9938 11.5312 41.176 14.2317C40.0859 15.8512 40.7843 20.9182 41.9084 24.6968C41.003 26.3716 40.4146 28.3065 40.2129 30.5">
</path>
<path d="M82.9458 30.5471L76.8413 31.657"></path>
<path d="M76.2867 34.4319L81.8362 37.7616"></path>
<path d="M49.4995 27.8242V30.4999"></path>
<path d="M67.3374 27.8242V30.4998"></path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M45.3697 34.2658C41.8877 32.1376 39.7113 28.6222 39.7113 23.2283C39.7113 20.3101 40.3483 17.7986 41.4845 15.6968C40.3605 11.9182 39.662 6.85125 40.7522 5.23168C42.5699 2.53117 49.3177 4.6027 52.1188 8.24095C53.831 7.85521 55.6556 7.66186 57.5491 7.66186C59.3929 7.66186 61.1713 7.84519 62.8442 8.21095C65.6593 4.59134 72.375 2.5386 74.1877 5.23168C75.2599 6.82461 74.6019 11.7525 73.5105 15.5094C74.7112 17.6488 75.3869 20.2229 75.3869 23.2283C75.3869 28.6222 73.2105 32.1376 69.7285 34.2658C70.8603 35.5363 72.6057 38.3556 73.3076 40">
</path>
<path d="M49.0747 19.8242V22.4999"></path>
<path
d="M54.0991 28C54.6651 29.0893 55.7863 30.0812 57.9929 30.0812C59.0642 30.0812 59.8797 29.8461 60.5 29.4788">
</path>
<path d="M66.9126 19.8242V22.4999"></path>
<path d="M33.2533 20.0237L39.0723 22.1767"></path>
<path d="M39.1369 25.0058L33.0935 27.3212"></path>
<path d="M81.8442 19.022L76.0252 21.1751"></path>
<path d="M75.961 24.0041L82.0045 26.3196"></path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M73.4999 40.2236C74.9709 38.2049 75.8108 35.5791 75.8108 32.2283C75.8108 29.2229 75.1351 26.6488 73.9344 24.5094C75.0258 20.7525 75.6838 15.8246 74.6116 14.2317C72.7989 11.5386 66.0832 13.5913 63.2681 17.211C61.5952 16.8452 59.8167 16.6619 57.973 16.6619C56.0795 16.6619 54.2549 16.8552 52.5427 17.2409C49.7416 13.6027 42.9938 11.5312 41.176 14.2317C40.0859 15.8512 40.7843 20.9182 41.9084 24.6968C41.003 26.3716 40.4146 28.3065 40.2129 30.5">
</path>
<path d="M82.9458 30.5471L76.8413 31.657"></path>
<path d="M76.2867 34.4319L81.8362 37.7616"></path>
<path d="M49.4995 27.8242V30.4999"></path>
<path d="M67.3374 27.8242V30.4998"></path>
</g>
<g class="profile-color-modes-illu-frame">
<path
d="M40.6983 31.5C40.5387 29.6246 40.6456 28.0199 41.1762 27.2317C42.9939 24.5312 49.7417 26.6027 52.5428 30.2409C54.2551 29.8552 56.0796 29.6619 57.9731 29.6619C59.8169 29.6619 61.5953 29.8452 63.2682 30.211C66.0833 26.5913 72.799 24.5386 74.6117 27.2317C75.6839 28.8246 75.0259 33.7525 73.9345 37.5094C74.2013 37.9848 74.4422 38.4817 74.6555 39">
</path>
</g>
</g>
</svg>
<span class="profile-color-modes-toggle js-promo-color-modes-toggle no-select" tabindex="0"
onclick="switchTheme()">
<div class="profile-color-modes-toggle-track no-select"></div>
<div class="profile-color-modes-toggle-thumb js-promo-color-modes-thumb">
<svg style="fill: var(--color-profile-color-modes-toggle-moon); margin: 7px 0 0 7px;" width="14"
height="13" viewBox="0 0 14 13" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M4.52208 7.71754C7.5782 7.71754 10.0557 5.24006 10.0557 2.18394C10.0557 1.93498 10.0392 1.68986 10.0074 1.44961C9.95801 1.07727 10.3495 0.771159 10.6474 0.99992C12.1153 2.12716 13.0615 3.89999 13.0615 5.89383C13.0615 9.29958 10.3006 12.0605 6.89485 12.0605C3.95334 12.0605 1.49286 10.001 0.876728 7.24527C0.794841 6.87902 1.23668 6.65289 1.55321 6.85451C2.41106 7.40095 3.4296 7.71754 4.52208 7.71754Z">
</path>
</svg>
</div>
</span>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -33,8 +33,8 @@
class="Box pinned-item-list-item d-flex p-3 width-full js-pinned-item-list-item public source sortable-button-item"> class="Box pinned-item-list-item d-flex p-3 width-full js-pinned-item-list-item public source sortable-button-item">
<div class="pinned-item-list-item-content" name="pinned-post"> <div class="pinned-item-list-item-content" name="pinned-post">
<div class="d-flex width-full flex-items-center position-relative"> <div class="d-flex width-full flex-items-center position-relative">
<svg class="octicon octicon-repo mr-2 text-gray flex-shrink-0" viewBox="0 0 12 16" <svg class="octicon octicon-repo mr-2 text-gray flex-shrink-0" viewBox="0 0 12 16" version="1.1"
version="1.1" width="12" height="16" aria-hidden="true"> width="12" height="16">
<path fill-rule="evenodd" <path fill-rule="evenodd"
d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z" /> d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z" />
</svg> </svg>
@@ -74,7 +74,8 @@
<a class="js-year-link selected"></a> <a class="js-year-link selected"></a>
</div> </div>
<div class="border border-gray-dark py-2 graph-before-activity-overview"> <div class="border border-gray-dark py-2 graph-before-activity-overview">
<div class="js-calendar-graph mx-3 d-flex flex-column flex-items-end flex-xl-items-center overflow-hidden pt-1 is-graph-loading graph-canvas calendar-graph height-full text-center"> <div
class="js-calendar-graph mx-3 d-flex flex-column flex-items-end flex-xl-items-center overflow-hidden pt-1 is-graph-loading graph-canvas calendar-graph height-full text-center">
<svg width="828" height="128" class="js-calendar-graph-svg"> <svg width="828" height="128" class="js-calendar-graph-svg">
<g transform="translate(10, 20)" id="graph-svg"> <g transform="translate(10, 20)" id="graph-svg">
</g> </g>
@@ -99,9 +100,11 @@
</div> </div>
<div class="activity-listing contribution-activity"> <div class="activity-listing contribution-activity">
<div class="d-none d-lg-block"> <div class="d-none d-lg-block">
<div class="profile-timeline-year-list js-profile-timeline-year-list bg-white float-right col-2 pl-5 is-placeholder" <div
class="profile-timeline-year-list js-profile-timeline-year-list bg-white float-right col-2 pl-5 is-placeholder"
style="visibility: hidden; display: none; height: 210px;"></div> style="visibility: hidden; display: none; height: 210px;"></div>
<div class="profile-timeline-year-list js-profile-timeline-year-list bg-white js-sticky float-right col-2 pl-5" <div
class="profile-timeline-year-list js-profile-timeline-year-list bg-white js-sticky float-right col-2 pl-5"
data-original-top="74px" style="position: static;"> data-original-top="74px" style="position: static;">
<ul class="filter-list small" id="year-list"> <ul class="filter-list small" id="year-list">
</ul> </ul>

View File

@@ -18,7 +18,8 @@
href="{{ .Permalink }}">{{ .Title }}</a></strong> href="{{ .Permalink }}">{{ .Title }}</a></strong>
<div class="d-block text-small text-gray"> <div class="d-block text-small text-gray">
Created <time-ago datetime="{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap"> Created <time-ago datetime="{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}"
class="no-wrap">
Mon, 02 Jan 2006 15:04:05 -0700</time-ago> Mon, 02 Jan 2006 15:04:05 -0700</time-ago>
<span class="file-info-divider"></span> <span class="file-info-divider"></span>
Modified <time-ago datetime="{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap"> Modified <time-ago datetime="{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap">

View File

@@ -5,23 +5,7 @@
<div class="col-lg-9 col-md-8 col-12 float-md-left pl-md-2"> <div class="col-lg-9 col-md-8 col-12 float-md-left pl-md-2">
<div class="UnderlineNav width-full user-profile-nav top-0 is-placeholder" <div class="UnderlineNav width-full user-profile-nav top-0 is-placeholder"
style="visibility: hidden; display: none; height: 56px;"></div> style="visibility: hidden; display: none; height: 56px;"></div>
<div class="UnderlineNav width-full user-profile-nav js-sticky top-0"
style="position: static; top: 0px; left: 330.5px; width: 911.5px;">
<nav class="UnderlineNav-body" aria-label="User profile">
<a aria-current="page" class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}">
Overview
</a>
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 selected" href="{{ absURL "posts/" }}">
Posts
<span class="Counter hide-lg hide-md hide-sm">
{{ $section_count}}
</span>
</a>
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ absURL "about/" }}">
About
</a>
</nav>
</div>
<div class="position-relative"> <div class="position-relative">
<div id="user-repositories-list"> <div id="user-repositories-list">
@@ -50,8 +34,7 @@
<div class="paginate-container"> <div class="paginate-container">
<div class="BtnGroup" data-test-selector="pagination"> <div class="BtnGroup" data-test-selector="pagination">
{{ if .Paginator.HasPrev }} {{ if .Paginator.HasPrev }}
<a rel="nofollow" class="btn btn-outline BtnGroup-item" <a rel="nofollow" class="btn btn-outline BtnGroup-item" href="{{ .Paginator.Prev.URL }}">Previous</a>
href="{{ .Paginator.Prev.URL }}">Previous</a>
{{ else }} {{ else }}
<button class="btn btn-outline BtnGroup-item" disabled="disabled">Previous</button> <button class="btn btn-outline BtnGroup-item" disabled="disabled">Previous</button>
{{ end }} {{ end }}

View File

@@ -1,115 +1,106 @@
<div class="h-card col-lg-3 col-md-4 col-12 float-md-left pr-md-3 pr-xl-6" itemscope {{ partial "menus.html" . }}
itemtype="http://schema.org/Person"> <div class="container-xl px-3 px-md-4 px-lg-5">
<div class="user-profile-sticky-bar js-user-profile-sticky-bar"> <div class="gutter-condensed gutter-lg flex-column flex-md-row d-flex">
</div> <div class="flex-shrink-0 col-12 col-md-3 mb-4 mb-md-0">
<div class="clearfix mb-2"> <div class="h-card mt-md-n5">
<div class="float-left col-3 col-md-12 pr-3 pr-md-0"> <div class="clearfix d-flex d-md-block flex-items-center mb-4 mb-md-0">
<div class="position-relative d-inline-block col-2 col-md-12 mr-3 mr-md-0 flex-shrink-0" style="z-index:4;">
{{ with $.Site.Params.avatar }} {{ with $.Site.Params.avatar }}
<a itemprop="image" class="u-photo d-block position-relative" aria-hidden="true" <a href="{{ $.Site.Params.avatar }}">
href="{{ $.Site.Params.avatar }}"> <img style="height:auto;" alt="Avatar" width="260" height="260"
<img alt="" width="260" height="260" class="avatar avatar-user width-full border bg-white" src="{{ $.Site.Params.avatar }}">
class="avatar width-full height-full rounded-2" src="{{ $.Site.Params.avatar }}" />
</a> </a>
{{ else }} {{ else }}
<a itemprop="image" class="u-photo d-block position-relative" aria-hidden="true" <a href="{{ "images/avatar.png" | absURL }}">
href="{{ "images/avatar.png" | absURL }}"> <img style="height:auto;" alt="Avatar" width="260" height="260"
class="avatar avatar-user width-full border bg-white" src="{{ "images/avatar.png" | absURL }}">
<img alt="" width="260" height="260"
class="avatar width-full height-full rounded-2" src="{{ "images/avatar.png" | absURL }}" />
</a> </a>
{{ end }} {{ end }}
</div> </div>
<div class="float-left col-9 col-md-12 pl-2 pl-md-0">
<div class="vcard-names-container pt-1 pt-md-3 pb-1 pb-md-3 js-sticky js-user-profile-sticky-fields"> <div
<h1 class="vcard-names"> class="vcard-names-container float-left col-10 col-md-12 pt-1 pt-md-3 pb-1 pb-md-3 js-sticky js-user-profile-sticky-fields"
<span class="p-name vcard-fullname d-block overflow-hidden" data-original-top="0px" style="position: sticky;">
itemprop="name">{{ .Site.Params.author }}</span> <h1 class="vcard-names pl-2 pl-md-0">
<span class="p-nickname vcard-username d-block" <span class="p-name vcard-fullname d-block overflow-hidden">{{ .Site.Params.author }}</span>
itemprop="additionalName">{{ .Site.Params.github }}</span> {{ if .Site.Params.github }}
<span class="p-nickname vcard-username d-block">{{ .Site.Params.github }}</span>
{{ end }}
</h1> </h1>
</div> </div>
</div>
<div class="d-none d-md-block"> <div class="p-note user-profile-bio mb-3 js-user-profile-bio f4">
<div class="js-profile-editable-area">
<div class="p-note user-profile-bio js-user-profile-bio">
<div>{{ .Site.Params.Description }}</div> <div>{{ .Site.Params.Description }}</div>
</div> </div>
<ul class="vcard-details mb-3">
{{ if .Site.Params.email }} <div class="d-flex flex-column">
<li itemprop="email" aria-label="Email: {{ .Site.Params.Email }}" <div class="js-profile-editable-area d-flex flex-column d-md-block">
class="vcard-detail pt-1 css-truncate css-truncate-target"><svg class="octicon octicon-mail" <ul class="vcard-details">
viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"> {{ if .Site.Params.location }}
<li class="vcard-detail pt-1 css-truncate css-truncate-target hide-sm hide-md">
<svg class="octicon octicon-location" viewBox="0 0 16 16" version="1.1" width="16" height="16">
<path fill-rule="evenodd" <path fill-rule="evenodd"
d="M0 4v8c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1H1c-.55 0-1 .45-1 1zm13 0L7 9 1 4h12zM1 5.5l4 3-4 3v-6zM2 12l3.5-3L7 10.5 8.5 9l3.5 3H2zm11-.5l-4-3 4-3v6z" /> d="M11.536 3.464a5 5 0 010 7.072L8 14.07l-3.536-3.535a5 5 0 117.072-7.072v.001zm1.06 8.132a6.5 6.5 0 10-9.192 0l3.535 3.536a1.5 1.5 0 002.122 0l3.535-3.536zM8 9a2 2 0 100-4 2 2 0 000 4z">
</path>
</svg> </svg>
<a class="u-email " href="mailto:{{ .Site.Params.Email }}">{{ .Site.Params.Email }}</a> <span class="p-label">{{ .Site.Params.location }}</span>
</li> </li>
{{ end }} {{ end }}
<li itemprop="url" data-test-selector="profile-website-url" {{ if .Site.Params.email }}
class="vcard-detail pt-1 css-truncate css-truncate-target"><svg class="octicon octicon-link" <li class="vcard-detail pt-1 css-truncate css-truncate-target ">
viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"> <svg class="octicon octicon-mail" viewBox="0 0 16 16" version="1.1" width="16" height="16">
<path fill-rule="evenodd" <path fill-rule="evenodd"
d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"> d="M1.75 2A1.75 1.75 0 000 3.75v.736a.75.75 0 000 .027v7.737C0 13.216.784 14 1.75 14h12.5A1.75 1.75 0 0016 12.25v-8.5A1.75 1.75 0 0014.25 2H1.75zM14.5 4.07v-.32a.25.25 0 00-.25-.25H1.75a.25.25 0 00-.25.25v.32L8 7.88l6.5-3.81zm-13 1.74v6.441c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25V5.809L8.38 9.397a.75.75 0 01-.76 0L1.5 5.809z">
</path>
</svg>
<a class="u-email link-gray-dark " href="mailto:{{ .Site.Params.Email }}">{{ .Site.Params.Email }}</a>
</li>
{{ end }}
<li class="vcard-detail pt-1 css-truncate css-truncate-target ">
<svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16">
<path fill-rule="evenodd"
d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z">
</path> </path>
</svg> </svg>
{{ if .Site.Params.url }} {{ if .Site.Params.url }}
<a rel="nofollow me" href="{{ .Site.Params.url }}">{{ .Site.Params.url }}</a> <a rel="nofollow me" class="link-gray-dark" href="{{ .Site.Params.url }}">{{ .Site.Params.url }}</a>
{{ else }} {{ else }}
<a rel="nofollow me" href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a> <a rel="nofollow me" class="link-gray-dark" href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a>
{{ end }} {{ end }}
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="border-top py-3 clearfix hide-sm hide-md"> <div class="border-top color-border-secondary pt-3 mt-3 clearfix hide-sm hide-md">
<h2 class="mb-1 h4">Organizations</h2> <h2 class="mb-2 h4">Organizations</h2>
{{ if .Site.Params.github}} {{ if .Site.Params.github}}
<a class="avatar-group-item" data-hovercard-type="organization" <a class="avatar-group-item" href="https://github.com/{{ .Site.Params.github }}">
href="https://github.com/{{ .Site.Params.github }}"> <img alt="@github" width="32" height="32" src="{{ "images/github.png" | absURL }}" class="avatar">
<svg width="35" height="35" class="avatar github-octicon" viewBox="0 0 16 16" version="1.1"
aria-hidden="true">
<path fill-rule="evenodd"
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z">
</path>
</svg>
</a> </a>
{{ end }} {{ end }}
{{ if .Site.Params.misskey}}
<a class="avatar-group-item" data-hovercard-type="organization"
href="{{ .Site.Params.misskey }}">
<img src="{{ "images/misskey.png" | absURL }}" class="avatar" width="35" height="35">
</a>
{{ end }}
{{ if .Site.Params.mastodon}}
<a class="avatar-group-item" data-hovercard-type="organization"
href="{{ .Site.Params.mastodon }}">
<img src="{{ "images/mastodon.png" | absURL }}" class="avatar" width="35" height="35">
</a>
{{ end }}
{{ if .Site.Params.facebook}}
<a class="avatar-group-item" data-hovercard-type="organization"
href="https://facebook.com/{{ .Site.Params.facebook }}">
<img src="{{ "images/facebook.png" | absURL }}" class="avatar" width="35" height="35">
</a>
{{ end }}
{{ if .Site.Params.Twitter}}
<a class="avatar-group-item" data-hovercard-type="organization"
href="https://twitter.com/{{ .Site.Params.Twitter }}">
<img src="{{ "images/twitter.png" | absURL }}" class="avatar" width="35" height="35">
</a>
{{ end }}
<a class="avatar-group-item" data-hovercard-type="organization"
href="{{ "posts/index.xml" | absURL }}">
<img src="{{ "images/rss.png" | absURL }}" class="avatar" width="38" height="38">
</a>
</div>
<div data-test-selector="profile-sponsorships"> {{ if .Site.Params.twitter}}
<a class="avatar-group-item" href="https://github.com/{{ .Site.Params.twitter }}">
<img alt="@twitter" width="32" height="32" src="{{ "images/twitter.png" | absURL }}" class="avatar">
</a>
{{ end }}
{{ if .Site.Params.facebook}}
<a class="avatar-group-item" href="https://github.com/{{ .Site.Params.facebook }}">
<img alt="@facebook" width="32" height="32" src="{{ "images/facebook.png" | absURL }}" class="avatar">
</a>
{{ end }}
{{ if .Site.Params.rss }}
<a class="avatar-group-item" href="{{ "posts/index.xml" | absURL }}">
<img alt="@rss" width="32" height="32" src="{{ "images/rss.png" | absURL }}" class="avatar">
</a>
{{ end }}
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,4 +1,4 @@
[data-theme=dark] { [data-color-mode=dark] {
--body-background-color: #000; --body-background-color: #000;
--color-actions-workflow-table-sticky-bg: rgba(13, 17, 23, 0.95); --color-actions-workflow-table-sticky-bg: rgba(13, 17, 23, 0.95);
--color-alert-error-bg: rgba(248, 81, 73, 0.1); --color-alert-error-bg: rgba(248, 81, 73, 0.1);

18
static/css/frameworks.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,5 @@
body { body {
margin: 0; margin: 0;
background-color: var(--body-background-color);
} }
.Header { .Header {
@@ -107,3 +106,12 @@ body {
background-color: var(--color-profile-color-modes-toggle-thumb-bg); background-color: var(--color-profile-color-modes-toggle-thumb-bg);
cursor: pointer; cursor: pointer;
} }
.no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

6
static/css/github.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,26 +1,2 @@
function switchTheme() {
const currentStyle = currentTheme();
if (currentStyle == 'light') {
setTheme('dark');
}
else {
setTheme('light');
}
}
function setTheme(style) {
console.log(`set theme ${style}`);
document.documentElement.setAttribute('data-theme', style);
localStorage.setItem('data-theme', style);
}
function currentTheme() {
const localStyle = localStorage.getItem('data-theme');
const systemStyle = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
return localStyle || systemStyle;
}
(() => { (() => {
setTheme(currentTheme());
})(); })();

29
static/js/theme-mode.js Normal file
View File

@@ -0,0 +1,29 @@
function switchTheme() {
const currentStyle = currentTheme();
if (currentStyle == 'light') {
setTheme('dark');
}
else {
setTheme('light');
}
}
function setTheme(style) {
console.log(`set theme ${style}`);
document.querySelectorAll('.isInitialToggle').forEach(elem => {
elem.classList.remove('isInitialToggle');
});
document.documentElement.setAttribute('data-color-mode', style);
localStorage.setItem('data-color-mode', style);
}
function currentTheme() {
const localStyle = localStorage.getItem('data-color-mode');
const systemStyle = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
return localStyle || systemStyle;
}
(() => {
setTheme(currentTheme());
})();