Compare commits

...
Author SHA1 Message Date
callebtc 3bdf090f13 random_colors 2022-04-30 13:33:48 +02:00
a53f8e307a Userpage: ln.tips link (#343)
* small note

* rem instead of px

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-04-30 13:08:42 +02:00
6f14fab93b send card template (#342)
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-04-30 12:04:42 +02:00
99a866854b send_to_card (#341)
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-04-30 12:02:33 +02:00
21f5abbb25 Userpage metadata (#340)
* new pic

* round logo

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-04-30 11:22:43 +02:00
5 changed files with 28 additions and 6 deletions
+15 -4
View File
@@ -4,12 +4,19 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<meta property="og:title" content="Pay to {{.Username}}@ln.tips">
<meta property="og:description" content="Send bitcoin to {{.Username}} over Lightning. Get your own Lightning address at https://ln.tips 👈">
<meta property="og:type" content="article" />
<meta property="og:image" content="https://github.com/LightningTipBot/LightningTipBot/raw/main/resources/send_to_card.png">
<meta property="og:url" content="https://ln.tips/@{{.Username}}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image:alt" content="Pay to {{.Username}}@ln.tips">
<title>{{.Username}}@ln.tips</title>
<script src="https://unpkg.com/kjua@0.6.0/dist/kjua.min.js"></script>
<style>
body {
background: rgb(36,71,247);
background: radial-gradient(circle, rgba(36,71,247,1) 0%, rgba(249,42,84,1) 100%);
background: rgb({{.RGBStart}});
background: radial-gradient(circle, rgba({{.RGBStart}},1) 0%, rgba({{.RGBEnd}},1) 100%);
margin: auto;
text-align: center;
font-family: monospace;
@@ -30,6 +37,10 @@
.white {
color: #f3f3f3c5;
}
.sm {
color: #f3f3f3c5;
font-size: 1rem;
}
#qr {
display: block;
margin-top: 50px;
@@ -41,7 +52,7 @@
white-space: pre-wrap;
word-wrap: break-word;
word-break: break-all;
font-size: 23px;
font-size: 1.5rem;
}
</style>
@@ -50,7 +61,7 @@
<div><a href="lightning:{{.LNURLPay}}" id="qr"></a></div>
<div class="white" id="invoice">{{.LNURLPay}}</div>
<div class="sm">Get your own Lightning address here: <a class="sm" href="https://ln.tips">ln.tips</a></div>
<script>
qr.appendChild(
kjua({
+12 -1
View File
@@ -5,10 +5,12 @@ import (
"errors"
"fmt"
"html/template"
"math/bits"
"net/http"
"time"
"github.com/LightningTipBot/LightningTipBot/internal"
"github.com/LightningTipBot/LightningTipBot/internal/str"
"github.com/LightningTipBot/LightningTipBot/internal/telegram"
"github.com/PuerkitoBio/goquery"
"github.com/fiatjaf/go-lnurl"
@@ -78,11 +80,20 @@ func (s Service) UserPageHandler(w http.ResponseWriter, r *http.Request) {
log.Errorln("[UserPage]", err)
image = "https://telegram.org/img/t_logo.png"
}
// generate random color
i := str.Int32Hash(username)
rgb_start := fmt.Sprintf("%d, %d, %d", i%256, bits.RotateLeft32(i, 1)%256, bits.RotateLeft32(i, 2)%256)
rgb_end := fmt.Sprintf("%d, %d, %d", bits.RotateLeft32(i, 3)%256, bits.RotateLeft32(i, 4)%256, bits.RotateLeft32(i, 5)%256)
log.Infof(rgb_start, rgb_end)
if err := tmpl.ExecuteTemplate(w, "userpage", struct {
Username string
Image string
LNURLPay string
}{username, image, lnurlEncode}); err != nil {
RGBStart string
RGBEnd string
}{username, image, lnurlEncode, rgb_start, rgb_end}); err != nil {
log.Errorf("failed to render template")
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ import (
tb "gopkg.in/lightningtipbot/telebot.v3"
)
const queryImage = "https://avatars.githubusercontent.com/u/88730856?v=6"
const queryImage = "https://avatars.githubusercontent.com/u/88730856?v=7"
func (bot TipBot) inlineQueryInstructions(ctx intercept.Context) (intercept.Context, error) {
instructions := []struct {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB