Skip to content

Conversation

@AdityaSingh-7
Copy link
Contributor

@AdityaSingh-7 AdityaSingh-7 commented Jan 14, 2025

Added India-Map Component

Description

This pull request adds improvements to the India map project in Astro, including updates to the CSS for better responsiveness, enhancements to the SVG map layout, and integration of JSON data for displaying state-specific folk dances. The changes aim to provide a smoother user experience and better visuals across devices.

Fixes #14 (Improve SVG and image layout responsiveness)

Current Issue

Facing problem in dynamic routing from the pop-up to the a specific state page.

Example : A state with a single word like 'Goa', routing is efficient but for a state with two words like "Andhra Pradesh" , routing is inefficient as the space between the words is not processed properly.

Current Fix

Using a slug field in the JSON file with the state's name in lowercase and no spaces.
Example- Andhra Pradesh ⟶ andhrapradesh

How Has This Been Tested?

The changes have been tested using the following methods:

  • Verified responsive design across different screen sizes (mobile, tablet, desktop)
  • Ensured SVG map renders correctly and is interactive
  • Tested integration of JSON data for state-specific dance information
  • Checked compatibility on Chrome, Firefox, and Safari
  • Performed accessibility checks using Lighthouse

Test Configuration:

  • Browser(s) tested: Chrome, Firefox, Safari
  • Device(s) tested: Desktop (macOS, Windows), Mobile (iOS, Android)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional Notes

These changes ensure the map project aligns with the goals of a visually appealing, responsive, and content-rich web experience for showcasing Indian folk dances.

@AdityaSingh-7 AdityaSingh-7 linked an issue Jan 14, 2025 that may be closed by this pull request
@AdityaSingh-7 AdityaSingh-7 self-assigned this Jan 14, 2025
@recursivezero
Copy link
Owner

folder naming convention are easy to distinguish no deep nesetd folder such as

asstes/icons/states/<state.svg>
assets/styles/<file>,css

Copy link
Owner

@recursivezero recursivezero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check RC and fix all

---
import StateLayout from "@/layouts/mapLayouts/StateLayout";
import stateData from "@/assets/map_assets/stateData.json";
import "@/assets/styles/map_styles/stateStyles.css";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no deep nested folder inside styles just use /styles/map.css

const { title = "Indian Classical Dance" } = Astro.props;
---

<html lang="en">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no HTML body head tag again; use BaseLayput and adjust code accordingly

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no nested folder

});
</script>

<style>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract the CSS

"image": "himachal.jpg",
"svg": "HimachalPradesh.svg",
"wikiLink": "https://en.wikipedia.org/wiki/Himachal_Pradesh",
"official_website": "https://himachal.nic.in",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"official_website": "https://himachal.nic.in",
"official_website": "https://himachal.gov.in",

"image": "bihar.jpeg",
"svg": "Bihar.svg",
"wikiLink": "https://en.wikipedia.org/wiki/Bihar",
"official_website": "https://state.bihar.gov.in",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"official_website": "https://state.bihar.gov.in",
"official_website": "https://www.bihar.gov.in",

"image": "delhi.jpg",
"svg": "Delhi.svg",
"wikiLink": "https://en.wikipedia.org/wiki/Delhi",
"official_website": "https://delhi.gov.in",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add www

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ladakh is missing

</div>

<script define:vars={{ statesData }}>
document.addEventListener("DOMContentLoaded", async () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use astro page load event astro:page-load
check this https://docs.astro.build/en/guides/view-transitions/#lifecycle-events

and use <ViewTransition/>

@xkeshav xkeshav changed the base branch from main to develop January 18, 2025 14:23
@xkeshav xkeshav merged commit 7c63a82 into develop Jan 31, 2025
2 checks passed
@recursivezero recursivezero deleted the feature/RZA-250002 branch July 1, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

❇️ RZA-250002: india map integration

4 participants