Skip to content

Commit 9450b88

Browse files
author
Aman Kumar Sinha
committed
Completed 5th Project
1 parent 842fdd8 commit 9450b88

4 files changed

Lines changed: 32 additions & 3 deletions

File tree

project-1/facebook-add-remove-friend.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1>Add & Remove Friends</h1>
3333

3434
<div class="image"></div>
3535

36-
<h2 class="card-title"> Angel Priya</h2>
36+
<h2 class="card-title"> Facebook User</h2>
3737

3838
<p id="currentStatus">Stranger</p>
3939

project-5/insta-story.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,23 @@ main {
2222
rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
2323
border-radius: 1rem;
2424
background-color: white;
25+
overflow: hidden;
26+
z-index: 0;
27+
28+
& #fullscreen {
29+
height: 100%;
30+
width: 100%;
31+
position: absolute;
32+
display: none;
33+
background-size: cover;
34+
background-position: center;
35+
z-index: 1;
36+
}
2537

2638
& .stories {
2739
height: 12rem;
2840
width: 100%;
2941
border-bottom: 1.5px solid #555;
30-
3142
white-space: nowrap;
3243
overflow-x: auto;
3344
overflow-y: hidden;
@@ -48,6 +59,7 @@ main {
4859
overflow: hidden;
4960
display: inline-block;
5061
margin: 0 0.2rem;
62+
cursor: pointer;
5163

5264
& img {
5365
height: 100%;

project-5/insta-story.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
<main>
2929
<div class="container">
3030
<div class="card">
31+
32+
<div id="fullscreen"></div>
3133
<div class="stories"></div>
3234
<div class="text">
3335
<h1>Instgram Stories</h1>
3436
</div>
3537
</div>
3638

37-
39+
3840
</div>
3941
</main>
4042
</section>

project-5/insta-story.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
let images = [
22
{
33
src: "images/peacock.webp",
4+
story: "images/peacock.webp",
45
},
56
{
67
src: "images/eagle.webp",
8+
story: "images/eagle.webp",
79
},
810
{
911
src: "images/lion.webp",
12+
story: "images/lion.webp",
1013
},
1114
{
1215
src: "images/deer.webp",
16+
story: "images/deer.webp",
1317
},
1418
{
1519
src: "images/model.webp",
20+
story: "images/model.webp",
1621
},
1722
];
1823

@@ -25,3 +30,13 @@ images.forEach((image, index) => {
2530

2631
let stories = document.querySelector(".stories");
2732
stories.innerHTML = story;
33+
34+
stories.addEventListener("click", (dets) => {
35+
36+
document.querySelector("#fullscreen").style.display = "block";
37+
document.querySelector("#fullscreen").style.backgroundImage = `url(${images[dets.target.id].story})`;
38+
39+
setTimeout(() => {
40+
document.querySelector("#fullscreen").style.display = "none";
41+
}, 3000);
42+
});

0 commit comments

Comments
 (0)