nea

<style>
#vasilopita-globe-container {
position: relative;
width: 100%;
height: 92vh;
min-height: 620px;
margin: 0;
padding: 0;
overflow: hidden;
background: radial-gradient(ellipse at center, #0a0a2e 0%, #000010 70%, #000000 100%);
font-family: ‘Segoe UI’, Tahoma, Geneva, Verdana, sans-serif;
}
#vasilopita-globe-container canvas {
display: block;
width: 100% !important;
height: 100% !important;
}
.snowflake {
position: absolute;
color: #fff;
pointer-events: none;
z-index: 10;
animation: fall linear infinite;
}
@keyframes fall {
to { transform: translateY(100vh) rotate(360deg); }
}
#globe-title {
position: absolute;
top: 15px;
left: 50%;
transform: translateX(-50%);
color: #ffd700;
text-align: center;
z-index: 20;
text-shadow: 0 0 12px #ff0, 0 0 25px #f00;
pointer-events: none;
}
#globe-title h1 {
font-size: 1.6rem;
margin: 0;
}
#globe-title p {
font-size: 1rem;
margin: 4px 0 0;
color: #fff;
}
#loading {
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
color: #ffd700;
font-size: 1.3rem;
z-index: 50;
text-shadow: 0 0 10px #ff0;
}
</style>

<div id=”vasilopita-globe-container”>
<div id=”loading”>Φορτώνει η υδρόγειος με τα τραπέζια…</div>
<div id=”globe-title”>
<h1>🎄 Παγκόσμια Βασιλόπιτα 🎁</h1>
<p>Η υδρόγειος περιστρέφεται αργά γύρω από το μεγάλο τραπέζι</p>
</div>
</div>

<script src=”https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js”></script>
<script>
(function() {
// ===== ΒΑΛΕ ΕΔΩ ΤΟ URL ΤΗΣ ΕΙΚΟΝΑΣ ΤΟΥ ΤΡΑΠΕΖΙΟΥ ΠΟΥ ΑΝΕΒΑΣΕΣ =====
const TABLE_IMAGE_URL = “http://www.vasilopita.eu/wp-content/uploads/2026/10/vasilopita_table_transparent.png // ← άλλαξέ το

const container = document.getElementById(‘vasilopita-globe-container’);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(45, container.clientWidth / container.clientHeight, 0.1, 1000);
camera.position.set(0, 0.35, 3.1);

const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setSize(container.clientWidth, container.clientHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
container.appendChild(renderer.domElement);

// Φωτισμός
scene.add(new THREE.AmbientLight(0x404060, 0.65));
const sun = new THREE.DirectionalLight(0xfff5e0, 1.25);
sun.position.set(5, 3, 5);
scene.add(sun);
const warmLight = new THREE.PointLight(0xffaa44, 0.8, 15);
warmLight.position.set(0, 1.2, 2.5);
scene.add(warmLight);

// Αστέρια
const starsGeo = new THREE.BufferGeometry();
const starPos = new Float32Array(2500 * 3);
for (let i = 0; i < 2500 * 3; i++) starPos[i] = (Math.random() – 0.5) * 110;
starsGeo.setAttribute(‘position’, new THREE.BufferAttribute(starPos, 3));
scene.add(new THREE.Points(starsGeo, new THREE.PointsMaterial({ color: 0xffffff, size: 0.065 })));

const earthGroup = new THREE.Group();
scene.add(earthGroup);

const textureLoader = new THREE.TextureLoader();

// Υδρόγειος
const earthTexture = textureLoader.load(‘https://unpkg.com/three-globe/example/img/earth-blue-marble.jpg’, () => {
document.getElementById(‘loading’).style.display = ‘none’;
});
const earth = new THREE.Mesh(
new THREE.SphereGeometry(1, 64, 64),
new THREE.MeshPhongMaterial({ map: earthTexture, shininess: 14 })
);
earthGroup.add(earth);

// Νέφη
const clouds = new THREE.Mesh(
new THREE.SphereGeometry(1.012, 64, 64),
new THREE.MeshPhongMaterial({
map: textureLoader.load(‘https://unpkg.com/three-globe/example/img/earth-clouds.png’),
transparent: true,
opacity: 0.22,
depthWrite: false
})
);
earthGroup.add(clouds);

// ===== ΤΡΑΠΕΖΙΑ ΚΑΘΕΤΑ ΓΥΡΩ ΑΠΟ ΤΟΝ ΙΣΗΜΕΡΙΝΟ =====
const tableTexture = textureLoader.load(TABLE_IMAGE_URL);
tableTexture.encoding = THREE.sRGBEncoding;

// Πόσα τραπέζια θέλουμε γύρω-γύρω (όσο περισσότερα τόσο πιο συνεχές φαίνεται)
const NUM_TABLES = 18; // δοκίμασε 16, 18, 20, 24
const TABLE_RADIUS = 1.28; // απόσταση από το κέντρο της Γης
const TABLE_WIDTH = 0.72; // πλάτος κάθε τραπεζιού
const TABLE_HEIGHT = 0.38; // ύψος κάθε τραπεζιού (κάθετο στη Γη)

for (let i = 0; i < NUM_TABLES; i++) {
const angle = (i / NUM_TABLES) * Math.PI * 2;

// Θέση πάνω στον κύκλο του Ισημερινού
const x = Math.cos(angle) * TABLE_RADIUS;
const z = Math.sin(angle) * TABLE_RADIUS;

// Δημιουργία plane για κάθε τραπέζι
const geo = new THREE.PlaneGeometry(TABLE_WIDTH, TABLE_HEIGHT);
const mat = new THREE.MeshPhongMaterial({
map: tableTexture,
side: THREE.DoubleSide,
transparent: true,
shininess: 25
});
const table = new THREE.Mesh(geo, mat);

table.position.set(x, 0.02, z); // y ≈ 0 = Ισημερινός

// Περιστροφή ώστε να κοιτάει προς τα έξω (κάθετα στη Γη)
table.rotation.y = -angle + Math.PI / 2;

// Λίγη κλίση προς τα πάνω για καλύτερη οπτική
table.rotation.x = -0.08;

earthGroup.add(table);
}

// Χιόνι
for (let i = 0; i < 45; i++) {
const flake = document.createElement(‘div’);
flake.className = ‘snowflake’;
flake.innerHTML = ‘❄’;
flake.style.left = Math.random() * 100 + ‘%’;
flake.style.animationDuration = (7 + Math.random() * 10) + ‘s’;
flake.style.animationDelay = Math.random() * 7 + ‘s’;
flake.style.opacity = 0.3 + Math.random() * 0.55;
flake.style.fontSize = (9 + Math.random() * 14) + ‘px’;
container.appendChild(flake);
}

// Αργή περιστροφή
function animate() {
requestAnimationFrame(animate);
earthGroup.rotation.y += 0.0014; // πολύ αργή
clouds.rotation.y += 0.0003;
renderer.render(scene, camera);
}
animate();

// Resize
window.addEventListener(‘resize’, () => {
const w = container.clientWidth;
const h = container.clientHeight;
camera.aspect = w / h;
camera.updateProjectionMatrix();
renderer.setSize(w, h);
});
})();
</script>

en_USEN