-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
266 lines (231 loc) · 8.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Repeat Generator</title>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #f06, #ff9f00);
color: white;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
/* Stylish header */
.top-box {
width: 100%;
background-color: #ffcc00;
text-align: center;
padding: 10px 0;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
z-index: 999;
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 20px;
padding-right: 20px;
}
.top-box h1 {
font-size: 1.8rem;
margin: 0;
padding: 0;
font-weight: normal;
text-align: center;
flex-grow: 1;
}
.share-icon {
font-size: 1.5rem; /* Adjusted size */
cursor: pointer;
}
.container {
width: 90%;
max-width: 800px;
background: rgba(0, 0, 0, 0.6);
padding: 30px;
border-radius: 10px;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
text-align: center;
margin-top: 80px;
}
label {
font-size: 1.2rem;
margin-top: 10px;
}
input, select, button {
padding: 10px;
font-size: 1.2rem;
width: 100%;
margin: 10px 0;
border-radius: 5px;
border: 1px solid #ffcc00;
outline: none;
background: #333;
color: white;
}
button:hover {
background: #ffcc00;
cursor: pointer;
}
.output-box {
margin-top: 20px;
padding: 20px;
background: #444;
border-radius: 5px;
color: #ffcc00;
word-wrap: break-word;
}
.social-icons {
margin-top: 20px;
display: flex;
justify-content: center;
gap: 20px;
}
.social-icons img {
width: 40px;
cursor: pointer;
}
.share-btn {
background-color: #ffcc00;
border: none;
padding: 8px;
border-radius: 50%;
font-size: 1.5rem;
color: black;
cursor: pointer;
height: 40px;
width: 40px;
}
/* Footer with clickable text */
.footer {
margin-top: 30px;
text-align: center;
color: #ffcc00;
}
.footer a {
color: #ffcc00;
margin: 0 15px;
font-size: 1.2rem;
text-decoration: none;
transition: color 0.3s;
}
.footer a:hover {
color: #ff6600;
}
/* Alert Message Styling */
.alert {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
background-color: #f44336;
color: white;
padding: 15px 30px;
border-radius: 5px;
font-size: 1.2rem;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
z-index: 9999;
display: none;
}
</style>
</head>
<body>
<!-- Stylish Header -->
<div class="top-box">
<button class="share-btn" onclick="shareWebsite()">
<img src="https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg" alt="Custom Share Icon" style="width: 24px; height: 24px;">
</button>
<h1>Text Repeat Generator</h1>
</div>
<div class="container">
<h1>Text Repeat Generator</h1>
<label for="input-text">Enter Text:</label>
<input type="text" id="input-text" placeholder="Enter your text here">
<label for="separator-select">Select Separator:</label>
<select id="separator-select">
<option value=" ">Space</option>
<option value=",">, (Comma)</option>
<option value="_">_ (Underscore)</option>
<option value="|">| (Pipe)</option>
<option value="•">• (Bullet)</option>
<option value="∆">∆ (Delta)</option>
</select>
<label for="format-select">Select Format:</label>
<select id="format-select">
<option value="horizontal">Horizontal</option>
<option value="vertical">Vertical</option>
</select>
<label for="repeat-count">Repeat Count:</label>
<input type="number" id="repeat-count" placeholder="Enter number of times to repeat" min="1" max="1000" value="10">
<button onclick="generateText()">Generate Text</button>
<div class="output-box" id="output-box"></div>
<button id="copy-btn" onclick="copyText()">Copy Text</button>
</div>
<!-- Alert for exceeding max count -->
<div class="alert" id="alert-message">Max repeat count is 1000!</div>
<!-- Social Media Icons -->
<div class="social-icons">
<a href="https://wa.me/916260273863" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg" alt="WhatsApp"></a>
<a href="https://www.instagram.com" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/9/95/Instagram_logo_2022.svg" alt="Instagram"></a>
<a href="https://www.facebook.com" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg" alt="Facebook"></a>
</div>
<!-- Footer with clickable text -->
<div class="footer">
<a href="mistershubhamkumar.github.io/Text-repeater-/feedback.html">Feedback</a>
<a href="mistershubhamkumar.github.io/Text-repeater-/about.html">About</a>
<a href="mistershubhamkumar.github.io/Text-repeater-/privecy.html">Privacy</a>
</div>
<script>
function generateText() {
const text = document.getElementById('input-text').value;
const separator = document.getElementById('separator-select').value;
const format = document.getElementById('format-select').value;
let repeatCount = document.getElementById('repeat-count').value;
if (repeatCount > 1000) {
// Show alert if repeat count is greater than 1000
document.getElementById('alert-message').style.display = 'block';
setTimeout(() => {
document.getElementById('alert-message').style.display = 'none';
}, 3000);
repeatCount = 1000; // Limit to 1000 if user enters more
document.getElementById('repeat-count').value = 1000;
}
let output = '';
if (format === 'horizontal') {
output = Array(parseInt(repeatCount)).fill(text).join(separator + ' '); // Repeat text horizontally with chosen separator + space
} else if (format === 'vertical') {
output = (text + '<br>').repeat(parseInt(repeatCount)); // Repeat entire text vertically
}
document.getElementById('output-box').innerHTML = output;
}
function copyText() {
const text = document.getElementById('output-box').innerText;
navigator.clipboard.writeText(text).then(() => {
alert("Text copied to clipboard!");
});
}
function shareWebsite() {
const shareData = {
title: 'Text Repeat Generator',
text: 'Check out this amazing Text Repeat Generator!',
url: window.location.href
};
// Try sharing via navigator.share (works on mobile devices)
if (navigator.share) {
navigator.share(shareData).catch((error) => console.log('Error sharing:', error));
} else {
// Fallback: copy URL if sharing isn't supported
navigator.clipboard.writeText(window.location.href).then(() => {
alert("Website URL copied to clipboard!");
});
}
}
</script>