cdnhost 2.0.0 → 2.0.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/_fr.png ADDED
Binary file
package/_ham.png ADDED
Binary file
@@ -0,0 +1,96 @@
1
+ document.addEventListener("DOMContentLoaded", function () {
2
+ const links = [
3
+ { href: "https://099.kr", text: "AI매지션" },
4
+ { href: "https://logig.im", text: "로긱" },
5
+ { href: "https://blog.099.kr", text: "블로긱" },
6
+ { href: "https://snapp.im", text: "스냅" },
7
+ { href: "https://seekr.kr", text: "시커" },
8
+ { href: "https://adsense.ko-kr.workers.dev", text: "애드센스포럼" },
9
+ { href: "https://youtube.ko-kr.workers.dev", text: "유튜브포럼" },
10
+ { href: "https://199.kr", text: "해외주식갤러리" },
11
+ { href: "https://919.kr", text: "미국주식갤러리" },
12
+ { href: "https://ranovel.kr", text: "라노벨KR" },
13
+ { href: "https://manatoki.kr", text: "유머토끼" }
14
+ ];
15
+
16
+ // --- 스타일 삽입 ---
17
+ const style = document.createElement("style");
18
+ style.textContent = `
19
+ .fhl-widget-wrapper{position:fixed;z-index:1000;bottom:15px;left:50%;transform:translateX(-50%);
20
+ display:flex;align-items:center;gap:8px;height:48px;width:calc(100% - 30px);max-width:480px;
21
+ padding:0 8px 0 12px;margin:0;border-radius:14px;
22
+ background-color:rgba(255,255,255,.95);backdrop-filter:blur(10px);
23
+ box-shadow:0 4px 15px rgba(0,0,0,.2);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}
24
+ .fhl-widget-wrapper *, .fhl-widget-wrapper *::before, .fhl-widget-wrapper *::after{box-sizing:border-box}
25
+ .fhl-search-input{flex-shrink:0;width:60px;height:32px;padding:0 4px;margin:0;font-size:14px;color:#333;
26
+ background:transparent;border:none;border-bottom:1px solid #ccc;border-radius:0;-webkit-appearance:none}
27
+ .fhl-search-input:focus{outline:none;border-bottom-color:#007bff}
28
+ .fhl-list-container{flex:1;min-width:0;height:100%;display:flex;align-items:center;gap:8px;
29
+ overflow-x:auto;padding:0;margin:0;scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none}
30
+ .fhl-list-container::-webkit-scrollbar{display:none}
31
+ .fhl-list-item{flex-shrink:0;display:block;padding:7px 14px;margin:0;font-size:14px;font-weight:500;color:#333;
32
+ text-decoration:none;white-space:nowrap;background:#f1f1f1;border:1px solid #ddd;border-radius:10px;
33
+ transition:background-color .2s ease}
34
+ .fhl-list-item:hover{background:#e5e5e5}
35
+ .fhl-scroll-arrow{flex-shrink:0;width:32px;height:32px;padding:0;margin:0;font-size:18px;font-weight:700;color:#fff;
36
+ background:#007bff;border:none;border-radius:50%;cursor:pointer;display:flex;justify-content:center;align-items:center}
37
+ @media(min-width:600px){.fhl-widget-wrapper{left:auto;right:20px;transform:none;width:auto}}
38
+ `;
39
+ document.head.appendChild(style);
40
+
41
+ // --- 위젯 DOM 생성 ---
42
+ const wrapper = document.createElement("div");
43
+ wrapper.className = "fhl-widget-wrapper";
44
+
45
+ const searchInput = document.createElement("input");
46
+ searchInput.type = "text";
47
+ searchInput.className = "fhl-search-input";
48
+ searchInput.placeholder = "검색";
49
+ searchInput.autocomplete = "off";
50
+ wrapper.appendChild(searchInput);
51
+
52
+ const listContainer = document.createElement("div");
53
+ listContainer.className = "fhl-list-container";
54
+ links.forEach(link => {
55
+ const a = document.createElement("a");
56
+ a.href = link.href;
57
+ a.target = "_blank";
58
+ a.className = "fhl-list-item";
59
+ a.textContent = link.text;
60
+ listContainer.appendChild(a);
61
+ });
62
+ wrapper.appendChild(listContainer);
63
+
64
+ const scrollArrow = document.createElement("button");
65
+ scrollArrow.className = "fhl-scroll-arrow";
66
+ scrollArrow.setAttribute("aria-label", "다음으로 스크롤");
67
+ scrollArrow.textContent = "›";
68
+ wrapper.appendChild(scrollArrow);
69
+
70
+ document.body.appendChild(wrapper);
71
+
72
+ // --- 기능 ---
73
+ const listItems = listContainer.querySelectorAll(".fhl-list-item");
74
+
75
+ scrollArrow.addEventListener("click", function () {
76
+ const scrollAmount = listContainer.clientWidth * 0.8;
77
+ const isAtEnd =
78
+ Math.abs(
79
+ listContainer.scrollWidth -
80
+ listContainer.clientWidth -
81
+ listContainer.scrollLeft
82
+ ) < 1;
83
+ listContainer.scrollTo({
84
+ left: isAtEnd ? 0 : listContainer.scrollLeft + scrollAmount,
85
+ behavior: "smooth",
86
+ });
87
+ });
88
+
89
+ searchInput.addEventListener("input", function () {
90
+ const searchTerm = searchInput.value.toLowerCase();
91
+ listItems.forEach(function (item) {
92
+ const itemText = item.textContent.toLowerCase();
93
+ item.style.display = itemText.includes(searchTerm) ? "block" : "none";
94
+ });
95
+ });
96
+ });
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdnhost",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "cdnhost",
5
5
  "main": "index.js",
6
6
  "scripts": {
Binary file