Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
javierarce committed Oct 1, 2023
1 parent 94dbc9e commit 3686c14
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/rss.reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ class RSS extends HTMLElement {
connectedCallback() {
this.styles = document.createElement('style')
this.styles.innerHTML = `
rss-reader { display: block; margin: 0 0 0 0; }
::part(blog), ::part(entry) { text-decoration: none; color: #ffc107; text-decoration: underline; }
rss-reader { display: block; margin: 0 0 1em 0; }
::part(blog) { text-decoration: none; color: #ffc107; text-decoration: underline; }
::part(post) { opacity: 0; visibility: hidden; transition: opacity 250ms ease-in-out; }
::part(entry) { text-decoration: underline; }
::part(date) { font-size: 0.8em; }
rss-reader.is-loaded::part(post) { opacity: 0.4; visibility: visible; }
`
Expand All @@ -24,7 +23,7 @@ class RSS extends HTMLElement {
this.title = this.getAttribute("data-title")
this.author = this.getAttribute("data-author")

const title = document.createElement('div')
const title = document.createElement('span')
const blog = document.createElement('a')

blog.textContent = this.title
Expand Down Expand Up @@ -65,8 +64,11 @@ class RSS extends HTMLElement {
entryDate.textContent = ago ? ` ${ago} ago` : ''
entryDate.part = 'date'

entry.appendChild(entryDate)
this.shadow.appendChild(entry)
const titleElement = this.shadow.querySelector('span');
titleElement.appendChild(entryDate)

//entry.appendChild(entryDate)
//this.shadow.appendChild(entry)
this.classList.add('is-loaded')
}

Expand Down

0 comments on commit 3686c14

Please sign in to comment.