Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cache/03f795bca894ed338ba4edbd8da70ad3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .cache/07dd276677047de0cd4aa683b8d4a4c8.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .cache/1b7a293038fda019199735fb6d4f16d9.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .cache/41f9d5c5556a7b96066432067b9dddbf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"img/news.jpeg","dependencies":[],"generated":{"js":"module.exports = \"/ec1c8d1de91f8ecbc7828407685ce312.jpeg\";"},"hash":"5b6f21f1e5279173145b3fe5337a1624","cacheData":{"env":{}}}
1 change: 1 addition & 0 deletions .cache/591b9936d02363e9f6edecbf68f7182a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"index.css","dependencies":[{"name":"_css_loader","parent":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/index.css","resolved":"/usr/local/lib/node_modules/parcel-bundler/src/builtins/css-loader.js"}],"generated":{"css":"* {\n box-sizing: inherit;\n}\n\nbody {\n box-sizing: border-box;\n margin: 0;\n font-family: \"Gill Sans\", \"Gill Sans MT\", Calibri, \"Trebuchet MS\", sans-serif;\n}\n\n.app {\n}\n\na:hover {\n text-decoration: underline;\n}\n\nnav {\n display: flex;\n height: 33px;\n color: black;\n margin-left: 10px;\n flex-direction: row;\n justify-content: space-between;\n}\n\nnav .logo {\n padding: 5px;\n width: 60px;\n height: auto;\n}\n\nnav #logo {\n height: 24px;\n width: 84px;\n}\n\nnav .navBar {\n display: flex;\n flex-direction: row;\n font-size: 1em;\n align-items: center;\n}\n\nnav .navBar a {\n padding: 10px 8px 8px 8px;\n color: #333;\n text-decoration: none;\n}\n\nnav .navBar a:hover {\n text-decoration: underline;\n}\n\nnav .homeNav {\n flex-grow: 2;\n border-left: 0.5px solid black;\n}\n\nnav .newsNav {\n flex-grow: 1;\n border-left: 0.5px solid black;\n}\n\nnav .moreNav {\n flex-grow: 1;\n border-left: 0.5px solid black;\n}\n\nnav .searchNav {\n flex-grow: 2;\n border-left: 0.5px solid black;\n}\n\nheader {\n display: flex;\n background-color: #bb1919;\n height: 58px;\n color: white;\n justify-content: space-between;\n}\n\nheader a {\n color: white;\n text-decoration: none;\n}\n\nheader h1 {\n font-size: 2.3em;\n font-weight: 400;\n}\n\nheader .NEWS {\n margin: 0 0 0 20px;\n}\n\nheader .menu {\n justify-content: flex-end;\n border: 0.5px solid #d2d2d2;\n border-radius: 3px;\n padding: 7px 10px 7px 10px;\n margin: 7px 10px 10px 0;\n height: 70%;\n}\n\nheader .menu a {\n padding: 15px 5px 0 5px;\n}\n\n.tab {\n display: flex;\n background-color: #bb1919;\n color: white;\n flex-direction: row;\n height: 40px;\n}\n.tab .latest-stories {\n flex-grow: 1;\n text-align: center;\n}\n\n.tab .most-read {\n background-color: #900;\n flex-grow: 1;\n text-align: center;\n}\n\n.tab h3 {\n font-size: 1em;\n font-weight: 300;\n}\n\n.tab h3:hover {\n text-decoration: underline;\n}\n\n.long-menu {\n display: none;\n}\n\n.location-menu {\n display: none;\n}\n\nmain {\n}\n\nmain h2 {\n font-weight: 600;\n}\n\nmain a {\n color: black;\n text-decoration: none;\n}\n\nmain a:visited {\n color: grey;\n}\n\nmain .story {\n border-top: 0.5px solid grey;\n padding: 1em 1em 1em 1em;\n}\n\nmain .story img {\n display: none;\n}\n\nmain .story:first-child {\n border-top: 0px solid black;\n}\n\nmain .story:first-child img {\n display: block;\n max-width: 100%;\n height: auto;\n}\n\nfooter {\n}\n\n@media (min-width: 600px) {\n body {\n }\n .app {\n width: auto;\n margin: auto;\n }\n\n nav {\n height: 45px;\n }\n\n nav .logo {\n display: inline-block;\n padding: 10px 0 0 5px;\n width: 60px;\n height: auto;\n }\n\n header .menu {\n display: none;\n }\n\n .tab {\n display: none;\n }\n\n .long-menu {\n display: flex;\n background-color: #bb1919;\n height: 40px;\n }\n\n .long-menu ul {\n display: flex;\n flex-direction: row;\n }\n\n .long-menu li {\n padding: 0 12px 0 12px;\n border-left: 0.5px solid grey;\n }\n\n .long-menu ul:first-child {\n border-left: 0px;\n }\n\n .long-menu a {\n color: white;\n list-style: none;\n text-decoration: none;\n }\n\n .long-menu a:hover {\n text-decoration: underline;\n }\n\n .location-menu {\n display: flex;\n height: 40px;\n }\n\n .location-menu ul {\n display: flex;\n flex-direction: row;\n }\n\n .location-menu li {\n padding: 0 12px 0 12px;\n border-left: 0.5px solid grey;\n }\n\n .location-menu li:first-of-type {\n border: 0px;\n }\n\n .location-menu a {\n color: black;\n list-style: none;\n text-decoration: none;\n }\n\n .location-menu a:hover {\n text-decoration: underline;\n }\n\n main {\n display: grid;\n grid-template-columns: auto auto auto;\n grid-template-rows: auto;\n }\n\n main h2 {\n font-size: 1em;\n font-weight: 600;\n }\n main p {\n font-size: 1em;\n }\n\n main .story {\n border: 0px;\n }\n\n main .story img {\n display: block;\n max-width: 100%;\n height: auto;\n }\n\n main .story:first-child {\n grid-column-start: 1;\n grid-column-end: 4;\n grid-row-end: 2;\n\n border-bottom: 0.5px solid grey;\n\n display: flex;\n\n flex-direction: row-reverse;\n }\n\n main .story:first-child .article-text {\n justify-content: flex-start;\n padding: 0 10px 0 0;\n }\n\n main .story:first-child h2 {\n font-size: 2em;\n font-weight: 700;\n }\n}\n\n@media (min-width: 900px) {\n .app {\n width: auto;\n margin: auto;\n }\n main {\n display: grid;\n grid-template-columns: auto auto auto auto;\n grid-template-rows: auto auto auto auto;\n }\n\n main .story:first-child {\n border-bottom: 0px solid grey;\n }\n}\n@media (min-width: 1000px) {\n .app {\n width: 1000px;\n margin: auto;\n }\n}\n","js":"\nvar reloadCSS = require('_css_loader');\nmodule.hot.dispose(reloadCSS);\nmodule.hot.accept(reloadCSS);"},"hash":"78e4e1b55c39dcca33f237fc6d1e18ea","cacheData":{"env":{}}}
1 change: 1 addition & 0 deletions .cache/7b969c33e40737a7208cbd622f6cdea9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"index.html","dependencies":[{"name":"./index.css","dynamic":true,"parent":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/index.html","resolved":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/index.css"},{"name":"./img/BBC-LOGO.png","dynamic":true,"parent":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/index.html","resolved":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/img/BBC-LOGO.png"},{"name":"./index.js","dynamic":true,"parent":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/index.html","resolved":"/Users/matthewcollier/Documents/Sites/constructor-labs/responsive-news-reader/index.js"}],"generated":{"html":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <link rel=\"stylesheet\" href=\"/f92313d23e50ec268f04e6c02f969aab.css\">\n <title>Home BBC News</title>\n</head>\n<body>\n <div class=\"app\">\n <nav>\n <div class=\"logo\">\n <img id=\"logo\" src=\"/d62f424794abe95dc8a4fbaa71419ce4.png\">\n </div>\n <div class=\"navBar\">\n <div class=\"homeNav\"><a href=\"#\">Home</a></div>\n <div class=\"newsNav\"><a href=\"#\">News</a></div>\n <div class=\"moreNav\"><a href=\"#\">More</a></div>\n <div class=\"searchNav\"><a href=\"#\">Search</a></div>\n \n </div></nav>\n <header>\n <div class=\"NEWS\">\n <h1>NEWS</h1>\n </div>\n <a href=\"#\">\n <div class=\"menu\">\n - Sections\n </div>\n </a>\n </header>\n <div class=\"tab\">\n <div class=\"latest-stories\">\n <h3>Latest Stories</h3>\n </div>\n <div class=\"most-read\">\n <h3>Most read</h3>\n </div>\n </div>\n <div class=\"long-menu\">\n <ul>\n <a href=\"#\"><li>Home</li></a>\n <a href=\"#\"><li>UK</li></a>\n <a href=\"#\"><li>World</li></a>\n <a href=\"#\"><li>Business</li></a>\n <a href=\"#\"><li>Politics</li></a>\n <a href=\"#\"><li>Tech</li></a>\n <a href=\"#\"><li>Science</li></a>\n <a href=\"#\"><li>Health</li></a>\n <a href=\"#\"><li>More</li></a>\n </ul>\n </div>\n <div class=\"location-menu\">\n <ul>\n <a href=\"#\"><li>England</li></a>\n <a href=\"#\"><li>N. Ireland</li></a>\n <a href=\"#\"><li>Scotland</li></a>\n <a href=\"#\"><li>Alba</li></a>\n <a href=\"#\"><li>Wales</li></a>\n <a href=\"#\"><li>Cymru</li></a>\n <a href=\"#\"><li>Local News</li></a>\n </ul>\n </div>\n <main>\n </main>\n\n\n <footer>\n <button id=\"switch-languages\" type=\"button\" name=\"Switch Language\">Switch to French</button>\n <button id=\"load-next-page\" type=\"button\" name=\"Load next page\">Load next page</button>\n <form>\n <input id=\"search-field\" type=\"search\" name=\"search\">\n <button id=\"search-button\" type=\"submit\" name=\"Load next page\">search</button>\n </form>\n </footer>\n</div>\n<script src=\"/c5e9165eb77c2ef7dd5d2d6fa140e609.js\"></script>\n</body>\n</html>\n"},"hash":"e15a9feeba2bdccc2e4937bbbcd3d1e9","cacheData":{}}
1 change: 1 addition & 0 deletions .cache/e81ad842f3f02e058f59a8578c523dc4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"img/BBC-LOGO.png","dependencies":[],"generated":{"js":"module.exports = \"/d62f424794abe95dc8a4fbaa71419ce4.png\";"},"hash":"5223417354f2a6b705722ccf43c55c87","cacheData":{"env":{}}}
1 change: 1 addition & 0 deletions .cache/f003a3633e04a198a5e318304fd16c11.json

