Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Nogal random blog</title>
- <style>
- body{
- background: ##ECE9E6; /* fallback for old browsers */
- background: -webkit-linear-gradient(to left, #ECE9E6 , #FFFFFF); /* Chrome 10-25, Safari 5.1-6 */
- background: linear-gradient(to left, #ECE9E6 , #FFFFFF); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
- width:90%;
- text-align:center;
- }
- #mainContent {
- background: #0B486B; /* fallback for old browsers */
- background: -webkit-linear-gradient(to left, #0B486B , #F56217); /* Chrome 10-25, Safari 5.1-6 */
- background: linear-gradient(to left, #0B486B , #F56217); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
- border-radius:25px;
- color:white;
- display:inline-block;
- margin-top:20px;
- margin-left:-100px;
- padding:20px;
- text-align:center;
- width:700px;
- }
- #topPosts {
- border:3px solid black;
- border-radius:25px;
- float:left;
- margin:20px;
- width:500px;
- display:inline-block;
- text-align:left;
- }
- #topPosts p, h2 {
- margin-left:10px;
- }
- .blogContent {
- text-align:left;
- }
- a {
- color:black;
- }
- p {
- }
- img {
- float:right;
- margin-left:20px;
- width:60%;
- }
- </style>
- </head>
- <body>
- <div id="topPosts">
- <h2>Best beoordeelde blogposts:</h2>
- </div>
- <div id="mainContent">
- </div>
- <script>
- var functions = {
- render: function(object) {
- if(object.image == undefined){
- return "<h2>" + object.title + "</h2>" + object.bodyText + object.link + object.author + "rank: " + object.ranking + "<p>" + object.comments[0].inhoud + "</p>";
- } else {
- return "<h2>" + object.title + "</h2>" + object.image + object.bodyText + object.link + object.author + "rank: " + object.ranking + "<p>" + object.comments[0].inhoud + "</p>";
- }
- },
- showAllPosts: function() {
- var blogPosts = [myBlogPosting1, myBlogPosting2, myBlogPosting3, myBlogPosting4, myBlogPosting5, myBlogPosting6, myBlogPosting7, myBlogPosting8];
- var posts = ""
- for (var i = 0; i < blogPosts.length; i++){
- posts += this.render(blogPosts[i]) + "<br><br><hr>"
- }
- return posts
- functions.returnRank()
- },
- returnRank: function() {
- var blogPosts = [myBlogPosting1, myBlogPosting2, myBlogPosting3, myBlogPosting4, myBlogPosting5, myBlogPosting6, myBlogPosting7, myBlogPosting8];
- var ratings = "<h2>Best beoordeelde blogposts</h2>"
- for (var i = 0; i < blogPosts.length; i++){
- if( blogPosts[i].ranking < 3 ) {
- null
- }
- else if( blogPosts[i].ranking >= 3 && blogPosts[i].ranking !== 5 ) {
- ratings+= "<p>" + blogPosts[i].title + " ★".repeat(blogPosts[i].ranking) + "</p>"
- }
- else if( blogPosts[i].ranking == 5 ) {
- ratings += "<p>" + "<b>" + blogPosts[i].title + " ★".repeat(blogPosts[i].ranking) + "</b>" + "</p>"
- }
- }
- return ratings;
- }
- }
- var myBlogPosting1 = {
- title: "Google launches underwater Street View",
- bodyText: "<p class = 'blogContent'>Today Google Maps unveils a new Street View feature: " +
- "underwater panoramic views of six special sea spots. " +
- "The idea is to create a virtual map of the oceans, " +
- "documenting the state of fragile ecosystems as they " +
- "change over time, and sharing a vivid experience of " +
- "part of our world that few humans get to see up close " +
- "and in person, in real life.</p>" +
- "<p class = 'blogContent'>The ocean collection on Google Street View is now " +
- "available at maps.google.com/ocean, and includes coral " +
- "reefs and the creatures who live in them, in Australia, " +
- "the Philippines and Hawaii.</p>",
- link: "<a href='http://boingboing.net/2012/09/25/google-launches-underwater-str.html'>Link to article</a>",
- author: "<p>Author: <b>Xeni Jardin</b></p>",
- image: "<img src='https://puu.sh/uRX6A/9b22e07652.jpg'>",
- ranking: 2,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- var myBlogPosting2 = {
- title: "Terug naar 2007: wat is er van de rijders terechtgekomen?",
- bodyText: "<p class = 'blogContent'>Met Max Verstappen, Carlos Sainz, Esteban Ocon en Stoffel Vandoorne " +
- "zijn er in de afgelopen twee jaar een aantal bijzondere talenten gedebuteerd, " +
- "van wie in de toekomst veel verwacht wordt. " +
- "Rond het jaar 2007 arriveerde er eveneens een grote lichting aan talentvolle rijders. " +
- "GPUpdate.net kijkt precies tien jaar terug in de tijd naar wie er destijds in Australië aan de start verschenen: " +
- "wat is er terechtgekomen van de coureurs van toen?</p>",
- link: "<a href='http://www.gpupdate.net/nl/f1-nieuws/350728/terug-naar-2007-wat-is-er-van-de-rijders-terechtgekomen/'>Link to article</a>",
- author: "<p>Author: <b>René Oudman</b></p>",
- image: "<img src='http://adn.gpupdate.net/news/300528.jpg'>",
- ranking: 4
- }
- var myBlogPosting3 = {
- title: "Robben en Lens melden zich pas later bij Oranje",
- bodyText: "<p class = 'blogContent'>Arjen Robben en Jeremain Lens sluiten pas later aan bij het Nederlands elftal, " +
- "zo laat de KNVB weten. " +
- "De aanvaller van Bayern München kampt met een lichte voetblessure, " +
- "terwijl de aanvaller van Fenerbahçe vanwege trieste " +
- "familieomstandigheden nog niet is afgereisd naar Noordwijk.</p>" +
- "<p class = 'blogContent'>Lens zit in Suriname vanwege het overlijden van zijn vader en komt woensdag aan in Nederland. " +
- "Robben werd zondag in de slotfase van het competitieduel met Borussia Mönchengladbach naar de kant gehaald. " +
- "Hij meldt zich dinsdagmiddag bij de selectie van bondscoach Danny Blind. " +
- "De kans is groot dat Robben alleen het eerste duel met Bulgarije speelt en de oefeninterland tegen Italië niet hoeft te spelen.</p>",
- link: "<a href='http://www.voetbalzone.nl/doc.asp?uid=301960'>Link to article</a>",
- author: "<p>Author: <b>Voetbalzone.nl</b></p>",
- image: "<img src='http://static.voetbalzone.nl/images/photos/ori_576_324/11235763514235.jpg'>",
- ranking: 3,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- var myBlogPosting4 = {
- title: "Wat gebeurt er met de 3,5mm-jack?",
- bodyText: "<p class = 'blogContent'>Het is een hardnekkige mythe dat Apple altijd wil verrassen bij zijn productintroducties. " +
- "Voor de iPhone 7, met een presentatie in september 2016, " +
- "wilde de fabrikant juist dat het publiek en de makers van accessoires ruim van tevoren " +
- "op de hoogte waren van de grootste verandering. " +
- "Daarom kwam in november 2015 voor het eerst het gerucht naar buiten " +
- "dat Apple de geliefde 3,5mm-jack voor headsets wilde schrappen.</p>",
- link: "<a href='https://tweakers.net/reviews/5271/wat-gebeurt-er-met-de-3-komma-5mm-jack.html'>Link to article</a>",
- author: "<p>Author: <b>Arnoud Wokke</b></p>",
- ranking: 5,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- var myBlogPosting5 = {
- title: "Pinguïnpopulatie op Zuidpool veel groter dan gedacht",
- bodyText: "<p class = 'blogContent'>Er leven veel meer pinguïns op de Zuidpool dan wetenschappers tot nu toe dachten. " +
- "Tot dusver werd uitgegaan van 2,3 miljoen pinguïns in het oosten van Antarctica, " +
- "maar het blijken er 5,9 miljoen te zijn.</p>" +
- "<p class = 'blogContent'>Australische wetenschappers hebben de populatie op de Zuidpool " +
- "uitgebreid onderzocht door middel van videobeelden vanuit de lucht en op de grond. " +
- "Bij deze telling zijn voor het eerst niet-broedende adeliepinguïns, " +
- "een kleine zwart-witte soort, meegeteld. " +
- "De vorige tellingen focusten zich alleen op broedende pinguïns.</p>",
- link: "<a href='http://nos.nl/artikel/2164212-pinguinpopulatie-op-zuidpool-veel-groter-dan-gedacht.html'>Link to article</a>",
- author: "<p>Author: <b>NOS.nl</b></p>",
- image: "<img src='http://yourshot.nationalgeographic.com/u/ss/fQYSUbVfts-T7pS2VP2wnKyN8wxywmXtY0-FwsgxoQufDJR20dfArh3C8-z7w3B7yFPXINNpiHU3SyF8RM38/'>",
- ranking: 4,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- var myBlogPosting6 = {
- title: "Paul McCartney on Chuck Berry: 'He Was a Magician'",
- bodyText: "<p class = 'blogContent'>In a reflective tribute to the late Chuck Berry, " +
- "Paul McCartney honored the rock icon's massive influence on the Beatles' formative music. " +
- "'To us, he was a magician making music that was exotic, yet normal, at the same time,' " +
- "the singer wrote on his website. " +
- "'We learnt so many things from him which led us into " +
- "a dream world of rock & roll music.'</p>",
- link: "<a href='http://www.rollingstone.com/music/news/paul-mccartney-on-chuck-berry-he-was-a-magician-w472980'>Link to article</a>",
- author: "<p>Author: <b>Ryan Reed</b></p>",
- image: "<img src='https://puu.sh/uS3Im/e6cb3d54cf.jpg'>",
- ranking: 2,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- var myBlogPosting7 = {
- title: "Terrifying face gadget promises to keep your conversations private in public places",
- bodyText: "<p class = 'blogContent'>Now you can keep your conversations private, annoy your coworkers and look like Bane — all at once." +
- "<p class = 'blogContent'>The gadget that makes it all happen is called Hushme. " +
- "It bills itself as the 'world's first voice mask for mobile phones.' " +
- "This absurd-looking contraption is designed to help you keep your " +
- "conversations private when you're in a public space.</p>",
- link: "<a href='http://mashable.com/2017/03/14/hushme-private-conversations-gadget/#agAwx1NsJ5qQ'>Link to article</a>",
- author: "<p>Author: <b>Freia Lobo</b></p>",
- image: "<img src='https://puu.sh/uS4r2/e40c322b03.jpg'>",
- ranking: 5,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- var myBlogPosting8 = {
- title: "Get ready for all sorts of augmented reality wizardry on your iPhone",
- bodyText: "<p class = 'blogContent'>We know that Tim Cook loves augmented reality. He loves it so much that he declared the technology might be as big as an idea as the smartphone. " +
- "Now, a new report from Bloomberg sheds some light on what, exactly, Apple is working on in the field of AR, and what it might mean for the company's upcoming iPhone.</p> " +
- "<p class = 'blogContent'>According to the report, which cites multiple sources familiar with Apple's plans, " +
- "Apple has built a large team of engineers—a combination of their own experts " +
- "and teams that joined through acquisitions of smaller AR companies such as " +
- "Metaio—to work on both hardware and software augmented reality products and solutions.</p>",
- link: "<a href='http://mashable.com/2017/03/20/apple-ar-report/#DheK0L4jqOq4'>Link to article</a>",
- author: "<p>Author: <b>Stan Schroeder</b></p>",
- image: "<img src='https://puu.sh/uS4P6/7ee7495b19.jpg'>",
- ranking: 2,
- comments: [ { inhoud: "Leuk artikel!",
- naam: "Joost Klaassen",
- ranking: 4
- },
- { inhoud: "Mooie foto, ga het zeker eens bekijken.",
- naam: "Piet van Dijk",
- ranking: 3
- }
- ]
- }
- document.getElementById("mainContent").innerHTML = functions.showAllPosts();
- document.getElementById("topPosts").innerHTML = functions.returnRank();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement