diff --git a/README.md b/README.md index 5c91169..f315440 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,20 @@ -# create-svelte - -Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). - -## Creating a project - -If you're seeing this, you've probably already done this step. Congrats! - -```bash -# create a new project in the current directory -npm create svelte@latest - -# create a new project in my-app -npm create svelte@latest my-app -``` - -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: +# [ngn13.fun](https://ngn13.fun) | my personal website +This is the frontend application for my personal website, it's written in SvelteKit and vanilla CSS +## development setup ```bash +git clone https://github.com/ngn13/ngn13.fun && cd ngn13.fun +npm i npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open ``` -## Building - -To create a production version of your app: - +## build setup ```bash +git clone https://github.com/ngn13/ngn13.fun && cd ngn13.fun +npm i npm run build ``` -You can preview the production build with `npm run preview`. - -> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. +## license +you cannot publish my website or parts of it on any server/domain without my permission +if you want to do this (for some reason) [contact me](mailto:ngn13proton@proton.me) diff --git a/package-lock.json b/package-lock.json index 95393d9..186f9a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,11 @@ "": { "name": "website", "version": "0.0.1", + "dependencies": { + "@types/dompurify": "^3.0.2", + "dompurify": "^3.0.5", + "marked": "^7.0.4" + }, "devDependencies": { "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/kit": "^1.20.4", @@ -527,12 +532,25 @@ "integrity": "sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==", "dev": true }, + "node_modules/@types/dompurify": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.0.2.tgz", + "integrity": "sha512-YBL4ziFebbbfQfH5mlC+QTJsvh0oJUrWbmxKMyEdL7emlHJqGR2Qb34TEFKj+VCayBvjKy3xczMFNhugThUsfQ==", + "dependencies": { + "@types/trusted-types": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", "dev": true }, + "node_modules/@types/trusted-types": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.3.tgz", + "integrity": "sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==" + }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -651,6 +669,11 @@ "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==", "dev": true }, + "node_modules/dompurify": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.5.tgz", + "integrity": "sha512-F9e6wPGtY+8KNMRAVfxeCOHU0/NPWMSENNq4pQctuXRqqdEPW7q3CrLbR5Nse044WwacyjHGOMlvNsBe1y6z9A==" + }, "node_modules/esbuild": { "version": "0.18.17", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.17.tgz", @@ -763,6 +786,17 @@ "node": ">=12" } }, + "node_modules/marked": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-7.0.4.tgz", + "integrity": "sha512-t8eP0dXRJMtMvBojtkcsA7n48BkauktUKzfkPSCq85ZMTJ0v76Rke4DYz01omYpPTUh4p/f7HePgRo3ebG8+QQ==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 16" + } + }, "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -1338,12 +1372,25 @@ "integrity": "sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==", "dev": true }, + "@types/dompurify": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.0.2.tgz", + "integrity": "sha512-YBL4ziFebbbfQfH5mlC+QTJsvh0oJUrWbmxKMyEdL7emlHJqGR2Qb34TEFKj+VCayBvjKy3xczMFNhugThUsfQ==", + "requires": { + "@types/trusted-types": "*" + } + }, "@types/estree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", "dev": true }, + "@types/trusted-types": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.3.tgz", + "integrity": "sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==" + }, "acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -1433,6 +1480,11 @@ "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==", "dev": true }, + "dompurify": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.5.tgz", + "integrity": "sha512-F9e6wPGtY+8KNMRAVfxeCOHU0/NPWMSENNq4pQctuXRqqdEPW7q3CrLbR5Nse044WwacyjHGOMlvNsBe1y6z9A==" + }, "esbuild": { "version": "0.18.17", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.17.tgz", @@ -1521,6 +1573,11 @@ "@jridgewell/sourcemap-codec": "^1.4.15" } }, + "marked": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-7.0.4.tgz", + "integrity": "sha512-t8eP0dXRJMtMvBojtkcsA7n48BkauktUKzfkPSCq85ZMTJ0v76Rke4DYz01omYpPTUh4p/f7HePgRo3ebG8+QQ==" + }, "mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", diff --git a/package.json b/package.json index ede4b8a..5c59c6f 100644 --- a/package.json +++ b/package.json @@ -13,5 +13,10 @@ "svelte": "^4.0.5", "vite": "^4.4.2" }, - "type": "module" + "type": "module", + "dependencies": { + "@types/dompurify": "^3.0.2", + "dompurify": "^3.0.5", + "marked": "^7.0.4" + } } diff --git a/src/app.html b/src/app.html index 9324995..ab40404 100644 --- a/src/app.html +++ b/src/app.html @@ -2,7 +2,7 @@ - + %sveltekit.head% diff --git a/src/lib/card_link.svelte b/src/lib/card_link.svelte new file mode 100644 index 0000000..e994092 --- /dev/null +++ b/src/lib/card_link.svelte @@ -0,0 +1,67 @@ + + + + +
+ {current} +
+
+ +
+
+ + diff --git a/src/lib/header.svelte b/src/lib/header.svelte index f7806ac..e215e01 100644 --- a/src/lib/header.svelte +++ b/src/lib/header.svelte @@ -9,8 +9,7 @@ diff --git a/src/lib/project.svelte b/src/lib/project.svelte new file mode 100644 index 0000000..6e7064d --- /dev/null +++ b/src/lib/project.svelte @@ -0,0 +1,57 @@ + + +
+ +

