From 6db32affc4a2c028000b43c2dd1b330b9cab2d45 Mon Sep 17 00:00:00 2001 From: caviri Date: Fri, 30 Aug 2024 14:38:24 +0200 Subject: [PATCH] fix(site folder erased): Not recognized by Github pages --- site/index.html => index.html | 5 +- index.json | 71 +++++++++++++++++++++++++++ script.js | 56 +++++++++++++++++++++ site/index.json | 92 ----------------------------------- site/script.js | 26 ---------- site/styles.css => styles.css | 28 +++++++++++ 6 files changed, 157 insertions(+), 121 deletions(-) rename site/index.html => index.html (93%) create mode 100644 index.json create mode 100644 script.js delete mode 100644 site/index.json delete mode 100644 site/script.js rename site/styles.css => styles.css (70%) diff --git a/site/index.html b/index.html similarity index 93% rename from site/index.html rename to index.html index 5acc97c..942efde 100644 --- a/site/index.html +++ b/index.html @@ -23,9 +23,8 @@

pNeuma RDI Hub Prototype

  • Github Repository
  • -
    - -
    + +
    diff --git a/index.json b/index.json new file mode 100644 index 0000000..fb72086 --- /dev/null +++ b/index.json @@ -0,0 +1,71 @@ +{ + "index_timestamp": "2024-09-08 16:50:41.941809", + "catalog": { + "datasets": [ + { + "schema_version": "1.0.0", + "schema_type": "dataset", + "dataset_id": "0001-pneuma-dataset", + "title": "pNEUMA Dataset", + "doi": "10.5281/zenodo.7426506", + "version": "v1", + "description": "pNEUMA is an open large-scale dataset of naturalistic trajectories of half a million vehicles that have been collected by a one-of-a-kind experiment by a swarm of drones in the congested downtown area of Athens, Greece.", + "created_at": "2022-12-08T16:26:11Z", + "updated_at": "2022-12-08T16:26:11Z", + "data_format": "zip", + "tags": [ + "traffic", + "drone" + ], + "source": "Zenodo", + "authors": [ + { + "name": "Kim, Sohyeong" + }, + { + "name": "Anagnostopoulos, Georg" + }, + { + "name": "Barmpounakis, Emmanouil" + }, + { + "name": "Geroliminis, Nikolas" + } + ], + "license": "CC BY 4.0", + "access_url": "https://zenodo.org/record/7426506/", + "documentation_url": "https://zenodo.org/record/7426506" + }, + { + "schema_version": "1.0.0", + "schema_type": "dataset", + "dataset_id": "0002-pneuma-vision-dataset", + "title": "pNEUMA vision dataset", + "doi": "10.5281/zenodo.10491409", + "version": "v1", + "description": "The pNEUMA dataset is the drone traffic imagery dataset that contains images of frame and vehicle annotations as positions. This dataset is the expansion of the pNEUMA, the urban trajectory dataset collected by swarms of drones in Athens. For more details about pNEUMA and pNEUMA Vision, please check our website at https://open-traffic.epfl.ch and github.", + "created_at": "2023-08-30T15:12:56Z", + "updated_at": "2023-08-30T15:12:56Z", + "data_format": "csv jpg", + "tags": [ + "traffic", + "GNSS", + "urban mobility", + "traffic safety" + ], + "source": "Zenodo", + "authors": [ + { + "name": "Barmpounakis, Emmanouil" + }, + { + "name": "Geroliminis, Nikolas" + } + ], + "license": "CC BY 4.0", + "access_url": "https://zenodo.org/record/10491409", + "documentation_url": "https://zenodo.org/record/10491409" + } + ] + } +} \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..264193c --- /dev/null +++ b/script.js @@ -0,0 +1,56 @@ +fetch('index.json') + .then(response => response.json()) + .then(data => { + const sidebar = document.querySelector('.sidebar'); + const container = document.querySelector('.content-container'); + + // Create tabs for each category in data.catalog + Object.keys(data.catalog).forEach(category => { + const tab = document.createElement('div'); + tab.classList.add('tab'); + tab.innerText = category.charAt(0).toUpperCase() + category.slice(1); + tab.dataset.category = category; + sidebar.appendChild(tab); + }); + + // Function to display content for a selected category + const displayContent = (category) => { + container.innerHTML = ''; // Clear previous content + data.catalog[category].forEach(item => { + const itemDiv = document.createElement('div'); + itemDiv.classList.add('item'); + itemDiv.innerHTML = ` +

    ${item.title}

    +

    DOI: ${item.doi}

    +

    ${item.description}

    +

    Created At: ${item.created_at}

    +

    Updated At: ${item.updated_at}

    +

    Format: ${item.data_format}

    +

    Size: ${item.size_in_mb} MB

    +

    Tags: ${item.tags.join(', ')}

    +

    Source: ${item.source}

    +

    Authors: ${item.authors.name} (ORCID: ${item.authors.orcid})

    +

    License: ${item.license}

    + Access ${category.charAt(0).toUpperCase() + category.slice(1)} + View Documentation + `; + container.appendChild(itemDiv); + }); + }; + + // Add event listeners to tabs + document.querySelectorAll('.tab').forEach(tab => { + tab.addEventListener('click', () => { + document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); + tab.classList.add('active'); + displayContent(tab.dataset.category); + }); + }); + + // Display the first category by default + const firstCategory = Object.keys(data.catalog)[0]; + document.querySelector(`.tab[data-category="${firstCategory}"]`).classList.add('active'); + displayContent(firstCategory); + }) + .catch(error => console.error('Error loading data:', error)); + diff --git a/site/index.json b/site/index.json deleted file mode 100644 index 4ba8eb2..0000000 --- a/site/index.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "index_timestamp": "2024-08-30T12:00:00Z", - "catalog": { - "datasets": [ - { - "version": "1.0.0", - "dataset_id": "123e4567-e89b-12d3-a456-426614174000", - "title": "Global Climate Data 2023", - "doi": "10.1234/global-climate-2023", - "description": "This dataset contains global climate data for the year 2023, including temperature, precipitation, and atmospheric pressure readings from various regions around the world.", - "created_at": "2023-01-01T12:00:00Z", - "updated_at": "2023-06-15T12:00:00Z", - "data_format": "CSV", - "tags": ["climate", "temperature", "precipitation", "atmospheric pressure"], - "source": "National Meteorological Organization", - "authors": { - "name": "Dr. Jane Doe", - "orcid": "0000-0002-1825-0097" - }, - "license": "CC BY 4.0", - "access_url": "https://example.com/datasets/global-climate-2023", - "documentation_url": "https://example.com/datasets/global-climate-2023/documentation", - "access_endpoint": "https://api.example.com/climate/2023/data", - "documentation_endpoint": "https://api.example.com/climate/2023/docs" - }, - { - "version": "1.0.0", - "dataset_id": "223e4567-e89b-12d3-a456-426614174111", - "title": "Regional Climate Data 2022", - "doi": "10.1234/regional-climate-2022", - "description": "This dataset provides detailed climate data for specific regions for the year 2022.", - "created_at": "2022-01-01T12:00:00Z", - "updated_at": "2022-12-15T12:00:00Z", - "data_format": "JSON", - "tags": ["climate", "regional data", "temperature"], - "source": "Regional Weather Stations", - "authors": { - "name": "Dr. John Smith", - "orcid": "0000-0002-3456-7890" - }, - "license": "MIT", - "access_url": "https://example.com/datasets/regional-climate-2022", - "documentation_url": "https://example.com/datasets/regional-climate-2022/documentation", - "access_endpoint": "https://api.example.com/climate/2022/data", - "documentation_endpoint": "https://api.example.com/climate/2022/docs" - }, - { - "version": "1.0.0", - "dataset_id": "323e4567-e89b-12d3-a456-426614174222", - "title": "Global Economic Indicators 2023", - "doi": "10.1234/global-economic-2023", - "description": "This dataset includes global economic indicators such as GDP, inflation rates, and unemployment figures for the year 2023.", - "created_at": "2023-02-01T12:00:00Z", - "updated_at": "2023-07-01T12:00:00Z", - "data_format": "Parquet", - "tags": ["economy", "GDP", "inflation", "unemployment"], - "source": "World Economic Forum", - "authors": { - "name": "Dr. Emily Johnson", - "orcid": "0000-0003-1234-5678" - }, - "license": "CC BY-SA 4.0", - "access_url": "https://example.com/datasets/global-economic-2023", - "documentation_url": "https://example.com/datasets/global-economic-2023/documentation", - "access_endpoint": "https://api.example.com/economy/2023/data", - "documentation_endpoint": "https://api.example.com/economy/2023/docs" - }, - { - "version": "1.0.0", - "dataset_id": "423e4567-e89b-12d3-a456-426614174333", - "title": "Regional Economic Data 2022", - "doi": "10.1234/regional-economic-2022", - "description": "This dataset provides economic data for various regions in 2022, including GDP and unemployment rates.", - "created_at": "2022-03-01T12:00:00Z", - "updated_at": "2022-09-01T12:00:00Z", - "data_format": "CSV", - "tags": ["economy", "regional", "GDP", "unemployment"], - "source": "Regional Economic Offices", - "authors": { - "name": "Dr. Michael Lee", - "orcid": "0000-0004-5678-9101" - }, - "license": "Apache 2.0", - "access_url": "https://example.com/datasets/regional-economic-2022", - "documentation_url": "https://example.com/datasets/regional-economic-2022/documentation", - "access_endpoint": "https://api.example.com/economy/2022/data", - "documentation_endpoint": "https://api.example.com/economy/2022/docs" - } - ] - } - } - \ No newline at end of file diff --git a/site/script.js b/site/script.js deleted file mode 100644 index c279986..0000000 --- a/site/script.js +++ /dev/null @@ -1,26 +0,0 @@ -fetch('index.json') - .then(response => response.json()) - .then(data => { - const container = document.querySelector('.dataset-container'); - data.catalog.datasets.forEach(dataset => { - const datasetDiv = document.createElement('div'); - datasetDiv.classList.add('dataset'); - datasetDiv.innerHTML = ` -

    ${dataset.title}

    -

    DOI: ${dataset.doi}

    -

    ${dataset.description}

    -

    Created At: ${dataset.created_at}

    -

    Updated At: ${dataset.updated_at}

    -

    Format: ${dataset.data_format}

    -

    Size: ${dataset.size_in_mb} MB

    -

    Tags: ${dataset.tags.join(', ')}

    -

    Source: ${dataset.source}

    -

    Authors: ${dataset.authors.name} (ORCID: ${dataset.authors.orcid})

    -

    License: ${dataset.license}

    - Access Dataset - View Documentation - `; - container.appendChild(datasetDiv); - }); - }) - .catch(error => console.error('Error loading datasets:', error)); diff --git a/site/styles.css b/styles.css similarity index 70% rename from site/styles.css rename to styles.css index a81efec..fa2bd8d 100644 --- a/site/styles.css +++ b/styles.css @@ -40,6 +40,34 @@ p { margin: 5px 0; } +.sidebar { + width: 200px; + float: left; + background-color: #f4f4f4; + padding: 10px; +} + +.tab { + padding: 10px; + cursor: pointer; +} + +.tab.active { + background-color: #ddd; +} + +.content-container { + margin-left: 220px; + padding: 10px; +} + +.item { + margin-bottom: 20px; + border: 1px solid #d1d5db; + border-radius: 8px; + padding: 15px; +} + .button { display: inline-block; padding: 10px 15px;