Minor UI improvements
This commit is contained in:
parent
7fb27e728c
commit
42762d944b
15
css/main.css
15
css/main.css
@ -50,7 +50,7 @@ body[data-theme=dark] ::-webkit-calendar-picker-indicator {
|
|||||||
p,
|
p,
|
||||||
strong {
|
strong {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
max-width: 70ch;
|
max-width: 65ch;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
color: rgba(var(--text-color), 0.8);
|
color: rgba(var(--text-color), 0.8);
|
||||||
}
|
}
|
||||||
@ -685,8 +685,9 @@ theme-toggle {
|
|||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
.article-card__category {
|
.article-card__category {
|
||||||
background-color: rgba(var(--text-color), 0.1);
|
border: solid thin rgba(var(--text-color), 0.3);
|
||||||
border-radius: 0.3rem;
|
margin-right: 0.5rem;
|
||||||
|
border-radius: 1rem;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
padding: 0.3rem 0.6rem;
|
padding: 0.3rem 0.6rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@ -785,6 +786,10 @@ theme-toggle {
|
|||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#article_summary:not(:empty) {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
#article_contributors {
|
#article_contributors {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.3rem;
|
gap: 0.3rem;
|
||||||
@ -1175,6 +1180,10 @@ theme-toggle {
|
|||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#article_body {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.request-card {
|
.request-card {
|
||||||
grid-template-columns: 1fr auto;
|
grid-template-columns: 1fr auto;
|
||||||
}
|
}
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -54,7 +54,7 @@ body[data-theme="dark"] {
|
|||||||
p,
|
p,
|
||||||
strong {
|
strong {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
max-width: 70ch;
|
max-width: 65ch;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
color: rgba(var(--text-color), 0.8);
|
color: rgba(var(--text-color), 0.8);
|
||||||
|
|
||||||
@ -649,8 +649,9 @@ theme-toggle {
|
|||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
&__category {
|
&__category {
|
||||||
background-color: rgba(var(--text-color), 0.1);
|
border: solid thin rgba(var(--text-color), 0.3);
|
||||||
border-radius: 0.3rem;
|
margin-right: 0.5rem;
|
||||||
|
border-radius: 1rem;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
padding: 0.3rem 0.6rem;
|
padding: 0.3rem 0.6rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@ -746,6 +747,9 @@ theme-toggle {
|
|||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
}
|
}
|
||||||
|
#article_summary:not(:empty) {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
#article_contributors {
|
#article_contributors {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.3rem;
|
gap: 0.3rem;
|
||||||
@ -1113,6 +1117,9 @@ theme-toggle {
|
|||||||
position: relative;
|
position: relative;
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
|
#article_body {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.request-card {
|
.request-card {
|
||||||
grid-template-columns: 1fr auto;
|
grid-template-columns: 1fr auto;
|
||||||
|
|||||||
35
index.html
35
index.html
@ -234,13 +234,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
<main class="grid gap-2">
|
<main class="grid gap-2">
|
||||||
<section class="hero-section">
|
<header class="hero-section">
|
||||||
<h1 id="article_title"></h1>
|
<h1 id="article_title"></h1>
|
||||||
|
<p id="article_summary"></p>
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<time id="published_time"></time>
|
<time id="published_time"></time>
|
||||||
<span class="bullet-point"></span><span id="reading_time" style="white-space: nowrap;"></span>
|
<span class="bullet-point"></span><span id="reading_time" style="white-space: nowrap;"></span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</header>
|
||||||
<details id="article_map_accordion" class="hide-on-desktop">
|
<details id="article_map_accordion" class="hide-on-desktop">
|
||||||
<summary class="space-between">
|
<summary class="space-between">
|
||||||
<h4>In this article</h4>
|
<h4>In this article</h4>
|
||||||
@ -538,27 +539,27 @@
|
|||||||
</sm-popup>
|
</sm-popup>
|
||||||
<template id="trending_article_template">
|
<template id="trending_article_template">
|
||||||
<div class="trending-article grid gap-0-5">
|
<div class="trending-article grid gap-0-5">
|
||||||
<a href="" class="article-card__category"></a>
|
|
||||||
<a class="article-card--highlight grid gap-0-5" href="" style="color: inherit">
|
<a class="article-card--highlight grid gap-0-5" href="" style="color: inherit">
|
||||||
<h3 class="trending-article__title"></h3>
|
<h3 class="trending-article__title"></h3>
|
||||||
<div class="flex">
|
|
||||||
<span class="trending-article__read-time h5"></span><span class="bullet-point"></span><time
|
|
||||||
class="trending-article__published h5"></time>
|
|
||||||
</div>
|
|
||||||
<p class="trending-article__summary"></p>
|
<p class="trending-article__summary"></p>
|
||||||
</a>
|
</a>
|
||||||
|
<div class="flex align-center" style="margin-top: 0.3rem;">
|
||||||
|
<a href="" class="article-card__category interact"></a>
|
||||||
|
<span class="trending-article__read-time h5"></span><span class="bullet-point"></span><time
|
||||||
|
class="trending-article__published h5"></time>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template id="article_card_template">
|
<template id="article_card_template">
|
||||||
<li class="article-card grid">
|
<li class="article-card grid">
|
||||||
<a href="" class="article-card__category interact"></a>
|
|
||||||
<a href="" class="grid article-link">
|
<a href="" class="grid article-link">
|
||||||
<h4 class="article-card__title"></h4>
|
<h4 class="article-card__title"></h4>
|
||||||
<div class="flex">
|
|
||||||
<span class="article-card__read-time"></span><span class="bullet-point"></span>
|
|
||||||
<time class="article-card__published"></time>
|
|
||||||
</div>
|
|
||||||
</a>
|
</a>
|
||||||
|
<div class="flex align-center" style="margin-top: 0.3rem;">
|
||||||
|
<a href="" class="article-card__category interact"></a>
|
||||||
|
<span class="article-card__read-time"></span><span class="bullet-point"></span>
|
||||||
|
<time class="article-card__published"></time>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
<template id="article_row_template">
|
<template id="article_row_template">
|
||||||
@ -759,11 +760,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('popupopened', e => {
|
document.addEventListener('popupopened', e => {
|
||||||
// switch (e.target.id) {
|
|
||||||
// case 'preview_popup':
|
|
||||||
// getRef('preview_container').innerHTML = ''
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
document.addEventListener('popupclosed', e => {
|
document.addEventListener('popupclosed', e => {
|
||||||
zIndex--
|
zIndex--
|
||||||
@ -1218,11 +1214,12 @@
|
|||||||
async function renderArticle(articleID, firstLoad = true) {
|
async function renderArticle(articleID, firstLoad = true) {
|
||||||
const frag = document.createDocumentFragment()
|
const frag = document.createDocumentFragment()
|
||||||
const allArticles = await compactIDB.readData('appObjects', 'articlesContent')
|
const allArticles = await compactIDB.readData('appObjects', 'articlesContent')
|
||||||
const { title, published, readTime, contributors, updated } = floGlobals.appObjects.rmTimes.articles[articleID]
|
const { title, published, readTime, contributors, updated, summary } = floGlobals.appObjects.rmTimes.articles[articleID]
|
||||||
getRef('article_title').textContent = title
|
getRef('article_title').textContent = title
|
||||||
|
getRef('article_summary').textContent = summary
|
||||||
getRef('published_time').textContent = `Published ${getFormattedTime(published, 'date-only')}${updated ? `, Updated ${relativeTime.from(updated)}` : ''}`
|
getRef('published_time').textContent = `Published ${getFormattedTime(published, 'date-only')}${updated ? `, Updated ${relativeTime.from(updated)}` : ''}`
|
||||||
getRef('reading_time').textContent = `${readTime} Min read`
|
getRef('reading_time').textContent = `${readTime} Min read`
|
||||||
getRef('article_body').innerHTML = allArticles[articleID]
|
getRef('article_body').innerHTML = DOMPurify.sanitize(allArticles[articleID])
|
||||||
getRef('article_body').querySelectorAll('h3').forEach(heading => {
|
getRef('article_body').querySelectorAll('h3').forEach(heading => {
|
||||||
const headingText = heading.textContent
|
const headingText = heading.textContent
|
||||||
const headingID = `s${floCrypto.randString(8)}`
|
const headingID = `s${floCrypto.randString(8)}`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user