Large diffs are not rendered by default.

40 changes: 2 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,5 @@
# 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/). You will need to register with the service to obtain an API key.
A project to get to grips with CSS grid and responsive layouts by recreating BBC.co.uk over desktop, tablet and mobile.

## Objectives

- [ ] 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.

- [ ] Fetch news articles from News API and display them including title, image, description, publication, date and link to article.

- [ ] Display images for tablet and desktop screens only

- [ ] Implement a feature of your choice

## Stretch goals

- [ ] Implement pagination which allows you to get the next 20 results and display them

- [ ] Add search functionality which allows the user to retrieve news about a particular topic

## Instructions

- 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

## Getting started

- Take a look at the API documentation to see what the response data will look like
- Start with pen and paper to draw what you want your new app to look like
- Create a basic HTML page with your layout
- Create a CSS file and a JS file and import them into the webpage.
- Use `fetch` load some news items from API and insert them into your web page.

## README.md

When finished, update this README.md file 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. This is quite important as you want to put projects in your portfolio and the information provided here will help a reviewer understand what it is they are looking at.
Live demo available at https://wizardly-hodgkin-453a46.netlify.com/
Binary file added dist/BBC-LOGO.71419ce4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!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">
<link rel="stylesheet" href="/responsive-news-reader.2f969aab.css">
<title>Home BBC News</title>
<script src="/responsive-news-reader.2f969aab.js"></script></head>
<body>
<div class="app">
<nav>
<div class="logo">
<img id="logo" src="/BBC-LOGO.71419ce4.png">
</div>
<div class="navBar">
<div class="homeNav"><a href="#">Home</a></div>
<div class="newsNav"><a href="#">News</a></div>
<div class="moreNav"><a href="#">More</a></div>
<div class="searchNav"><a href="#">Search</a></div>

