Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4990057
Update Font API URL
exoRift Jun 20, 2022
32aecf4
Add constant navbar height
exoRift Jun 20, 2022
b800339
Add skeleton for glossary index
exoRift Jun 20, 2022
356ae3d
Add blowup skeleton
exoRift Jun 21, 2022
1d361f3
Implement vanilla item fetching
exoRift Jun 21, 2022
ca9af35
Complete crafting table grid for recipes
exoRift Jun 22, 2022
273cb65
Glossary mobile support
exoRift Jun 22, 2022
0aa482f
Better mobile support and navigation systems
exoRift Jun 22, 2022
964eb6d
Implement search bar to glossary and hint at mobile index
exoRift Jun 22, 2022
7cd307d
Implement furnace crafting GUI for glossary
exoRift Jun 23, 2022
af382ee
Add shuffling for shapeless crafting
exoRift Jun 23, 2022
3bdaf33
Add kettle GUI to glossary
exoRift Jun 23, 2022
349f081
Redesign kettle GUI in glossary
exoRift Jun 23, 2022
8df4331
Change site version and add support for multiple recipes per item
exoRift Jun 23, 2022
7747113
Add support for stack sizes
exoRift Jun 23, 2022
854c52f
Add spinning wheel GUI
exoRift Jun 24, 2022
7d4603a
Split entries and recipes and support multiple products
exoRift Jun 26, 2022
ded0d3f
Add Witches' Oven GUI
exoRift Jun 26, 2022
d94b18e
Support uncertain products
exoRift Jun 26, 2022
0836c5e
Add distillery GUI
exoRift Jun 26, 2022
b42321c
Minor changes
exoRift Jun 26, 2022
46a6078
Add compendium page and its index
exoRift Jun 30, 2022
7a04424
Adjust navbar to be more stable on mobile
exoRift Jun 30, 2022
45e3a1b
Trim and polish root HTML file and manifest
exoRift Jul 5, 2022
3df0964
Use Google's material icons as opposed to a local library
exoRift Aug 14, 2022
c581d1f
Syntactic changes
exoRift Aug 14, 2022
cab12d1
Update home backvid to not scale with page resizing
exoRift Aug 16, 2022
84d9efe
Stop IntersectionObserver on Navbar unmount
exoRift Aug 16, 2022
58a34ef
Add implicit Discord authorization to version upload
exoRift Oct 16, 2022
bc1071e
Fix glossary scrolling
exoRift Nov 21, 2022
a8864c2
Fix crafting grid tooltips
exoRift Nov 21, 2022
23270ad
Switch from CRA to Vite
exoRift Nov 21, 2022
9a2aa11
Add autoprefixer to Vite config
exoRift Nov 21, 2022
1f1f2b5
Switch Vite export dir from dist to build
exoRift Nov 21, 2022
2f695d0
Trim dependencies
exoRift Nov 28, 2022
4eab21e
Merge
MsRandom Jan 10, 2023
2069b9d
Fix conflicts
MsRandom Jan 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .idea/.gitignore
Empty file.
13 changes: 7 additions & 6 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<link rel='icon' href='%PUBLIC_URL%/assets/images/favicon.ico'/>
<meta charset='utf-8'/>
<link rel='icon' href='/assets/images/favicon.ico'/>
<meta name='viewport' content='width=device-width, initial-scale=1'/>
<meta name='theme-color' content='#000000'/>
<meta name='theme-color' content='#7a2a91'/>
<meta
name='description'
content='Witchery: Resurrected aims to recreate and improve the popular Witchery mod in modern versions; with a focus on customizability.'
/>
<link rel='apple-touch-icon' href='%PUBLIC_URL%/assets/images/logo192.png'/>
<link rel='manifest' href='%PUBLIC_URL%/manifest.json' />
<link rel='stylesheet' type='text/css' href='%PUBLIC_URL%/assets/css/main.css'>
<link rel='apple-touch-icon' href='/assets/images/logo192.png'/>
<link rel='manifest' href='/manifest.json' />

<title>Witchery: Resurrected</title>
</head>
Expand All @@ -20,5 +19,7 @@
<noscript>You need to enable JavaScript to run this app.</noscript>

<div id='root'/>

<script type='module' src='/src/index.jsx'></script>
</body>
</html>
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "witchery-resurrected-web",
"version": "0.1.0",
"name": "witchery-resurrected",
"version": "1.0.0",
"description": "Witchery: Resurrected aims to recreate and improve the popular Witchery Minecraft mod in modern versions; with a focus on customizability.",
"scripts": {
"dev": "react-scripts start",
"build": "react-scripts build"
"dev": "vite dev",
"build": "vite build"
},
"repository": {
"type": "git",
Expand All @@ -29,14 +29,16 @@
},
"keywords": [],
"dependencies": {
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.3.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.2.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.14.0",
"eslint-config-react-app": "^7.0.1",
"eslint-config-standard": "^17.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1"
"vite": "^3.2.3"
}
}
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"theme_color": "#7a2a91",
"background_color": "#26272b"
}
Binary file added src/assets/TEMP/attuned_stone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/TEMP/clay_jar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/TEMP/foul_fume.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/TEMP/goddess_breath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/TEMP/goddess_tear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/TEMP/magic_whiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fonts/Mojang-Regular.ttf
Binary file not shown.
Binary file modified src/assets/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/book_back_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/crafting_table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/distillery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/furnace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/kettle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/progress_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/smelting_flames.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/crafting_guis/witches_oven.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/paper_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 49 additions & 8 deletions src/client/AdminPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,28 @@ class File extends React.Component {
}

