Skip to content

Slacker News App#10

Open
HTLuff wants to merge 3 commits into
constructorlabs:masterfrom
HTLuff:master
Open

Slacker News App#10
HTLuff wants to merge 3 commits into
constructorlabs:masterfrom
HTLuff:master

Conversation

@HTLuff
Copy link
Copy Markdown

@HTLuff HTLuff commented Jun 18, 2018

  • Lastest Tech News button
  • Invert colours button
  • Hide/Show description button

Comment thread assets/index.js
const appScreen = document.querySelector('#app');
const descriptionToggle = document.querySelector('#descrption-toggle');

function createURL(indvCategory){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like the helper function use

Comment thread assets/index.js
return `https://newsapi.org/v2/top-headlines?category=technology&country=gb&apiKey=${newAPIKey}&pagesize=5`;
}

function display(newsData){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

display logic nicely broken out into own function

Comment thread assets/index.js
const newsDesc = Array.from(document.getElementsByClassName('news-desc'));
if(descriptionToggle.className.match(/(?:|\s) toggle-on(?!\s)/)){
newsDesc.forEach(function(el){
el.className = el.className.replace(' toggle-on', '');
Copy link
Copy Markdown
Contributor

@dmitrigrabov dmitrigrabov Jul 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread assets/style.css
}

.clicked {
filter: invert(100%);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants