Add about to homepage, add color script to templates

This commit is contained in:
Cassidy Williams
2022-08-22 23:39:41 -05:00
parent c43f69766e
commit 89b2038744
6 changed files with 65 additions and 54 deletions

View File

@@ -1,7 +1,5 @@
--- ---
// Import the global.css file here so that it is included on import '../global.css';
// all pages through the use of the <BaseHead /> component.
import '../styles/global.css';
export interface Props { export interface Props {
title: string; title: string;
@@ -41,5 +39,8 @@ const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
<meta name="twitter:creator" content="@cassidoo" /> <meta name="twitter:creator" content="@cassidoo" />
<meta name="twitter:image" content="http://cassidoo.co/img/headshot.png" /> <meta name="twitter:image" content="http://cassidoo.co/img/headshot.png" />
<link
href="https://fonts.googleapis.com/css?family=Roboto+Mono"
rel="stylesheet"
/>

View File

@@ -0,0 +1,28 @@
<script is:inline>
let colors = ['#24d05a', '#eb4888', '#10a2f5', '#e9bc3f'];
function getRandomColor() {
return colors[Math.floor(Math.random() * colors.length)];
}
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 () {
setRandomLinkColor();
setColorHoverListener();
setInterval(() => {
setRandomLinkColor();
}, 3000);
})();
</script>

View File

@@ -1,19 +1,25 @@
--- ---
import HeaderLink from './HeaderLink.astro'; import HeaderLink from "./HeaderLink.astro";
import { SITE_TITLE } from '../config'; import { SITE_TITLE } from "../config";
--- ---
<header> <header>
<h2> <div class="header-section">
{SITE_TITLE} <div class="header-frame">
</h2> <h1>{SITE_TITLE}</h1>
<h2>a blog, or whatever</h2>
</div>
</div>
<nav> <nav>
<HeaderLink href="/">Home</HeaderLink> <HeaderLink href="/">home</HeaderLink>
<HeaderLink href="/blog">Blog</HeaderLink> <HeaderLink href="/blog">posts</HeaderLink>
<HeaderLink href="/about">About</HeaderLink> <HeaderLink href="https://cassidoo.co" target="_blank">website</HeaderLink>
<HeaderLink href="https://cassidoo.co/newsletter" target="_blank">Newsletter</HeaderLink> <HeaderLink href="https://twitter.com/cassidoo" target="_blank"
<HeaderLink href="https://twitter.com/cassidoo" target="_blank">Twitter</HeaderLink> >twitter
<HeaderLink href="https://github.com/cassidoo" target="_blank">GitHub</HeaderLink> </HeaderLink>
<HeaderLink href="https://cassidoo.co/newsletter" target="_blank"
>newsletter
</HeaderLink>
</nav> </nav>
</header> </header>
<style> <style>

View File

@@ -2,6 +2,7 @@
import BaseHead from "../components/BaseHead.astro"; import BaseHead from "../components/BaseHead.astro";
import Header from "../components/Header.astro"; import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro"; import Footer from "../components/Footer.astro";
import ColorScript from "../components/ColorScript.astro";
export interface Props { export interface Props {
content: { content: {
@@ -53,5 +54,6 @@ const {
</article> </article>
</main> </main>
<Footer /> <Footer />
<ColorScript />
</body> </body>
</html> </html>

View File

@@ -1,12 +1,7 @@
---
layout: "../layouts/BlogPost.astro"
title: "About Me"
description: "I'm Cassidy"
updatedDate: "August 08 2022"
---
I'm Cassidy, and I like to make memes and dreams and software. I'm Cassidy, and I like to make memes and dreams and software.
When Im not working, I like to watch movies, play music, eat a lot, practice Spanish, and salsa dance. I like brainstorming projects that I build maybe half the time. It's nice to dream. When Im not working, I like to watch movies, play music, eat a lot, practice Spanish, and salsa dance. I like brainstorming projects that I build maybe half the time. It's nice to dream.
You should check out my website, [cassidoo.co](https://cassidoo.co), my [newsletter](https://cassidoo.co/newsletter), or my [GitHub profile](https://github.com/cassidoo). Or dont. Im not your mother. You should check out my website, [cassidoo.co](https://cassidoo.co), my [newsletter](https://cassidoo.co/newsletter), or my [GitHub profile](https://github.com/cassidoo). Or dont. Im not your mother.
Anyway, welcome to my blog AKA digital garden AKA mind dump land!

View File

@@ -2,7 +2,9 @@
import BaseHead from '../components/BaseHead.astro'; import BaseHead from '../components/BaseHead.astro';
import Header from '../components/Header.astro'; import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro'; import Footer from '../components/Footer.astro';
import ColorScript from '../components/ColorScript.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../config'; import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
import {Content as About} from './about.md';
--- ---
<!DOCTYPE html> <!DOCTYPE html>
@@ -13,38 +15,15 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
<body> <body>
<Header title={SITE_TITLE} /> <Header title={SITE_TITLE} />
<main> <main>
<h1>🧑‍🚀 Hello, Astronaut!</h1> <About />
<p>
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This <h3>Here's a sampler of some posts</h3>
template serves as a lightweight, minimally-styled starting point for anyone looking to build <p>hello blah blah blah</p>
a personal website, blog, or portfolio with Astro.
</p> <h3>View posts by tag</h3>
<p> <p>hello blah blah blah</p>
This template comes with a few integrations already configured in your
<code>astro.config.mjs</code> file. You can customize your setup with
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
React, or Vue to your project.
</p>
<p>Here are a few ideas on how to get started with the template:</p>
<ul>
<li>Edit this page in <code>src/pages/index.astro</code></li>
<li>Edit the site header items in <code>src/components/Header.astro</code></li>
<li>Add your name to the footer in <code>src/components/Footer.astro</code></li>
<li>Check out the included blog posts in <code>src/pages/blog/</code></li>
<li>Customize the blog post page layout in <code>src/layouts/BlogPost.astro</code></li>
</ul>
<p>
Have fun! If you get stuck, remember to <a href="https://docs.astro.build/"
>read the docs
</a> or <a href="https://astro.build/chat">join us on Discord</a> to ask questions.
</p>
<p>
Looking for a blog template with a bit more personality? Check out <a
href="https://github.com/Charca/astro-blog-template"
>astro-blog-template
</a> by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
</p>
</main> </main>
<Footer /> <Footer />
<ColorScript />
</body> </body>
</html> </html>