class AdminPanel extends React.Component {
static authURL = 'https://discord.com/api/oauth2/authorize?client_id=665314456745541653&response_type=code&scope=identify&redirect_uri=' +
encodeURIComponent(window.location.origin + '/auth')

static cancel (e) {
if (e) e.preventDefault()

window.location.reload()
}

state = {
files: []
files: [],
authToken: null
}

componentDidMount () {
return this.addFile()
}

componentWillUnmount () {
clearInterval(this.authCheckInterval)
}

render () {
return (
<div className='page admin-panel'>
Expand All @@ -104,11 +118,18 @@ class AdminPanel extends React.Component {
<button className='file-button add' onClick={this.addFile.bind(this)}>+</button>
</div>

<div className='buttons'>
<button className='btn btn-success' type='submit'>Upload</button>
<button className='btn btn-danger cancel' onClick={this.cancel}>Cancel</button>
<input type='hidden' id='auth' name='auth' value={this.state.authToken || ''}/>

<input id='pass' type='password' name='pass' placeholder='Secret' required/>
<div className='buttons'>
<button className='btn btn-success' type='submit' onClick={this.checkAuth.bind(this)}>Upload</button>
<button className='btn btn-danger cancel' onClick={AdminPanel.cancel}>Cancel</button>

<div
className={`btn btn-${this.state.authToken ? 'outline-success disabled' : 'secondary'} authorize`}
onClick={this.openAuthWindow.bind(this)}
>
{this.state.authToken ? 'Authorized' : 'Authorize'}
</div>
</div>
</form>
</div>
Expand Down Expand Up @@ -144,10 +165,30 @@ class AdminPanel extends React.Component {
})
}

cancel (e) {
if (e) e.preventDefault()
openAuthWindow () {
window.open(AdminPanel.authURL, 'popup', 'width=500,height=800,scrollbars=no,resizable=no,noreferrer')

window.location.reload()
if (!this.authCheckInterval) {
this.authCheckInterval = setInterval(() => {
if ('admin_auth' in localStorage) {
this.setState({
authToken: localStorage.getItem('admin_auth')
})

localStorage.removeItem('admin_auth')

clearInterval(this.authCheckInterval)
}
})
}
}

checkAuth (e) {
if (!this.state.authToken) {
alert('Remember to authorize!')

e.preventDefault()
}
}
}

Expand Down
15 changes: 15 additions & 0 deletions src/client/Auth.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'

class Auth extends React.Component {
componentDidMount () {
localStorage.setItem('admin_auth', new URLSearchParams(window.location.search).get('code'))

window.close()
}

render () {
return (<></>)
}
}

export default Auth
108 changes: 108 additions & 0 deletions src/client/Compendium.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import React from 'react'
import {
Link
} from 'react-router-dom'

import backArrow from '../assets/images/book_back_arrow.png'

import './styles/Compendium.css'

// TEMP
const categories = [
'infusions',
'afflictions'
]
// TEMP

class Compendium extends React.Component {
static capitalizationRegex = /(?:^|\s)(.)/g
static hashRegex = /#(?<category>[^/]+)(?:\/(?<id>.+))?/

state = {
categories, // TEMP
sections: {
infusions: [
{
id: 'light',
name: 'Light',
icon: null,
description: 'THIS IS THE LIGHT INFUSION'
}
],
afflictions: [
{
id: 'vampirism',
name: 'Vampirism',
icon: null,
description: 'THIS IS VAMPIRISIM',
forms: [
{
id: 'bat',
name: 'Bat',
stats: {
health: '5'
},
description: 'THIS IS THE BAT TRANSFORMATION'
}
]
}
]
} // TEMP
}

constructor (props) {
super(props)

this.title = props.title + ' - Compendium'
document.title = this.title
}

componentDidMount () { // TODO: GET SECTIONS
const location = window.location.hash.match(Compendium.hashRegex)

if (location) this.switchLocation(location.groups.category, location.groups.id)
}

render () {
return (
<div className='page compendium'>
<div className='content'>
<div className='side index'>
<ul className='categories'>
{this.state.categories.map((c, i) =>
<li className={`minecraft category${c === this.state.category ? ' selected' : ''}`} key={i} onClick={this.switchLocation.bind(this, c)}>
{c.replace(Compendium.capitalizationRegex, (l) => l.toUpperCase())}
</li>)}
</ul>

<Link to='/glossary'><img className='back-arrow' alt='back' src={backArrow}/></Link>
</div>

<div className='side blowup'>
BRUH MOMENT
</div>
</div>
</div>
)
}

switchLocation (category, section) {
if (!(category in this.state.sections)) return

window.location.hash = category
this.setState({
category
})

const data = this.state.sections[category].find((s) => s.id === section)
if (!data) return

window.location += '/' + section
document.title = this.title + ` [${data.name}]`
this.setState({
section
})
}
}

export default Compendium
Loading