Skip to content

Commit

Permalink
added header
Browse files Browse the repository at this point in the history
  • Loading branch information
jespermhl committed May 30, 2024
1 parent cac801d commit 9b654fd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
20 changes: 15 additions & 5 deletions scripts/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,37 @@ document.addEventListener("DOMContentLoaded", function () {
// Replace placeholders in description with actual HTML anchor tags
var description = item.description.replace(
"[here]",
'<a class="icon-link" href="' + item.link + '">here <i class="bi bi-box-arrow-up-right"></i></a>'
'<a class="icon-link" href="' +
item.link +
'">here <i class="bi bi-box-arrow-up-right"></i></a>'
);
description = description.replace(
"[Read more]",
'<a class="icon-link" href="' + item.link + '">Read more <i class="bi bi-box-arrow-up-right"></i></a>'
'<a class="icon-link" href="' +
item.link +
'">Read more <i class="bi bi-box-arrow-up-right"></i></a>'
);
description = description.replace(
"[read more]",
'<a class="icon-link" href="' + item.link + '">read more <i class="bi bi-box-arrow-up-right"></i></a>'
'<a class="icon-link" href="' +
item.link +
'">read more <i class="bi bi-box-arrow-up-right"></i></a>'
);

var cardHtml = `
<div class="col">
<div class="card h-100">
<img src="${item.image_src}" class="card-img-top" alt="..." />
<div class="card-header">
${item.type}
</div>
<img src="${item.image_src}" class="card-img-top" alt="${item.alt}" />
<div class="card-body">
<h5 class="card-title">${item.title}</h5>
<p class="card-text">${description}</p>
<!--<div class="d-grid gap-2"><a href="#" class="btn btn-primary">Go somewhere</a></div>-->
</div>
<div class="card-footer">
<small class="text-body-secondary">Published on ${item.published_date}</small>
<small class="text-body-secondary">Published on ${item.published_date} by ${item.author}</small>
</div>
</div>
</div>
Expand Down
25 changes: 20 additions & 5 deletions scripts/blogposts.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,52 @@
[
{
"type": "Update",
"title": "Update May 28, 2024",
"image_src": "/static/images/blog/generalupdate.jpg",
"image_alt": "A blue circular icon with two white curved arrows forming a circle around a plumbob in the center. The background features various shades of blue triangles and patterns.",
"description": "The Sims Team just published a new update! These are the key fixes: <ul><li>Dishes won't hide anymore; they'll be cleaned up properly.</li><li>Gardens stay weed-free even when out of season.</li><li>Campfires won't cause chaos on your lot.</li><li>No more annoying trash can reminders.</li><li>Skills stay stable, even when you leave the lot.</li><li>Packs are listed correctly in the Build/Buy filter.</li><li>Performance improvements mean smoother gameplay and faster load times.</li><li>Plus, various pack-specific fixes!</li></ul> I can't include everything here, so [read more] on the EA blog post!",
"link": "https://www.ea.com/games/the-sims/the-sims-4/news/update-5-28-2024",
"published_date": "May 28, 2024"
"published_date": "May 28, 2024",
"author": "Jesper"
},
{
"type": "Pack announcement",
"title": "New Kits got announced!",
"image_src": "/static/images/blog/rivieraretreatcozybistro.jpg",
"image_alt": "Split-screen image featuring \"The Sims 4\" characters. Left: A character enjoying wine by a pool with \"Riviera Retreat Kit\" text. Right: A character sipping from a glass in a bistro with \"Cozy Bistro Kit\" text. Both settings convey a relaxed, social atmosphere.",
"description": "The Riviera Retreat Kit & the Cozy Bistro Kit just got announced. The Riviera Retreat Kit is a pool themed Kit with new pool fountains, pool trims, stucco, archways and more! <br /> <br /> The Cozy Bistro Kit is a bistro themed Kit with new tables, chairs, awnings wallpapers and more! <br /> <br /> They will both be available May 30, 2024 on all usual platforms. You can find more about these in the EA blog post [here].",
"link": "https://www.ea.com/games/the-sims/the-sims-4/news/cozy-bistro-and-riviera-retreat-kits",
"published_date": "May 28, 2024"
"published_date": "May 28, 2024",
"author": "Jesper"
},
{
"type": "Sale",
"title": "The Blooming Rooms Kit is FREE!",
"image_src": "/static/images/cover/The_Sims_4_Blooming_Rooms_Cover.jpg",
"image_alt": "Illustration of a room filled with various potted plants, including large leafy greens, a small tree, and a citrus plant with oranges. A window in the background lets in light. Text reads \"Blooming Rooms Kit\" with \"The Sims 4\" logo in the bottom left corner.",
"description": "You can get the Blooming Rooms Kit for free now and then have it forever. Click [here] to be taken to the official EA Website to redeem it for free! <br /> <br /> Disclaimer: This offer is exclusively accessible through the EA App on Mac and PC until June 17th.",
"link": "https://www.ea.com/games/the-sims/the-sims-4/store/addons/the-sims-4-blooming-rooms-kit",
"published_date": "May 25, 2024"
"published_date": "May 25, 2024",
"author": "Jesper"
},
{
"type": "Pack announcement",
"title": "New Kit: \"Party Essentials\"",
"image_src": "/static/images/cover/The_Sims_4_Party_Essentials_Cover.jpg",
"image_alt": "A promotional image for The Sims 4 Party Essentials Kit showing a decorated party room with balloons, a disco ball, a table with party supplies, and a large golden backdrop.",
"description": "The Sims announced two new kits! This one - the Party Essentials Kit has party props like baloons, a fog machine, speakers, a disco ball and more! Both of the Kits are scheduled to be released April 18th, 2024 at 10AM Pacific Time. They will cost 4,99 USD / 4,99 EUR each. You can get it [here].",
"link": "https://www.ea.com/games/the-sims/the-sims-4/store/addons/the-sims-4-party-essentials-kit",
"published_date": "April 10, 2024"
"published_date": "April 10, 2024",
"author": "Jesper"
},
{
"type": "Pack announcement",
"title": "New Kit: \"Urban Homage\"",
"image_src": "/static/images/cover/The_Sims_4_Urban_Homage_Cover.jpg",
"image_alt": "Promotional image for \"The Sims 4 Urban Homage Kit\" showing four animated characters in trendy urban outfits against a light blue background.",
"description": "The Sims announced two new kits! This one - the Urban Homage Kit was created in collaboration with Danielle \"Ebonix\" Udogaranya. It has London-city 90s and 2000s inspired clothing with lively patterns, vibrant graffiti motifs and eye-catching accessories. Both of the Kits are scheduled to be released April 18th, 2024 at 10AM Pacific Time. They will cost 4,99 USD / 4,99 EUR each. You can get it [here].",
"link": "https://www.ea.com/games/the-sims/the-sims-4/store/addons/the-sims-4-urban-homage-kit",
"published_date": "April 10, 2024"
"published_date": "April 10, 2024",
"author": "Jesper"
}
]

0 comments on commit 9b654fd

Please sign in to comment.