%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/devita.rezakurnia.com/X9KQ7MW2RT8PY4ND6LV3JH5CG8BF2ZM7QW4/scene8a/
Upload File :
Create Path :
Current File : //home2/rezakur1/devita.rezakurnia.com/X9KQ7MW2RT8PY4ND6LV3JH5CG8BF2ZM7QW4/scene8a/scene8a.js

fetch('../components/header.html')
.then(response => response.text())
.then(data => {

    document.getElementById(
        'header-container'
    ).innerHTML = data;

});

/* PROPERTY MODAL */

const cards =
document.querySelectorAll(
    '.property-card'
);

const modal =
document.getElementById(
    'propertyModal'
);

const title =
document.getElementById(
    'modalTitle'
);

const content =
document.getElementById(
    'modalContent'
);

cards.forEach(card=>{

    card.addEventListener(
        'click',
        ()=>{

            title.textContent =
                card.dataset.title;

            content.textContent =
                card.dataset.content;

            modal.style.display =
                'flex';
        }
    );

});

document
.getElementById(
    'closeModal'
)
.onclick = ()=>{

    modal.style.display =
        'none';
};

/* SIMPLE 3D VIEWER */

const container =
document.getElementById(
    'ionicViewer'
);

const scene =
new THREE.Scene();

const camera =
new THREE.PerspectiveCamera(
    60,
    container.clientWidth /
    container.clientHeight,
    0.1,
    1000
);

const renderer =
new THREE.WebGLRenderer({
    antialias:true,
    alpha:true
});

renderer.setSize(
    container.clientWidth,
    container.clientHeight
);

container.innerHTML='';

container.appendChild(
    renderer.domElement
);

const group =
new THREE.Group();

for(let i=0;i<6;i++){

    const sphere =
    new THREE.Mesh(

        new THREE.SphereGeometry(
            0.4,
            32,
            32
        ),

        new THREE.MeshBasicMaterial({
            color:0x42a5f5
        })

    );

    sphere.position.x =
        Math.cos(i)*1.4;

    sphere.position.y =
        Math.sin(i)*1.4;

    group.add(
        sphere
    );
}

scene.add(group);

camera.position.z = 5;

function animate(){

    requestAnimationFrame(
        animate
    );

    group.rotation.y += 0.01;

    renderer.render(
        scene,
        camera
    );
}

animate();

Zerion Mini Shell 1.0