File size: 2,631 Bytes
c3bb20b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Sample data for the gallery
const samplePhotos = [
    {
        id: 1,
        title: "The Phoenix Lights",
        date: "1997-03-13",
        location: "Phoenix, Arizona",
        image: "http://static.photos/technology/640x360/1",
        description: "One of the most famous mass UFO sightings in history. Thousands of people reported seeing a huge V-shaped object with lights silently gliding over the city.",
        type: "ufo",
        credibility: 8
    },
    {
        id: 2,
        title: "Roswell Incident",
        date: "1947-07-08",
        location: "Roswell, New Mexico",
        image: "http://static.photos/science/640x360/2",
        description: "The alleged crash of an extraterrestrial spacecraft and subsequent cover-up by the U.S. government. The debris field contained strange metallic fragments with unearthly properties.",
        type: "alien",
        credibility: 7
    },
    {
        id: 3,
        title: "Tic-Tac Encounter",
        date: "2004-11-14",
        location: "Pacific Ocean",
        image: "http://static.photos/aerial/640x360/3",
        description: "Navy pilots encountered a white, oblong object resembling a tic-tac candy that demonstrated impossible flight characteristics, captured on FLIR video.",
        type: "ufo",
        credibility: 9
    }
];

// Load gallery with sample data
function loadGallery() {
    const gallery = document.getElementById('gallery');
    
    if (!gallery) return;
    
    gallery.innerHTML = '';
    
    samplePhotos.forEach(photo => {
        const photoCard = document.createElement('custom-photo-card');
        photoCard.setAttribute('data-id', photo.id);
        photoCard.setAttribute('data-title', photo.title);
        photoCard.setAttribute('data-date', photo.date);
        photoCard.setAttribute('data-location', photo.location);
        photoCard.setAttribute('data-image', photo.image);
        photoCard.setAttribute('data-description', photo.description);
        photoCard.setAttribute('data-type', photo.type);
        photoCard.setAttribute('data-credibility', photo.credibility);
        
        gallery.appendChild(photoCard);
    });
    
    feather.replace();
}

// Handle form submission for new sightings
document.getElementById('photo-form')?.addEventListener('submit', function(e) {
    e.preventDefault();
    
    // In a real app, you would save to a database
    // For now, we'll just redirect to the gallery
    alert('Sighting saved successfully!');
    window.location.href = 'index.html';
});

// Initialize the app
document.addEventListener('DOMContentLoaded', () => {
    feather.replace();
});