-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1d054c0
Showing
25 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
services: | ||
nginx: | ||
image: nginx | ||
volumes: | ||
- ./:/usr/share/nginx/html/ | ||
ports: | ||
- "8080:80" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!doctype html> | ||
|
||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Base-bones HTML5</title> | ||
<link rel="shortcut icon" href="favicon.ico"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body class="center"> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<div class="img-11"><div class="hidden"></div></div> | ||
<noscript> | ||
</noscript> | ||
|
||
</body> | ||
<script src="script.js"></script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
events { worker_connections 1024; } | ||
|
||
http { | ||
|
||
upstream app_servers { # Create an upstream for the web servers | ||
server server1:80; # the first server | ||
server server2:80; # the second server | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
location / { | ||
proxy_pass http://app_servers; # load balance the traffic | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* Randomize array in-place using Durstenfeld shuffle algorithm */ | ||
function shuffleArray(array) { | ||
for (var i = array.length - 1; i > 0; i--) { | ||
var j = Math.floor(Math.random() * (i + 1)); | ||
var temp = array[i]; | ||
array[i] = array[j]; | ||
array[j] = temp; | ||
} | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", function(){ | ||
|
||
const maxImage = 20; | ||
|
||
const img11 = [...document.querySelectorAll('.img-11')]; | ||
|
||
function getOptions(){ | ||
let options = Array.from(Array(maxImage).keys()); | ||
options.shift(); // remove zero | ||
shuffleArray(options); | ||
return options; | ||
} | ||
|
||
let options = getOptions(); | ||
; | ||
// preload all images | ||
options.forEach((option) => { | ||
const img = new Image(); | ||
img.src = `./images/11/${options[0]}.jpeg`; | ||
}); | ||
|
||
// set initial images | ||
for(let i = 0; i < img11.length; i++){ | ||
img11[i].style.backgroundImage = `url(./images/11/${options[i]}.jpeg)`; | ||
const hidden = img11[i].childNodes[0]; | ||
hidden.classList.add('show'); | ||
} | ||
|
||
function animate(){ | ||
|
||
// select random tile | ||
const tile = Math.floor(Math.random() * img11.length); | ||
|
||
let options = getOptions(); | ||
|
||
// filter out the already shown images to avoid duplicates | ||
const existing = img11.map((img) => parseInt(img.style.backgroundImage.split('.jpeg')[0].split('11/')[1])); | ||
options = options.filter((option) => !existing.includes(option)); | ||
|
||
// animate the tile | ||
const hidden = img11[tile].childNodes[0]; | ||
|
||
hidden.addEventListener('transitionend', function() { | ||
this.removeEventListener('transitionend',arguments.callee, false); | ||
|
||
img11[tile].style.backgroundImage = `url(./images/11/${options[0]}.jpeg)`; | ||
hidden.classList.add('show'); | ||
|
||
setTimeout(animate, 1000); | ||
|
||
}, false); | ||
|
||
hidden.classList.remove('show'); | ||
} | ||
|
||
setTimeout(animate, 1000); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
html, body{ | ||
height: 100%; | ||
width: 100%; | ||
margin: 0px 0px 0px 0px; | ||
padding: 0px 0px 0px 0px; | ||
background-color: white; | ||
} | ||
|
||
.center{ | ||
display: grid; | ||
justify-content: center; | ||
align-content: center; | ||
grid-template-columns: repeat(3, 1fr); | ||
grid-template-rows: repeat(4, 3fr); | ||
height: 100vh; | ||
max-width: 70vh; | ||
margin: auto; | ||
box-sizing: border-box; | ||
} | ||
|
||
.center > div { | ||
background-image: url(./images/11/1.jpeg); | ||
background-size: cover; | ||
background-position: center; | ||
} | ||
|
||
|
||
div.hidden { | ||
opacity: 1; | ||
transition: opacity 0.6s linear; | ||
background-color: lightgray; | ||
width:100%; | ||
height: 100%; | ||
} | ||
|
||
.show { | ||
opacity: 0 !important; | ||
} |