Add files via upload
This commit is contained in:
parent
c4cf3e02aa
commit
960f9988b0
31 changed files with 1507 additions and 2 deletions
19
js/randomimg.js
Normal file
19
js/randomimg.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Get a list of all the files in the folder
|
||||
const fileNames = [
|
||||
'img/pirate-logo-color.png',
|
||||
'img/pirate-logo-color-new.png',
|
||||
'img/missingno.png',
|
||||
'img/floppysl.png',
|
||||
];
|
||||
|
||||
// Get a random index from the list of file names
|
||||
const randomIndex = Math.floor(Math.random() * fileNames.length);
|
||||
|
||||
// Get the file name at the random index
|
||||
const randomFileName = fileNames[randomIndex];
|
||||
|
||||
// Get the image element
|
||||
const imageElement = document.getElementById('random-image');
|
||||
|
||||
// Set the src attribute of the image element to the random file name
|
||||
imageElement.src = randomFileName;
|
Loading…
Add table
Add a link
Reference in a new issue