migrating to astro
This commit is contained in:
11
astro.config.mjs
Normal file
11
astro.config.mjs
Normal file
@ -0,0 +1,11 @@
|
||||
import { defineConfig } from "astro/config";
|
||||
import mdx from "@astrojs/mdx";
|
||||
import react from "@astrojs/react";
|
||||
|
||||
import sitemap from "@astrojs/sitemap";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: "https://example.com",
|
||||
integrations: [react(), mdx(), sitemap()],
|
||||
});
|
@ -4,6 +4,8 @@
|
||||
"description": "Personal website",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"astro:build": "astro build",
|
||||
"astro:dev": "astro dev",
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
@ -17,6 +19,10 @@
|
||||
"vite": "^2.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^0.9.0",
|
||||
"@astrojs/react": "^1.0.0",
|
||||
"@astrojs/sitemap": "^1.0.0",
|
||||
"astro": "^1.0.5",
|
||||
"clsx": "^1.1.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^17.0.2",
|
||||
|
3209
pnpm-lock.yaml
generated
3209
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,34 +1,13 @@
|
||||
//============================================================
|
||||
// Essential Imports
|
||||
//============================================================
|
||||
|
||||
import clsx from "clsx";
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
//============================================================
|
||||
// Component
|
||||
//============================================================
|
||||
import React from "react";
|
||||
|
||||
const FadeComponent = ({ delay, children }) => {
|
||||
const [showComponent, setShowComponent] = useState("opacity-0");
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setShowComponent("opacity-100");
|
||||
}, delay);
|
||||
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="w-full bg-polar-night-400">
|
||||
<div
|
||||
className={clsx(
|
||||
"w-full transition-all ease-in-out duration-500 ",
|
||||
showComponent
|
||||
)}
|
||||
className={
|
||||
"w-full transition-all ease-in-out duration-500"
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
@ -3,6 +3,7 @@
|
||||
//============================================================
|
||||
|
||||
import React from "react";
|
||||
import '../../index.css';
|
||||
|
||||
//============================================================
|
||||
// Imported Components
|
||||
@ -19,7 +20,7 @@ import Projects from '../sections/Projects';
|
||||
// Component
|
||||
//============================================================
|
||||
|
||||
const DELAY = 750;
|
||||
const DELAY = 0;
|
||||
|
||||
const FrontPage = () => {
|
||||
return (
|
@ -1,35 +1,10 @@
|
||||
//============================================================
|
||||
// Essential Imports
|
||||
//============================================================
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
//============================================================
|
||||
// Component
|
||||
//============================================================
|
||||
import clsx from 'clsx';
|
||||
|
||||
const AppearText = ({ text, delay, className }) => {
|
||||
const [showText, setShowText] = useState("opacity-0");
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setShowText("opacity-100");
|
||||
}, delay);
|
||||
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1
|
||||
className={clsx(
|
||||
"transition-all ease-in-out duration-500",
|
||||
className,
|
||||
showText
|
||||
)}
|
||||
className={clsx("transition-all ease-in-out duration-500", className)}
|
||||
>
|
||||
{text}
|
||||
</h1>
|
||||
|
11
src/pages/index.astro
Normal file
11
src/pages/index.astro
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
import FrontPage from '../components/pages/FrontPage';
|
||||
---
|
||||
<html>
|
||||
<head>
|
||||
<title>My Homepage</title>
|
||||
</head>
|
||||
<body>
|
||||
<FrontPage></FrontPage>
|
||||
</body>
|
||||
</html>
|
5
src/pages/test.md
Normal file
5
src/pages/test.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
---
|
||||
# Hello world
|
||||
|
||||
## Just testing
|
Reference in New Issue
Block a user