Compare commits
No commits in common. "81ffeaa7804d3325d976085a47a74474706baba4" and "b6f8ef8f3778da6705caf051a4cb38b7f845f959" have entirely different histories.
81ffeaa780
...
b6f8ef8f37
|
@ -7,9 +7,6 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "deprived-main-website",
|
"name": "deprived-main-website",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
|
||||||
"svelte-media-queries": "^1.6.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "^3.0.0",
|
"@sveltejs/adapter-auto": "^3.0.0",
|
||||||
"@sveltejs/adapter-static": "^3.0.1",
|
"@sveltejs/adapter-static": "^3.0.1",
|
||||||
|
@ -1187,11 +1184,6 @@
|
||||||
"svelte": "^3.19.0 || ^4.0.0"
|
"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": {
|
"node_modules/svelte/node_modules/@ampproject/remapping": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
||||||
|
|
|
@ -19,8 +19,5 @@
|
||||||
"typescript": "^5.0.0",
|
"typescript": "^5.0.0",
|
||||||
"vite": "^5.0.3"
|
"vite": "^5.0.3"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module"
|
||||||
"dependencies": {
|
|
||||||
"svelte-media-queries": "^1.6.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,6 @@
|
||||||
export let title = '<title>';
|
export let title = '<title>';
|
||||||
export let summary = '<summary>';
|
export let summary = '<summary>';
|
||||||
export let creation_date = '<date>';
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="news-card">
|
<div class="news-card">
|
||||||
|
@ -20,7 +15,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h3 id="title">{title}</h3>
|
<h3 id="title">{title}</h3>
|
||||||
<p id="summary-text">{summary}</p>
|
<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>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,11 +5,6 @@
|
||||||
export let title = '<title>';
|
export let title = '<title>';
|
||||||
export let summary = '<summary>';
|
export let summary = '<summary>';
|
||||||
export let creation_date = '<date>';
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="news-card">
|
<div class="news-card">
|
||||||
|
@ -20,7 +15,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h3 id="title">{title}</h3>
|
<h3 id="title">{title}</h3>
|
||||||
<p id="summary-text">{summary}</p>
|
<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>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,9 +17,6 @@ type Summary = {
|
||||||
export function load() {
|
export function load() {
|
||||||
let summaries : Summary[] = [];
|
let summaries : Summary[] = [];
|
||||||
|
|
||||||
// Sort by newest news first
|
|
||||||
posts.sort((a, b) => b.creation_date - a.creation_date);
|
|
||||||
|
|
||||||
posts.map((post) => {
|
posts.map((post) => {
|
||||||
let summary : Summary = {
|
let summary : Summary = {
|
||||||
url: post.url,
|
url: post.url,
|
||||||
|
|
|
@ -1,20 +1,10 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MediaQuery from 'svelte-media-queries';
|
|
||||||
import NewsCard from '$lib/posts/NewsCard.svelte';
|
import NewsCard from '$lib/posts/NewsCard.svelte';
|
||||||
import ShowcaseNewsCard from '$lib/posts/ShowcaseNewsCard.svelte';
|
import ShowcaseNewsCard from '$lib/posts/ShowcaseNewsCard.svelte';
|
||||||
|
|
||||||
export let data; // <- contains post data
|
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>
|
</script>
|
||||||
|
|
||||||
<!-- Detect mobile -->
|
|
||||||
<MediaQuery query='(max-width: {mobileThreshold})' bind:matches={mobile} />
|
|
||||||
|
|
||||||
<div class="main-title">
|
<div class="main-title">
|
||||||
<h1>The Deprived Devs</h1>
|
<h1>The Deprived Devs</h1>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,10 +14,10 @@
|
||||||
<h1 id="news-header">Recent News</h1>
|
<h1 id="news-header">Recent News</h1>
|
||||||
<div class="news-container">
|
<div class="news-container">
|
||||||
<!-- The newest blog post being showcased -->
|
<!-- 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">
|
<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} />
|
<NewsCard post_url={summary.url} title={summary.title} summary={summary.summary} creation_date={summary.creation_date} />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +33,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
width: 60%;
|
width: 60%;
|
||||||
margin-inline: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#news-header {
|
#news-header {
|
||||||
|
@ -81,17 +71,4 @@
|
||||||
h1 {
|
h1 {
|
||||||
color: var(--text1);
|
color: var(--text1);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{#if mobile}
|
|
||||||
<style>
|
|
||||||
#news-section {
|
|
||||||
width: 90vw !important;
|
|
||||||
}
|
|
||||||
.news-container {
|
|
||||||
flex-direction: column !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,4 @@ export const posts : Post[] = [
|
||||||
creation_date: 1708382491,
|
creation_date: 1708382491,
|
||||||
modification_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,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue