Format literally everything

This commit is contained in:
Cassidy Williams
2022-10-23 23:26:41 -05:00
parent ff9f16105e
commit 0d4e70c5ee
45 changed files with 11569 additions and 11706 deletions

View File

@@ -1,5 +1,5 @@
---
import '../global.css';
import "../global.css";
export interface Props {
title: string;
@@ -7,7 +7,7 @@ export interface Props {
image?: string;
}
const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
const { title, description, image = "/placeholder-social.jpg" } = Astro.props;
---
<!-- Global Metadata -->
@@ -43,4 +43,3 @@ const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
href="https://fonts.googleapis.com/css?family=Roboto+Mono"
rel="stylesheet"
/>

View File

@@ -1,28 +1,28 @@
<script is:inline>
let colors = ['#24d05a', '#eb4888', '#10a2f5', '#e9bc3f'];
let colors = ["#24d05a", "#eb4888", "#10a2f5", "#e9bc3f"];
function getRandomColor() {
return colors[Math.floor(Math.random() * colors.length)];
}
function getRandomColor() {
return colors[Math.floor(Math.random() * colors.length)];
}
function setRandomLinkColor() {
Array.from(document.getElementsByTagName('a')).forEach((e) => {
e.style.color = getRandomColor();
});
}
function setRandomLinkColor() {
Array.from(document.getElementsByTagName("a")).forEach((e) => {
e.style.color = getRandomColor();
});
}
function setColorHoverListener() {
Array.from(document.querySelectorAll('a, button')).forEach((e) => {
e.addEventListener('mouseover', setRandomLinkColor);
});
}
function setColorHoverListener() {
Array.from(document.querySelectorAll("a, button")).forEach((e) => {
e.addEventListener("mouseover", setRandomLinkColor);
});
}
(function () {
(function () {
setRandomLinkColor();
setColorHoverListener();
setInterval(() => {
setRandomLinkColor();
setColorHoverListener();
setInterval(() => {
setRandomLinkColor();
}, 3000);
})();
</script>
}, 3000);
})();
</script>

View File

@@ -4,21 +4,26 @@ const { slug, title, tags, description, date } = Astro.props;
---
<li class="post">
<a href={`/post/${slug}/`} class="title">{title}</a>
<time datetime={date}>
{new Date(date).toLocaleDateString('en-us', {
year: 'numeric',
month: 'short',
day: 'numeric',
})}
</time>
<br />
{description && <span class="excerpt">{description}</span>}
<div>
{tags && tags.map(tag => (
<>
<a class="tag" href={`/tag/${tag}`}>#{tag}</a>
</>
))}
</div>
</li>
<a href={`/post/${slug}/`} class="title">{title}</a>
<time datetime={date}>
{
new Date(date).toLocaleDateString("en-us", {
year: "numeric",
month: "short",
day: "numeric",
})
}
</time>
<br />
{description && <span class="excerpt">{description}</span>}
<div>
{
tags &&
tags.map((tag) => (
<a class="tag" href={`/tag/${tag}`}>
#{tag}
</a>
))
}
</div>
</li>

View File

@@ -1,16 +1,20 @@
---
import Post from '../components/Post.astro';
import Post from "../components/Post.astro";
const { allPosts } = Astro.props;
let posts = allPosts.sort(() => 0.5 - Math.random()).slice(0, 3)
let posts = allPosts.sort(() => 0.5 - Math.random()).slice(0, 3);
---
<content>
<ul>
{posts.map(
({url, frontmatter: { description, slug, title, tags, added: date }}) => (
<Post {url} {description} {date} {slug} {title} {tags} />
))}
</ul>
</content>
<ul>
{
posts.map(
({
url,
frontmatter: { description, slug, title, tags, added: date },
}) => <Post {url} {description} {date} {slug} {title} {tags} />
)
}
</ul>
</content>