Inital Commit
This commit is contained in:
commit
d563adacf9
69 changed files with 10401 additions and 0 deletions
19
src/components/Greet.svelte
Normal file
19
src/components/Greet.svelte
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<script lang="ts">
|
||||
import { invoke } from "@tauri-apps/api/tauri"
|
||||
let name = "";
|
||||
let greetMsg = ""
|
||||
async function greet(){
|
||||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
||||
greetMsg = await invoke("greet", { name })
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<div class="row">
|
||||
<input id="greet-input" placeholder="Enter a name..." bind:value={name} />
|
||||
<button on:click={greet}>
|
||||
Greet
|
||||
</button>
|
||||
</div>
|
||||
<p>{greetMsg}</p>
|
||||
</div>
|
||||
5
src/config.ts
Normal file
5
src/config.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// Place any global data in this file.
|
||||
// You can import this data from anywhere in your site by using the `import` keyword.
|
||||
|
||||
export const SITE_TITLE = "Steven Carpenter's Blog";
|
||||
export const SITE_DESCRIPTION = 'Welcome to my personal website!';
|
||||
5
src/env.d.ts
vendored
Normal file
5
src/env.d.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
/// <reference path="../.astro/types.d.ts" />
|
||||
/// <reference types="astro/client" />
|
||||
/// <reference path="@tauri-apps/api" />
|
||||
/// <reference types="./types/classnames.d.ts" />
|
||||
|
||||
93
src/layouts/Layout.astro
Normal file
93
src/layouts/Layout.astro
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
import '../styles/global.css'
|
||||
export interface Props {
|
||||
title: string;
|
||||
}
|
||||
const { title } = Astro.props;
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>{title}</title>
|
||||
</head>
|
||||
<body>
|
||||
<slot />
|
||||
</body>
|
||||
</html>
|
||||
<style is:global>
|
||||
:root {
|
||||
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
color: #0f0f0f;
|
||||
background-color: #f6f6f6;
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
transition: 0.75s;
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
a {
|
||||
font-weight: 500;
|
||||
color: #646cff;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
a:hover {
|
||||
color: #535bf2;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
input,
|
||||
button {
|
||||
border-radius: 8px;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.6em 1.2em;
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
color: #0f0f0f;
|
||||
background-color: #ffffff;
|
||||
transition: border-color 0.25s;
|
||||
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
border-color: #396cd8;
|
||||
}
|
||||
input,
|
||||
button {
|
||||
outline: none;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
color: #f6f6f6;
|
||||
background-color: #2f2f2f;
|
||||
}
|
||||
a:hover {
|
||||
color: #24c8db;
|
||||
}
|
||||
input,
|
||||
button {
|
||||
color: #ffffff;
|
||||
background-color: #0f0f0f98;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
68
src/pages/index.astro
Normal file
68
src/pages/index.astro
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import Greet from "../components/Greet.svelte";
|
||||
---
|
||||
|
||||
<Layout title="Welcome to Astro.">
|
||||
<main>
|
||||
<div class="row">
|
||||
<a href="https://tauri.app" target="_blank">
|
||||
<img src="/tauri.svg" class="logo tauri" alt="Tauri logo" />
|
||||
</a>
|
||||
<a href="https://astro.build" target="_blank">
|
||||
<img
|
||||
src="/astro-dark.svg"
|
||||
class="logo astro dark-mode-only"
|
||||
alt="Astro logo"
|
||||
/>
|
||||
<img
|
||||
src="/astro-light.svg"
|
||||
class="logo astro light-mode-only"
|
||||
alt="Astro logo"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<p>Click on the Tauri and Astro logos to learn more.</p>
|
||||
<p>
|
||||
Recommended IDE setup:
|
||||
<a href="https://code.visualstudio.com/" target="_blank">VS Code</a>
|
||||
+
|
||||
<a href="https://github.com/tauri-apps/tauri-vscode" target="_blank">Tauri</a>
|
||||
+
|
||||
<a href="https://github.com/rust-lang/rust-analyzer" target="_blank" >rust-analyzer</a>
|
||||
</p>
|
||||
<div class="row">
|
||||
<Greet client:visible />
|
||||
</div>
|
||||
</main>
|
||||
</Layout>
|
||||
|
||||
<style>
|
||||
main {
|
||||
margin: 0;
|
||||
padding-top: 10vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
.logo.tauri:hover {
|
||||
filter: drop-shadow(0 0 2em #24c8db);
|
||||
}
|
||||
.logo.astro:hover {
|
||||
filter: drop-shadow(0 0 2em rgb(184, 81, 34));
|
||||
}
|
||||
#greet-input {
|
||||
margin-right: 5px;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.logo.light-mode-only {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: light) {
|
||||
.logo.dark-mode-only {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
61
src/styles/global.css
Normal file
61
src/styles/global.css
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
The CSS in this style tag is based off of Bear Blog's default CSS.
|
||||
https://github.com/HermanMartinus/bearblog/blob/297026a877bc2ab2b3bdfbd6b9f7961c350917dd/templates/styles/blog/default.css
|
||||
License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('/fonts/woff2/FiraCode-Light.woff2') format('woff2'),
|
||||
url("/fonts/woff/FiraCode-Light.woff") format("woff");
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('/fonts/woff2/FiraCode-Regular.woff2') format('woff2'),
|
||||
url("/fonts/woff/FiraCode-Regular.woff") format("woff");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('/fonts/woff2/FiraCode-Medium.woff2') format('woff2'),
|
||||
url("/fonts/woff/FiraCode-Medium.woff") format("woff");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('/fonts/woff2/FiraCode-SemiBold.woff2') format('woff2'),
|
||||
url("/fonts/woff/FiraCode-SemiBold.woff") format("woff");
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('/fonts/woff2/FiraCode-Bold.woff2') format('woff2'),
|
||||
url("/fonts/woff/FiraCode-Bold.woff") format("woff");
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code VF';
|
||||
src: url('/fonts/woff2/FiraCode-VF.woff2') format('woff2-variations'),
|
||||
url('/fonts/woff/FiraCode-VF.woff') format('woff-variations');
|
||||
/* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */
|
||||
font-weight: 300 700;
|
||||
font-style: normal;
|
||||
}
|
||||
header {
|
||||
font-family: Fira Code VF, monospace;
|
||||
}
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
21
src/test/basic.test.ts
Normal file
21
src/test/basic.test.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { assert, expect, test } from 'vitest';
|
||||
|
||||
// Edit an assertion and save to see HMR in action
|
||||
|
||||
test('Math.sqrt()', () => {
|
||||
expect(Math.sqrt(4)).toBe(2);
|
||||
expect(Math.sqrt(144)).toBe(12);
|
||||
expect(Math.sqrt(2)).toBe(Math.SQRT2);
|
||||
});
|
||||
|
||||
test('JSON', () => {
|
||||
const input = {
|
||||
foo: 'hello',
|
||||
bar: 'world',
|
||||
};
|
||||
|
||||
const output = JSON.stringify(input);
|
||||
|
||||
expect(output).eq('{"foo":"hello","bar":"world"}');
|
||||
assert.deepEqual(JSON.parse(output), input, 'matches original');
|
||||
});
|
||||
19
src/types/classnames.d.ts
vendored
Normal file
19
src/types/classnames.d.ts
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// This file is auto-generated with postcss-ts-classnames.
|
||||
|
||||
export type ClassNames =
|
||||
| "antialiased"
|
||||
| "astro"
|
||||
| "border"
|
||||
| "dark-mode-only"
|
||||
| "drop-shadow"
|
||||
| "filter"
|
||||
| "flex"
|
||||
| "grayscale"
|
||||
| "light-mode-only"
|
||||
| "logo"
|
||||
| "outline"
|
||||
| "row"
|
||||
| "tauri"
|
||||
| "transition";
|
||||
|
||||
export default ClassNames;
|
||||
Reference in a new issue