-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfont_incScriptPage.js
118 lines (93 loc) · 3.4 KB
/
font_incScriptPage.js
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
const hamburger = document.querySelector('.hamburger')
hamburger.addEventListener('click', () => {
var ham1 = document.getElementById('ham1')
var ham2 = document.getElementById('ham2')
var ham3 = document.getElementById('ham3')
ham1.classList.toggle('x1')
ham2.classList.toggle('x2')
ham3.classList.toggle('x3')
})
function header() {
var mynav = document.getElementById('menu')
mynav.classList.toggle('show')
}
function viewFunc(displayName) {
const hider = document.querySelectorAll('.p0001');
const advert = document.querySelector('.DisplaySectionAdvert');
const popup = document.querySelector('.popupbody')
hider.forEach((content) => {
content.style.display = 'none';
advert.style.display = "none";
});
if (window.innerWidth <= 712) {
popup.style.display = "grid";
popup.style.position = "fixed";
}
document.getElementById(displayName).style.display = 'block';
}
const popupbody = document.getElementById('popupbody');
const closebutton = document.getElementById('closebutton')
closebutton.addEventListener('click', () => {
popupbody.style.display = 'none'
});
window.addEventListener("click", (event) => {
if (event.target == popupbody) {
popupbody.style.display = "none";
}
});
function oninputFunc(IDofPreview, textBoxOfPreview, typesofthefont) {
let fontsetter = document.getElementById(IDofPreview)
let showtextdivID = document.getElementById(textBoxOfPreview)
let newsize = `${fontsetter.value}px`
showtextdivID.style.fontSize = newsize
}
const typessser = document.querySelector('.john')
typessser.addEventListener('click', () => {
document.getElementById('types').classList.toggle('shower');
})
function onchangeFontType(IDofPreview, textBoxOfPreview) {
let typesofthefont = document.getElementById(IDofPreview);
let mytextBoxOfPreview = document.getElementById(textBoxOfPreview)
let fontWeight = 'normal';
let fontStyle = 'normal';
if (typesofthefont.value == 'Bold') {
fontWeight = 'bold'
} else if (typesofthefont.value == 'Italics') {
fontStyle = 'italic'
} else if (typesofthefont.value == 'Thin') {
fontStyle = 'lighter'
}
mytextBoxOfPreview.style.fontWeight = fontWeight;
mytextBoxOfPreview.style.fontStyle = fontStyle;
}
const searchInput = document.getElementById("searchbar");
const fontList = document.getElementById("fontDisplaySection");
const egfont = document.getElementsByClassName("egfont")
searchInput.addEventListener("input", function () {
const searchTerm = searchInput.value.toLowerCase();
const fonts = fontList.getElementsByClassName("henry");
for (const font of fonts) {
const fontName = font.querySelector(".name").textContent.toLowerCase();
if (fontName.includes(searchTerm)) {
font.style.display = "block";
egfont.style.flexGrow = 1
} else {
font.style.display = "none";
}
}
});
const firstpopup = document.getElementById('firstpopup')
function fpop() {
firstpopup.style.display = "block";
}
// setTimeout(fpop, 6000) ;
const mibc = document.getElementById('mainpopup_inside_buttons_close');
mibc.addEventListener('click', () => {
firstpopup.style.display = "none";
})
function randad() {
window.addEventListener('click', () => {
window.location.href = "newpage.html";
})
}
// setTimeout(randad, 6000);