Compare commits

...

5 Commits

Author SHA1 Message Date
xaloc 1c50d3bbe7 change bg to cover and add more top margin to panel 2023-07-07 15:23:09 +02:00
xaloc dbf21f570b fix style extra height 2023-07-07 15:03:54 +02:00
xaloc 1edb455c41 fix start url 2023-07-07 14:51:27 +02:00
xaloc b5f6c5bb90 improve compatibility input appearance 2023-07-07 14:42:16 +02:00
xaloc d9d68c190f make web installable 2023-07-07 14:39:49 +02:00
6 changed files with 75 additions and 2 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

+9
View File
@@ -5,6 +5,8 @@
<meta name="author" content="Xaloc"> <meta name="author" content="Xaloc">
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
<link rel="manifest" href="manifest.json">
<link rel="apple-touch-icon" href="img/icon.png"/>
<title>Currency Converter</title> <title>Currency Converter</title>
</head> </head>
@@ -53,5 +55,12 @@
</div> </div>
</div> </div>
<script src='script.js'></script> <script src='script.js'></script>
<script>
if('serviceWorker' in navigator){
navigator.serviceWorker.register('/service-worker.js');
} else {
console.log("Service worker is not supported");
}
</script>
</body> </body>
</html> </html>
+23
View File
@@ -0,0 +1,23 @@
{
"name": "Currency Converter",
"short_name": "Currency Converter",
"start_url": "/currency",
"background_color": "#55335C",
"theme_color": "#9E79C0",
"icons": [
{
"src": "img/icon.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "img/192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
}
],
"display": "standalone",
"orientation":"portrait"
}
+36
View File
@@ -0,0 +1,36 @@
const CACHE_NAME = 'Convert-currency';
let resourcesToCache = ["./", "./bg.jpg", "./script.js", "./style.css"];
self.addEventListener("install", e=>{
e.waitUntil(
caches.open(CACHE_NAME).then(cache =>{
return cache.addAll(resourcesToCache);
})
);
});
// Cache and return requests
self.addEventListener("fetch", e=>{
e.respondWith(
caches.match(e.request).then(response=>{
return response || fetch(e.request);
})
);
});
// Update a service worker
const cacheWhitelist = ['Convert-currency'];
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(cacheNames => {
return Promise.all(
cacheNames.map(cacheName => {
if (cacheWhitelist.indexOf(cacheName) === -1) {
return caches.delete(cacheName);
}
})
);
})
);
});
+7 -2
View File
@@ -6,23 +6,27 @@ html {
} }
body { body {
background-image: url("bg.jpg"); background-image: url("bg.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: cover;
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
border: 1px solid transparent;
} }
.panel { .panel {
height: 60%; height: 60%;
min-height: 192px;
margin-left: 15%; margin-left: 15%;
margin-right: 15%; margin-right: 15%;
margin-top: 15%; margin-top: 20%;
font-size: 15px; font-size: 15px;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
outline: none; outline: none;
color: #000000; color: #000000;
background-color: #9e79c0; background-color: #9e79c0;
border: none;
border-radius: 15px; border-radius: 15px;
box-shadow: 0 9px 9px 9px #55335c; box-shadow: 0 9px 9px 9px #55335c;
} }
@@ -95,6 +99,7 @@ input[type=number]::-webkit-outer-spin-button {
input[type=number] { input[type=number] {
-moz-appearance: textfield; -moz-appearance: textfield;
appearance: textfield;
} }
select { select {