cdnhost 1.3.5 → 1.3.7

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/cdnbanner.js ADDED
@@ -0,0 +1,149 @@
1
+ function loadBanner(divId = '1', userId = 'admin', width = 300, height = 250) {
2
+ const div = document.getElementById(divId);
3
+ if (!div) {
4
+ console.error(`Element with id="${divId}" not found.`);
5
+ return;
6
+ }
7
+
8
+ div.style.height = (typeof height === 'number' ? height + 'px' : height);
9
+ div.style.width = (typeof width === 'number' ? width + 'px' : width);
10
+ div.style.background = '#000';
11
+ div.innerHTML = '';
12
+
13
+ fetch('https://api.ipify.org?format=json')
14
+ .then(res => res.json())
15
+ .then(data => fetch(`https://gig.snapp.im/banner_test.php?user=${encodeURIComponent(userId)}&country=ko&ip=${data.ip}`))
16
+ .then(res => res.json())
17
+ .then(data => {
18
+ const banner = document.createElement('a');
19
+ banner.href = `banner2.php?link=${encodeURIComponent(data.link)}&user=${encodeURIComponent(userId)}&country=ko`;
20
+ banner.target = "_blank";
21
+ banner.style.background = '#000';
22
+ banner.style.color = '#fff';
23
+ banner.style.textDecoration = 'none';
24
+ banner.style.display = 'flex';
25
+ banner.style.overflow = 'hidden';
26
+ banner.style.position = 'relative'; // �� ���� �������� ���� ����
27
+
28
+ const imgWidth = 300;
29
+ const imgHeight = 250;
30
+
31
+ const imageDiv = document.createElement('div');
32
+ imageDiv.style.backgroundImage = `url('${data.image}')`;
33
+ imageDiv.style.backgroundSize = 'cover';
34
+ imageDiv.style.backgroundPosition = 'center';
35
+ imageDiv.style.flexShrink = '0';
36
+
37
+ const textDiv = document.createElement('div');
38
+ textDiv.style.color = '#fff';
39
+ textDiv.style.boxSizing = 'border-box';
40
+ textDiv.style.padding = '10px';
41
+ textDiv.style.overflow = 'hidden';
42
+
43
+ const title = document.createElement('h3');
44
+ title.textContent = data.title;
45
+ title.style.margin = '0 0 10px 0';
46
+
47
+ const desc = document.createElement('p');
48
+ desc.textContent = data.desc;
49
+ desc.style.margin = '0';
50
+
51
+ textDiv.appendChild(title);
52
+ textDiv.appendChild(desc);
53
+
54
+ const widthNum = typeof width === 'number' ? width : null;
55
+ const isFullWidth = width.toString() === '100%';
56
+
57
+ if (widthNum === imgWidth && height === imgHeight) {
58
+ banner.style.width = imgWidth + 'px';
59
+ banner.style.height = imgHeight + 'px';
60
+ banner.style.flexDirection = 'column';
61
+ imageDiv.style.width = imgWidth + 'px';
62
+ imageDiv.style.height = imgHeight + 'px';
63
+
64
+ banner.appendChild(imageDiv);
65
+
66
+ } else if (isFullWidth) {
67
+ banner.style.width = '100%';
68
+ banner.style.height = imgHeight + 'px';
69
+ banner.style.flexDirection = 'row';
70
+
71
+ imageDiv.style.width = imgWidth + 'px';
72
+ imageDiv.style.height = imgHeight + 'px';
73
+
74
+ textDiv.style.flexGrow = '1';
75
+ textDiv.style.height = imgHeight + 'px';
76
+ textDiv.style.display = 'flex';
77
+ textDiv.style.flexDirection = 'column';
78
+ textDiv.style.justifyContent = 'center';
79
+
80
+ banner.appendChild(imageDiv);
81
+ banner.appendChild(textDiv);
82
+
83
+ } else if (widthNum !== null && widthNum > imgWidth) {
84
+ const extraWidth = widthNum - imgWidth;
85
+ banner.style.width = widthNum + 'px';
86
+ banner.style.height = imgHeight + 'px';
87
+ banner.style.flexDirection = 'row';
88
+
89
+ imageDiv.style.width = imgWidth + 'px';
90
+ imageDiv.style.height = imgHeight + 'px';
91
+
92
+ textDiv.style.width = extraWidth + 'px';
93
+ textDiv.style.height = imgHeight + 'px';
94
+ textDiv.style.display = 'flex';
95
+ textDiv.style.flexDirection = 'column';
96
+ textDiv.style.justifyContent = 'center';
97
+
98
+ banner.appendChild(imageDiv);
99
+ banner.appendChild(textDiv);
100
+
101
+ } else if (typeof height === 'number' && height > imgHeight) {
102
+ const extraHeight = height - imgHeight;
103
+ banner.style.width = imgWidth + 'px';
104
+ banner.style.height = height + 'px';
105
+ banner.style.flexDirection = 'column';
106
+
107
+ imageDiv.style.width = imgWidth + 'px';
108
+ imageDiv.style.height = imgHeight + 'px';
109
+
110
+ textDiv.style.width = imgWidth + 'px';
111
+ textDiv.style.height = extraHeight + 'px';
112
+
113
+ banner.appendChild(imageDiv);
114
+ banner.appendChild(textDiv);
115
+ } else {
116
+ banner.style.width = (typeof width === 'number' ? width + 'px' : width);
117
+ banner.style.height = (typeof height === 'number' ? height + 'px' : height);
118
+ banner.style.flexDirection = 'column';
119
+
120
+ imageDiv.style.width = (typeof width === 'number' ? width + 'px' : width);
121
+ imageDiv.style.height = (typeof height === 'number' ? height + 'px' : height);
122
+
123
+ banner.appendChild(imageDiv);
124
+ }
125
+
126
+ // �߰��� ���� ������ (���� ���)
127
+ const fixedIcon = document.createElement('a');
128
+ fixedIcon.href = 'https://gig.snapp.im/';
129
+ fixedIcon.target = '_blank';
130
+ fixedIcon.style.position = 'absolute';
131
+ fixedIcon.style.top = '5px';
132
+ fixedIcon.style.right = '5px';
133
+ fixedIcon.style.width = '30px';
134
+ fixedIcon.style.zIndex = '10';
135
+
136
+ const fixedImg = document.createElement('img');
137
+ fixedImg.src = 'https://cdn.jsdelivr.net/npm/cdnhost@0.1.4/l2.png';
138
+ fixedImg.alt = 'a';
139
+ fixedImg.style.width = '100%';
140
+
141
+ fixedIcon.appendChild(fixedImg);
142
+ banner.appendChild(fixedIcon);
143
+
144
+ div.appendChild(banner);
145
+ })
146
+ .catch(err => {
147
+ console.error('��� �ε� ����:', err);
148
+ });
149
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdnhost",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "cdnhost",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/seekr.js CHANGED
@@ -130,5 +130,5 @@ function h(){
130
130
  button.style.opacity = 1;
131
131
  document.getElementById("s2").style.transition = "opacity 1s";
132
132
  document.getElementById("button").style.transition = "opacity 1s";
133
- }, 2000);
133
+ }, 3000);
134
134
  }
package/seekr2.js CHANGED
@@ -116,5 +116,5 @@ function h(){
116
116
  button.style.opacity = 1;
117
117
  document.getElementById("s2").style.transition = "opacity 1s";
118
118
  document.getElementById("button").style.transition = "opacity 1s";
119
- }, 2000);
119
+ }, 3000);
120
120
  }
package/total.js CHANGED
@@ -130,5 +130,5 @@ function h(){
130
130
  button.style.opacity = 1;
131
131
  document.getElementById("s2").style.transition = "opacity 1s";
132
132
  document.getElementById("button").style.transition = "opacity 1s";
133
- }, 2000);
133
+ }, 3000);
134
134
  }