mirror of
https://github.com/wassname/template.git
synced 2026-07-11 22:52:17 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49deb31aeb | |||
| b5a00b7f43 | |||
| 0f8f0f5962 | |||
| 094f0d4c58 | |||
| cd4594f320 | |||
| be585691c5 | |||
| b25fd66fd7 | |||
| 010eed6280 | |||
| 3a643ab7ad |
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "distill-template",
|
"name": "distill-template",
|
||||||
"version": "2.2.10",
|
"version": "2.2.13",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "distill-template",
|
"name": "distill-template",
|
||||||
"version": "2.2.10",
|
"version": "2.2.13",
|
||||||
"description": "Template for creating Distill articles.",
|
"description": "Template for creating Distill articles.",
|
||||||
"main": "dist/template.v2.js",
|
"main": "dist/template.v2.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"url": "https://github.com/distillpub/distill-template/issues"
|
"url": "https://github.com/distillpub/distill-template/issues"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "rollup -c rollup.config.dev.js -w",
|
"dev": "rollup -c rollup.config.dev.js -w",
|
||||||
"serve": "python3 -m http.server --bind 127.0.0.1 8888",
|
"serve": "python3 -m http.server --bind 127.0.0.1 8888",
|
||||||
"test": "mocha",
|
"test": "mocha",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { Template } from '../mixins/template';
|
import { Template } from '../mixins/template';
|
||||||
import { body } from '../helpers/layout';
|
|
||||||
|
|
||||||
const T = Template('d-appendix', `
|
const T = Template('d-appendix', `
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
d-appendix {
|
d-appendix {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
line-height: 1.7em;
|
line-height: 1.7em;
|
||||||
margin-top: 60px;
|
margin-top: 60px;
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import { bibliography_cite } from '../helpers/citation';
|
|||||||
|
|
||||||
const styles = `
|
const styles = `
|
||||||
d-citation-list {
|
d-citation-list {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d-citation-list .references {
|
d-citation-list .references {
|
||||||
|
|||||||
@@ -38,6 +38,21 @@ d-hover-box {
|
|||||||
margin-top: 1.9em;
|
margin-top: 1.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul li {
|
||||||
|
padding: 15px 10px 15px 10px;
|
||||||
|
border-bottom: 1px solid rgba(0,0,0,0.1)
|
||||||
|
}
|
||||||
|
|
||||||
|
ul li:last-of-type {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<d-hover-box id="hover-box"></d-hover-box>
|
<d-hover-box id="hover-box"></d-hover-box>
|
||||||
@@ -106,7 +121,9 @@ export class Cite extends T(HTMLElement) {
|
|||||||
|
|
||||||
set entries(entries) {
|
set entries(entries) {
|
||||||
if (this.hoverBox) {
|
if (this.hoverBox) {
|
||||||
this.hoverBox.innerHTML = entries.map(hover_cite).join('<br><br>');
|
this.hoverBox.innerHTML = `<ul>
|
||||||
|
${entries.map(hover_cite).map(html => `<li>${html}</li>`).join('\n')}
|
||||||
|
</ul>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ const T = Template('d-footnote-list', `
|
|||||||
<style>
|
<style>
|
||||||
|
|
||||||
d-footnote-list {
|
d-footnote-list {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d-footnote-list > * {
|
d-footnote-list > * {
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ const T = Template('d-hover-box', `
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.5em;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -27,11 +29,9 @@ const T = Template('d-hover-box', `
|
|||||||
background-color: rgb(250, 250, 250);
|
background-color: rgb(250, 250, 250);
|
||||||
box-shadow: 0 0 7px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 7px rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 10px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function renderTOC(element, headings) {
|
|||||||
<style>
|
<style>
|
||||||
|
|
||||||
d-toc {
|
d-toc {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import { serializeFrontmatterToBibtex } from '../helpers/bibtex';
|
|||||||
const styles = `
|
const styles = `
|
||||||
<style>
|
<style>
|
||||||
distill-appendix {
|
distill-appendix {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
distill-appendix .citation {
|
distill-appendix .citation {
|
||||||
|
|||||||
@@ -72,18 +72,14 @@ distill-header .nav a {
|
|||||||
${logo}
|
${logo}
|
||||||
Distill
|
Distill
|
||||||
</a>
|
</a>
|
||||||
<div class="nav">
|
<nav class="nav">
|
||||||
<a href="/about/">About</a>
|
<a href="/about/">About</a>
|
||||||
<a href="/prize/">Prize</a>
|
<a href="/prize/">Prize</a>
|
||||||
<a href="/journal/">Submit</a>
|
<a href="/journal/">Submit</a>
|
||||||
</div>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
`, false);
|
`, false);
|
||||||
|
|
||||||
// <div class="nav">
|
|
||||||
// <a href="https://github.com/distillpub">GitHub</a>
|
|
||||||
// <!-- https://twitter.com/distillpub -->
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
export class DistillHeader extends T(HTMLElement) {
|
export class DistillHeader extends T(HTMLElement) {
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ export function bibliography_cite(ent, fancy){
|
|||||||
export function hover_cite(ent){
|
export function hover_cite(ent){
|
||||||
if (ent){
|
if (ent){
|
||||||
var cite = '';
|
var cite = '';
|
||||||
cite += '<b>' + ent.title + '</b>';
|
cite += '<strong>' + ent.title + '</strong>';
|
||||||
cite += link_string(ent);
|
cite += link_string(ent);
|
||||||
cite += '<br>';
|
cite += '<br>';
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
d-article {
|
d-article {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
|
overflow-x: hidden;
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
padding-top: 2rem;
|
padding-top: 2rem;
|
||||||
color: rgba(0, 0, 0, 0.8);
|
color: rgba(0, 0, 0, 0.8);
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d-article > * {
|
d-article > * {
|
||||||
@@ -169,14 +169,29 @@ d-article span.equation-mimic {
|
|||||||
d-article > d-code,
|
d-article > d-code,
|
||||||
d-article section > d-code {
|
d-article section > d-code {
|
||||||
display: block;
|
display: block;
|
||||||
overflow-x: scroll;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d-article > d-math[block],
|
d-article > d-math[block],
|
||||||
d-article section > d-math[block] {
|
d-article section > d-math[block] {
|
||||||
display: block;
|
display: block;
|
||||||
overflow-x: scroll;
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
d-article > d-code,
|
||||||
|
d-article section > d-code,
|
||||||
|
d-article > d-math[block],
|
||||||
|
d-article section > d-math[block] {
|
||||||
|
overflow-x: scroll;
|
||||||
|
-ms-overflow-style: none; // IE 10+
|
||||||
|
overflow: -moz-scrollbars-none; // Firefox
|
||||||
|
}
|
||||||
|
|
||||||
|
d-article > d-code::-webkit-scrollbar,
|
||||||
|
d-article section > d-code::-webkit-scrollbar,
|
||||||
|
d-article > d-math[block]::-webkit-scrollbar,
|
||||||
|
d-article section > d-math[block]::-webkit-scrollbar {
|
||||||
|
display: none; // Safari and Chrome
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d-article .citation {
|
d-article .citation {
|
||||||
@@ -190,8 +205,7 @@ d-include {
|
|||||||
}
|
}
|
||||||
|
|
||||||
d-figure {
|
d-figure {
|
||||||
contain: content;
|
contain: layout style;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* KaTeX */
|
/* KaTeX */
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
d-byline {
|
d-byline {
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
||||||
contain: content;
|
contain: content;
|
||||||
|
overflow: hidden;
|
||||||
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
line-height: 1.8em;
|
line-height: 1.8em;
|
||||||
padding: 1.5rem 0;
|
padding: 1.5rem 0;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
d-title {
|
d-title {
|
||||||
padding: 2rem 0 1.5rem;
|
padding: 2rem 0 1.5rem;
|
||||||
contain: content;
|
contain: layout style;
|
||||||
overflow: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(min-width: 768px) {
|
@media(min-width: 768px) {
|
||||||
@@ -52,4 +52,4 @@ d-title .status span {
|
|||||||
border-bottom: 1px solid #80cbc4;
|
border-bottom: 1px solid #80cbc4;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ figcaption a {
|
|||||||
color: rgba(0, 0, 0, 0.6);
|
color: rgba(0, 0, 0, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
figcaption b {
|
figcaption b,
|
||||||
|
figcaption strong, {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: rgba(0, 0, 0, 1.0);
|
color: rgba(0, 0, 0, 1.0);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -181,6 +181,7 @@ export class Slider extends T(HTMLElement) {
|
|||||||
static get observedAttributes() {return ['min', 'max', 'value', 'step', 'ticks', 'origin', 'tickValues', 'tickLabels']; }
|
static get observedAttributes() {return ['min', 'max', 'value', 'step', 'ticks', 'origin', 'tickValues', 'tickLabels']; }
|
||||||
|
|
||||||
attributeChangedCallback(attr, oldValue, newValue) {
|
attributeChangedCallback(attr, oldValue, newValue) {
|
||||||
|
if (isNaN(newValue) || newValue === undefined || newValue === null) return;
|
||||||
if (attr == 'min') {
|
if (attr == 'min') {
|
||||||
this.min = +newValue;
|
this.min = +newValue;
|
||||||
this.setAttribute('aria-valuemin', this.min);
|
this.setAttribute('aria-valuemin', this.min);
|
||||||
@@ -194,7 +195,7 @@ export class Slider extends T(HTMLElement) {
|
|||||||
}
|
}
|
||||||
if (attr == 'origin') {
|
if (attr == 'origin') {
|
||||||
this.origin = +newValue;
|
this.origin = +newValue;
|
||||||
this.update(this.value);
|
// this.update(this.value);
|
||||||
}
|
}
|
||||||
if (attr == 'step') {
|
if (attr == 'step') {
|
||||||
if (newValue > 0) {
|
if (newValue > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user