Skip to content

Commit

Permalink
cleanup: split card into multiple components
Browse files Browse the repository at this point in the history
  • Loading branch information
max1mde committed Dec 11, 2024
1 parent 2d83de8 commit 2e94486
Show file tree
Hide file tree
Showing 27 changed files with 236 additions and 236 deletions.
4 changes: 2 additions & 2 deletions public/scripts/hover.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
*
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
Expand Down
4 changes: 2 additions & 2 deletions public/scripts/scroll.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
*
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
Expand Down
15 changes: 5 additions & 10 deletions scripts/add-headers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
*
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
Expand All @@ -11,7 +11,7 @@ const fs = require("fs").promises;
const path = require("path");

const CURRENT_YEAR = new Date().getFullYear();
const GITHUB_LINK = "https://github.com/max1mde";
const GITHUB_LINK = "https://github.com/max1mde/portfolio";

function createLicenseHeader(year) {
return `/**
Expand Down Expand Up @@ -40,7 +40,7 @@ function hasLicenseHeader(content, licenseHeader) {
};

const contentStripped = stripYear(
content.split("\n").slice(0, 10).join("\n")
content.split("\n").slice(0, 10).join("\n"),
);
const headerStripped = stripYear(licenseHeader);

Expand All @@ -53,18 +53,15 @@ async function processFile(filePath) {
const existingYear = extractCopyrightYear(content);
const licenseHeader = createLicenseHeader(CURRENT_YEAR);


if (!hasLicenseHeader(content, licenseHeader)) {

if (existingYear && existingYear !== CURRENT_YEAR) {
const updatedContent = content.replace(
/Copyright \(C\) \d{4}/,
`Copyright (C) ${CURRENT_YEAR}`
`Copyright (C) ${CURRENT_YEAR}`,
);
await fs.writeFile(filePath, updatedContent);
console.log(`Updated copyright year in: ${filePath}`);
} else {

await fs.writeFile(filePath, licenseHeader + content);
console.log(`Added license header to: ${filePath}`);
}
Expand All @@ -82,7 +79,6 @@ async function addLicenseHeaders(dir) {
const stat = await fs.stat(fullPath);

if (stat.isDirectory()) {

const skipDirs = ["node_modules", ".next", ".git", "dist", "build"];
if (!skipDirs.includes(file)) {
await addLicenseHeaders(fullPath);
Expand All @@ -98,7 +94,6 @@ async function addLicenseHeaders(dir) {
}
}


addLicenseHeaders(process.cwd())
.then(() => console.log("License header processing complete"))
.catch(console.error);
2 changes: 1 addition & 1 deletion src/app/api/contact/route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand Down
4 changes: 2 additions & 2 deletions src/app/contact/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
*
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
Expand Down
2 changes: 1 addition & 1 deletion src/app/home/page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand Down
8 changes: 2 additions & 6 deletions src/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -17,7 +17,6 @@ import Script from "next/script";
import CustomCursor from "@/components/custom/cursor";
import Footer from "@/components/custom/footer";

import Head from "next/head";

const deliusFont = localFont({
src: "./fonts/DeliusSwashCaps-Regular.ttf",
Expand Down Expand Up @@ -53,10 +52,6 @@ export default function RootLayout({ children }) {

return (
<html lang="en">
<Head>
<Script src="scripts/scroll.js" strategy="afterInteractive" />
</Head>

<body
className={`${selectedFont.variable} antialiased flex flex-col min-h-screen`}
>
Expand All @@ -66,6 +61,7 @@ export default function RootLayout({ children }) {
<Navbar />
<main className="flex-1 p-4">{children}</main>
<Footer config={config} />
<Script src="scripts/hover.js" strategy="afterInteractive" />
</body>
</html>
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/privacy/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
*
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
Expand Down
4 changes: 2 additions & 2 deletions src/app/projects/page.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
*/
"use client";

import { Card } from "@/components/custom/card";
import { Card } from "@/components/custom/card/card";
import { useState, useEffect, useRef } from "react";
import config from "/CONFIG.json";

Expand Down
4 changes: 2 additions & 2 deletions src/components/custom/action_buttons.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Portfolio
* Copyright (C) 2024 Maxim (https://github.com/max1mde)
*
* Copyright (C) 2024 Maxim (https://github.com/max1mde/portfolio)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation.
Expand Down
181 changes: 0 additions & 181 deletions src/components/custom/card.jsx

This file was deleted.

Loading

0 comments on commit 2e94486

Please sign in to comment.