Update NPM packages, v-tweaks
This commit is contained in:
parent
03ef9001a2
commit
5e55e891ac
10 changed files with 2511 additions and 19358 deletions
|
|
@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
|
|||
import { CSSTransition } from 'react-transition-group';
|
||||
import semver from 'semver';
|
||||
import Components from '../../vt-components.json';
|
||||
import { Tooltip } from 'bootstrap/dist/js/bootstrap.bundle.js';
|
||||
|
||||
|
||||
const searchFeaturesByName = (query) => {
|
||||
const results = Components.all.map(
|
||||
|
|
@ -32,14 +34,16 @@ export default () => {
|
|||
versionFilter: null,
|
||||
});
|
||||
|
||||
const [initBtn, setInitBtn] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (initBtn) {
|
||||
initBtn.click();
|
||||
}
|
||||
return () => {};
|
||||
}, [initBtn]);
|
||||
[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
.forEach((tooltipEl) => {
|
||||
new Tooltip(tooltipEl, {
|
||||
customClass: tooltipEl.className.includes('experimental') ? "experimental-tooltip" : ""
|
||||
});
|
||||
})
|
||||
|
||||
return () => { };
|
||||
}, []);
|
||||
|
||||
const onSearch = (evt) => {
|
||||
const val = evt.target.value;
|
||||
|
|
@ -67,6 +71,7 @@ export default () => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<CSSTransition classNames="react-router" appear in timeout={300}>
|
||||
<div>
|
||||
|
|
@ -95,6 +100,7 @@ export default () => {
|
|||
className={`btn ${state.versionFilter === version ? 'btn-primary' : 'btn-secondary'}`}
|
||||
value={version}
|
||||
onClick={onVersionSet}
|
||||
key={`version_${version}`}
|
||||
>
|
||||
{version}
|
||||
</button>
|
||||
|
|
@ -108,11 +114,10 @@ export default () => {
|
|||
<h2 className="text-center">
|
||||
Search Results
|
||||
</h2>
|
||||
|
||||
<div className="row row-cols-1 row-cols-xl-3 g-4">
|
||||
{state.searchFeatures.map((feature) => (
|
||||
<div className={`col ${(state.versionFilter == null || feature.versions.includes(state.versionFilter)) ? '' : 'd-none'}`}>
|
||||
<div className="card h-100">
|
||||
<div className={`card h-100 ${feature.experimental ? 'experimental' : ''}`}>
|
||||
<img src={feature.img} alt="" className="card-img-top" />
|
||||
<div className="card-body">
|
||||
<h5 className="text-center card-title">
|
||||
|
|
@ -134,63 +139,80 @@ export default () => {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<ul className={`nav nav-tabs nav-fill ${state.searching ? 'd-none' : ''}`} role="tablist" style={{ cursor: 'pointer' }} id="nav-tab">
|
||||
{
|
||||
Components.all.map((comp, idx) => (
|
||||
<li className="nav-item" role="presentation">
|
||||
<div
|
||||
className="nav-link"
|
||||
href={`#${comp.name.toLowerCase().replace(/ /g, '-')}`}
|
||||
<nav>
|
||||
<div
|
||||
className={`nav nav-tabs nav-fill ${state.searching ? 'd-none' : ''}`}
|
||||
id="nav-tab"
|
||||
role="tablist"
|
||||
style={{ cursor: 'pointer' }}
|
||||
>
|
||||
{
|
||||
Components.all.map((comp, idx) => (
|
||||
<button
|
||||
className={`nav-link ${idx === 0 ? 'active' : ''}`}
|
||||
id={`${comp.name.toLowerCase().replace(/ /g, '-')}-tab`}
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target={`#${comp.name.toLowerCase().replace(/ /g, '-')}`}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-controls={`${comp.name.toLowerCase().replace(/ /g, '-')}`}
|
||||
data-toggle="tab"
|
||||
ref={(ref) => idx === 0 && setInitBtn(ref)}
|
||||
aria-selected={idx === 0 ? "true" : "false"}
|
||||
key={`${idx}_${comp.name}`}
|
||||
>
|
||||
{comp.name}
|
||||
</div>
|
||||
</li>
|
||||
))
|
||||
</button>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div className={`tab-content ${state.searching ? 'd-none' : ''}`} role="presentation">
|
||||
<div
|
||||
className={`tab-content ${state.searching ? 'd-none' : ''}`}
|
||||
id="nav-tabContent"
|
||||
>
|
||||
{
|
||||
Components.all.map((comp) => (
|
||||
<div
|
||||
className="tab-pane fade"
|
||||
id={`${comp.name.toLowerCase().replace(/ /g, '-')}`}
|
||||
aria-labelledby={`${comp.name.toLowerCase().replace(/ /g, '-')}-tab`}
|
||||
role="tabpanel"
|
||||
>
|
||||
<div className="container-fluid my-3">
|
||||
<h2 className="text-center">
|
||||
{comp.name}
|
||||
</h2>
|
||||
<div className="row row-cols-1 row-cols-xl-3 g-4">
|
||||
{comp.features.map((feature) => (
|
||||
<div className={`col ${(state.versionFilter == null || feature.versions.includes(state.versionFilter)) ? '' : 'd-none'}`}>
|
||||
<div className="card h-100">
|
||||
<img src={feature.img} alt="" className="card-img-top" />
|
||||
<div className="card-body">
|
||||
<h5 className="text-center card-title">
|
||||
{feature.name}
|
||||
</h5>
|
||||
<p className="card-text mb-1">
|
||||
{feature.desc}
|
||||
</p>
|
||||
</div>
|
||||
<div className="card-footer">
|
||||
<code className="text-center">
|
||||
{feature.versions.join(', ')}
|
||||
</code>
|
||||
Components.all.map((comp, idx) => (
|
||||
<div
|
||||
className={`tab-pane fade ${idx === 0 ? 'show active' : ''}`}
|
||||
id={`${comp.name.toLowerCase().replace(/ /g, '-')}`}
|
||||
role="tabpanel"
|
||||
aria-labelledby={`${comp.name.toLowerCase().replace(/ /g, '-')}-tab`}
|
||||
>
|
||||
<div className="container-fluid my-3">
|
||||
<h2 className="text-center">
|
||||
{comp.name}
|
||||
</h2>
|
||||
<div className="row row-cols-1 row-cols-xl-3 g-4">
|
||||
{comp.features.map((feature) => (
|
||||
<div className={`col ${(state.versionFilter == null || feature.versions.includes(state.versionFilter)) ? '' : 'd-none'}`}>
|
||||
<div
|
||||
className={`card h-100 ${feature.experimental ? 'experimental' : ''}`}
|
||||
|
||||
data-bs-toggle={feature.experimental && "tooltip"}
|
||||
data-bs-placement={feature.experimental && "top"}
|
||||
title={feature.experimental && "This Feature is Experimental!"}
|
||||
>
|
||||
<img src={feature.img} alt="" className="card-img-top" />
|
||||
<div className="card-body">
|
||||
<h5 className="text-center card-title">
|
||||
{feature.name}
|
||||
</h5>
|
||||
<p className="card-text mb-1">
|
||||
{feature.desc}
|
||||
</p>
|
||||
</div>
|
||||
<div className="card-footer">
|
||||
<code className="text-center">
|
||||
{feature.versions.join(', ')}
|
||||
</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -54,3 +54,27 @@
|
|||
color: unset !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.experimental {
|
||||
height: 250px;
|
||||
width: 400px;
|
||||
background: linear-gradient(white,white), repeating-linear-gradient(
|
||||
45deg,
|
||||
black,
|
||||
black 10px,
|
||||
yellow 10px,
|
||||
yellow 20px
|
||||
);
|
||||
background-attachment: padding-box, border-box;
|
||||
padding: 5px 5px;
|
||||
border-radius: 8px;
|
||||
background-origin: content-box, padding-box;
|
||||
background-clip: content-box, padding-box;}
|
||||
|
||||
.experimental-tooltip .tooltip-arrow:before {
|
||||
border-top-color: red;
|
||||
}
|
||||
|
||||
.experimental-tooltip .tooltip-inner {
|
||||
background-color: red;
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -75,6 +75,13 @@
|
|||
"1.8.9",
|
||||
"1.9.4"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Tree Falling",
|
||||
"desc": "Trees actually fall down when breaking their trunk, based off of Tersnip's ChopDown Mod!",
|
||||
"experimental": true,
|
||||
"img": "/img/vtweaks/screenshots/tree_falling.gif",
|
||||
"versions": [ "1.16.5" ]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -104,7 +111,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -119,7 +126,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -134,7 +141,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -145,7 +152,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -183,7 +190,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -198,7 +205,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -210,7 +217,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -253,8 +260,26 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Smaller Bees",
|
||||
"desc": "This tweak makes it so that bees appear to be smaller (exactly half their size, actually!). Logistically this changes nothing about them - their bounding and hit box is the same for your convenience, but they're sooo cute!",
|
||||
"img": "/img/vtweaks/screenshots/smol_bees.jpg",
|
||||
"versions": [ "1.16.5" ]
|
||||
},
|
||||
{
|
||||
"name": "Low Health Sound",
|
||||
"desc": "This tweak produces a heartbeat-like sound whenever your health is below a configurable threshold. This is purely client-side and can be disabled individually by each user.",
|
||||
"img": "/img/vtweaks/screenshots/low_health_sound.png",
|
||||
"versions": [ "1.16.5" ]
|
||||
},
|
||||
{
|
||||
"name": "No Pet Friendly Fire",
|
||||
"desc": "This tweak prevents pet owners (or all players - this is configurable) from hurting tamed pets so that you can keep your special friend alive and healthy!",
|
||||
"img": "/img/vtweaks/screenshots/npff.jpg",
|
||||
"versions": [ "1.16.5" ]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -270,7 +295,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -285,7 +310,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -300,7 +325,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -358,7 +383,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -373,7 +398,7 @@
|
|||
"1.12.2",
|
||||
"1.14.4",
|
||||
"1.15.2",
|
||||
"1.16.4"
|
||||
"1.16.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -408,6 +433,12 @@
|
|||
"1.8.9",
|
||||
"1.9.4"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Cheap Anvil Repairs",
|
||||
"desc": "Ever felt that it was unfair how quickly the XP cost of repairing a tool was? This tweak resets the repair cost every time so that you can reasonably maintain your tools for a long time!",
|
||||
"img": "/img/vtweaks/screenshots/anvil_repair_cost.png",
|
||||
"versions": [ "1.16.5" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue