почему-то не работает
new Swiper
? // ...прилегают к первой кнопке
const showAfterFirst = currentPage < 5;
// ...прилегают к последней кнопке
const showBeforeLast = currentPage > totalPages - 4;
!showAfterFirst
и !showBeforeLast
. А чтобы отобразить центральную группу кнопок, оба базовых условия должны быть ложными: !(showAfterFirst || showBeforeLast)
.<Route path='/notifications' component={NotificationsList} />
<Route path='/notifications/:typeId' component={ConcreteNotification} />
const { typeId } = useParams()
useEffect(() => fetchNotification(typeId), [])
const notification = useSelector(s => s.notifications.data.find(n => n.typeId === typeId))
условно говоря юниор средняя около 30-40к
This method exists for rare use cases where the state depends on changes in props over time. For example, it might be handy for implementing a component that compares its previous and next children to decide which of them to animate in and out.
<script type="module">
, в нем будет объект guisvar guis = {
// ....
IcosahedronGeometry: function ( mesh ) {
var data = {
radius: 10,
detail: 0
};
function generateGeometry() {
updateGroupGeometry( mesh,
new IcosahedronGeometry(
data.radius, data.detail
)
);
}
var folder = gui.addFolder( 'THREE.IcosahedronGeometry' );
folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
folder.add( data, 'detail', 0, 5 ).step( 1 ).onChange( generateGeometry );
generateGeometry();
},
// ....
}
const meshes = [
new THREE.BoxGeometry(),
new THREE.SphereGeometry(),
new THREE.CylinderGeometry(),
new THREE.ConeGeometry(),
new THREE.IcosahedronGeometry(),
new THREE.OctahedronGeometry(),
new THREE.TorusGeometry(),
new THREE.TorusKnotGeometry(),
new THREE.DodecahedronGeometry(),
].map(geometry => new THREE.Mesh( geometry, materials ));
face
геометрии есть materialIndex
, смотрим на них:console.log(meshes.map(mat => [
mat.geometry.type,
mat.geometry.faces.map(face => face.materialIndex).join('')
]));
0: (2) ["BoxGeometry", "001122334455"]
1: (2) ["SphereGeometry", "00000000000000000000000000000000000000000000000000000000000000000000000000000000"]
2: (2) ["CylinderGeometry", "00000000000000001111111122222222"]
3: (2) ["ConeGeometry", "0000000022222222"]
4: (2) ["IcosahedronGeometry", "00000000000000000000"]
5: (2) ["OctahedronGeometry", "00000000"]
6: (2) ["TorusGeometry", "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"]
7: (2) ["TorusKnotGeometry", "00000000000000000000000000000000000000000000000000…0000000000000000000000000000000000000000000000000"]
8: (2) ["DodecahedronGeometry", "000000000000000000000000000000000000"]