</div></nav>
<header>
<div class="NEWS">
<h1>NEWS</h1>
</div>
<a href="#">
<div class="menu">
- Sections
</div>
</a>
</header>
<div class="tab">
<div class="latest-stories">
<h3>Latest Stories</h3>
</div>
<div class="most-read">
<h3>Most read</h3>
</div>
</div>
<div class="long-menu">
<ul>
<a href="#"><li>Home</li></a>
<a href="#"><li>UK</li></a>
<a href="#"><li>World</li></a>
<a href="#"><li>Business</li></a>
<a href="#"><li>Politics</li></a>
<a href="#"><li>Tech</li></a>
<a href="#"><li>Science</li></a>
<a href="#"><li>Health</li></a>
<a href="#"><li>More</li></a>
</ul>
</div>
<div class="location-menu">
<ul>
<a href="#"><li>England</li></a>
<a href="#"><li>N. Ireland</li></a>
<a href="#"><li>Scotland</li></a>
<a href="#"><li>Alba</li></a>
<a href="#"><li>Wales</li></a>
<a href="#"><li>Cymru</li></a>
<a href="#"><li>Local News</li></a>
</ul>
</div>
<main>
</main>


<footer>
<button id="switch-languages" type="button" name="Switch Language">Switch to French</button>
<button id="load-next-page" type="button" name="Load next page">Load next page</button>
<form>
<input id="search-field" type="search" name="search">
<button id="search-button" type="submit" name="Load next page">search</button>
</form>
</footer>
</div>
<script src="/responsive-news-reader.a140e609.js"></script>
</body>
</html>
Binary file added dist/news.685ce312.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading