nodebb-plugin-niki-loyalty 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-niki-loyalty",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Niki The Cat Coffee Loyalty System - Earn points while studying on IEU Forum.",
5
5
  "main": "library.js",
6
6
  "nbbpm": {
@@ -14,19 +14,39 @@ $(document).ready(function () {
14
14
  }
15
15
 
16
16
  // -------------------------------------------------------------
17
- // 🔔 NİKİ TOAST BİLDİRİM FONKSİYONU (Sol Alt - Logo ile)
17
+ // 🔔 NİKİ TOAST BİLDİRİM FONKSİYONU (Sol Alt - Inline Stiller)
18
18
  // -------------------------------------------------------------
19
19
  function showNikiToast(message) {
20
20
  // Mevcut toast'ı kaldır
21
21
  $('.niki-toast').remove();
22
22
 
23
23
  // Logo yolunu al (plugin'in static klasöründen)
24
- const logoUrl = config.relative_path + '/plugins/nodebb-plugin-niki-loyalty/static/logo.png';
24
+ const logoUrl = (config && config.relative_path ? config.relative_path : '') + '/plugins/nodebb-plugin-niki-loyalty/static/logo.png';
25
25
 
26
- // Toast HTML'i oluştur
26
+ // Toast HTML'i oluştur (Inline stiller ile)
27
27
  const toastHtml = `
28
- <div class="niki-toast">
29
- <img src="${logoUrl}" alt="Niki" style="width: 28px; height: 28px; border-radius: 50%; object-fit: cover;">
28
+ <div class="niki-toast" style="
29
+ position: fixed;
30
+ bottom: 90px;
31
+ left: 25px;
32
+ background: linear-gradient(135deg, #4E342E 0%, #3E2723 100%);
33
+ color: #fff;
34
+ padding: 12px 20px;
35
+ border-radius: 16px;
36
+ font-size: 14px;
37
+ font-weight: 600;
38
+ box-shadow: 0 8px 25px rgba(0,0,0,0.3);
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 12px;
42
+ z-index: 9999;
43
+ opacity: 0;
44
+ transform: translateY(20px) scale(0.9);
45
+ transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
46
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
47
+ border: 1px solid rgba(255,255,255,0.1);
48
+ ">
49
+ <img src="${logoUrl}" alt="Niki" style="width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.2);">
30
50
  <span>${message}</span>
31
51
  </div>
32
52
  `;
@@ -34,24 +54,35 @@ $(document).ready(function () {
34
54
  // Body'ye ekle
35
55
  $('body').append(toastHtml);
36
56
 
37
- // Animasyon için kısa gecikme
57
+ // Animasyon için kısa gecikme - görünür yap
38
58
  setTimeout(function () {
39
- $('.niki-toast').addClass('show');
59
+ $('.niki-toast').css({
60
+ 'opacity': '1',
61
+ 'transform': 'translateY(0) scale(1)'
62
+ });
40
63
  }, 50);
41
64
 
42
65
  // 4 saniye sonra kaldır
43
66
  setTimeout(function () {
44
- $('.niki-toast').removeClass('show');
67
+ $('.niki-toast').css({
68
+ 'opacity': '0',
69
+ 'transform': 'translateY(20px) scale(0.9)'
70
+ });
45
71
  setTimeout(function () {
46
72
  $('.niki-toast').remove();
47
- }, 300);
73
+ }, 400);
48
74
  }, 4000);
49
75
 
50
76
  // Widget'ı da bounce animasyonu ile canlandır
51
- $('#niki-floating-widget .niki-widget-content').addClass('niki-bounce');
52
- setTimeout(function () {
53
- $('#niki-floating-widget .niki-widget-content').removeClass('niki-bounce');
54
- }, 500);
77
+ const $widget = $('#niki-floating-widget .niki-widget-content');
78
+ if ($widget.length) {
79
+ $widget.css('transform', 'scale(1.1)');
80
+ setTimeout(function () {
81
+ $widget.css('transform', 'scale(1)');
82
+ }, 300);
83
+ }
84
+
85
+ console.log('[Niki-Loyalty] Toast gösterildi:', message);
55
86
  }
56
87
 
57
88
  // Fonksiyonu global yap (Konsoldan test için)