「✨」 feat: Added static website
This commit is contained in:
1 parent
05d2f7a981
commit
b3dc6ebb98
81 files changed
+120
-3
No files matched your search
@@ -0,0 +1,24 @@
|
||||
function init()
|
||||
{
|
||||
var img = document.querySelector("#kanel");
|
||||
const random = Math.floor(Math.random() * 70) + 1;
|
||||
img.src = 'img/'+random+'.jpg';
|
||||
const { naturalWidth, naturalHeight } = img;
|
||||
const isLandscape = naturalWidth / naturalHeight > 1;
|
||||
|
||||
if (isLandscape) {
|
||||
img.style.width = window.innerWidth+'px';
|
||||
img.style.height = 'auto';
|
||||
} else {
|
||||
img.style.height = window.innerHeight+'px';
|
||||
img.style.width = 'auto';
|
||||
}
|
||||
|
||||
if (img.src == 'img/70.jpg')
|
||||
{
|
||||
img.style.height = 'auto';
|
||||
img.style.width = '100%';
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
Reference in new issue
Block a user