Compare commits

..

No commits in common. "81ffeaa7804d3325d976085a47a74474706baba4" and "b6f8ef8f3778da6705caf051a4cb38b7f845f959" have entirely different histories.

8 changed files with 6 additions and 60 deletions

8
package-lock.json generated
View File

@ -7,9 +7,6 @@
"": {
"name": "deprived-main-website",
"version": "0.0.1",
"dependencies": {
"svelte-media-queries": "^1.6.2"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.1",
@ -1187,11 +1184,6 @@
"svelte": "^3.19.0 || ^4.0.0"
}
},
"node_modules/svelte-media-queries": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/svelte-media-queries/-/svelte-media-queries-1.6.2.tgz",
"integrity": "sha512-SMz6od/vIeZEGlc4P0HKJK4G0fZotuwFhCSpBQaPqh75h6sL6sNf+4+IjbegFKXbP7b+SOfyzVOIMXTr8jynkA=="
},
"node_modules/svelte/node_modules/@ampproject/remapping": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",

View File

@ -19,8 +19,5 @@
"typescript": "^5.0.0",
"vite": "^5.0.3"
},
"type": "module",
"dependencies": {
"svelte-media-queries": "^1.6.2"
}
"type": "module"
}

View File

@ -5,11 +5,6 @@
export let title = '<title>';
export let summary = '<summary>';
export let creation_date = '<date>';
const monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
$: human_creation_date = new Date(+creation_date * 1000);
</script>
<div class="news-card">
@ -20,7 +15,7 @@
<div class="content">
<h3 id="title">{title}</h3>
<p id="summary-text">{summary}</p>
<p id="date">{human_creation_date.getDate()} {monthNames[human_creation_date.getMonth()]} {human_creation_date.getFullYear()}</p>
<p id="date">{creation_date}</p>
</div>
</a>
</div>

View File

@ -5,11 +5,6 @@
export let title = '<title>';
export let summary = '<summary>';
export let creation_date = '<date>';
const monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
$: human_creation_date = new Date(+creation_date * 1000);
</script>
<div class="news-card">
@ -20,7 +15,7 @@
<div class="content">
<h3 id="title">{title}</h3>
<p id="summary-text">{summary}</p>
<p id="date">{human_creation_date.getDate()} {monthNames[human_creation_date.getMonth()]} {human_creation_date.getFullYear()}</p>
<p id="date">{creation_date}</p>
</div>
</a>
</div>

View File

@ -17,9 +17,6 @@ type Summary = {
export function load() {
let summaries : Summary[] = [];
// Sort by newest news first
posts.sort((a, b) => b.creation_date - a.creation_date);
posts.map((post) => {
let summary : Summary = {
url: post.url,

View File

@ -1,20 +1,10 @@
<script lang="ts">
import MediaQuery from 'svelte-media-queries';
import NewsCard from '$lib/posts/NewsCard.svelte';
import ShowcaseNewsCard from '$lib/posts/ShowcaseNewsCard.svelte';
export let data; // <- contains post data
$: most_recent_post = data.summaries[0];
const mobileThreshold : string = '1000px';
const post_show_count : number = 3;
let mobile : boolean;
</script>
<!-- Detect mobile -->
<MediaQuery query='(max-width: {mobileThreshold})' bind:matches={mobile} />
<div class="main-title">
<h1>The Deprived Devs</h1>
</div>
@ -24,10 +14,10 @@
<h1 id="news-header">Recent News</h1>
<div class="news-container">
<!-- The newest blog post being showcased -->
<ShowcaseNewsCard post_url={most_recent_post.url} title={most_recent_post.title} summary={most_recent_post.summary} creation_date={most_recent_post.creation_date} />
<ShowcaseNewsCard post_url={data.summaries[0].url} title={data.summaries[0].title} summary={data.summaries[0].summary} creation_date={data.summaries[0].creation_date} />
<div class="news-list">
{#each data.summaries.slice(1, post_show_count) as summary}
{#each data.summaries as summary}
<NewsCard post_url={summary.url} title={summary.title} summary={summary.summary} creation_date={summary.creation_date} />
{/each}
</div>
@ -43,7 +33,7 @@
align-items: center;
width: 60%;
margin-inline: auto;
margin: auto;
}
#news-header {
@ -81,17 +71,4 @@
h1 {
color: var(--text1);
}
</style>
{#if mobile}
<style>
#news-section {
width: 90vw !important;
}
.news-container {
flex-direction: column !important;
}
</style>
{/if}

View File

@ -27,11 +27,4 @@ export const posts : Post[] = [
creation_date: 1708382491,
modification_date: 1708382491,
},
{
url: 'lorem1',
title: 'Idk some arcticle bruh!',
summary: 'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
creation_date: 1708558377,
modification_date: 1708558377,
},
];