Camper News

Developer
Size
3,013 Kb
Views
46,552

How do I make an camper news?

What is a camper news? How do you make a camper news? This script and codes were developed by Steven on 31 July 2022, Sunday.

Camper News Previews

Camper News - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Camper News</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href='https://fonts.googleapis.com/css?family=Gloria+Hallelujah' rel='stylesheet' type='text/css'>
<div class="outer-container"> <h1>Volv</h2> <h2>Camper News</h3> <div class="debug"></div>
</div><!-- Outer-container --> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Camper News - Script Codes CSS Codes

body { text-align: center; background: rgba(100, 150, 100, .7);
}
h1 { font-family: 'Gloria Hallelujah', cursive; font-weight: bold; margin-top: -20px;
}
h2 { font-family: 'Gloria Hallelujah', cursive; font-weight: bold; margin-bottom: 30px;
}
.outer-container { width: 90%; margin: auto; margin-top: 40px;
}
.post { text-align: left; display: inline-block; background: white; border-top-left-radius: 10px; border-top-right-radius: 10px; width: 200px; height: 290px; margin-left: 10px; margin-right: 10px; margin-bottom: 30px;
}
.post img { border-top-left-radius: 10px; border-top-right-radius: 10px; height: 200px; width: 200px; cursor: pointer;
}
.description { display: block; border-top: solid 1px black; height: 90px;
}
.description p { margin-bottom: 2px; margin-left: 2px; margin-right: 2px; padding-left: 5px;
}
.title { font-weight: bold;
}
.heart { padding-right: 5px;
}
.heart button { height: 22px; float: right; background: rgba(91, 192, 222, 1); color: white;
}
.like-count { padding-left:3px;
}
.heart button:hover { color: white; background: #31b0d5;
}
.date {}
.debug { color: blue; font-size: 30px;
}

Camper News - Script Codes JS Codes

$(document).ready(function() { $.ajax({ url: "http://www.freecodecamp.com/news/hot" }) .done(function(data) { for (var i = 0; i < data.length; i++) { var story = {}; story.title = data[i].headline; story.date = new Date(data[i].timePosted).toDateString(); story.link = data[i].link; story.upvotes = data[i].upVotes.length; story.authorpic = data[i].author.picture; story.author = data[i].author.username; story.authorlink = "http://www.freecodecamp.com/" + story.author; story.image = data[i].image; story.discusslink = "http://www.freecodecamp.com/news/" + data[i].storyLink.replace(" ", "-"); loadStories(story); } $('.alink').click(function() { window.open($(this).attr("href"), "_blank"); }); //Overly complex looking click attach to also handle middle mouse $(".alink").on('mousedown', function(e) { if ((e.which == 2)) { // Middle Mouse e.preventDefault(); window.open($(this).attr("href")); } }); /* for (var i = 0; i < data.length; i++) for (k in data[i]) $(".debug").append("<b>" + k + "</b> - " + JSON.stringify(data[i][k]) + "<br>");*/ }); // ajax function loadStories(story) { var storyString = ""; storyString += "<div class='post'>"; storyString += "<img href = '" + story.link + "' class='img-responsive alink' src='" + story.authorpic + "' data-toggle='tooltip' title='"+story.title+"'>"; storyString += "<span class='description'>"; storyString += "<p class='title'><a href='" + story.link + "' class='title-link alink' data-toggle='tooltip' title='"+story.title+"'>" + trunc(story.title, 22) + "</a></p>"; storyString += "<p class='author'><a href='" + story.authorlink + "' class='author-link'>By: " + story.author + "</a></p>"; storyString += "<p class='heart'>"; storyString += "<i class='fa fa-heart' data-toggle='tooltip' title='"+story.upvotes+" Upvotes'></i>"; storyString += "<span class='like-count' data-toggle='tooltip' title='"+story.upvotes+" Upvotes'>" + story.upvotes + "</span>"; storyString += "</p>"; storyString += "<p class='date'>Posted On: " + story.date + "</p>"; storyString += "</span>"; storyString += "</div>"; console.log(storyString); $(storyString).appendTo(".outer-container"); } function trunc(str, len) { if (str.length > len) { return str.slice(0, len) + " ..."; } return str; }
}); // Ready
Camper News - Script Codes
Camper News - Script Codes
Home Page Home
Developer Steven
Username volv
Uploaded July 31, 2022
Rating 3
Size 3,013 Kb
Views 46,552
Do you need developer help for Camper News?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Steven (volv) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!