Skip to content

Commit

Permalink
site: PWA ready and remove autoplay music
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-Nickson committed Jun 23, 2021
1 parent d4160e5 commit ec21d77
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "windows-gcc-x86",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:\\MinGW\\bin\\gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x86",
"compilerArgs": [
"-Wall",
"-Wextra",
"-Wpedantic"
]
}
],
"version": 4
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"C_Cpp_Runner.cCompilerPath": "C:\\MinGW\\bin\\gcc.exe",
"C_Cpp_Runner.cppCompilerPath": "C:\\MinGW\\bin\\g++.exe"
}
22 changes: 16 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="./timer.js"></script>
<link rel="stylesheet" href="./styles.css">
<link rel = "icon" href =
"./resources/img/win-11-logo.jpg"
type = "image/x-icon">
<link rel = "icon" href = "./resources/img/win-11-logo.jpg" type = "image/x-icon">
<link rel="apple-touch-icon" href="./resources/img/win-11-logo.jpg">
<title>Windows!!Event: possibly</title>

<meta name="theme-color" content="#317EFB"/>
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> -->
<link rel="manifest" href="manifest.json">


</head>
<body>
<div class="bg-img"></div>
Expand All @@ -30,10 +34,16 @@ <h1 id="headline">Countdown for the <a href="https://www.microsoft.com/en-us/win
</div>
</div>

<audio autoplay controls loop>
<audio controls loop>
<source src="./resources/audio/microsoftTime.mp3" type="audio/mp3">
<embed src="./resources/audio/microsoftTime.mp3" loop="true" autostart="true" width="2" height="0">
<p>If you are reading this, it is because your browser does not support the audio element. </p>
</audio>
</audio>
<script src="./timer.js"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js')
}
</script>
</body>
</html>
49 changes: 49 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "Windows11 Event Countdown",
"short_name": "Win11 Event",
"start_url": "/?home=true",
"shortcuts": [
{
"name": "Activity Feed",
"short_name": "Feed",
"description": "View your activity feed",
"url": "/feed?utm_source=homescreen",
"icons": [{ "src": "/icons/feed.png", "sizes": "192x192" }]
},
{
"name": "Recent Comments",
"short_name": "Comments",
"description": "View recent comments",
"url": "/comments?utm_source=homescreen",
"icons": [{ "src": "/icons/comments.png", "sizes": "192x192" }]
}
],
"icons": [
{
"src": "./resources/img/win-11-logo-manifest.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
}
],
"share_target": {
"action": "/share-photo",
"method": "POST",
"enctype": "multipart/form-data",
"params": {
"title": "name",
"text": "description",
"url": "link",
"files": [
{
"name": "photos",
"accept": "image/png"
}
]
}
},
"theme_color": "#000000",
"background_color": "#FFFFFF",
"display": "fullscreen",
"orientation": "portrait"
}
Binary file added resources/img/win-11-logo-manifest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
/* filter: blur(8px);
-webkit-filter: blur(8px); */

background-color: hsl(218, 74%, 6%);
display: flex;
Expand All @@ -32,12 +30,15 @@
}

.container {
color: rgba(242, 222, 74, 0.741);
margin: 0 auto;
text-align: center;

/* filter: blur(8px);
-webkit-filter: blur(8px); */
}

h1 {

font-weight: normal;
letter-spacing: .125rem;
text-transform: uppercase;
Expand All @@ -47,6 +48,7 @@
}

li {

display: inline-block;
font-size: 1.5em;
list-style-type: none;
Expand Down
6 changes: 6 additions & 0 deletions sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
importScripts('https://storage.googleapis.com/workbox-cdn/releases/6.0.2/workbox-sw.js');

workbox.routing.registerRoute(
({request}) => request.destination === 'image',
new workbox.strategies.CacheFirst()
);
2 changes: 1 addition & 1 deletion timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
hour = minute * 60,
day = hour * 24;

let TheBigEvent = "Jun 24 2021 20:30:00",
let TheBigEvent = "Jun 23 2021 16:51:40",
countDown = new Date(TheBigEvent).getTime(),
x = setInterval(function() {

Expand Down

0 comments on commit ec21d77

Please sign in to comment.