Skip to content

Commit 27539c5

Browse files
authored
Merge pull request #10 from sojijr/font-selector
feat(font): add font selector to threadimage
2 parents 7c931b7 + ece63ff commit 27539c5

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

assets/css/styles.css

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,13 @@ footer a {
215215
display: block;
216216
}
217217

218-
.expand-content p {
219-
color: #fff;
220-
margin: 10px 0;
218+
#fontSelector {
219+
width: 100%;
220+
padding: 5px;
221+
margin-top: -150px;
222+
border: 1px solid #ccc;
223+
border-radius: 5px;
224+
width: 85px;
221225
}
222226

223227
.loading-spinner {
@@ -309,6 +313,7 @@ a.link-preview-box strong {
309313

310314
.container {
311315
width: 90%;
316+
transition: height 0.5s ease;
312317
}
313318

314319
.github-link {
@@ -363,6 +368,28 @@ a.link-preview-box strong {
363368
font-size: 21px;
364369
}
365370

371+
.expanded {
372+
height: 700px;
373+
transition: height 2s ease;
374+
}
375+
376+
.expanded-content {
377+
display: flex;
378+
max-height: 700px;
379+
flex-direction: column;
380+
align-items: flex-start;
381+
}
382+
383+
label {
384+
margin-bottom: 5px;
385+
}
386+
387+
#colorPicker,
388+
#fontSelector {
389+
width: 100%;
390+
margin-right: 0;
391+
}
392+
366393
footer {
367394
font-size: 13px;
368395
}

assets/js/script.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ document.addEventListener("DOMContentLoaded", function () {
2525
resultBox.style.backgroundColor = selectedColor;
2626
});
2727

28+
//font picker
29+
fontSelector.addEventListener("change", function () {
30+
const selectedFont = fontSelector.value;
31+
resultBox.style.fontFamily = selectedFont;
32+
});
33+
2834
form.addEventListener("submit", function (event) {
2935
event.preventDefault(); // Prevent form submission
3036

index.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<title>Threadimage: Threads to Images</title>
1919
<link rel="icon" href="assets/images/favicon.png" type="image/x-icon">
2020
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap" rel="stylesheet">
21+
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet">
22+
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap" rel="stylesheet">
23+
<link href="https://fonts.googleapis.com/css2?family=Fugaz+One&display=swap" rel="stylesheet">
24+
<link href="https://fonts.googleapis.com/css2?family=Sansita+Swashed:wght@300;700&display=swap" rel="stylesheet">
2125
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
2226
<link href="assets/css/styles.css" rel="stylesheet" type="text/css">
2327
</head>
@@ -44,6 +48,16 @@ class="github-icon">
4448
<div class="expand-content">
4549
<label for="colorPicker">Select Color:</label>
4650
<input type="color" id="colorPicker" name="colorPicker" value="#000000">
51+
<label for="fontSelector">Select Font:</label>
52+
<select id="fontSelector" name="fontSelector">
53+
<option value="Poppins, sans-serif">Poppins</option>
54+
<option value="Pacifico, cursive">Pacifico</option>
55+
<option value="Fugaz One, sans-serif">Fugaz One</option>
56+
<option value="Georgia, serif">Georgia</option>
57+
<option value="Courier New, monospace">Courier New</option>
58+
<option value="Dancing Script, cursive">Dancing Script</option>
59+
<option value="Sansita Swashed, sans-serif">Sansita</option>
60+
</select>
4761
</div>
4862
</div>
4963

0 commit comments

Comments
 (0)