support-kurdistan 1.1.1 → 1.1.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/index.js +2 -0
- package/package.json +22 -6
- package/react/SupportKurdistan.jsx +94 -0
- package/types/react.d.ts +11 -0
- package/vue/SupportKurdistan.vue +81 -0
- package/index.html +0 -42
- package/src/support-kurdistan.js +0 -206
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "support-kurdistan",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "Luxury banner component to support Kurdistan for React, Next.js and Vue",
|
|
5
|
+
"types": "./types/react.d.ts",
|
|
5
6
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
+
"main": "./index.js",
|
|
7
8
|
"exports": {
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./react": {
|
|
11
|
+
"types": "./types/react.d.ts",
|
|
12
|
+
"default": "./react/SupportKurdistan.jsx"
|
|
13
|
+
},
|
|
14
|
+
"./vue": "./vue/SupportKurdistan.vue"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"kurdistan",
|
|
18
|
+
"react",
|
|
19
|
+
"nextjs",
|
|
20
|
+
"vue",
|
|
21
|
+
"banner",
|
|
22
|
+
"solidarity"
|
|
23
|
+
],
|
|
24
|
+
"author": "Abdulsamad Zuhair",
|
|
25
|
+
"license": "MIT"
|
|
26
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export default function SupportKurdistan({
|
|
5
|
+
locale = "en",
|
|
6
|
+
theme = "light",
|
|
7
|
+
text = "",
|
|
8
|
+
mode = "top"
|
|
9
|
+
}) {
|
|
10
|
+
|
|
11
|
+
const translations = {
|
|
12
|
+
en: "We stand with Kurdistan",
|
|
13
|
+
ku: "ئێمە لەگەڵ کوردستانین",
|
|
14
|
+
ckb: "ئێمە لەگەڵ کوردستانین",
|
|
15
|
+
ar: "نحن نقف مع كوردستان"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const hashtags = ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"];
|
|
19
|
+
|
|
20
|
+
const themes = {
|
|
21
|
+
light: { bg:"#fff", color:"#333", border:"#e8e8e8", accent:"#c0392b" },
|
|
22
|
+
dark: { bg:"#1a1a1a", color:"#f5f5f5", border:"#333", accent:"#e74c3c" },
|
|
23
|
+
subtle: { bg:"#f9f9f9", color:"#444", border:"#e0e0e0", accent:"#2980b9" }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const t = themes[theme] || themes.light;
|
|
27
|
+
const isRTL = ["ar","ku","ckb"].includes(locale);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
position: mode === "footer" ? "relative" : "sticky",
|
|
33
|
+
top: mode === "footer" ? undefined : 0,
|
|
34
|
+
zIndex: 100,
|
|
35
|
+
background: t.bg,
|
|
36
|
+
borderBottom: `1px solid ${t.border}`,
|
|
37
|
+
width: "100%"
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<div style={{
|
|
41
|
+
maxWidth:1200,
|
|
42
|
+
margin:"0 auto",
|
|
43
|
+
padding:"12px 20px",
|
|
44
|
+
display:"flex",
|
|
45
|
+
justifyContent:"space-between",
|
|
46
|
+
alignItems:"center",
|
|
47
|
+
gap:20,
|
|
48
|
+
flexWrap:"wrap"
|
|
49
|
+
}}>
|
|
50
|
+
|
|
51
|
+
<div style={{display:"flex",alignItems:"center",gap:16}}>
|
|
52
|
+
<img
|
|
53
|
+
src="https://cdn-icons-png.flaticon.com/512/10600/10600720.png"
|
|
54
|
+
width={36}
|
|
55
|
+
height={36}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<p style={{
|
|
59
|
+
margin:0,
|
|
60
|
+
fontFamily:"Inter, sans-serif",
|
|
61
|
+
fontSize:16,
|
|
62
|
+
fontWeight:500,
|
|
63
|
+
color:t.color,
|
|
64
|
+
direction:isRTL?"rtl":"ltr",
|
|
65
|
+
textAlign:isRTL?"right":"left"
|
|
66
|
+
}}>
|
|
67
|
+
{text || translations[locale] || translations.en}
|
|
68
|
+
{!text && <span style={{marginLeft:6,color:"#e74c3c"}}>❤️</span>}
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div style={{display:"flex",gap:14,flexWrap:"wrap"}}>
|
|
73
|
+
{hashtags.map((tag,i)=>(
|
|
74
|
+
<a
|
|
75
|
+
key={i}
|
|
76
|
+
href={`https://twitter.com/search?q=${encodeURIComponent(tag)}`}
|
|
77
|
+
target="_blank"
|
|
78
|
+
style={{
|
|
79
|
+
color:t.accent,
|
|
80
|
+
fontFamily:"Inter, sans-serif",
|
|
81
|
+
fontSize:14,
|
|
82
|
+
fontWeight:500,
|
|
83
|
+
textDecoration:"none"
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{tag}
|
|
87
|
+
</a>
|
|
88
|
+
))}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
package/types/react.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
export interface SupportKurdistanProps {
|
|
4
|
+
locale?: string;
|
|
5
|
+
theme?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
mode?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare const SupportKurdistan: ComponentType<SupportKurdistanProps>;
|
|
11
|
+
export default SupportKurdistan;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
locale: { default: "en" },
|
|
4
|
+
theme: { default: "light" },
|
|
5
|
+
text: { default: "" },
|
|
6
|
+
mode: { default: "top" },
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const translations = {
|
|
10
|
+
en: "We stand with Kurdistan",
|
|
11
|
+
ku: "ئێمە لەگەڵ کوردستانین",
|
|
12
|
+
ckb: "ئێمە لەگەڵ کوردستانین",
|
|
13
|
+
ar: "نحن نقف مع كوردستان",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const hashtags = ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"];
|
|
17
|
+
|
|
18
|
+
const themes = {
|
|
19
|
+
light: { bg: "#fff", color: "#333", border: "#e8e8e8", accent: "#c0392b" },
|
|
20
|
+
dark: { bg: "#1a1a1a", color: "#f5f5f5", border: "#333", accent: "#e74c3c" },
|
|
21
|
+
subtle: {
|
|
22
|
+
bg: "#f9f9f9",
|
|
23
|
+
color: "#444",
|
|
24
|
+
border: "#e0e0e0",
|
|
25
|
+
accent: "#2980b9",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const t = themes[props.theme] || themes.light;
|
|
30
|
+
const isRTL = ["ar", "ku", "ckb"].includes(props.locale);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<div :style="{ background: t.bg, borderBottom: `1px solid ${t.border}` }">
|
|
35
|
+
<div class="wrap">
|
|
36
|
+
<div class="left">
|
|
37
|
+
<img
|
|
38
|
+
src="https://cdn-icons-png.flaticon.com/512/10600/10600720.png"
|
|
39
|
+
width="36"
|
|
40
|
+
/>
|
|
41
|
+
<p :style="{ color: t.color, direction: isRTL ? 'rtl' : 'ltr' }">
|
|
42
|
+
{{ props.text || translations[props.locale] || translations.en }}
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="right">
|
|
46
|
+
<a
|
|
47
|
+
v-for="tag in hashtags"
|
|
48
|
+
:href="`https://twitter.com/search?q=${encodeURIComponent(tag)}`"
|
|
49
|
+
target="_blank"
|
|
50
|
+
>
|
|
51
|
+
{{ tag }}
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<style scoped>
|
|
59
|
+
.wrap {
|
|
60
|
+
max-width: 1200px;
|
|
61
|
+
margin: auto;
|
|
62
|
+
padding: 12px 20px;
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
flex-wrap: wrap;
|
|
66
|
+
}
|
|
67
|
+
.left {
|
|
68
|
+
display: flex;
|
|
69
|
+
gap: 16px;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
.right {
|
|
73
|
+
display: flex;
|
|
74
|
+
gap: 14px;
|
|
75
|
+
flex-wrap: wrap;
|
|
76
|
+
}
|
|
77
|
+
a {
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
text-decoration: none;
|
|
80
|
+
}
|
|
81
|
+
</style>
|
package/index.html
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Support Kurdistan Header Demo</title>
|
|
7
|
-
<script type="module" src="./src/support-kurdistan.js"></script>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<support-kurdistan
|
|
11
|
-
locale="en"
|
|
12
|
-
theme="light"
|
|
13
|
-
mode="top"
|
|
14
|
-
>
|
|
15
|
-
</support-kurdistan>
|
|
16
|
-
|
|
17
|
-
<br>
|
|
18
|
-
|
|
19
|
-
<support-kurdistan
|
|
20
|
-
text="Custom support message"
|
|
21
|
-
theme="dark"
|
|
22
|
-
>
|
|
23
|
-
</support-kurdistan>
|
|
24
|
-
|
|
25
|
-
<br>
|
|
26
|
-
|
|
27
|
-
<support-kurdistan
|
|
28
|
-
locale="ar"
|
|
29
|
-
theme="minimal"
|
|
30
|
-
>
|
|
31
|
-
</support-kurdistan>
|
|
32
|
-
|
|
33
|
-
<br>
|
|
34
|
-
|
|
35
|
-
<support-kurdistan
|
|
36
|
-
locale="ckb"
|
|
37
|
-
theme="dark"
|
|
38
|
-
title="hello"
|
|
39
|
-
>
|
|
40
|
-
</support-kurdistan>
|
|
41
|
-
</body>
|
|
42
|
-
</html>
|
package/src/support-kurdistan.js
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
class SupportKurdistan extends HTMLElement {
|
|
2
|
-
connectedCallback() {
|
|
3
|
-
const locale = this.getAttribute("locale") || "en";
|
|
4
|
-
const theme = this.getAttribute("theme") || "light";
|
|
5
|
-
const customText = this.getAttribute("text") || "";
|
|
6
|
-
const mode = this.getAttribute("mode") || "top";
|
|
7
|
-
|
|
8
|
-
const translations = {
|
|
9
|
-
en: "We stand with Kurdistan",
|
|
10
|
-
ku: "ئێمە لەگەڵ کوردستانین",
|
|
11
|
-
ckb: "ئێمە لەگەڵ کوردستانین",
|
|
12
|
-
ar: "نحن نقف مع كوردستان"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const hashtags = ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"];
|
|
16
|
-
|
|
17
|
-
const themes = {
|
|
18
|
-
light: {
|
|
19
|
-
bg: "#ffffff",
|
|
20
|
-
color: "#333333",
|
|
21
|
-
border: "#e8e8e8",
|
|
22
|
-
accent: "#c0392b",
|
|
23
|
-
shadow: "0 2px 12px rgba(0, 0, 0, 0.08)"
|
|
24
|
-
},
|
|
25
|
-
dark: {
|
|
26
|
-
bg: "#1a1a1a",
|
|
27
|
-
color: "#f5f5f5",
|
|
28
|
-
border: "#333333",
|
|
29
|
-
accent: "#e74c3c",
|
|
30
|
-
shadow: "0 2px 12px rgba(0, 0, 0, 0.2)"
|
|
31
|
-
},
|
|
32
|
-
subtle: {
|
|
33
|
-
bg: "#f9f9f9",
|
|
34
|
-
color: "#444444",
|
|
35
|
-
border: "#e0e0e0",
|
|
36
|
-
accent: "#2980b9",
|
|
37
|
-
shadow: "0 1px 6px rgba(0, 0, 0, 0.05)"
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const t = themes[theme] || themes.light;
|
|
42
|
-
const isRTL = ['ar', 'ku', 'ckb'].includes(locale);
|
|
43
|
-
|
|
44
|
-
const positionStyle = mode === "footer"
|
|
45
|
-
? "margin-top: auto;"
|
|
46
|
-
: "position: sticky; top: 0; z-index: 100;";
|
|
47
|
-
|
|
48
|
-
this.attachShadow({ mode: "open" });
|
|
49
|
-
|
|
50
|
-
this.shadowRoot.innerHTML = `
|
|
51
|
-
<style>
|
|
52
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
|
|
53
|
-
|
|
54
|
-
:host {
|
|
55
|
-
display: block;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.banner {
|
|
59
|
-
${positionStyle}
|
|
60
|
-
width: 100%;
|
|
61
|
-
background: ${t.bg};
|
|
62
|
-
border-bottom: 1px solid ${t.border};
|
|
63
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.banner-content {
|
|
67
|
-
max-width: 1200px;
|
|
68
|
-
margin: 0 auto;
|
|
69
|
-
padding: 12px 20px;
|
|
70
|
-
display: flex;
|
|
71
|
-
justify-content: space-between;
|
|
72
|
-
align-items: center;
|
|
73
|
-
gap: 20px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.left-content {
|
|
77
|
-
display: flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
gap: 16px;
|
|
80
|
-
flex: 1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.right-content {
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
gap: 20px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.flag-container {
|
|
90
|
-
width: 36px;
|
|
91
|
-
height: 36px;
|
|
92
|
-
flex-shrink: 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.flag {
|
|
96
|
-
width: 100%;
|
|
97
|
-
height: 100%;
|
|
98
|
-
object-fit: contain;
|
|
99
|
-
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.message {
|
|
103
|
-
font-family: 'Inter', sans-serif;
|
|
104
|
-
font-size: 16px;
|
|
105
|
-
font-weight: 500;
|
|
106
|
-
line-height: 1.4;
|
|
107
|
-
margin: 0;
|
|
108
|
-
direction: ${isRTL ? 'rtl' : 'ltr'};
|
|
109
|
-
text-align: ${isRTL ? 'right' : 'left'};
|
|
110
|
-
color: ${t.color};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.hashtag {
|
|
114
|
-
font-family: 'Inter', sans-serif;
|
|
115
|
-
font-size: 14px;
|
|
116
|
-
font-weight: 500;
|
|
117
|
-
color: ${t.accent};
|
|
118
|
-
text-decoration: none;
|
|
119
|
-
transition: opacity 0.2s ease;
|
|
120
|
-
white-space: nowrap;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.hashtag:hover {
|
|
124
|
-
opacity: 0.8;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.heart {
|
|
128
|
-
color: #e74c3c;
|
|
129
|
-
display: inline-block;
|
|
130
|
-
margin-left: 6px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
@media (max-width: 768px) {
|
|
134
|
-
.banner-content {
|
|
135
|
-
flex-direction: column;
|
|
136
|
-
gap: 12px;
|
|
137
|
-
padding: 10px 16px;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.left-content {
|
|
141
|
-
width: 100%;
|
|
142
|
-
justify-content: center;
|
|
143
|
-
text-align: center;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.right-content {
|
|
147
|
-
width: 100%;
|
|
148
|
-
justify-content: center;
|
|
149
|
-
flex-wrap: wrap;
|
|
150
|
-
gap: 12px;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.message {
|
|
154
|
-
font-size: 15px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.hashtag {
|
|
158
|
-
font-size: 13px;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
@media (max-width: 480px) {
|
|
163
|
-
.right-content {
|
|
164
|
-
gap: 8px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.hashtag {
|
|
168
|
-
font-size: 12px;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
</style>
|
|
172
|
-
|
|
173
|
-
<div class="banner">
|
|
174
|
-
<div class="banner-content">
|
|
175
|
-
<div class="left-content">
|
|
176
|
-
<div class="flag-container">
|
|
177
|
-
<img class="flag"
|
|
178
|
-
src="https://cdn-icons-png.flaticon.com/512/10600/10600720.png"
|
|
179
|
-
alt="Kurdistan Map">
|
|
180
|
-
</div>
|
|
181
|
-
<p class="message">
|
|
182
|
-
${customText || (translations[locale] || translations.en)}
|
|
183
|
-
${!customText ? '<span class="heart">❤️</span>' : ''}
|
|
184
|
-
</p>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
<div class="right-content">
|
|
188
|
-
${hashtags.map(tag =>
|
|
189
|
-
`<a href="#" class="hashtag">${tag}</a>`
|
|
190
|
-
).join('')}
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
`;
|
|
195
|
-
|
|
196
|
-
// Add click handlers for hashtags
|
|
197
|
-
this.shadowRoot.querySelectorAll('.hashtag').forEach((link, index) => {
|
|
198
|
-
link.addEventListener('click', (e) => {
|
|
199
|
-
e.preventDefault();
|
|
200
|
-
window.open(`https://twitter.com/search?q=${encodeURIComponent(hashtags[index])}`, '_blank');
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
customElements.define("support-kurdistan", SupportKurdistan);
|