diff --git a/have-been-to/countries.db b/have-been-to/countries.db index 760f7e3..39a6550 100644 Binary files a/have-been-to/countries.db and b/have-been-to/countries.db differ diff --git a/have-been-to/static/js/globe.js b/have-been-to/static/js/globe.js index 240293a..b08a5e5 100644 --- a/have-been-to/static/js/globe.js +++ b/have-been-to/static/js/globe.js @@ -72,6 +72,15 @@ function init() { document.getElementById('zoom-out').addEventListener('click', () => { controls.zoomOut(); }); + + // Update renderer size + updateRendererSize(); + + // Add event listener for sidebar toggle + document.querySelector('button[x-on\\:click]').addEventListener('click', updateRendererSize); + + // Add event listener for window resize + window.addEventListener('resize', updateRendererSize); } function onWindowResize() { @@ -236,13 +245,14 @@ function updateCountryList() { ul.innerHTML = ''; countries.forEach(country => { const li = document.createElement('li'); - li.className = 'flex justify-between items-center bg-gray-100 p-2 rounded'; + li.className = 'flex justify-between items-center bg-gray-800 p-2 rounded'; const span = document.createElement('span'); span.textContent = country; + span.className = 'text-gray-200'; li.appendChild(span); const removeButton = document.createElement('button'); removeButton.textContent = '删除'; - removeButton.className = 'bg-red-500 text-white px-2 py-1 rounded text-sm hover:bg-red-600 transition duration-200'; + removeButton.className = 'bg-red-600 text-white px-2 py-1 rounded text-sm hover:bg-red-700 transition duration-200'; removeButton.onclick = () => removeCountry(country); li.appendChild(removeButton); ul.appendChild(li); @@ -395,3 +405,14 @@ function exportMap() { link.click(); document.body.removeChild(link); } + +function updateRendererSize() { + const mapContainer = document.getElementById('map'); + const width = mapContainer.clientWidth; + const height = mapContainer.clientHeight; + + camera.aspect = width / height; + camera.updateProjectionMatrix(); + + renderer.setSize(width, height); +} diff --git a/have-been-to/templates/index.html b/have-been-to/templates/index.html index d7e25ce..1a3b42a 100644 --- a/have-been-to/templates/index.html +++ b/have-been-to/templates/index.html @@ -5,6 +5,7 @@ 我去过的国家 + - +
-
-

国家列表

- -
- - + +
+ + + +
+

国家列表

+
    +
    + + +
    + +

    +
    +

    高亮颜色

    +
    +
    +
    - -

    -
    -

    高亮颜色

    -
    -
    -
    -
    - -
    - - + + +
    +
    + +
    + +
    +