Skip to content

Commit

Permalink
🦄 update: change the card design and add a countdown timer
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktimsaikia committed Sep 25, 2020
1 parent 55102ef commit 4d583fa
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 146 deletions.
85 changes: 50 additions & 35 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

body {
background: #f7fafc;
font-family: 'Open Sans', sans-serif;
ffont-family: 'Poppins', sans-serif;
}

ul {
Expand All @@ -25,16 +25,24 @@ p {
padding: 2rem;
margin-top: 20px;
}
#hero-page > h3 {

#hero-page>h3 {
font-weight: 600;
margin-bottom: 10px;
}
#hero-page > h4 {

#hero-page>h4 {
font-weight: 600;
margin-bottom: 10px;
}

#countdown > div {
.countdown-title {
font-weight: 600;
font-size: 20px;
margin-bottom: 30px;
}

#countdown>div {
display: inline-block;
width: 8%;
background: #fff;
Expand All @@ -44,13 +52,14 @@ p {
0 4px 6px -2px rgba(0, 0, 0, 0.05);
border-radius: 10px;
}
#countdown > div > span:nth-child(1) {

#countdown>div>span:nth-child(1) {
font-size: 40px;
font-weight: 600;
color: #4f4f4f;
}

#countdown > div > span {
#countdown>div>span {
color: #818181;
font-weight: 600;
font-size: 10px;
Expand All @@ -69,7 +78,6 @@ p {
list-style: none;
grid-gap: 3vw;
grid-template-columns: repeat(4, 20vw);
font-family: 'Roboto';
}

.info_card {
Expand All @@ -82,20 +90,35 @@ p {
box-shadow: 0 10px 15px 5px rgba(0, 0, 0, 0.1),
0 4px 6px -2px rgba(0, 0, 0, 0.05);
border-radius: 5px;
padding: 1.3vw;
padding: 10px;
display: inherit;
}

.img-wrapper {
position: relative;
width: 150px;
border-radius: 50%;
padding: 5px;
border: 2px solid #55ff60;
}

.info-wrapper {
display: flex;
justify-content: space-between;
align-items: baseline;
}

.info_card img {
width: 100%;
height: auto;
height: 100%;
object-fit: cover;
object-position: 100% 0%;
border-radius: 0.6em;
border-radius: 50%;
}

.info_card h4 {
font-size: 2vw;
text-align: center;
font-size: 20px;
font-weight: bold;
margin-bottom: 1.3vw;
white-space: nowrap;
Expand All @@ -117,7 +140,7 @@ p {
}

.info_card p.country {
font-size: 1vw;
font-size: 12px;
background-color: var(--lightgrey);
border: solid var(--lightgrey);
border-radius: 0.4em;
Expand All @@ -127,51 +150,48 @@ p {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 10px;
}

.info_card p.country > i {
.info_card p.country>i {
vertical-align: middle;
}

.info_card li {
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
}

.tech-stack {
margin-top: 0.7vw;
}

.tech-stack > ul {
.tech-stack>ul {
display: flex;
list-style-type: none;
white-space: nowrap;
overflow: hidden;
}

.tech-stack li {
font-size: 1vw;
background-color: var(--lightgrey);
border: solid var(--lightgrey);
font-size: 12px;
border-radius: 0.4em;
margin-top: 0.5vw;
text-overflow: ellipsis;
overflow: inherit;
padding: 0vw 1vw;
}

.info_card > a {
.info_card>a {
font-size: 30px;
margin: 10px;
}

.social-row {
margin-top: -2vw;
margin-bottom: 3vw;
margin-bottom: 25px;
}

.social-media {
background-color: var(--lightgreen);
border: solid var(--lightgreen);
border-radius: 0.6em;
margin: 0;
display: inline-flex;
align-items: center;
Expand All @@ -181,18 +201,13 @@ p {
justify-content: center;
}

.social-media:hover {
background-color: var(--darkgreen);
border: solid var(--darkgreen);
}

.social-row > a:hover {
.social-row>a:hover {
text-decoration: none;
}

.social-media > i {
font-size: 1.5vw;
color: black;
.social-media>i {
font-size: 15px;
color: #5165d3;
}

/* divs with the buttons to scroll up and down */
Expand All @@ -217,4 +232,4 @@ p {
border-radius: 5px;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
0 1px 10px -12px rgba(0, 0, 0, 0.4);
}
}
9 changes: 6 additions & 3 deletions public/js/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const countDownDate = new Date('Oct 31, 2019 12:00:00').getTime();
const countDownDate = new Date('Oct 31, 2020 12:00:00').getTime();

const numberFormat = n => `0${n}`.slice(-2);
// Update the count down every 1 second
const x = setInterval(() => {
const countDown = setInterval(() => {
const now = new Date().getTime();

const distance = countDownDate - now;
Expand All @@ -20,7 +20,7 @@ const x = setInterval(() => {
document.getElementById('sec').innerHTML = numberFormat(seconds);

if (distance < 0) {
clearInterval(x);
clearInterval(countDown);
document.getElementById('countdown').innerHTML = '';
}
}, 1000);
Expand All @@ -44,3 +44,6 @@ scrollUpButton.addEventListener('click', () => {
behavior: 'smooth',
});
});

//INIT COUNTDOWN
countDown();
Loading

0 comments on commit 4d583fa

Please sign in to comment.