Skip to content

Commit

Permalink
Merge pull request #2 from Praveen-Prabhu/deployment
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
Praveen-Prabhu authored Aug 15, 2023
2 parents 0fe7f25 + c1ef2f4 commit 2af45c7
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 128 deletions.
32 changes: 17 additions & 15 deletions Countdown.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<!DOCTYPE html>
<html>
<head>

<head>
<meta charset="utf-8">
<title>Independence Day 2023</title>
<link rel ="icon" href = "icon.png" type = "image/x-icon">
<title>New Year 2024</title>
<link rel="icon" href="icon.png" type="image/x-icon">
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<link rel="manifest" href="manifest.json">
</head>
<body>
</head>

<body>
<img src="">
<div class="container">
<h2><span>Countdown to</span>Independence Day 2023</h2>
<div class="countdown">
<div id="day">-</div>
<div id="hour">-</div>
<div id="minute">-</div>
<div id="second">-</div>
</div>
<h2><span>Countdown to</span>New Year 2024</h2>
<div class="countdown">
<div id="day">-</div>
<div id="hour">-</div>
<div id="minute">-</div>
<div id="second">-</div>
</div>
</div>
</body>
</html>
</body>

</html>
32 changes: 17 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<!DOCTYPE html>
<html>
<head>

<head>
<meta charset="utf-8">
<title>Independence Day 2023</title>
<link rel ="icon" href = "icon.png" type = "image/x-icon">
<title>New Year 2024</title>
<link rel="icon" href="icon.png" type="image/x-icon">
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<link rel="manifest" href="manifest.json">
</head>
<body>
</head>

<body>
<img src="">
<div class="container">
<h2><span>Countdown to</span>Independence Day 2023</h2>
<div class="countdown">
<div id="day">-</div>
<div id="hour">-</div>
<div id="minute">-</div>
<div id="second">-</div>
</div>
<h2><span>Countdown to</span>New Year 2024</h2>
<div class="countdown">
<div id="day">-</div>
<div id="hour">-</div>
<div id="minute">-</div>
<div id="second">-</div>
</div>
</div>
</body>
</html>
</body>

</html>
8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"start_url": ".",
"icons": [
{
"src": "icon.png",
"type": "image/png",
"sizes": "225x225"
"src": "icon.png",
"type": "image/png",
"sizes": "225x225"
}
]
}
}
13 changes: 7 additions & 6 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var countDate = new Date('Aug 15, 2023 00:00:00').getTime();
var countDate = new Date('Jan 01, 2024 00:00:00').getTime();

window.addEventListener('load', e =>{
window.addEventListener('load', e => {
newYear();

if('serviceWorker' in navigator){
if ('serviceWorker' in navigator) {
try {
navigator.serviceWorker.register('sw.js');
console.log('SW registered');
Expand All @@ -13,7 +13,7 @@ window.addEventListener('load', e =>{
}
});

function newYear(){
function newYear () {
var now = new Date().getTime();
gap = countDate - now;
var second = 1000;
Expand All @@ -29,6 +29,7 @@ function newYear(){
document.getElementById('minute').innerText=m;
document.getElementById('second').innerText=s;
}
setInterval(function(){

setInterval(function() {
newYear();
},1000)
}, 1000)
169 changes: 84 additions & 85 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,99 +1,98 @@
@import url('https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900');

*
{
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
* {
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
}
body
{
display: flex;
background-image: url("https://bing.biturl.top/?resolution=1920&format=image&index=0&mkt=zh-CN");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
background-blend-mode: hard-light;

body {
display: flex;
background-image: url("https://bing.biturl.top/?resolution=1920&format=image&index=0&mkt=zh-CN");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
background-blend-mode: hard-light;
}
.container
{
position: absolute;
top: 80px;
left: 100px;
right: 100px;
bottom: 80px;
background-attachment: fixed;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
box-shadow: 0 50px 50px rgba(0,0,0,0.5),
0 0 0 100px rgba(0,0,0,.1);

.container {
position: absolute;
top: 80px;
left: 100px;
right: 100px;
bottom: 80px;
background-attachment: fixed;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
box-shadow: 0 50px 50px rgba(0, 0, 0, 0.5),
0 0 0 100px rgba(0, 0, 0, .1);
}
.container h2
{
text-align: center;
font-size: 8em;
line-height: 1em;
color: #333;
letter-spacing: 20px;
margin-top: -80px;

.container h2 {
text-align: center;
font-size: 8em;
line-height: 1em;
color: #333;
letter-spacing: 20px;
margin-top: -80px;

}
.container h2 span
{
display: block;
font-weight: 300;
letter-spacing: 20px;
font-size: 0.5em;

.container h2 span {
display: block;
font-weight: 300;
letter-spacing: 20px;
font-size: 0.5em;
}
.countdown
{
display: flex;
margin-top: 50px;

.countdown {
display: flex;
margin-top: 50px;
}
.countdown div
{
position: relative;
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
background: #333;
color: #fff;
margin: 0 15px;
font-size: 3em;
font-weight: 500;

.countdown div {
position: relative;
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
background: #333;
color: #fff;
margin: 0 15px;
font-size: 3em;
font-weight: 500;
}
.countdown div:before
{
content: '';
position: absolute;
bottom: -30px;
left: 0;
width: 100%;
height: 35px;
background: #ff0;
color: #333;
font-size: 0.35em;
line-height: 35px;
font-weight: 300;

.countdown div:before {
content: '';
position: absolute;
bottom: -30px;
left: 0;
width: 100%;
height: 35px;
background: #ff0;
color: #333;
font-size: 0.35em;
line-height: 35px;
font-weight: 300;
}
.countdown #day:before
{
content: 'Days';

.countdown #day:before {
content: 'Days';
}
.countdown #hour:before
{
content: 'Hours';

.countdown #hour:before {
content: 'Hours';
}
.countdown #minute:before
{
content: 'Minutes';

.countdown #minute:before {
content: 'Minutes';
}
.countdown #second:before
{
content: 'Seconds';

.countdown #second:before {
content: 'Seconds';
}
6 changes: 3 additions & 3 deletions sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const staticAssets = [
'./script.js'
];

self.addEventListener('install', async event =>{
self.addEventListener('install', async event => {
const cache = await caches.open('pwa-static');
cache.addAll(staticAssets);
});
Expand All @@ -13,9 +13,9 @@ self.addEventListener('fetch', event => {
const req = event.request;
const url = new URL(req.url);

if(url.origin == location.origin){
if(url.origin == location.origin) {
event.respondWith(cacheFirst(req));
}else{
} else {
event.respondWith(networkFirst(req));
}
});
Expand Down

0 comments on commit 2af45c7

Please sign in to comment.