Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/donate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type Options = {
message: string;
title: string;
highLight: string;
close: string;
position: string;
links: Array<{ url: string; text: string; style: string }>;
};
Expand All @@ -22,7 +23,7 @@ class Donate {
<div class="popup">
<div class="popup__content ${this.options.position}">
<a id="popup__close" href="#" class="popup__close">
<span class='close'>Kapat</span>
<span class='close'>${this.options.close?.length ? this.options.close : '<img src="./assets/img/close-circle.png" alt="close" />'}</span>
</a>
${
this.options.theme !== "dark"
Expand Down
7 changes: 6 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ <h1>Donate.JS Demo</h1>
</textarea
>
</div>

<div class="select">
<label for="close">Close Text</label>
<input value="Kapat" id="close" type="text" />
</div>
<button id="show">Show Modal</button>
</div>

Expand All @@ -74,13 +77,15 @@ <h1>Donate.JS Demo</h1>
const title = document.getElementById("title");
const highlight = document.getElementById("highlight");
const message = document.getElementById("message");
const close = document.getElementById("close");

show.addEventListener("click", () => {
const donate = new Donate({
theme: dark.checked ? "dark" : "light",
position: position.value,
title: title.value,
highLight: highlight.value,
close: close.value,
links: [
{
text: "Trendyol Bağış Linki",
Expand Down
5 changes: 5 additions & 0 deletions src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
color: #cf626e;
}

.popup__close img {
height: 24px;
width: 24px;
}

.button {
border: 1px solid #000;
background: var(--primary-color);
Expand Down