Compare commits
7 Commits
dd4f848071
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| dcfad5fcd6 | |||
| 9b8b59d4e6 | |||
|
|
dc7e82b143 | ||
|
|
703b611dfd | ||
| 9b58851c42 | |||
| 6142b6c9cc | |||
| cfdecde769 |
@@ -1,41 +1,41 @@
|
||||
import React, {Children, useState} from "react";
|
||||
import {AiFillLeftCircle} from 'react-icons/ai';
|
||||
import React, { useState } from "react";
|
||||
import { AiFillLeftCircle } from "react-icons/ai";
|
||||
|
||||
export const ImageSlide = ({ children }: any) => {
|
||||
const [current, setCurrent] = useState(0);
|
||||
const length = children.length;
|
||||
|
||||
export const ImageSlide = ({children}:any) => {
|
||||
const [current, setCurrent] = useState(0);
|
||||
const length = children.length;
|
||||
|
||||
const array = Children.toArray(children);
|
||||
console.log(array)
|
||||
|
||||
const nextSlide = () => {
|
||||
setCurrent(current === length - 1 ? 0 : current + 2);
|
||||
};
|
||||
const nextSlide = () => {
|
||||
setCurrent(current === length - 1 ? 0 : current + 2);
|
||||
};
|
||||
|
||||
const prevSlide = () => {
|
||||
setCurrent(current === 0 ? length - 1 : current - 2);
|
||||
};
|
||||
if(children.length <= 0){
|
||||
return null;
|
||||
};
|
||||
const prevSlide = () => {
|
||||
setCurrent(current === 0 ? length - 1 : current - 2);
|
||||
};
|
||||
if (children.length <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return(
|
||||
<section className='slider'>
|
||||
<AiFillLeftCircle className='left-arrow' onClick={prevSlide} />
|
||||
<AiFillLeftCircle className='right-arrow' onClick={nextSlide} />
|
||||
{children.map((slide : any, index : any) => {
|
||||
return (
|
||||
<div
|
||||
className={index === current ? 'slide active' : 'slide'}
|
||||
key={index}
|
||||
>
|
||||
{index === current && (
|
||||
<img src={slide.props.children[0]} alt='travel image' className='image' />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
return (
|
||||
<section className="slider">
|
||||
<AiFillLeftCircle className="left-arrow" onClick={prevSlide} />
|
||||
<AiFillLeftCircle className="right-arrow" onClick={nextSlide} />
|
||||
{children.map((slide: any, index: any) => {
|
||||
return (
|
||||
<div
|
||||
className={index === current ? "slide active" : "slide"}
|
||||
key={index}
|
||||
>
|
||||
{index === current && (
|
||||
<img
|
||||
src={slide.props.children[0]}
|
||||
alt="travel image"
|
||||
className="image"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ export const Navbar = () => {
|
||||
const [showMenu, setShowMenu] = useState(false);
|
||||
|
||||
return (
|
||||
<nav className="py-4 xl:px-10 px-4 flex flex-row justify-between sticky top-0 bg-slate-100 dark:bg-gradient-dark z-50 border-b dark:border-gradient-light border-gray-200">
|
||||
<nav className="py-4 xl:px-10 px-4 flex flex-row justify-between sticky top-0 z-50 bg-gradient-to-b from-black/50 to-black/30">
|
||||
<Link
|
||||
href="/"
|
||||
id="logo"
|
||||
@@ -28,7 +28,7 @@ export const Navbar = () => {
|
||||
<div className="hidden xl:flex flex-row gap-10 items-center font-medium font-mono">
|
||||
{links.map(({ name, href }) => (
|
||||
<Link href={href} key={name}>
|
||||
<button className="px-10 py-1 rounded-sm bg-primary hover:bg-primary/50 transition-all duration-150 ease-out text-white">
|
||||
<button className="px-10 py-1 rounded-sm bg-gradient-to-r from-indigo-500/30 to-fuchsia-500/20 hover:bg-primary/50 transition-all duration-150 ease-out text-white">
|
||||
{name}
|
||||
</button>
|
||||
</Link>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useRef, useMemo } from 'react'
|
||||
import { Canvas, useFrame } from '@react-three/fiber'
|
||||
import { useRef, useMemo } from "react";
|
||||
import { Canvas, useFrame } from "@react-three/fiber";
|
||||
import { BufferGeometry, Material, MathUtils, Mesh } from "three";
|
||||
import { vertexShader } from './Shaders/Background/vertex';
|
||||
import { fragmentShader } from './Shaders/Background/fragment';
|
||||
import { vertexShader } from "./Shaders/Background/vertex";
|
||||
import { fragmentShader } from "./Shaders/Background/fragment";
|
||||
|
||||
const Fragment = () => {
|
||||
// This reference will give us direct access to the mesh
|
||||
@@ -21,12 +21,13 @@ const Fragment = () => {
|
||||
);
|
||||
|
||||
useFrame((state) => {
|
||||
if(!meshRef.current){
|
||||
return;
|
||||
if (!meshRef.current) {
|
||||
return;
|
||||
}
|
||||
const { clock } = state;
|
||||
//@ts-ignore
|
||||
meshRef.current.material.uniforms.u_time.value = 0.4 * clock.getElapsedTime()/5;
|
||||
meshRef.current.material.uniforms.u_time.value =
|
||||
(0.4 * clock.getElapsedTime()) / 5;
|
||||
//@ts-ignore
|
||||
meshRef.current.material.uniforms.u_intensity.value = MathUtils.lerp(
|
||||
//@ts-ignore
|
||||
@@ -37,7 +38,12 @@ const Fragment = () => {
|
||||
});
|
||||
|
||||
return (
|
||||
<mesh ref={meshRef} position={[0, 0, 0]} rotation={[-Math.PI/17, Math.PI/20, 0]} scale={1.5}>
|
||||
<mesh
|
||||
ref={meshRef}
|
||||
position={[0, 0, 0]}
|
||||
rotation={[-Math.PI / 17, Math.PI / 20, 0]}
|
||||
scale={1.5}
|
||||
>
|
||||
<planeGeometry args={[30, 30, 200, 200]} />
|
||||
<shaderMaterial
|
||||
fragmentShader={fragmentShader}
|
||||
@@ -49,13 +55,12 @@ const Fragment = () => {
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export const R3Gradient = () => {
|
||||
return (
|
||||
<div className='-z-40 h-screen w-screen fixed bg-black opacity-60'>
|
||||
return (
|
||||
<div className="-z-40 h-screen w-screen fixed bg-black opacity-60 top-0 left-0 blur">
|
||||
<Canvas camera={{ position: [0.0, 0.0, 5.0] }}>
|
||||
<Fragment />
|
||||
</Canvas>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,253 +0,0 @@
|
||||
---
|
||||
title: "Markdown test"
|
||||
date: 29.12.2022
|
||||
author: kookroach
|
||||
authorLink: https://git.peroxy.dev/kookroach
|
||||
description: Short description
|
||||
---
|
||||
|
||||
# USE ONLY H3 TAGS FOR HEADER HYPERLINKS
|
||||
### Test heading
|
||||
|
||||
|
||||
|
||||
## Horizontal Rules
|
||||
|
||||
___
|
||||
|
||||
---
|
||||
|
||||
***
|
||||
|
||||
|
||||
## Typographic replacements
|
||||
|
||||
Enable typographer option to see result.
|
||||
|
||||
(c) (C) (r) (R) (tm) (TM) (p) (P) +-
|
||||
|
||||
|
||||
test.. test... test.... test..... test?..... test!....
|
||||
|
||||
|
||||
!!!!!! ???? ,, -- ---
|
||||
|
||||
"Smartypants, double quotes" and 'single quotes'
|
||||
|
||||
|
||||
## Emphasis
|
||||
|
||||
**This is bold text**
|
||||
|
||||
__This is bold text__
|
||||
|
||||
*This is italic text*
|
||||
|
||||
_This is italic text_
|
||||
|
||||
~~Strikethrough~~
|
||||
|
||||
|
||||
## Blockquotes
|
||||
|
||||
|
||||
> Blockquotes can also be nested...
|
||||
>> ...by using additional greater-than signs right next to each other...
|
||||
> > > ...or with spaces between arrows.
|
||||
|
||||
|
||||
## Lists
|
||||
|
||||
Unordered
|
||||
|
||||
+ Create a list by starting a line with `+`, `-`, or `*`
|
||||
+ Sub-lists are made by indenting 2 spaces:
|
||||
- Marker character change forces new list start:
|
||||
* Ac tristique libero volutpat at
|
||||
+ Facilisis in pretium nisl aliquet
|
||||
- Nulla volutpat aliquam velit
|
||||
+ Very easy!
|
||||
|
||||
Ordered
|
||||
|
||||
1. Lorem ipsum dolor sit amet
|
||||
2. Consectetur adipiscing elit
|
||||
3. Integer molestie lorem at massa
|
||||
|
||||
|
||||
1. You can use sequential numbers...
|
||||
1. ...or keep all the numbers as `1.`
|
||||
|
||||
Start numbering with offset:
|
||||
|
||||
57. foo
|
||||
1. bar
|
||||
|
||||
|
||||
https://www.youtube.com/watch?v=lrBRV3WK2x4
|
||||
|
||||
|
||||
## Code
|
||||
|
||||
Inline `code`
|
||||
|
||||
Indented code
|
||||
|
||||
// Some comments
|
||||
line 1 of code
|
||||
line 2 of code
|
||||
line 3 of code
|
||||
|
||||
|
||||
Block code "fences"
|
||||
|
||||
```
|
||||
Sample text here...
|
||||
```
|
||||
|
||||
Syntax highlighting
|
||||
|
||||
```tsx
|
||||
var foo = function (bar) {
|
||||
return bar++;
|
||||
};
|
||||
|
||||
console.log(foo(5));
|
||||
```
|
||||
|
||||
```tsx line=200, title="pidhsome je"
|
||||
var foo = function (bar) {
|
||||
return bar++;
|
||||
};
|
||||
|
||||
console.log(foo(5));
|
||||
```
|
||||
|
||||
## Tables
|
||||
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| data | path to data files to supply the data that will be passed into templates. |
|
||||
| engine | engine to be used for processing templates. Handlebars is the default. |
|
||||
| ext | extension to be used for dest files. |
|
||||
|
||||
Right aligned columns
|
||||
|
||||
| Option | Description |
|
||||
| ------:| -----------:|
|
||||
| data | path to data files to supply the data that will be passed into templates. |
|
||||
| engine | engine to be used for processing templates. Handlebars is the default. |
|
||||
| ext | extension to be used for dest files. |
|
||||
|
||||
|
||||
## Links
|
||||
|
||||
[link text](http://dev.nodeca.com)
|
||||
|
||||
[link with title](http://nodeca.github.io/pica/demo/ "title text!")
|
||||
|
||||
Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
|
||||
|
||||
|
||||
## Images
|
||||
|
||||

|
||||

|
||||
|
||||
Like links, Images also have a footnote style syntax
|
||||
|
||||
![Alt text][id]
|
||||
|
||||
With a reference later in the document defining the URL location:
|
||||
|
||||
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
|
||||
|
||||
|
||||
## Plugins
|
||||
|
||||
The killer feature of `markdown-it` is very effective support of
|
||||
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).
|
||||
|
||||
|
||||
### [Emojies](https://github.com/markdown-it/markdown-it-emoji)
|
||||
|
||||
> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
|
||||
>
|
||||
> Shortcuts (emoticons): :-) :-( 8-) ;)
|
||||
|
||||
see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji.
|
||||
|
||||
|
||||
### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup)
|
||||
|
||||
- 19^th^
|
||||
- H~2~O
|
||||
|
||||
|
||||
### [\<ins>](https://github.com/markdown-it/markdown-it-ins)
|
||||
|
||||
++Inserted text++
|
||||
|
||||
|
||||
### [\<mark>](https://github.com/markdown-it/markdown-it-mark)
|
||||
|
||||
==Marked text==
|
||||
|
||||
|
||||
### [Footnotes](https://github.com/markdown-it/markdown-it-footnote)
|
||||
|
||||
Footnote 1 link[^first].
|
||||
|
||||
Footnote 2 link[^second].
|
||||
|
||||
Inline footnote^[Text of inline footnote] definition.
|
||||
|
||||
Duplicated footnote reference[^second].
|
||||
|
||||
[^first]: Footnote **can have markup**
|
||||
|
||||
and multiple paragraphs.
|
||||
|
||||
[^second]: Footnote text.
|
||||
|
||||
|
||||
### [Definition lists](https://github.com/markdown-it/markdown-it-deflist)
|
||||
|
||||
Term 1
|
||||
|
||||
: Definition 1
|
||||
with lazy continuation.
|
||||
|
||||
Term 2 with *inline markup*
|
||||
|
||||
: Definition 2
|
||||
|
||||
{ some code, part of Definition 2 }
|
||||
|
||||
Third paragraph of definition 2.
|
||||
|
||||
_Compact style:_
|
||||
|
||||
Term 1
|
||||
~ Definition 1
|
||||
|
||||
Term 2
|
||||
~ Definition 2a
|
||||
~ Definition 2b
|
||||
|
||||
|
||||
### [Abbreviations](https://github.com/markdown-it/markdown-it-abbr)
|
||||
|
||||
This is HTML abbreviation example.
|
||||
|
||||
It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.
|
||||
|
||||
*[HTML]: Hyper Text Markup Language
|
||||
|
||||
### [Custom containers](https://github.com/markdown-it/markdown-it-container)
|
||||
|
||||
::: warning
|
||||
*here be dragons*
|
||||
:::
|
||||
|
||||
[go to 3rd heading](#test-heading)
|
||||
@@ -3,7 +3,7 @@ export default function Home() {
|
||||
return (
|
||||
<MainLayout>
|
||||
<div className="grid lg:grid-cols-2 grid-cols-1 xl:mt-10 gap-10 items-center">
|
||||
<div className="bg-primary-dark p-10 rounded-lg flex flex-col gap-10 h-fit 3xl:w-2/3 w-full text-lg text-primary-text/90 shadow-lg shadow-gradient-dark/20">
|
||||
<div className="bg-primary-dark/30 border-white/30 border p-10 rounded-lg flex flex-col gap-10 h-fit 3xl:w-2/3 w-full text-lg text-primary-text/90 shadow-lg shadow-gradient-dark/20">
|
||||
<div>
|
||||
<span className="font-bold text-xl text-primary-text">
|
||||
Lorem ipsum dolor{" "}
|
||||
|
||||
@@ -4,8 +4,6 @@ import fs from "fs";
|
||||
import { FrontMatter, MarkdownDocument } from "../types/types";
|
||||
import { remark } from "remark";
|
||||
import html from "remark-html";
|
||||
import remarkGfm from "remark-gfm";
|
||||
|
||||
|
||||
export const BLOGS_PATH = join(process.cwd(), "content/blogs");
|
||||
export const PROJECTS_PATH = join(process.cwd(), "content/projects");
|
||||
@@ -14,6 +12,14 @@ export interface Post {
|
||||
slug: string;
|
||||
}
|
||||
|
||||
const getDate = (date: string) => {
|
||||
if (typeof date === "string") {
|
||||
const d = date.split(".").map((v) => +v);
|
||||
return new Date(d[2], d[1] - 1, d[0]);
|
||||
}
|
||||
return new Date();
|
||||
};
|
||||
|
||||
export const getBlogContentBySlug = (slug: string): MarkdownDocument => {
|
||||
const filepath = join(BLOGS_PATH, `${slug}.md` || `${slug}.mdx`);
|
||||
const filecontents = fs.readFileSync(filepath);
|
||||
@@ -40,22 +46,32 @@ export const getProjectContentBySlug = (slug: string): MarkdownDocument => {
|
||||
export const getAllBlogsFrontMatter = (): Post[] => {
|
||||
const files = fs.readdirSync(BLOGS_PATH);
|
||||
|
||||
return files.reduce((allPosts: Post[], postSlug: string) => {
|
||||
const blogs = files.reduce((allPosts: Post[], postSlug: string) => {
|
||||
const slug = postSlug.replace(".md", "");
|
||||
const post = getBlogContentBySlug(slug);
|
||||
|
||||
return [{ frontMatter: post.frontMatter, slug }, ...allPosts];
|
||||
}, []);
|
||||
|
||||
return blogs.sort(
|
||||
//@ts-ignore
|
||||
(a, b) => getDate(b.frontMatter.date) - getDate(a.frontMatter.date)
|
||||
);
|
||||
};
|
||||
export const getAllProjectsFrontMatter = (): Post[] => {
|
||||
const files = fs.readdirSync(PROJECTS_PATH);
|
||||
|
||||
return files.reduce((allPosts: Post[], postSlug: string) => {
|
||||
const projects = files.reduce((allPosts: Post[], postSlug: string) => {
|
||||
const slug = postSlug.replace(".md", "");
|
||||
const post = getProjectContentBySlug(slug);
|
||||
|
||||
return [{ frontMatter: post.frontMatter, slug }, ...allPosts];
|
||||
}, []);
|
||||
|
||||
return projects.sort(
|
||||
//@ts-ignore
|
||||
(a, b) => getDate(b.frontMatter.date) - getDate(a.frontMatter.date)
|
||||
);
|
||||
};
|
||||
|
||||
export async function markdownToHtml(markdown: any) {
|
||||
|
||||
Reference in New Issue
Block a user