Skip to content

Commit 907b0e1

Browse files
committed
docs: add badges
1 parent 19bb66a commit 907b0e1

File tree

2 files changed

+46
-17
lines changed

2 files changed

+46
-17
lines changed

docs/app/app.component.html

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,39 @@
1212
</p>
1313
</div>
1414
<div class="badges d-flex align-items-center my-3 justify-content-center">
15+
<!-- <div class="badge"><img src="https://badgen.net/badge/Angular/7.x/1b95e0" alt="" /></div> -->
1516
<div class="badge">
16-
<a
17-
class="github-button"
18-
href="https://github.com/lokesh-coder/toppy"
19-
data-show-count="true"
20-
aria-label="Star lokesh-coder/toppy on GitHub"
21-
>Star</a
22-
>
17+
<img
18+
src="https://img.shields.io/npm/v/toppy.svg?style=popout-square&colorA=00bcd4&colorB=7d61af&label=&logo=data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiPjxwYXRoIGQ9Ik0wIDcuMzM0djhoNi42NjZ2MS4zMzJIMTJ2LTEuMzMyaDEydi04SDB6bTYuNjY2IDYuNjY0SDUuMzM0di00SDMuOTk5djRIMS4zMzVWOC42NjdoNS4zMzF2NS4zMzF6bTQgMHYxLjMzNkg4LjAwMVY4LjY2N2g1LjMzNHY1LjMzMmgtMi42Njl2LS4wMDF6bTEyLjAwMSAwaC0xLjMzdi00aC0xLjMzNnY0aC0xLjMzNXYtNGgtMS4zM3Y0aC0yLjY3MVY4LjY2N2g4LjAwMnY1LjMzMXoiIGZpbGw9IndoaXRlIi8+PHBhdGggZD0iTTEwLjY2NSAxMEgxMnYyLjY2N2gtMS4zMzVWMTB6IiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg=="
19+
alt=""
20+
/>
2321
</div>
2422
<div class="badge">
25-
<a
26-
href="https://twitter.com/share?ref_src=twsrc%5Etfw"
27-
class="twitter-share-button"
28-
data-text="Cute overlay library for Angular - tooltips, modals, toastr, menu, dropdowns, alerts, popovers, sidebar and more... "
29-
data-url="https://lokesh-coder.github.io/toppy/"
30-
data-via="lokesh-coder"
31-
data-hashtags="angular"
32-
data-show-count="false"
33-
>Tweet</a
34-
>
23+
<img
24+
src="https://img.shields.io/npm/dt/toppy.svg?style=flat-square&colorA=00bcd4&colorB=7d61af&logo=data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1kb3dubG9hZCI+PHBhdGggZD0iTTIxIDE1djRhMiAyIDAgMCAxLTIgMkg1YTIgMiAwIDAgMS0yLTJ2LTQiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSI3IDEwIDEyIDE1IDE3IDEwIj48L3BvbHlsaW5lPjxsaW5lIHgxPSIxMiIgeTE9IjE1IiB4Mj0iMTIiIHkyPSIzIj48L2xpbmU+PC9zdmc+&label="
25+
alt=""
26+
/>
27+
</div>
28+
<div class="badge">
29+
<img
30+
src="https://img.shields.io/github/stars/lokesh-coder/toppy.svg?style=flat-square&colorA=00bcd4&colorB=7d61af&label=&logo=github&logoColor=fff"
31+
alt=""
32+
/>
33+
</div>
34+
<div class="badge">
35+
<img
36+
src="https://img.shields.io/codecov/c/github/lokesh-coder/toppy/master.svg?style=flat-square&colorA=00bcd4&colorB=7d61af&label=&logo=codecov&logoColor=fff"
37+
alt=""
38+
/>
39+
</div>
40+
<div class="badge">
41+
<img
42+
src="https://img.shields.io/badge/share-tweet-aaa.svg?style=flat-square&colorA=00bcd4&colorB=7d61af&label=&logo=twitter&logoColor=fff"
43+
(click)="tweet($event)"
44+
alt=""
45+
/>
3546
</div>
47+
3648
<!--
3749
<div class="badge">
3850
<select

docs/app/app.component.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,21 @@ export class AppComponent {
7171
}
7272
});
7373
}
74+
75+
tweet(e) {
76+
const getWindowOptions = function() {
77+
const width = 500;
78+
const height = 350;
79+
const left = window.innerWidth / 2 - width / 2;
80+
const top = window.innerHeight / 2 - height / 2;
81+
82+
return ['resizable,scrollbars,status', 'height=' + height, 'width=' + width, 'left=' + left, 'top=' + top].join();
83+
};
84+
// const text = encodeURIComponent('Hey everyone, come & see how good I look!');
85+
const shareUrl = `https://twitter.com/intent/tweet?hashtags=angular&original_referer=http%3A%2F%2Flocalhost%3A4200%2F&ref_src=twsrc%5Etfw&text=Cute%20overlay%20library%20for%20Angular%20-%20tooltips%2C%20modals%2C%20toastr%2C%20menu%2C%20dropdowns%2C%20alerts%2C%20popovers%2C%20sidebar%20and%20more...%20&tw_p=tweetbutton&url=https%3A%2F%2Flokesh-coder.github.io%2Ftoppy%2F&via=lokesh-coder`;
86+
87+
e.preventDefault();
88+
const win = window.open(shareUrl, 'ShareOnTwitter', getWindowOptions());
89+
win.opener = null; // 2
90+
}
7491
}

0 commit comments

Comments
 (0)