Compare commits

...

18 commits

Author SHA1 Message Date
9e56458726 Merge pull request 'main' (#1) from React-Group/react-typescript-test:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/sageTheDm/react-typescript-test/pulls/1
2024-09-04 22:07:29 +02:00
f99a5353de Merge pull request 'Fixed my mistake' (#3) from sageTheDm/react-typescript-test:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/React-Group/react-typescript-test/pulls/3
2024-09-04 22:06:51 +02:00
8438ec2f9c Update app/LandingPage.tsx 2024-09-04 21:27:47 +02:00
8e4ba2de74 Update app/App.css 2024-09-04 21:27:26 +02:00
bab57ab5a8 Update app/App.css 2024-09-04 21:24:16 +02:00
d2ddd362a9 Update app/App.css 2024-09-04 21:21:29 +02:00
dc850140b3 Update app/LandingPage.tsx 2024-09-04 21:21:06 +02:00
cc42680e34 Update app/LandingPage.tsx 2024-09-04 21:17:26 +02:00
f6fabd0c2c Update next.config.mjs 2024-09-04 21:15:18 +02:00
02156bd30c Update next.config.mjs 2024-09-04 21:13:28 +02:00
ca090ed4ab Update next.config.mjs 2024-09-04 21:11:49 +02:00
f812ac1d2b Update next.config.mjs 2024-09-04 21:10:21 +02:00
47e7c006bf Update next.config.mjs 2024-09-04 20:57:29 +02:00
595b50585b Update package.json 2024-09-04 20:18:21 +02:00
5d2a13de4c Merge pull request 'Changes' (#2) from Patrick_Pluto/react-typescript-test:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/React-Group/react-typescript-test/pulls/2
2024-09-04 19:40:20 +02:00
patrick_pluto
bce1f05798 My site + corrections 2024-09-04 19:39:20 +02:00
11398dc7d8 Merge pull request 'reqd' (#1) from React-Group/react-typescript-test:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/Patrick_Pluto/react-typescript-test/pulls/1
2024-09-04 18:24:38 +02:00
bde28dbd8b Merge pull request 'Prepared the react project to avoid merge conflicts' (#1) from sageTheDm/react-typescript-test:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/React-Group/react-typescript-test/pulls/1
2024-09-04 18:23:48 +02:00
4 changed files with 84 additions and 15 deletions

View file

@ -8,7 +8,7 @@ const Home = () => {
<div className="home-container">
<h2>About Us</h2>
<p>
We are a group of informatics students from IMS (Informatik Schule Sargans), currently learning React to prepare for an upcoming project. This project will be part of our traineeship at a company, where we'll apply our skills in a real-world setting. Our coursework in React is equipping us with the knowledge and experience needed to excel in this practical opportunity.
We are a group of IT students from IMS (Informatikmittelschule), currently learning React to prepare for an upcoming project. This project will be part of our traineeship at a company, where we'll apply our skills in a real-world setting. Our coursework in React is equipping us with the knowledge and experience needed to excel in this practical opportunity.
</p>
<section className="cards">
@ -24,7 +24,7 @@ const Home = () => {
<div className="card">
<a href="https://interstellardevelopment.org/code/sageTheDm" className="card-link" target="_blank" rel="noopener noreferrer">
<img src="/img/sage.png" alt="Sage" />
<img src="/img/sage.png" alt="Luca" />
<h3>Luca</h3>
<p>
Luca, Patrick's co-programmer, is skilled in Java, GDScript, Bash, and Basic Typewriter. His expertise in Java and GDScript supports robust application and game development, while his Bash scripting skills streamline automation. His knowledge of Basic Typewriter adds a classic touch to his versatile programming capabilities.
@ -33,8 +33,8 @@ const Home = () => {
</div>
<div className="card">
<a href="https://interstellardevelopment.org/code/Patrick_Pluto" className="card-link" target="_blank" rel="noopener noreferrer">
<img src="/img/yasin.png" alt="Norway" />
<a href="https://interstellardevelopment.org/code/YasinOnm08" className="card-link" target="_blank" rel="noopener noreferrer">
<img src="/img/yasin.png" alt="Yasin" />
<h3>Yasin</h3>
<p>
Yasin is a proficient programmer with expertise in Java, where he has even developed games, as well as Bash, HTML, CSS, SQL, and NoSQL. His skills span from backend development and automation to web design and database management, making him a versatile asset in any tech project.

View file

@ -1,13 +1,80 @@
// Patrick.tsx
"use client";
import React from 'react';
import './Patrick.css'; // Import specific styles for Patrick
import React, { useRef, useEffect } from 'react';
import './Patrick.css';
const Patrick = () => (
<div className="programmer-space patrick">
<h2>Patrick's Space</h2>
<p>Welcome, Patrick! This is your programming space.</p>
</div>
);
const Patrick: React.FC = () => {
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const contextRef = useRef<CanvasRenderingContext2D | null>(null);
var isPressed = false;
useEffect(() => {
const canvas = canvasRef.current;
if (canvas) {
canvas.width = 1000; // Set canvas width
canvas.height = 500; // Set canvas height
const context = canvas.getContext('2d');
if (context) {
contextRef.current = context;
// Fill the canvas with a color
context.fillStyle = 'black';
context.fillRect(0, 0, canvas.width, canvas.height);
}
}
}, []);
const manipulatePixel = (x: number, y: number) => {
const context = contextRef.current;
if (context) {
// Get the pixel data
const imageData = context.getImageData(x, y, 1, 1);
const data = imageData.data;
// Manipulate the pixel (invert color)
data[0] = 255; // Red
data[1] = 255; // Green
data[2] = 255; // Blue
context.putImageData(imageData, x, y);
context.putImageData(imageData, x+1, y);
context.putImageData(imageData, x-1, y);
context.putImageData(imageData, x, y+1);
context.putImageData(imageData, x, y-1);
}
};
const handleClick = (event: React.MouseEvent<HTMLCanvasElement>) => {
const canvas = canvasRef.current;
if (canvas && isPressed) {
const rect = canvas.getBoundingClientRect();
const x = Math.floor(event.clientX - rect.left);
const y = Math.floor(event.clientY - rect.top);
manipulatePixel(x, y);
} else {
isPressed = false;
}
};
const moveDown = (event: React.MouseEvent<HTMLCanvasElement>) => {
isPressed = true;
handleClick(event)
};
const moveUp = () => {
isPressed = false;
};
return (
<div className="programmer-space patrick">
<h1>Welcome to Patrick-Paint.</h1>
<br></br>
<canvas
ref={canvasRef}
onMouseDown={moveDown}
onMouseUp={moveUp}
onMouseMove={handleClick}
style={{ border: '1px solid black' }}
/>
</div>
);
};
export default Patrick;

View file

@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
basePath: '/react',
};
export default nextConfig;

View file

@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"lint": "next lint"