Skip to content

Commit d4c96e7

Browse files
202210811
0 parents  commit d4c96e7

File tree

14 files changed

+236
-0
lines changed

14 files changed

+236
-0
lines changed

blog_data.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
blog_data = [
2+
{
3+
"default":"1",
4+
"title":"Beyond the Blog",
5+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
6+
"writingBy":"Shohag Islam Sajjad",
7+
"img":"./img/img-2.jpg"
8+
},
9+
{
10+
"default":"2",
11+
"title":"William",
12+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
13+
"writingBy":"William",
14+
"img":"./img/img-3.jpg"
15+
},
16+
{
17+
"default":"3",
18+
"title":"Joseph",
19+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
20+
"writingBy":"Joseph",
21+
"img":"./img/img-4.jpg"
22+
}
23+
,
24+
{
25+
"default":"4",
26+
"title":"Christopher",
27+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
28+
"writingBy":"Christopher",
29+
"img":"./img/img-5.jpg"
30+
}
31+
, {
32+
"default":"5",
33+
"title":"Christian",
34+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
35+
"writingBy":"Christian",
36+
"img":"./img/img-6.jpg"
37+
}
38+
,
39+
{
40+
"default":"6",
41+
"title":"Lawrence",
42+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
43+
"writingBy":"Lawrence",
44+
"img":"./img/img-7.jpg"
45+
}
46+
,
47+
{
48+
"default":"7",
49+
"title":"Eugene",
50+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
51+
"writingBy":"Eugene",
52+
"img":"./img/img-8.jpg"
53+
}
54+
,
55+
{
56+
"default":"8",
57+
"title":"Zachary",
58+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
59+
"writingBy":"Zachary",
60+
"img":"./img/img-9.jpg"
61+
}
62+
,
63+
{
64+
"default":"9",
65+
"title":"Walter",
66+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
67+
"writingBy":"Walter",
68+
"img":"./img/img-10.jpg"
69+
}
70+
, {
71+
"default":"10",
72+
"title":"Wayne",
73+
"dec":"When our current students graduate, they will go to work in a world that is different than the one we live in today",
74+
"writingBy":"Wayne",
75+
"img":"./img/img-11.jpg"
76+
}
77+
]

img/img-10.jpg

77.1 KB
Loading

img/img-11.jpg

51.5 KB
Loading

img/img-2.jpg

57.9 KB
Loading

img/img-3.jpg

41.6 KB
Loading

img/img-4.jpg

49.1 KB
Loading

img/img-5.jpg

33.1 KB
Loading

img/img-6.jpg

53.8 KB
Loading

img/img-7.jpg

74.4 KB
Loading

img/img-8.jpg

22.9 KB
Loading

img/img-9.jpg

21.3 KB
Loading

index.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<!-- Required meta tags -->
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<!-- Bootstrap CSS -->
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
10+
<!-- all CSS -->
11+
<link rel="stylesheet" href="style.css">
12+
<title>Hello, world!</title>
13+
14+
</head>
15+
<body>
16+
17+
<div class="main-container">
18+
<div class="items-1 mt-4">
19+
<div class="row ">
20+
<div class="col-xl-10 col-lg-10 col-md-8 col-7">
21+
<form action="">
22+
<input class="form-control w-100" type="text" placeholder="Search">
23+
</form>
24+
</div>
25+
<div class="col-xl-2 col-lg-2 col-md-4 col-5 ">
26+
<button class="btn w-100 card text-dark"><span style="color: gray;">Search</span></button>
27+
</div>
28+
29+
</div>
30+
<div class="wap my-4"></div>
31+
</div>
32+
<div class="items-2 container-2">
33+
<div style=" margin: 0 -5px;" class="row main-row">
34+
35+
<!-- 1 -->
36+
37+
38+
39+
40+
</div>
41+
</div>
42+
43+
<!-- Optional JavaScript; choose one of the two! -->
44+
<script src="./blog_data.js"></script>
45+
<script src="main.js" ></script>
46+
47+
<!-- Option 1: Bootstrap Bundle with Popper -->
48+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
49+
50+
<!-- Option 2: Separate Popper and Bootstrap JS -->
51+
<!--
52+
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js" integrity="sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN" crossorigin="anonymous"></script>
53+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.min.js" integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/" crossorigin="anonymous"></script>
54+
-->
55+
</body>
56+
</html>

main.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const mainRow = document.querySelector(".main-row")
2+
const form = document.querySelector("form")
3+
const button = document.querySelector("button")
4+
const input = document.querySelector("input")
5+
input.value=""
6+
blog_data.forEach((e)=>{
7+
let card = `
8+
<div class="col-xl-6 col-lg-6 col-12 blog-items col-width">
9+
<div class="card col-margin p-2">
10+
<div class="row">
11+
<div class="col-xl-5 col-lg-5 col-md-5 col-12">
12+
<h5 class=" title mt-2"> <small>${e.title}</small></h5>
13+
<small class="dec ">${e.dec}</small>
14+
<br> <a style="color: gray;" href="#">Read more</a>
15+
16+
<div class="mb-3"> <b class="mt-2 d-inline-block ">Writing by:</b> <span>${e.writingBy}</span> <span class="w-n py-2">@${e.writingBy}</span>
17+
</div>
18+
19+
</div>
20+
<div class="col-xl-7 col-lg-7 col-md-7 col-12 text-center ">
21+
<img class="img-thumbnail img mt-3" src="${e.img}" alt="">
22+
<br>
23+
</div>
24+
</div>
25+
</div>
26+
27+
</div>
28+
29+
`
30+
mainRow.insertAdjacentHTML("beforeend",card)
31+
32+
33+
})
34+
form.addEventListener("submit",(e)=>{
35+
e.preventDefault()
36+
})
37+
38+
39+
button.addEventListener("click",()=>{
40+
blog_data.forEach((e)=>{
41+
eValue = e.title
42+
if(eValue.includes(input.value)){
43+
console.log(eValue)
44+
}
45+
})
46+
})

style.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
*{
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
.title{
7+
text-transform: uppercase;
8+
font-weight: 600;
9+
}
10+
.items-1{
11+
margin-left: 1%;
12+
margin-right: 1%;
13+
}
14+
sec{
15+
font-size: 13px;
16+
color: gray;
17+
}
18+
.w-n{
19+
color: teal;
20+
}
21+
.img{
22+
height: 200px;
23+
width: 300px;
24+
}
25+
.wap{
26+
height: 20px;
27+
background-color: teal;
28+
filter: opacity(60%);
29+
}
30+
31+
/* responsive CSS */
32+
@media only screen and (max-width: 767px) {
33+
.img{
34+
width: 100%;
35+
height: 350px;
36+
37+
}
38+
}
39+
@media only screen and (max-width: 585px) {
40+
.img{
41+
width: 100%;
42+
height: 250px;
43+
transform: translateY(-15px);
44+
45+
}
46+
}
47+
@media only screen and (min-width: 768px) {
48+
.col-margin{
49+
margin: 2px;
50+
}
51+
.main-row{
52+
margin: 0!important;
53+
padding: 0!important;
54+
}
55+
}
56+
57+

0 commit comments

Comments
 (0)