-
Notifications
You must be signed in to change notification settings - Fork 34
Responsive News App #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joelamb
wants to merge
40
commits into
constructorlabs:master
Choose a base branch
from
joelamb:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
af2b898
add html placeholder elements
joelamb 2ad6942
add FF Meta VF to style.css
joelamb 923c964
create article and add to timeline
joelamb ff0073b
add articles to timeline
joelamb 882ef3b
time elapsed since publication with conditional plurals
joelamb 3e90cbf
refactor
joelamb 0d3ebdd
initialise and set News API URL
joelamb 7a09181
pagination
joelamb abf877f
search
joelamb a06f16c
stop pagination nav beyond last page
joelamb 90d767b
data filter to prevent stories without images or description loading
joelamb ba9410a
prevent empty search query submission
joelamb afd29f3
category navigation
joelamb 7c74fbf
category nav refactoring
joelamb 4933c62
search refactoring
joelamb bea0c24
mobile styling
joelamb 0db9706
iPad styling
joelamb 4f03b4d
iPad styling grid adjustment
joelamb 9495ccb
iPad styling and functionality
joelamb 5ec3fd2
desktop layout
joelamb 60be008
generate and style popular stories sidebar
joelamb 296acf4
redact Trump news
joelamb b76f729
italic styling with font-variant-settings
joelamb 31f7d78
Comment and clean up
joelamb 5b39150
comments and clean up
joelamb 4e22bda
redact trump images with cute kitten
joelamb bc3aba7
Documentation of App features
joelamb 093a026
refactoring redact behaviour
joelamb ba37237
comment out image redact function
joelamb 50c443c
pagingation fix on category view
joelamb 3c28911
category navigation
joelamb 0ed0833
Procfile
joelamb 2d91a32
demo link in README
joelamb dd670c1
Delete Procfile
joelamb cca4bae
Create now.json
joelamb 982b54e
Merge pull request #1 from joelamb/joelamb-now-1
joelamb 8828a9a
Revert "Create now.json"
joelamb af8b026
Merge pull request #2 from joelamb/revert-1-joelamb-now-1
joelamb 1cfc435
Create now.json
joelamb a2d4129
Merge pull request #3 from joelamb/joelamb-now-1
joelamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,57 @@ | ||
| # Responsive News Reader | ||
|
|
||
| Let's create a responsive news reader website. To get the latest news the app will display we are going to use [News API](https://newsapi.org/). As with the Weather and Unsplash APIs, you will need to register with the service to obtain an API key. | ||
| ## A responsive news website. Powered by [News API](https://newsapi.org/). | ||
| --- | ||
| > [View live demo](https://joelamb.github.io/update-live/) | ||
|
|
||
| ## Objectives | ||
| ## Features | ||
|
|
||
| - [ ] Create a responsive layout that works well and looks good at mobile, tablet and desktop screen sizes. Please create the mobile version first, then tablet and then desktop. | ||
| - A responsive mobile-first layout that works well and looks good at mobile, tablet and desktop screen sizes. | ||
|
|
||
| - [ ] Fetch news articles from News API and display them including title, image, description, publication, date and link to article. | ||
| - News articles fetched from News API and displayed. Each story includes title, image, description, publication source, publication date and a link to the original article. | ||
|
|
||
| - [ ] Display images for tablet and desktop screens only | ||
| - Publication date is shown as time elapsed since publication of the story. | ||
|
|
||
| - [ ] Implement a feature of your choice | ||
| - Images only display on tablet and desktop screens. | ||
|
|
||
| ## Stretch goals | ||
| - Category navigation allows the user to see the top stories in Entertainment, Science, Technology, Health, Food & Cycling. | ||
|
|
||
| - [ ] Implement pagination which allows you to get the next 20 results and display them | ||
| - Pagination links at the foot of the page allow the user to see the next page of results. The current page number and total number of available pages are also displayed. | ||
|
|
||
| - [ ] Add search functionality which allows the user to retrieve news about a particular topic | ||
| - Search functionality to allows the user to retrieve news about a particular topic. | ||
|
|
||
| ## Instructions | ||
| - Sidebar of most popular stories from the _Daily Mail_ | ||
|
|
||
| - Fork and clone this repo | ||
| - Commit your changes frequently with short and descriptive commit messages | ||
| - Create a pull request when complete | ||
| - We want to see great looking webpages | ||
| - Your code should have consistent indentation and sensible naming | ||
| - Use lots of concise functions with a clear purpose | ||
| - Add code comments where it is not immediately obvious what your code does | ||
| - Your code should not throw errors and handle edge cases gracefully. For example not break if server fails to return expected results | ||
| - Hidden redact feature when the user searches for 'Trump' | ||
|
|
||
| ## README.md | ||
| ## Code | ||
|
|
||
| When finished, include a README.md in your repo. This should explain what the project is, how to run it and how to use it. Someone who is not familiar with the project should be able to look at it and understand what it is and what to do with it. | ||
| - Clean, well-commented code. | ||
|
|
||
| - Concise functions, each with a clear purpose. | ||
|
|
||
| - `redact()` function wraps any 5,6,8 or 9 character word in the headline and story with a `<span>` when the user types 'Trump' in the search query input. | ||
|
|
||
| - `cleanData()` function takes the data returned by the News API and filters out any stories that do not have an image link or content in the 'description' field. | ||
|
|
||
| ## Performance | ||
|
|
||
| - Using `window.innerWidth`, images only load in the tablet and desktop views. | ||
|
|
||
| ## CSS | ||
|
|
||
| - Clean, well commented CSS. | ||
|
|
||
| - Font used throughout is FF Meta a new Variable Font based on the original typeface designed by Erik Spiekermann. | ||
|
|
||
| - Grid CSS used to layout tablet and desktop views. | ||
|
|
||
| ## To Do | ||
|
|
||
| - Error handling to get App to handle edge cases gracefully, alerting the user if there is an error. | ||
|
|
||
| - Sanitise news feed to detect broken image links. | ||
|
|
||
| - Give the user the choice of where they get most popular stories from in the sidebar. | ||
|
|
||
| - Redact 'Trump' search images. Add a class with CSS brightness filter of either 0 or 1 to randomly black out images. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
| <title>Update - News Reader</title> | ||
| <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" | ||
| crossorigin="anonymous"> | ||
| <link rel="stylesheet" href="style.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <header class='hero'> | ||
| <h1 class='hero__title'>Upd<i class="fas fa-broadcast-tower"></i>te <span>Live<i class="far fa-window-minimize"></i></span></h1> | ||
| <p class='hero__date'>Saturday</p> | ||
| </header> | ||
| <nav class="category-nav"> | ||
| <ul> | ||
| <li class="category category-general current">top stories</li> | ||
| <li class="category category-entertainment">entertainment</li> | ||
| <li class="category category-science">science</li> | ||
| <li class="category category-tech">technology</li> | ||
|
|
||
| <li class="category category-health">health</li> | ||
| <li class="category category-food">food</li> | ||
| <li class="category category-cycling">cycling</li> | ||
| </ul> | ||
| </nav> | ||
| <section class="search"> | ||
| <form class="search--form"> | ||
| <label for="search--query">Search</label> | ||
| <input type="text" name="search-query" id="search--query" placeholder="Type your search query..."> | ||
| </form> | ||
| </section> | ||
| <section class='news'> | ||
| <aside class="popular"> | ||
| <h2><em>Daily Mail</em><br /> Sidebar of Shame</h2> | ||
|
|
||
| </aside> | ||
| <nav class="page-nav"> | ||
| <button class="prev">←</button> | ||
| <p class="page-num">Page <span class="page-current">1</span> of <span class="page-total"></span></p> | ||
| <button class="next">→</button> | ||
| </nav> | ||
| </section> | ||
|
|
||
|
|
||
|
|
||
| <footer class='legals'> | ||
| <p class='legals__copyright'>© 2018 Joe Lamb</p> | ||
| <p class='legals__credit'>Powered by <a href="https://newsapi.org/">NewsAPI.org</a></p> | ||
| </footer> | ||
|
|
||
| <script src="index.js"></script> | ||
|
|
||
| </body> | ||
|
|
||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great README