cdnhost 1.7.2 → 1.7.3

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 CHANGED
@@ -168,4 +168,4 @@ const imgWidth = imgHeight * aspectRatio;
168
168
  .catch(err => {
169
169
  console.error('배너 로드 실패:', err);
170
170
  });
171
- }
171
+ }
@@ -0,0 +1,173 @@
1
+ function loadBanner(divId = '1', userId = 'admin', width = 300, height = 250, country = 'ko') {
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.overflow = 'hidden';
11
+
12
+ div.style.background = '#000';
13
+ div.innerHTML = '';
14
+
15
+ fetch(`https://gig.snapp.im/banner_api.php?user=${encodeURIComponent(userId)}&country=${encodeURIComponent(country)}`)
16
+
17
+ .then(res => res.json())
18
+ .then(data => {
19
+ const hasImage = data.image && data.image.trim() !== '';
20
+ const banner = document.createElement('div');
21
+
22
+ const targetUrl = `https://gig.snapp.im/banner2.php?link=${encodeURIComponent(data.link)}&user=${encodeURIComponent(userId)}&country=${encodeURIComponent(country)}`;
23
+
24
+ // 배너 기본 스타일
25
+ banner.style.background = '#fafafa';
26
+ banner.style.color = '#000';
27
+ banner.style.display = 'flex';
28
+ banner.style.border = '1px solid #eee';
29
+ banner.style.overflow = 'hidden';
30
+ banner.style.position = 'relative';
31
+ banner.style.cursor = 'pointer';
32
+
33
+ // 배너 클릭 시 링크 이동
34
+ banner.addEventListener('click', (e) => {
35
+ if (e.target.closest('.fixed-icon')) return; // 아이콘 클릭 제외
36
+ window.open(targetUrl, '_blank');
37
+ });
38
+
39
+ const textDiv = document.createElement('div');
40
+ textDiv.style.boxSizing = 'border-box';
41
+ textDiv.style.padding = '10px';
42
+ textDiv.style.overflow = 'hidden';
43
+ textDiv.style.height = '600px';
44
+ textDiv.style.display = 'flex';
45
+ textDiv.style.flexDirection = 'column';
46
+ textDiv.style.setProperty('color', '#000', 'important');
47
+ textDiv.style.setProperty('line-height', '1.4', 'important');
48
+
49
+ const title = document.createElement('h3');
50
+ title.textContent = data.title;
51
+ title.style.margin = '0 0 10px 0';
52
+ title.style.setProperty('color', '#000', 'important');
53
+ title.style.setProperty('line-height', '1.4', 'important');
54
+
55
+ const desc = document.createElement('p');
56
+ desc.textContent = data.desc;
57
+ desc.style.margin = '0';
58
+ desc.style.setProperty('color', '#000', 'important');
59
+ desc.style.setProperty('line-height', '1.4', 'important');
60
+
61
+ textDiv.appendChild(title);
62
+ textDiv.appendChild(desc);
63
+
64
+ const widthNum = typeof width === 'number' ? width : null;
65
+
66
+ const imgHeight = height;
67
+ const aspectRatio = 1.2;
68
+ const imgWidth = imgHeight * aspectRatio;
69
+
70
+ const isFullWidth = width.toString() === '100%';
71
+
72
+ if (hasImage) {
73
+ const imageDiv = document.createElement('div');
74
+ imageDiv.style.backgroundImage = `url('https://gig.snapp.im/${data.image}')`;
75
+ imageDiv.style.backgroundSize = 'cover';
76
+ imageDiv.style.backgroundPosition = 'center';
77
+ imageDiv.style.flexShrink = '0';
78
+
79
+ if (widthNum === imgWidth && height === imgHeight) {
80
+ banner.style.width = imgWidth + 'px';
81
+ banner.style.height = imgHeight + 'px';
82
+ banner.style.flexDirection = 'column';
83
+
84
+ imageDiv.style.width = imgWidth + 'px';
85
+ imageDiv.style.height = imgHeight + 'px';
86
+
87
+ banner.appendChild(imageDiv);
88
+
89
+ } else if (isFullWidth) {
90
+ banner.style.width = '100%';
91
+ banner.style.height = imgHeight + 'px';
92
+ banner.style.flexDirection = 'row';
93
+
94
+ imageDiv.style.width = imgWidth + 'px';
95
+ imageDiv.style.height = imgHeight + 'px';
96
+
97
+ textDiv.style.flexGrow = '1';
98
+ textDiv.style.height = imgHeight + 'px';
99
+
100
+ banner.appendChild(imageDiv);
101
+ banner.appendChild(textDiv);
102
+
103
+ } else if (widthNum !== null && widthNum > imgWidth) {
104
+ const extraWidth = widthNum - imgWidth;
105
+ banner.style.width = widthNum + 'px';
106
+ banner.style.height = imgHeight + 'px';
107
+ banner.style.flexDirection = 'row';
108
+
109
+ imageDiv.style.width = imgWidth + 'px';
110
+ imageDiv.style.height = imgHeight + 'px';
111
+
112
+ textDiv.style.width = extraWidth + 'px';
113
+ textDiv.style.height = imgHeight + 'px';
114
+
115
+ banner.appendChild(imageDiv);
116
+ banner.appendChild(textDiv);
117
+
118
+ } else if (typeof height === 'number' && height > imgHeight) {
119
+ const extraHeight = height - imgHeight;
120
+ banner.style.width = imgWidth + 'px';
121
+ banner.style.height = height + 'px';
122
+ banner.style.flexDirection = 'column';
123
+
124
+ imageDiv.style.width = imgWidth + 'px';
125
+ imageDiv.style.height = imgHeight + 'px';
126
+
127
+ textDiv.style.width = imgWidth + 'px';
128
+ textDiv.style.height = extraHeight + 'px';
129
+
130
+ banner.appendChild(imageDiv);
131
+ banner.appendChild(textDiv);
132
+ } else {
133
+ banner.style.width = (typeof width === 'number' ? width + 'px' : width);
134
+ banner.style.height = (typeof height === 'number' ? height + 'px' : height);
135
+ banner.style.flexDirection = 'column';
136
+
137
+ imageDiv.style.width = (typeof width === 'number' ? width + 'px' : width);
138
+ imageDiv.style.height = (typeof height === 'number' ? height + 'px' : height);
139
+
140
+ banner.appendChild(imageDiv);
141
+ }
142
+ } else {
143
+ banner.style.flexDirection = 'column';
144
+ textDiv.style.display = 'block';
145
+ banner.appendChild(textDiv);
146
+ }
147
+
148
+ // 고정 아이콘 (클릭 제외 대상)
149
+ const fixedIcon = document.createElement('a');
150
+ fixedIcon.className = 'fixed-icon';
151
+ fixedIcon.href = 'https://gig.snapp.im/';
152
+ fixedIcon.target = '_blank';
153
+ fixedIcon.style.position = 'absolute';
154
+ fixedIcon.style.top = '5px';
155
+ fixedIcon.style.right = '5px';
156
+ fixedIcon.style.width = '30px';
157
+ fixedIcon.style.zIndex = '10';
158
+
159
+ const fixedImg = document.createElement('img');
160
+ fixedImg.src = 'https://cdn.jsdelivr.net/npm/cdnhost@0.1.4/l2.png';
161
+ fixedImg.alt = 'a';
162
+ fixedImg.style.width = '100%';
163
+ fixedImg.style.background = '#000';
164
+
165
+ fixedIcon.appendChild(fixedImg);
166
+ banner.appendChild(fixedIcon);
167
+
168
+ div.appendChild(banner);
169
+ })
170
+ .catch(err => {
171
+ console.error('배너 로드 실패:', err);
172
+ });
173
+ }
@@ -0,0 +1,174 @@
1
+ function loadBanner(divId = '1', userId = 'admin', width = 300, height = 250, country = 'ko') {
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.overflow = 'hidden';
11
+
12
+ //div.style.background = '#000';
13
+ div.innerHTML = '';
14
+
15
+ fetch(`https://gig.snapp.im/banner_api.php?user=${encodeURIComponent(userId)}&country=${encodeURIComponent(country)}`)
16
+
17
+ .then(res => res.json())
18
+ .then(data => {
19
+ const hasImage = data.image && data.image.trim() !== '';
20
+ const banner = document.createElement('div');
21
+
22
+ const targetUrl = `https://gig.snapp.im/banner2.php?link=${encodeURIComponent(data.link)}&user=${encodeURIComponent(userId)}&country=${encodeURIComponent(country)}`;
23
+
24
+ // 배너 기본 스타일
25
+ banner.style.background = '#fff';
26
+ banner.style.color = '#000';
27
+ banner.style.borderRadius = '1rem';
28
+ banner.style.display = 'flex';
29
+ banner.style.overflow = 'hidden';
30
+ banner.style.position = 'relative';
31
+ banner.style.cursor = 'pointer';
32
+
33
+ // 배너 클릭 시 링크 이동
34
+ banner.addEventListener('click', (e) => {
35
+ if (e.target.closest('.fixed-icon')) return; // 아이콘 클릭 제외
36
+ window.open(targetUrl, '_blank');
37
+ });
38
+
39
+ const textDiv = document.createElement('div');
40
+ textDiv.style.boxSizing = 'border-box';
41
+ textDiv.style.padding = '10px';
42
+ textDiv.style.overflow = 'hidden';
43
+ textDiv.style.height = '600px';
44
+ textDiv.style.display = 'flex';
45
+ textDiv.style.flexDirection = 'column';
46
+ textDiv.style.setProperty('color', '#000', 'important');
47
+ textDiv.style.setProperty('line-height', '1.4', 'important');
48
+
49
+ const title = document.createElement('h3');
50
+ title.textContent = data.title;
51
+ title.style.margin = '0 0 10px 0';
52
+ title.style.setProperty('color', '#000', 'important');
53
+ title.style.setProperty('line-height', '1.4', 'important');
54
+
55
+ const desc = document.createElement('p');
56
+ desc.textContent = data.desc;
57
+ desc.style.margin = '0';
58
+ desc.style.setProperty('color', '#000', 'important');
59
+ desc.style.setProperty('line-height', '1.4', 'important');
60
+
61
+ textDiv.appendChild(title);
62
+ textDiv.appendChild(desc);
63
+
64
+ const widthNum = typeof width === 'number' ? width : null;
65
+
66
+ const imgHeight = height;
67
+ const aspectRatio = 1.2;
68
+ const imgWidth = imgHeight * aspectRatio;
69
+
70
+ const isFullWidth = width.toString() === '100%';
71
+
72
+ if (hasImage) {
73
+ const imageDiv = document.createElement('div');
74
+ imageDiv.style.backgroundImage = `url('https://gig.snapp.im/${data.image}')`;
75
+ imageDiv.style.backgroundSize = 'cover';
76
+ imageDiv.style.backgroundPosition = 'center';
77
+ imageDiv.style.flexShrink = '0';
78
+
79
+ if (widthNum === imgWidth && height === imgHeight) {
80
+ banner.style.width = imgWidth + 'px';
81
+ banner.style.height = imgHeight + 'px';
82
+ banner.style.flexDirection = 'column';
83
+
84
+ imageDiv.style.width = imgWidth + 'px';
85
+ imageDiv.style.height = imgHeight + 'px';
86
+
87
+ banner.appendChild(imageDiv);
88
+
89
+ } else if (isFullWidth) {
90
+ banner.style.width = '100%';
91
+ banner.style.height = imgHeight + 'px';
92
+ banner.style.flexDirection = 'row';
93
+
94
+ imageDiv.style.width = imgWidth + 'px';
95
+ imageDiv.style.height = imgHeight + 'px';
96
+
97
+ textDiv.style.flexGrow = '1';
98
+ textDiv.style.height = imgHeight + 'px';
99
+
100
+ banner.appendChild(imageDiv);
101
+ banner.appendChild(textDiv);
102
+
103
+ } else if (widthNum !== null && widthNum > imgWidth) {
104
+ const extraWidth = widthNum - imgWidth;
105
+ banner.style.width = widthNum + 'px';
106
+ banner.style.height = imgHeight + 'px';
107
+ banner.style.flexDirection = 'row';
108
+
109
+ imageDiv.style.width = imgWidth + 'px';
110
+ imageDiv.style.height = imgHeight + 'px';
111
+
112
+ textDiv.style.width = extraWidth + 'px';
113
+ textDiv.style.height = imgHeight + 'px';
114
+
115
+ banner.appendChild(imageDiv);
116
+ banner.appendChild(textDiv);
117
+
118
+ } else if (typeof height === 'number' && height > imgHeight) {
119
+ const extraHeight = height - imgHeight;
120
+ banner.style.width = imgWidth + 'px';
121
+ banner.style.height = height + 'px';
122
+ banner.style.flexDirection = 'column';
123
+
124
+ imageDiv.style.width = imgWidth + 'px';
125
+ imageDiv.style.height = imgHeight + 'px';
126
+
127
+ textDiv.style.width = imgWidth + 'px';
128
+ textDiv.style.height = extraHeight + 'px';
129
+
130
+ banner.appendChild(imageDiv);
131
+ banner.appendChild(textDiv);
132
+ } else {
133
+ banner.style.width = (typeof width === 'number' ? width + 'px' : width);
134
+ banner.style.height = (typeof height === 'number' ? height + 'px' : height);
135
+ banner.style.flexDirection = 'column';
136
+
137
+ imageDiv.style.width = (typeof width === 'number' ? width + 'px' : width);
138
+ imageDiv.style.height = (typeof height === 'number' ? height + 'px' : height);
139
+
140
+ banner.appendChild(imageDiv);
141
+ }
142
+ } else {
143
+ banner.style.flexDirection = 'column';
144
+ textDiv.style.display = 'block';
145
+ banner.appendChild(textDiv);
146
+ }
147
+
148
+ // 고정 아이콘 (클릭 제외 대상)
149
+ const fixedIcon = document.createElement('a');
150
+ fixedIcon.className = 'fixed-icon';
151
+ fixedIcon.href = 'https://gig.snapp.im/';
152
+ fixedIcon.target = '_blank';
153
+ fixedIcon.style.position = 'absolute';
154
+ fixedIcon.style.top = '5px';
155
+ fixedIcon.style.right = '5px';
156
+ fixedIcon.style.width = '30px';
157
+ fixedIcon.style.zIndex = '10';
158
+
159
+ const fixedImg = document.createElement('img');
160
+ fixedImg.src = 'https://cdn.jsdelivr.net/npm/cdnhost@0.1.4/l2.png';
161
+ fixedImg.alt = 'a';
162
+ fixedImg.style.width = '100%';
163
+ fixedImg.style.borderRadius = '50%';
164
+ fixedImg.style.background = '#000';
165
+
166
+ fixedIcon.appendChild(fixedImg);
167
+ banner.appendChild(fixedIcon);
168
+
169
+ div.appendChild(banner);
170
+ })
171
+ .catch(err => {
172
+ console.error('배너 로드 실패:', err);
173
+ });
174
+ }
package/link.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
  const urls = [...new Set([
3
- "//seekr.kr","//snapp.im","//2news.kr","//manatoki.kr","//199.kr","//1.2news.kr",
3
+ "//seekr.kr","//snapp.im","//2news.kr","//manatoki.kr","//199.kr","//1.2news.kr","//isai.kr",
4
4
  "//ruliweb.iwinv.net/","//instiz.iwinv.net/","//gmarket.iwinv.net/","//aliexpress.iwinv.net/","//facebook.iwinv.net/","//etoland.iwinv.net/","//auction.iwinv.net/","//asdasd.iwinv.net/","//kangkas.iwinv.net/","//lavikit.iwinv.net/","//maplegg.iwinv.net/","//kemono.iwinv.net/","//redgifs.iwinv.net/","//wikikr.iwinv.net/","//yourgg.iwinv.net/","//koreakr.iwinv.net/","//capcut.iwinv.net/","//snp500.iwinv.net/","//shopee.iwinv.net/","//namuwiki.iwinv.net/","//popcat.iwinv.net/","//fiveguys.iwinv.net/","//jjang0u.iwinv.net/","//mmtcld.iwinv.net/","//tdgall.iwinv.net/","//yakored.iwinv.net/","//postype.iwinv.net/","//manatoki.iwinv.net/","//dctribe.iwinv.net/","//blacktoon.iwinv.net/","//munpia.iwinv.net/","//snpetf.iwinv.net/","//hygall.iwinv.net/","//mingky.iwinv.net/","//skyscanner.iwinv.net/","//flightaware.iwinv.net/","//interpals.iwinv.net/","//fconline.iwinv.net/","//flextv.iwinv.net/","//mlbpark.iwinv.net/","//eomisae.iwinv.net/","//ecount.iwinv.net/","//hiworks.iwinv.net/","//toomics.iwinv.net/","//mixamo.iwinv.net/","//yandex.iwinv.net/","//toptoon.iwinv.net/","//slrclub.iwinv.net/","//dmitory.iwinv.net/","//kmcert.iwinv.net/","//lolchess.iwinv.net/","//curseforge.iwinv.net/","//hsreplay.iwinv.net/","//mapleinven.iwinv.net/","//c19670.iwinv.net/","//a12893.iwinv.net/","//bikini.iwinv.net/","//school.iwinv.net/","//qqqqqq.iwinv.net/","//iiiiii.iwinv.net/","//llllll.iwinv.net/","//oooooo.iwinv.net/","//xxxxxx.iwinv.net/","//eeeeee.iwinv.net/","//aaaaaa.iwinv.net/","//zzzzzz.iwinv.net/","//tttttt.iwinv.net/","//ssssss.iwinv.net/","//pdnews.iwinv.net/","//twitch.iwinv.net/","//twitter.iwinv.net/","//valorant.iwinv.net/","//tiktok.iwinv.net/","//tumblr.iwinv.net/","//netflix.iwinv.net/","//minecraft.iwinv.net/","//openai.iwinv.net/","//palworld.iwinv.net/",
5
5
  "//roblox.2news.kr","//daum.2news.kr","//nate.2news.kr","//blog.2news.kr","//wiki.2news.kr","//aa.2news.kr","//ab.2news.kr","//ac.2news.kr","//ad.2news.kr","//ae.2news.kr","//af.2news.kr","//ag.2news.kr","//ah.2news.kr","//aj.2news.kr","//a1.2news.kr","//a2.2news.kr","//a3.2news.kr","//a4.2news.kr","//a5.2news.kr","//a6.2news.kr","//a7.2news.kr","//a8.2news.kr","//a9.2news.kr","//b1.2news.kr","//b2.2news.kr","//b3.2news.kr","//b4.2news.kr","//b5.2news.kr","//b6.2news.kr","//b7.2news.kr","//b8.2news.kr","//b9.2news.kr","//c1.2news.kr","//c2.2news.kr","//c3.2news.kr","//c4.2news.kr","//c5.2news.kr","//c6.2news.kr","//c7.2news.kr","//c8.2news.kr","//c9.2news.kr","//d1.2news.kr","//d2.2news.kr","//d3.2news.kr","//d4.2news.kr","//d5.2news.kr","//d6.2news.kr","//d7.2news.kr","//d8.2news.kr","//d9.2news.kr","//e1.2news.kr","//a.manatoki.kr","//b.manatoki.kr","//c.manatoki.kr","//d.manatoki.kr","//e.manatoki.kr","//f.manatoki.kr","//g.manatoki.kr","//h.manatoki.kr","//i.manatoki.kr","//j.manatoki.kr","//k.manatoki.kr","//l.manatoki.kr","//m.manatoki.kr","//n.manatoki.kr","//o.manatoki.kr","//p.manatoki.kr","//admin.logig.im","//asdasd.logig.im","//google.logig.im","//tistory.logig.im","//naver.2news.kr","//google.2news.kr","//tistory.2news.kr","//instagram.2news.kr",
6
6
  "//1a.seekr.kr","//1b.seekr.kr","//1c.seekr.kr","//1d.seekr.kr","//1e.seekr.kr","//1f.seekr.kr","//1g.seekr.kr","//1h.seekr.kr","//1i.seekr.kr","//1.seekr.kr","//2.seekr.kr","//3.seekr.kr","//4.seekr.kr","//5.seekr.kr","//6.seekr.kr","//7.seekr.kr","//8.seekr.kr","//9.seekr.kr","//10.seekr.kr","//11.seekr.kr","//12.seekr.kr","//13.seekr.kr","//14.seekr.kr","//15.seekr.kr","//16.seekr.kr","//17.seekr.kr","//18.seekr.kr","//19.seekr.kr","//20.seekr.kr","//21.seekr.kr","//22.seekr.kr","//23.seekr.kr","//24.seekr.kr","//25.seekr.kr","//26.seekr.kr","//27.seekr.kr","//28.seekr.kr","//29.seekr.kr","//30.seekr.kr","//31.seekr.kr","//32.seekr.kr","//33.seekr.kr","//34.seekr.kr","//35.seekr.kr","//39.seekr.kr","//42.seekr.kr","//43.seekr.kr","//48.seekr.kr","//50.seekr.kr","//53.seekr.kr","//56.seekr.kr","//67.seekr.kr","//70.seekr.kr","//129.seekr.kr","//124.seekr.kr","//127.seekr.kr","//128.seekr.kr",
package/logo3.png ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdnhost",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "cdnhost",
5
5
  "main": "index.js",
6
6
  "scripts": {