ï„Ą

+
+

+

{desc}

+
+
+ + diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte new file mode 100644 index 0000000..f43feb2 --- /dev/null +++ b/src/routes/+error.svelte @@ -0,0 +1,8 @@ + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 6396dc6..63b47e0 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,10 +5,10 @@ [ngn] | homepage - + - +
@@ -16,45 +16,101 @@ hello world!
-
- - 👋 Hello! I'm ngn! - - +
+
+ + 👋 Hello! I'm ngn! +
    +
  • đŸ‡čđŸ‡· I'm a high school student from Turkey
  • +
  • đŸ–„ïž I'm interested in cyber security, programming and electronics
  • +
  • ❀ I love and support Free/Libre and Open Source Software (FLOSS)
  • +
  • 🐧 My GNU/Linux distribution of choice is Artix
  • +
  • 😋 In my free time, I like playing Minecraft
  • +
+
- - You are currently on my personal website, for all you nerds, here is some - techinal details you may want to know: -
    -
  •  I built the frontend app using SvelteKit -
  • îȘ„ I deploy my app to vecel using Github actions
  • -
  • 󰒋 Backend server is written in Go and it's hosted on my server
  • -
  • îźą And yup, I also have other services hosted on it
  • -
-
+ + You are currently on my personal website, for all you nerds, here is some + techinal details you may want to know: +
    +
  •  I built the frontend app using SvelteKit
  • +
  • îȘ„ I deploy my app to vercel using Github actions
  • +
  • 󰒋 Backend server is written in Go and it's hosted on my server
  • +
  • îźą And yup, I also have other services hosted on the same server
  • +
+
+
+ +
+ + I usually spend my time... +
    +
  •  building random projects
  • +
  • 󰓂 contributing stuff that I like
  • +
  • 󰈻 solving CTFs
  • +
  • 󰌱 customizing my desktop
  • +
  • 󱀉 posting random stuff on my blog, which you should definitely check out (it's very active)
  • +
+
+ + + If you want to have a chat, you can find me on the following platforms: + + Or you can DM me on matrix: +
+ @ngn:matrix.ngn13.fun +
+
+
+ +
+

v3.0

diff --git a/src/routes/blog/[id]/+page.server.js b/src/routes/blog/[id]/+page.server.js new file mode 100644 index 0000000..7592e51 --- /dev/null +++ b/src/routes/blog/[id]/+page.server.js @@ -0,0 +1,14 @@ +export async function load({ fetch, params }) { + const id = params.id + const api = import.meta.env.VITE_API_URL_DEV + const res = await fetch(api+"/blog/get?id="+id) + const data = await res.json() + + if (data["error"] != "") { + return { + error: data["error"] + } + } + + return data["result"] +} diff --git a/src/routes/blog/[id]/+page.svelte b/src/routes/blog/[id]/+page.svelte new file mode 100644 index 0000000..531e3e7 --- /dev/null +++ b/src/routes/blog/[id]/+page.svelte @@ -0,0 +1,163 @@ + + + + [ngn] | blog + + + + + + +
+ {data.title} +

{data.author} | {data.date}

+
+ +
+ +
+ {@html sanitized} +
+
+

{upvote()}} class="{upvote_status}">󰜷

