Skip to content

Commit

Permalink
Update for latest React (#79)
Browse files Browse the repository at this point in the history
* update react

* Fix styles

* remove package-lock.json
  • Loading branch information
extremeheat authored Sep 8, 2024
1 parent e720d42 commit bf6c3a3
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 181 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@
"homepage": "https://prismarinejs.github.io/",
"dependencies": {
"bootstrap": "^5.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.1"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
"react-scripts": "^5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"test:react": "react-scripts test --env=jsdom --watchAll=false",
"test": "npm run lint && npm run test:react",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build"
"deploy": "gh-pages -b master -d build",
"lint": "standard",
"fix": "standard --fix"
},
"devDependencies": {
"gh-pages": "^6.0.0"
"gh-pages": "^6.0.0",
"standard": "^17.1.0"
},
"browserslist": [
">0.2%",
Expand Down
15 changes: 0 additions & 15 deletions public/manifest.json

This file was deleted.

80 changes: 51 additions & 29 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ a:hover {
}

.promoBanner {
background-image: url(/images/background.svg), linear-gradient(45deg, #009688, #4db6ac)!important;
background-image: url(../public/images/background.svg), linear-gradient(45deg, #009688, #4db6ac) !important;
background-repeat: repeat;
background-size: 3.5rem, 100%;
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), 0 100%);
Expand All @@ -73,56 +73,78 @@ a:hover {
/* -------------------------------------------------------------------------- */

.headerTitle {
background-color: transparent;
color: #FFFFFF;
font-weight: 600;
background-color: transparent;
color: #FFFFFF;
font-weight: 600;
}

.meetTheTeam ul {
list-style: none;
padding-left: 0;
list-style: none;
padding-left: 0;
}

.meetTheTeam ul img {
border-radius: 15%;
height: 48px;
width: 48px;
border-radius: 15%;
height: 48px;
width: 48px;
}

.meetTheTeam ul {
list-style: none;
padding-left: 0;
list-style: none;
padding-left: 0;
}

.meetTheTeam ul li {
margin-bottom: 3px;
margin-bottom: 3px;
}

.meetTheTeam ul li img {
margin-right: 15px;
border-radius: 48px;
margin-right: 15px;
border-radius: 48px;
}

.meetTheTeam ul code {
background-color: #e83e8c;
color: #FFFFFF;
font-family: inherit;
padding: 0.2rem 0.5rem;
position: relative;
margin-left: 6px;
display: inline-block;
background-color: #e83e8c;
color: #FFFFFF;
font-family: inherit;
padding: 0.2rem 0.5rem;
position: relative;
margin-left: 6px;
display: inline-block;
}

.meetTheTeam ul code:before {
content: '';
border-right: 3px solid #E83E8C;
border-bottom: 3px solid transparent;
border-top: 3px solid transparent;
position: absolute;
top: calc(50% - 2px);
left: -3px;
content: '';
border-right: 3px solid #E83E8C;
border-bottom: 3px solid transparent;
border-top: 3px solid transparent;
position: absolute;
top: calc(50% - 2px);
left: -3px;
}

.meetTheTeam h3 {
margin-bottom: 1rem;
margin-bottom: 1rem;
}

.navbar {
display: flex;
justify-content: center;
width: fit-content;

.nav-button {
border-radius: 22px;
padding-left: 8px;
padding-right: 8px;

> a {
color: white;
display: flex;
gap: 8px;
> img {
filter: invert(1);
}
}
}
}

209 changes: 100 additions & 109 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,128 +1,119 @@
import React, { Component } from 'react';
import React, { useState } from 'react'

import 'bootstrap/dist/css/bootstrap.min.css';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css'
import './App.css'

class Members extends Component {
constructor(props) {
super(props)

this.state = {
maintainers: [
{ id: '2346494', name: 'Romain Beaumont', username: 'rom1504' },
{ id: '1069318', name: 'Robin Lambertz', username: 'roblabla' },
{ id: '1977472', name: 'Karang', username: 'Karang' },
{ id: '8526903', name: 'Keegan', username: 'mhsjlw', extra: 'flying-squid' },
{ id: '13330620', name: 'Kasper Seweryn', username: 'wvffle', extra: 'mineflayer' },
{ id: '8838132', name: 'plexigras', username: 'plexigras', extra: 'mineflayer'},
],
contributors: [
{ id: '106511', name: 'Andrew Kelley', username: 'andrewrk' },
{ id: '87436', name: 'Josh Wolfe', username: 'thejoshwolfe' },
{ id: '850714', name: 'Georges Oates Larsen', username: 'flynnn' },
{ id: '2260564', name: 'Harold Feit', username: 'DreadWingKnight' },
{ id: '5000732', name: '', username: 'ciolt', extra: 'website' },
{ id: '1270100', name: 'Will Franzen', username: 'wtfaremyinitials' },
{ id: '1077050', name: 'Dennis Bartlett', username: 'dcbartlett' },
]
}
function Members () {
const state = {
maintainers: [
{ id: '2346494', name: 'Romain Beaumont', username: 'rom1504' },
{ id: '1069318', name: 'Robin Lambertz', username: 'roblabla' },
{ id: '1977472', name: 'Karang', username: 'Karang' },
{ id: '8526903', name: 'Keegan', username: 'mhsjlw', extra: 'flying-squid' },
{ id: '13330620', name: 'Kasper Seweryn', username: 'wvffle', extra: 'mineflayer' },
{ id: '8838132', name: 'plexigras', username: 'plexigras', extra: 'mineflayer' }
],
contributors: [
{ id: '106511', name: 'Andrew Kelley', username: 'andrewrk' },
{ id: '87436', name: 'Josh Wolfe', username: 'thejoshwolfe' },
{ id: '850714', name: 'Georges Oates Larsen', username: 'flynnn' },
{ id: '2260564', name: 'Harold Feit', username: 'DreadWingKnight' },
{ id: '5000732', name: '', username: 'ciolt', extra: 'website' },
{ id: '1270100', name: 'Will Franzen', username: 'wtfaremyinitials' },
{ id: '1077050', name: 'Dennis Bartlett', username: 'dcbartlett' }
]
}

componentWillMount() {

}

render() {
return (
<div className="container">
<h2>Main projects</h2>
<ul>
<li><a href="https://prismarinejs.github.io/minecraft-data">Minecraft data</a> : Language independent module providing minecraft data for minecraft clients, servers and libraries.</li>
<li><a href="https://prismarinejs.github.io/mineflayer">Mineflayer</a> : Create Minecraft bots with a powerful, stable, and high level JavaScript API..</li>
<li><a href="https://prismarinejs.github.io/flying-squid">Flying-squid</a> : Create Minecraft servers with a powerful, stable, and high level JavaScript API.</li>
<li><a href="https://prismarinejs.github.io/node-minecraft-protocol">Minecraft protocol</a> : Parse and serialize minecraft packets, plus authentication and encryption..</li>
</ul>
<h2>How to contribute</h2>
<p>Go to <a href="https://github.com/PrismarineJS/prismarine-contribute">prismarine-contribute</a> to learn more about the projects
and start contributing !</p>
<h2>Meet the Team</h2>
<p>PrismarineJS is made possible by many contributors who have put their time and effort into making the project possible.</p>
<div className="row">
<div className="col-md">
<h3>Maintainers</h3>
<ul>
{this.state.maintainers.map((e) => {
return (
<li key={e.id}>
<img src={`https://avatars.githubusercontent.com/u/${e.id}?s=54`} alt="true" /> {e.name} <a href={`https://github.com/${e.username}`}>@{e.username}</a> {e.extra ? (<code>{e.extra}</code>) : undefined }
</li>
)
})}
</ul>
</div>
<div className="col-md">
<h3>Contributors</h3>
<ul>
{this.state.contributors.map((e) => {
return (
<li key={e.id}>
<img src={`https://avatars.githubusercontent.com/u/${e.id}?s=54`} alt="true" /> {e.name} <a href={`https://github.com/${e.username}`}>@{e.username}</a> {e.extra ? (<code>{e.extra}</code>) : undefined }
</li>
)
})}
</ul>
</div>
return (
<div className='container' style={{ marginTop: 20 }}>
<h2>Main projects</h2>
<ul>
<li><a href='https://prismarinejs.github.io/minecraft-data'>Minecraft data</a> : Language independent module providing minecraft data for minecraft clients, servers and libraries.</li>
<li><a href='https://prismarinejs.github.io/mineflayer'>Mineflayer</a> : Create Minecraft bots with a powerful, stable, and high level JavaScript API..</li>
<li><a href='https://prismarinejs.github.io/flying-squid'>Flying-squid</a> : Create Minecraft servers with a powerful, stable, and high level JavaScript API.</li>
<li><a href='https://prismarinejs.github.io/node-minecraft-protocol'>Minecraft protocol</a> : Parse and serialize minecraft packets, plus authentication and encryption..</li>
</ul>
<h2>How to contribute</h2>
<p>Go to <a href='https://github.com/PrismarineJS/prismarine-contribute'>prismarine-contribute</a> to learn more about the projects
and start contributing !
</p>
<h2>Meet the Team</h2>
<p>PrismarineJS is made possible by many contributors who have put their time and effort into making the project possible.</p>
<div className='row'>
<div className='col-md'>
<h3>Maintainers</h3>
<ul>
{state.maintainers.map((e) => {
return (
<li key={e.id}>
<img src={`https://avatars.githubusercontent.com/u/${e.id}?s=54`} alt='true' /> {e.name} <a href={`https://github.com/${e.username}`}>@{e.username}</a> {e.extra ? (<code>{e.extra}</code>) : undefined}
</li>
)
})}
</ul>
</div>
<div className='col-md'>
<h3>Contributors</h3>
<ul>
{state.contributors.map((e) => {
return (
<li key={e.id}>
<img src={`https://avatars.githubusercontent.com/u/${e.id}?s=54`} alt='true' /> {e.name} <a href={`https://github.com/${e.username}`}>@{e.username}</a> {e.extra ? (<code>{e.extra}</code>) : undefined}
</li>
)
})}
</ul>
</div>
</div>
)
}
</div>
)
}

export class App extends Component {
constructor(props) {
super(props)

this.state = { backgroundPosition: "0 0, 0 0" }

this.onMouseMove = this.onMouseMove.bind(this)
}
function NavEntry ({ name, link, image }) {
return (
<li className='nav-item nav-button'>
<a className='nav-link' href={link}>
<img src={image} style={{ width: 24, height: 24 }} />
{name}
</a>
</li>
)
}

componentWillMount() {
document.addEventListener('mousemove', this.onMouseMove)
}
export function App () {
const [backgroundPosition, setBackgroundPosition] = useState('0 0, 0 0')

onMouseMove(e) {
const posX = e.clientX / 20;
function onMouseMove (e) {
const posX = e.clientX / 20
const posY = e.clientY / 20
this.setState({ backgroundPosition: `${posX}px ${posY}px, 0px 0px` })
setBackgroundPosition(`${posX}px ${posY}px, 0px 0px`)
}

render() {
return (
<div>
<div className="promoBanner active" style={{backgroundPosition: this.state.backgroundPosition}}>
<nav className="navbar navbar-expand-md container transparent navbar-dark">
<a className="navbar-brand" href="/"><img className="d-inline-block align-top" src="/images/prismarine_js.svg" width={32} height={32} alt="PrismarineJS" /></a><button className="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation"><span className="navbar-toggler-icon" /></button>
<div className="collapse navbar-collapse" id="navbarContent">
<ul className="navbar-nav mr-auto">
<li className="nav-item"><a className="nav-link" href="https://github.com/PrismarineJS">GitHub</a></li>
</ul>
</div>
</nav>
<div className="container promo pb-5 pt-5 mb-5">
<h1 className="text-left display-4 col-md-auto">PrismarineJS</h1>
<h3 className="text-left col-md-8">Minecraft-compatible <a href="https://github.com/PrismarineJS/flying-squid" title="PrismarineJS/Flying-Squid on GitHub">server</a>, <a href="https://github.com/PrismarineJS/mineflayer" title="PrismarineJS/Mineflayer on GitHub">bot</a>, and <a href="https://github.com/PrismarineJS/node-minecraft-protocol" title="PrismarineJS/Node-Minecraft-Protocol on GitHub">API</a>. All written in JavaScript.</h3>
<div className="col-md-auto mt-4"><a href="https://github.com/PrismarineJS"><button className="btn btn-light" type="button">Check it out on GitHub</button></a></div>
return (
<div onMouseMove={onMouseMove}>
<div className='promoBanner active' style={{ backgroundPosition }}>
<nav className='navbar navbar-expand-md container transparent navbar-dark'>
<a className='navbar-brand' href='/'><img className='d-inline-block align-top' src='/images/prismarine_js.svg' width={32} height={32} alt='PrismarineJS' /></a><button className='navbar-toggler' type='button' data-toggle='collapse' data-target='#navbarContent' aria-controls='navbarContent' aria-expanded='false' aria-label='Toggle navigation'><span className='navbar-toggler-icon' /></button>
<div className='collapse navbar-collapse' id='navbarContent'>
<ul className='navbar-nav mr-auto'>
<NavEntry name='GitHub' link='https://github.com/PrismarineJS' image='https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg' />
<NavEntry name='Discord' link='https://discord.gg/GsEFRM8' image='https://cdn.prod.website-files.com/6257adef93867e50d84d30e2/636e0a6918e57475a843f59f_icon_clyde_black_RGB.svg' />
</ul>
</div>
</nav>
<div className='container promo pb-5 pt-5 mb-5' style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: 'fit-content' }}>
<h1 className='text-left display-4 col-md-auto'>PrismarineJS</h1>
<h3 className='text-left col-md-12'>Minecraft-compatible <a href='https://github.com/PrismarineJS/flying-squid' title='PrismarineJS/Flying-Squid on GitHub'>server</a>, <a href='https://github.com/PrismarineJS/mineflayer' title='PrismarineJS/Mineflayer on GitHub'>bot</a>, and <a href='https://github.com/PrismarineJS/node-minecraft-protocol' title='PrismarineJS/Node-Minecraft-Protocol on GitHub'>API</a>. All written in JavaScript.</h3>
<div className='col-md-auto mt-4'><a href='https://github.com/PrismarineJS'><button className='btn btn-light' type='button'>Check it out on GitHub</button></a></div>
</div>
<div className="content container-fluid">
<div className="row markdown-render meetTheTeam">
<Members />
</div>
</div>
<div className='content container-fluid' style={{ display: 'flex', justifyContent: 'center' }}>
<div className='row markdown-render meetTheTeam'>
<Members />
</div>
</div>
);
}
</div>
)
}

export default App;
export default App
Loading

0 comments on commit bf6c3a3

Please sign in to comment.