misc ui fixes:

- update logo, fix logo styling in docs
- fix terms modal
- embeds: add option to support 'deep-linking' into embed via hash
This commit is contained in:
Ilya Kreymer
2020-05-19 10:25:33 -07:00
parent 5014cff233
commit ab8e051ff0
9 changed files with 138 additions and 100 deletions
+32 -1
View File
@@ -13,6 +13,7 @@ class EmbedRWP extends LitElement
this.config = "";
this.coll = "";
this.paramString = null;
this.deepLink = false;
}
static get properties() {
@@ -28,7 +29,9 @@ class EmbedRWP extends LitElement
config: { type: String },
paramString: { type: String },
hashString: { type: String }
hashString: { type: String },
deepLink: { type: Boolean }
}
}
@@ -40,8 +43,36 @@ class EmbedRWP extends LitElement
if (event.data.title) {
this.title = event.data.title;
}
console.log(event.data);
if (!this.deepLink) {
return;
}
const currHash = new URLSearchParams({
url: event.data.url,
ts: event.data.ts,
});
window.location.hash = "#" + currHash.toString();
}
});
if (this.deepLink) {
this.updateFromHash();
window.addEventListener("hashchange", (event) => this.updateFromHash());
}
}
updateFromHash() {
const qs = new URLSearchParams(window.location.hash.slice(1));
if (qs.has("url")) {
this.url = qs.get("url");
}
if (qs.has("ts")) {
this.ts = qs.get("ts");
}
}
updated(changedProperties) {
+3 -4
View File
@@ -156,7 +156,7 @@ class AppMain extends LitElement
`}
${this.showTerms ? html`
<div class="modal is-active">
<div class="modal-background"></div>
<div class="modal-background" @click="${(e) => this.showTerms = false}"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Terms and Privacy</p>
@@ -172,7 +172,8 @@ class AppMain extends LitElement
<h3>Privacy</h3>
<p><b>No data is uploaded anywhere and no information is collected.</b></p>
<p>All content rendered stays directly in your browser.</p>
<p>All content rendered stays directly in your browser. When loading an archive from Google Drive,
the site may ask for account authorization to download the specified file only.</p>
<h4>Disclaimer of Warranties</h4>
<p>The application may not always be available. No guarantees!</p>
@@ -186,7 +187,6 @@ class AppMain extends LitElement
</div>
</section>
</div>
<button class="modal-close is-large" aria-label="close"></button>
</div>
` : ``} `
}
@@ -1818,7 +1818,6 @@ class WrReplayPage extends LitElement
</div>
</section>
</div>
<button class="modal-close is-large" aria-label="close"></button>
</div>
` : ``}
`;