+

{data.vote}

+

{downvote()}} class="{downvote_status}">󰜼

+
+
+ + diff --git a/src/routes/projects/+page.js b/src/routes/projects/+page.js new file mode 100644 index 0000000..088c8cb --- /dev/null +++ b/src/routes/projects/+page.js @@ -0,0 +1,35 @@ +export async function load({ fetch }) { + const api = import.meta.env.VITE_API_URL_DEV + const res = await fetch(api+"/projects/get") + const data = await res.json() + + if (data["error"] != ""){ + return { + error: data["error"] + } + } + + let all = data["result"] + let counter = 0 + let currentlist = [] + let projects = [] + + for (let i = 0; i < all.length; i++){ + currentlist.push(all[i]) + counter += 1 + + if(i == all.length-1 && counter != 3){ + projects.push(currentlist) + } + + if (counter == 3) { + projects.push(currentlist) + currentlist = [] + counter = 0 + } + } + + return { + projects + } +} diff --git a/src/routes/projects/+page.svelte b/src/routes/projects/+page.svelte index 783894b..555029c 100644 --- a/src/routes/projects/+page.svelte +++ b/src/routes/projects/+page.svelte @@ -1,17 +1,50 @@ + import Project from "../../lib/project.svelte"; + export let data + console.log(data) + [ngn] | projects - + - + -
ls -l projects
+
ls -l projects
+
+ {#each data.projects as projectlist} +
+ {#each projectlist as project} + {project.name} + {/each} +
+ {/each} +
+ +@media only screen and (max-width: 1316px) { + .flexrow { + flex-direction: column; + } +} + diff --git a/static/click.wav b/static/click.wav new file mode 100644 index 0000000..2183344 Binary files /dev/null and b/static/click.wav differ diff --git a/static/github.css b/static/github.css index 43c671c..8d779dc 100644 --- a/static/github.css +++ b/static/github.css @@ -47,6 +47,9 @@ } .markdown-body a { + animation-name: colorAnimation; + animation-iteration-count: infinite; + animation-duration: 10s; background-color: transparent; color: #58a6ff; text-decoration: none; diff --git a/static/global.css b/static/global.css index 6de860d..870b997 100644 --- a/static/global.css +++ b/static/global.css @@ -25,17 +25,15 @@ } body { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; background: var(--dark-one); font-family: "Ubuntu", sans-serif; overflow-x: hidden; } +::selection { + background: rgba(0, 0, 0, 0.7); +} + ::-webkit-scrollbar { border-radius: 10px; width: 10px; @@ -296,7 +294,7 @@ body { } } -c { +.c, c { animation-name: colorAnimation; animation-iteration-count: infinite; animation-duration: 10s; diff --git a/svelte.config.js b/svelte.config.js index 348fa32..a1e369f 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -7,7 +7,12 @@ const config = { // If your environment is not supported or you settled on a specific environment, switch out the adapter. // See https://kit.svelte.dev/docs/adapters for more information about adapters. adapter: adapter() - } + }, + + onwarn: (warning, handler) => { + if (warning.code === "a11y-click-events-have-key-events") return + handler(warning) + }, }; export default config;