new style
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
---
|
||||
import AboutHeroImage from '../assets/blog-placeholder-about.jpg';
|
||||
import Layout from '../layouts/BlogPost.astro';
|
||||
export const prerender = true;
|
||||
---
|
||||
|
||||
<Layout
|
||||
title="About Me"
|
||||
description="Lorem ipsum dolor sit amet"
|
||||
pubDate={new Date('August 08 2021')}
|
||||
heroImage={AboutHeroImage}
|
||||
>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
||||
labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo
|
||||
viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam
|
||||
adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus
|
||||
et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus
|
||||
vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque
|
||||
sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non
|
||||
tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non
|
||||
blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna
|
||||
porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis
|
||||
massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc.
|
||||
Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis
|
||||
bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra
|
||||
massa massa ultricies mi.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl
|
||||
suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet
|
||||
nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae
|
||||
turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem
|
||||
dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat
|
||||
semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus
|
||||
vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum
|
||||
facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam
|
||||
vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla
|
||||
urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper
|
||||
viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc
|
||||
scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur
|
||||
gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus
|
||||
pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim
|
||||
blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id
|
||||
cursus metus aliquam eleifend mi.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta
|
||||
nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam
|
||||
tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci
|
||||
ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar
|
||||
proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
</p>
|
||||
</Layout>
|
||||
@@ -16,6 +16,7 @@ const post = Astro.props;
|
||||
const { Content } = await render(post);
|
||||
---
|
||||
|
||||
|
||||
<BlogPost {...post.data}>
|
||||
<Content />
|
||||
</BlogPost>
|
||||
@@ -95,7 +95,7 @@ const posts = (await getCollection('blog')).sort(
|
||||
{
|
||||
posts.map((post) => (
|
||||
<li>
|
||||
<a href={`/blog/${post.id}/`}>
|
||||
<a href={`/articles/${post.id}/`}>
|
||||
{post.data.heroImage && (
|
||||
<Image width={720} height={360} src={post.data.heroImage} alt="" />
|
||||
)}
|
||||
99
src/pages/guestBook/index.astro
Normal file
99
src/pages/guestBook/index.astro
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
import BaseHead from '../../components/BaseHead.astro';
|
||||
import Header from '../../components/Header.astro';
|
||||
import Footer from '../../components/Footer.astro';
|
||||
|
||||
import { drizzle } from "drizzle-orm/d1";
|
||||
import { GuestLog } from "../../schema";
|
||||
import { env } from "cloudflare:workers";
|
||||
|
||||
export const prerender = false
|
||||
|
||||
const db = drizzle(env.DB);
|
||||
|
||||
if (Astro.request.method === 'POST') {
|
||||
// Parse form data
|
||||
const formData = await Astro.request.formData();
|
||||
console.log(formData);
|
||||
const name = formData.get('name');
|
||||
const message = formData.get('message');
|
||||
const website_link = formData.get('website_link');
|
||||
|
||||
if (
|
||||
typeof name === 'string' &&
|
||||
typeof website_link === 'string' &&
|
||||
typeof message === 'string' &&
|
||||
name !== "" &&
|
||||
message !== ""
|
||||
) {
|
||||
|
||||
if (message.length >= 255) {
|
||||
return;
|
||||
}
|
||||
|
||||
await db.insert(GuestLog).values([{
|
||||
name : name,
|
||||
message : message,
|
||||
website_link : website_link,
|
||||
date_viewed : new Date(),
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
let guest_logs : {id: number; name: string; message: string | null; date: Date;}[] = [];
|
||||
try {
|
||||
guest_logs = await db
|
||||
.select()
|
||||
.from(GuestLog)
|
||||
.orderBy(GuestLog.date);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
guest_logs.forEach(log => {
|
||||
console.log(log)
|
||||
});
|
||||
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title="guest book" description="a guest book of everyone who have visited my site" />
|
||||
</head>
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<section>
|
||||
<h1>sign the <span style="background-color: blueviolet;">guest</span> book</h1>
|
||||
<form method="POST" style="display: grid">
|
||||
<label for="name">Name</label>
|
||||
<input id="name" name="name" />
|
||||
|
||||
<label for="website_link">Website link(optional)</label>
|
||||
<input id="website_link" name="website_link" />
|
||||
|
||||
<label for="message">message</label>
|
||||
<textarea id="message" name="message"></textarea>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<h1>guest book</h1>
|
||||
<ul>
|
||||
{
|
||||
guest_logs.map((log) => (
|
||||
<li>
|
||||
<p>[{log.date.toDateString()}] {log.name}
|
||||
{log.website_link? (<a href={log.website_link}>{log.website_link}</a>) : ""}
|
||||
: {log.message}</p>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,56 +1,31 @@
|
||||
---
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import Icon from '../components/Icon.astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
import FormattedDate from '../components/FormattedDate.astro';
|
||||
import { Image } from 'astro:assets';
|
||||
|
||||
import { SITE_DESCRIPTION, SITE_TITLE } from '../consts';
|
||||
|
||||
import SkillCard from '../components/skillCard.astro'
|
||||
import { desc } from "drizzle-orm";
|
||||
import { drizzle } from "drizzle-orm/d1";
|
||||
import { GuestLog } from "../schema";
|
||||
import { env } from "cloudflare:workers";
|
||||
import { GuestLog } from "../schema";
|
||||
|
||||
export const prerender = false
|
||||
|
||||
const db = drizzle(env.DB);
|
||||
|
||||
if (Astro.request.method === 'POST') {
|
||||
// Parse form data
|
||||
const formData = await Astro.request.formData();
|
||||
console.log(formData);
|
||||
const name = formData.get('name');
|
||||
const message = formData.get('message');
|
||||
const website_link = formData.get('website_link');
|
||||
|
||||
if (
|
||||
typeof name === 'string' &&
|
||||
typeof website_link === 'string' &&
|
||||
typeof message === 'string' &&
|
||||
name !== "" &&
|
||||
message !== ""
|
||||
) {
|
||||
|
||||
if (message.length >= 255) {
|
||||
return;
|
||||
}
|
||||
|
||||
await db.insert(GuestLog).values([{
|
||||
name : name,
|
||||
message : message,
|
||||
website_link : website_link,
|
||||
date_viewed : new Date(),
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
let guest_logs : {id: number; name: string; message: string | null; date: Date;}[] = [];
|
||||
try {
|
||||
guest_logs = await db
|
||||
.select()
|
||||
.from(GuestLog)
|
||||
.orderBy(GuestLog.date);
|
||||
.orderBy(GuestLog.date)
|
||||
.limit(20);
|
||||
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
@@ -58,6 +33,15 @@ guest_logs = await db
|
||||
guest_logs.forEach(log => {
|
||||
console.log(log)
|
||||
});
|
||||
|
||||
|
||||
const posts = (await getCollection('blog')).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
@@ -68,65 +52,91 @@ guest_logs.forEach(log => {
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<div class="IntroHeader"></div>
|
||||
<h1 class="greeting">Hello!!, im sirlilpanda</h1>
|
||||
<Icon />
|
||||
|
||||
<!-- <div class="IntroHeader"></div> -->
|
||||
<div class="greeting-wrapper">
|
||||
<h1 class="greeting">Hello!!, im sirlilpanda</h1>
|
||||
<Icon height={128} width={128}/>
|
||||
</div>
|
||||
|
||||
<h1 id="about_me">About me</h1>
|
||||
<p1>
|
||||
im an insane computer engineer who has to many hobbies and projects for me to actually work on.
|
||||
That is just the best way to describe me you think of a hobby ive probably dabbled in it.
|
||||
just a friendly neighborhood technomancer
|
||||
</p1>
|
||||
|
||||
<p>
|
||||
click the clock in the corner if you want to change to dark mode. <br/>
|
||||
im still not full happy with the look of this website and will contiune to make changes.
|
||||
</p>
|
||||
|
||||
<h1>guest book</h1>
|
||||
<ul>
|
||||
<h3>check out my lastest <a href={`/articles/${posts[0].id}/`}>blog post</a></h3>
|
||||
<div class="preview-post">
|
||||
<a href={`/articles/${posts[0].id}/`}>
|
||||
{posts[0].data.heroImage && (
|
||||
<Image width={720} height={360} src={posts[0].data.heroImage} alt="" />
|
||||
)}
|
||||
<h4 class="title">{posts[0].data.title}</h4>
|
||||
<p class="date">
|
||||
<FormattedDate date={posts[0].data.pubDate} />
|
||||
</p>
|
||||
<p>{posts[0].data.description}</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<h3>consider adding to the <a href="/guestBook">guestbook</a></h3>
|
||||
<h5>heres what others had to say already</h5>
|
||||
<ul class="lastest-guestbook-logs">
|
||||
{
|
||||
guest_logs.map((log) => (
|
||||
<li>
|
||||
<p>[{log.date.toDateString()}] {log.name}
|
||||
{log.website_link? (<a href={log.website_link}>{log.website_link}</a>) : ""}
|
||||
: {log.message}</p>
|
||||
<p class="title">[{log.date.toDateString()}] {log.name}
|
||||
{log.website_link? (<a href={log.website_link}>{log.website_link}</a>) : ""}:</p>
|
||||
<p class="message">{log.message}</p>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
<h1>sign the <span style="background-color: blueviolet;">guest</span> book</h1>
|
||||
<form method="POST" style="display: grid">
|
||||
<label for="name">Name</label>
|
||||
<input id="name" name="name" />
|
||||
|
||||
<label for="website_link">Website link(optional)</label>
|
||||
<input id="website_link" name="website_link" />
|
||||
|
||||
|
||||
<h3>take my button, i will be collecting some soon too!</h3>
|
||||
|
||||
<textarea class="button-copy">
|
||||
<a href="https://sirlilpanda.studio" title="Visit sirlilpandas website">
|
||||
<img
|
||||
src="https://sirlilpanda.studio/public/panda.gif"
|
||||
alt="check out a man driven to insanity"
|
||||
width=88 height=31
|
||||
>
|
||||
</a>
|
||||
</textarea>
|
||||
|
||||
<label for="message">message</label>
|
||||
<textarea id="message" name="message"></textarea>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<a href="https://sirlilpanda.studio" title="Visit sirlilpandas website">
|
||||
<img src="panda_big.gif" alt="check out a man driven to insanity" width={88*4} height={31*4}>
|
||||
<img
|
||||
src="panda_big.gif" alt="check out a man driven to insanity" width={88*4} height={31*4}>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="https://onio.neocities.org" title="Visit Onio Café">
|
||||
<img src="https://onio.neocities.org/thebutton.gif" alt="Come Chat With Us!" width="88" height="31">
|
||||
</a>
|
||||
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
<style>
|
||||
.IntroHeader {
|
||||
display: flexbox;
|
||||
|
||||
.button-copy {
|
||||
font-size: 1em;
|
||||
color: var(--text-color);
|
||||
height: 10em;
|
||||
background: var(--background-colour);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@keyframes gradient {
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 90%;
|
||||
}
|
||||
@@ -163,4 +173,57 @@ guest_logs.forEach(log => {
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
.preview-post {
|
||||
border-radius: 2em;
|
||||
padding-top: 1em;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
background: var(--background-colour);
|
||||
border-style: solid;
|
||||
border-color: blanchedalmond;
|
||||
box-shadow: var(--box-shadow);
|
||||
margin-bottom: 5em;
|
||||
}
|
||||
|
||||
.Icon {
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
.greeting-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.lastest-guestbook-logs {
|
||||
border-radius: 2em;
|
||||
padding: 1em;
|
||||
background: var(--background-colour);
|
||||
border-style: solid;
|
||||
border-color: blanchedalmond;
|
||||
box-shadow: var(--box-shadow);
|
||||
margin-bottom: 5em;
|
||||
}
|
||||
|
||||
ul > li {
|
||||
margin-top: 1em;
|
||||
border-radius: 1em;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
border-style: solid;
|
||||
border-color: blanchedalmond;
|
||||
transition: 250ms;
|
||||
background: var(--background-colour);
|
||||
}
|
||||
|
||||
ul > li:hover {
|
||||
transform: translateY(-0.5em);
|
||||
box-shadow: var(--box-shadow);
|
||||
}
|
||||
|
||||
ul > li:nth-of-type(odd) {
|
||||
background: var(--main-background-colour);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
99
src/pages/pictures/index.astro
Normal file
99
src/pages/pictures/index.astro
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
import BaseHead from '../../components/BaseHead.astro';
|
||||
import Header from '../../components/Header.astro';
|
||||
import Footer from '../../components/Footer.astro';
|
||||
|
||||
import { drizzle } from "drizzle-orm/d1";
|
||||
import { GuestLog } from "../../schema";
|
||||
import { env } from "cloudflare:workers";
|
||||
|
||||
export const prerender = false
|
||||
|
||||
const db = drizzle(env.DB);
|
||||
|
||||
if (Astro.request.method === 'POST') {
|
||||
// Parse form data
|
||||
const formData = await Astro.request.formData();
|
||||
console.log(formData);
|
||||
const name = formData.get('name');
|
||||
const message = formData.get('message');
|
||||
const website_link = formData.get('website_link');
|
||||
|
||||
if (
|
||||
typeof name === 'string' &&
|
||||
typeof website_link === 'string' &&
|
||||
typeof message === 'string' &&
|
||||
name !== "" &&
|
||||
message !== ""
|
||||
) {
|
||||
|
||||
if (message.length >= 255) {
|
||||
return;
|
||||
}
|
||||
|
||||
await db.insert(GuestLog).values([{
|
||||
name : name,
|
||||
message : message,
|
||||
website_link : website_link,
|
||||
date_viewed : new Date(),
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
let guest_logs : {id: number; name: string; message: string | null; date: Date;}[] = [];
|
||||
try {
|
||||
guest_logs = await db
|
||||
.select()
|
||||
.from(GuestLog)
|
||||
.orderBy(GuestLog.date);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
guest_logs.forEach(log => {
|
||||
console.log(log)
|
||||
});
|
||||
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title="guest book" description="a guest book of everyone who have visited my site" />
|
||||
</head>
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<section>
|
||||
<h1>sign the <span style="background-color: blueviolet;">guest</span> book</h1>
|
||||
<form method="POST" style="display: grid">
|
||||
<label for="name">Name</label>
|
||||
<input id="name" name="name" />
|
||||
|
||||
<label for="website_link">Website link(optional)</label>
|
||||
<input id="website_link" name="website_link" />
|
||||
|
||||
<label for="message">message</label>
|
||||
<textarea id="message" name="message"></textarea>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<h1>guest book</h1>
|
||||
<ul>
|
||||
{
|
||||
guest_logs.map((log) => (
|
||||
<li>
|
||||
<p>[{log.date.toDateString()}] {log.name}
|
||||
{log.website_link? (<a href={log.website_link}>{log.website_link}</a>) : ""}
|
||||
: {log.message}</p>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user