Skip to content

feat: add PLT Price Widget with real-time AJAX updates#5

Open
Paulopk0 wants to merge 1 commit into
mainfrom
ajax.json
Open

feat: add PLT Price Widget with real-time AJAX updates#5
Paulopk0 wants to merge 1 commit into
mainfrom
ajax.json

Conversation

@Paulopk0
Copy link
Copy Markdown
Member

Description

Implementation of a real-time price widget for the Plata Token (PLT/USD). The component displays the current rate and total market capitalization (Market Cap) fetched via AJAX requests from a JSON file that is dynamically updated by a PHP script on the server.

The interface features a responsive, modern dark-mode design that aligns with the project's aesthetics. It includes support for copying the Polygon contract address to the clipboard and direct integration with the MetaMask wallet to import the PLT token.

Changes

  • Frontend Component (HTML/CSS/JS):

    • Created [index.html](ajax.json/index.html) containing the structured layout of the Info Box, Polygon network badges, and loading of internal CDNs.
    • Created [ajax.json.script.js](ajax.json/ajax.json.script.js) containing the AJAX request functions with tab visibility tracking (Page Visibility API) to suspend updates in the background, clipboard functionality for copying the contract, and MetaMask integration (wallet_watchAsset).
    • Created [ajax.json.style.css](ajax.json/ajax.json.style.css) implementing the design system based on the Montserrat font, rotation animations for data loading, and hover/active interactive states.
    • Added vector logos in [MetaMask-icon.svg](ajax.json/.img/MetaMask-icon.svg) and [platasmall.svg](ajax.json/.img/platasmall.svg).
  • Price Simulation (Backend PHP/JSON):

    • Created [rep.php](ajax.json/rep.php) to simulate price changes and write data in real-time to the JSON file.
    • Created [PLTUSD.json](ajax.json/PLTUSD.json) which stores the structured quotation consumed by the widget.

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.

1 participant