Currently, I am working on creating a widget that includes social sharing buttons. The goal is for these buttons to share the URL of the current page when clicked on various social media platforms. For instance, I attempted to integrate a Twitter share button by utilizing resources found here. Below is the code snippet that was inserted into my HTML:
<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-url="https://www.google.com" data-show-count="false"></a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8">
However, I wasn't satisfied with the default appearance of the button and decided to modify its styles by changing the class name within the tag. Although the visual aspect changed, the functionality of the button was not as expected, leading to it opening a Twitter page in an undesirable manner:
https://i.sstatic.net/MrSvW.png
My primary objective is to maintain the essential functionality of the Twitter share icon while simultaneously altering the button's style. Ideally, upon clicking the share button, it should appear similar to the following design: