Added buymeacoffee to donate tab

This commit is contained in:
0xboobface 2018-07-02 18:22:34 +02:00
parent c1df2f301f
commit a0bf1fbfe7
6 changed files with 15 additions and 6 deletions

View File

@ -1,8 +1,10 @@
package ctbrec.ui;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Tab;
import javafx.scene.control.TextField;
@ -36,9 +38,16 @@ public class DonateTabFx extends Tab {
HBox header = new HBox();
header.setAlignment(Pos.CENTER);
header.getChildren().add(headerVbox);
header.setPadding(new Insets(20, 0, 30, 0));
header.setPadding(new Insets(20, 0, 0, 0));
container.setTop(header);
ImageView coffeeImage = new ImageView(getClass().getResource("/html/buymeacoffee-fancy.png").toString());
Button coffeeButton = new Button("Buy me a coffee");
coffeeButton.setOnMouseClicked((e) -> { Launcher.open("https://www.buymeacoffee.com/0xboobface"); });
VBox buyCoffeeBox = new VBox(5);
buyCoffeeBox.setAlignment(Pos.TOP_CENTER);
buyCoffeeBox.getChildren().addAll(coffeeImage, coffeeButton);
int prefWidth = 360;
TextField bitcoinAddress = new TextField("15sLWZon8diPqAX4UdPQU1DcaPuvZs2GgA");
bitcoinAddress.setEditable(false);
@ -74,6 +83,9 @@ public class DonateTabFx extends Tab {
coinBox.setAlignment(Pos.CENTER);
coinBox.setSpacing(50);
coinBox.getChildren().addAll(bitcoinBox, ethereumBox, moneroBox);
container.setCenter(coinBox);
VBox centerBox = new VBox(50);
centerBox.getChildren().addAll(buyCoffeeBox, coinBox);
container.setCenter(centerBox);
}
}

View File

@ -1,7 +1,5 @@
package ctbrec.ui;
import java.net.URL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -22,8 +20,7 @@ public class DonateTabHtml extends Tab {
browser = new WebView();
try {
WebEngine webEngine = browser.getEngine();
URL donatePage = getClass().getResource("/html/donate.html");
webEngine.load(donatePage.toString());
webEngine.load("https://0xboobface.github.io/ctbrec/#donate");
webEngine.setJavaScriptEnabled(true);
webEngine.setOnAlert((e) -> {
System.out.println(e.getData());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 26 KiB