-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
163 lines (143 loc) · 4.33 KB
/
script.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
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
const oneHTML = `
<div id="test-one" class="col">
<div id="bubble-one" class="bg-dark text-white p-4 m-4">
<!--Code by aigle-levant-->
<p class="text text-break">{insert text here}</p>
<p class="text lead">{text to be emphasized}</p>
</div>
<div id="person-one" class="d-flex flex-row ms-auto">
<img id="person-one-img" class="img-round rounded-circle ml-3" src="{image link}">
<div id="person-one-info">
<h4 class="text">{name} | <small>Title</small></h4>
</div>
</div>
</div>
`;
document.getElementById('one-code-html').textContent = oneHTML;
const oneCSS = `
#person-one-img
{
width: 100px;
height: 100px;
margin-right: 20px;
}
`;
document.getElementById('one-code-css').textContent = oneCSS;
const twoHTML = `
<div class="card p-4 m-4">
<div class="card-body">
<div id="test-two-text">
<!--Code by aigle-levant-->
<p class="text text-break">
{text}
</p>
<p class="fw-bold">{bold text}</p>
</div>
<div id="person-two" class="d-flex flex-row ms-auto">
<img id="person-two-img" class="img-round rounded-circle ml-3" src="{image link}">
<div id="person-two-info" class="mt-3">
<h4 class="text">{name}</h4>
<h5 class="text">{title}</h5>
</div>
</div>
</div>
</div>
</div>
`;
document.getElementById('two-code-html').textContent = twoHTML;
const twoCSS = `
#person-two-img
{
width: 100px;
height: 100px;
margin-right: 20px;
}
`
document.getElementById('two-code-css').textContent = twoCSS;
const threeHTML = `
<div id="test-grp-two" class="container-fluid mt-4 mb-4 p-3 d-flex flex-row border">
<div id="test-three-img my-4" class="mr-3">
<img id="person-three-img" class="rounded" src="{image link}">
</div>
<!--code by aigle-levant-->
<div id="test-three-text d-flex flex-column">
<!--https://www.flaticon.com/authors/roundicons-premium-->
<img id="rating" src="star.png">
<div class="test-three-content">
<p class="text">{text}</p>
<h6 class="display-6">{name}</h6>
<h6 class="text">{title}</h6>
</div>
</div>
</div>
`;
document.getElementById('three-code-html').textContent = threeHTML;
const threeCSS = `
#person-three-img
{
width: 250px;
height: 300px;
}
#rating
{
width: 100px;
height: 100px;
}
.test-three-content, #rating
{
margin-left: 50px;
}
`;
document.getElementById('three-code-css').textContent = threeCSS;
const fourHTML = `
<div id="test-grp-three" class="container-fluid my-3 d-flex flex-column">
<div id="test-four" class="border p-4 m-4 text-center">
<div id="test-four-text">
<!--code by aigle-levant-->
<p class="content-1 text-break four-text">{text}</p>
<p class="hide content-2 text-break four-text">{text}</p>
<p class="hide content-3 text-break four-text">{text}</p>
</div>
<div id="test-four-img" class="mb-3">
<img class="img-four rounded-circle content-1" src="{image link}">
<img class="hide img-four rounded-circle content-2" src="{image link}">
<img class="hide img-four rounded-circle content-3" src="{image link}">
</div>
<div id="test-four-person">
<h6 class="fw-bold content-1">{name}</h6>
<h6 class="hide fw-bold content-2">{name}</h6>
<h6 class="hide fw-bold content-3">{name}</h6>
</div>
</div>
</div>
`;
document.getElementById('four-code-html').textContent = fourHTML;
const fourCSS = `
.img-four
{
width: 50px;
height: 50px;
}
.hide
{
display: none;
}
`;
document.getElementById('four-code-css').textContent = fourCSS;
const fourJS = `
let texts = document.querySelectorAll('.four-text');
let images = document.querySelectorAll('.img-four');
let names = document.querySelectorAll('#test-four-person h6');
let i = 0;
setInterval(() =>
{
texts[i].classList.add('hide');
images[i].classList.add('hide');
names[i].classList.add('hide');
i = (i+1)%texts.length;
texts[i].classList.remove('hide');
images[i].classList.remove('hide');
names[i].classList.remove('hide');
}, 3000);
`;
document.getElementById('four-code-js').textContent = fourJS;