Fix non-working hover box; now in a weird in-between state, though.

This commit is contained in:
Ludwig Schubert
2017-10-10 12:30:36 -07:00
parent 044acd8f03
commit 0ab27e1382
7 changed files with 134 additions and 93 deletions
+47 -23
View File
@@ -4,31 +4,55 @@ import { HoverBox } from '../helpers/hover-box';
const T = Template('d-cite', `
<style>
.citation {
color: hsla(206, 90%, 20%, 0.7);
}
.citation-number {
cursor: default;
white-space: nowrap;
font-family: -apple-system, BlinkMacSystemFont, "Roboto", Helvetica, sans-serif;
font-size: 75%;
color: hsla(206, 90%, 20%, 0.7);
display: inline-block;
line-height: 1.1em;
text-align: center;
position: relative;
top: -2px;
margin: 0 2px;
}
figcaption .citation-number {
font-size: 11px;
font-weight: normal;
top: -2px;
line-height: 1em;
}
.citation {
color: hsla(206, 90%, 20%, 0.7);
}
.citation-number {
cursor: default;
white-space: nowrap;
font-family: -apple-system, BlinkMacSystemFont, "Roboto", Helvetica, sans-serif;
font-size: 75%;
color: hsla(206, 90%, 20%, 0.7);
display: inline-block;
line-height: 1.1em;
text-align: center;
position: relative;
top: -2px;
margin: 0 2px;
}
figcaption .citation-number {
font-size: 11px;
font-weight: normal;
top: -2px;
line-height: 1em;
}
.container {
position: fixed;
width: 100%;
left: 0;
z-index: 10000;
}
.dt-hover-box {
margin: 0 auto;
width: 400px;
max-width: 700px;
background-color: #FFF;
opacity: 0.95;
border: 1px solid rgba(0, 0, 0, 0.25);
padding: 8px 16px;
border-radius: 3px;
box-shadow: 0px 2px 10px 2px rgba(0, 0, 0, 0.2);
}
</style>
<div id="hover-box" class="dt-hover-box">
<div class="container">
<div id="hover-box" class="dt-hover-box"></div>
</div>
<span id="citation-" class="citation">
+31 -6
View File
@@ -8,14 +8,16 @@ d-math[block] {
display: block;
}
:host {
position: relative;
}
sup {
line-height: 1em;
font-size: 0.75em;
position: relative;
top: 0;
top: -.5em;
vertical-align: baseline;
position: relative;
top: -6px;
}
span {
@@ -23,13 +25,36 @@ span {
cursor: default;
}
.container {
position: fixed;
width: 100%;
left: 0;
z-index: 10000;
}
.dt-hover-box {
margin: 0 auto;
width: 400px;
max-width: 700px;
background-color: #FFF;
opacity: 0.95;
border: 1px solid rgba(0, 0, 0, 0.25);
padding: 8px 16px;
border-radius: 3px;
box-shadow: 0px 2px 10px 2px rgba(0, 0, 0, 0.2);
}
</style>
<div id="hover-box" class="dt-hover-box">
<slot id="slot"></slot>
<div class="container">
<div id="hover-box" class="dt-hover-box">
<slot></slot>
</div>
</div>
<sup><span id="fn-" data-hover-ref=""></span></sup>
<sup>
<span id="fn-" data-hover-ref=""></span>
</sup>
`);
+1 -13
View File
@@ -24,11 +24,6 @@ const T = Template('d-interstitial', `
}
.overlay.transparent {
background: hsla(0, 0%, 100%, 0.7);
transition: background 1s;
}
.container {
position: relative;
left: 25%;
@@ -93,20 +88,13 @@ export class Interstitial extends T(HTMLElement) {
connectedCallback() {
const passwordInput = this.root.querySelector('#interstitial-password-input');
passwordInput.oninput = (event) => this.passwordChanged(event);
setTimeout(() => {
this.article = document.querySelector('d-article');
this.article.style = 'filter: blur(15px)';
const overlay = this.root.querySelector('.overlay');
overlay.classList.add('transparent');
}, 500);
}
passwordChanged(event) {
const entered = event.target.value;
if (entered === this.password) {
console.log('Correct password entered.');
event.target.classList.add('right');
this.article.style = '';
event.target.classList.add('correct');
this.parentElement.removeChild(this);
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ const T = Template('d-title', `
}
</style>
<div class="status"><span>✓ Peer Reviewed</span></div>
<!-- <div class="status"><span>✓ Peer Reviewed</span></div> -->
<slot></slot>
`);