Skip to content

Commit

Permalink
Issue #11: github pages added
Browse files Browse the repository at this point in the history
  • Loading branch information
evaristocuesta committed Jul 15, 2021
1 parent 2d0b17b commit 6d84094
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
background: white;
}

h1 {
display: flex;
justify-content: center;
align-items: center;
}

.content {
padding: 10px 10px;
margin: 20px 50px 20px;
display: flex;
justify-content: center;
align-items: center;
}

.content img {
max-height: 100%;
max-width: 90%;
box-shadow: 0px 0px 6px 0px #a5a5a5;
border-radius: 5px;
padding: 20px;
}

.content canvas {
max-height: 100%;
max-width: 90%;
box-shadow: 0px 0px 6px 0px #a5a5a5;
border-radius: 5px;
padding: 20px;
}
Binary file added docs/images/angus-young.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/jimi-hendrix.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pict2Pix.js</title>
<link rel="stylesheet" media="screen" href="css/style.css"/>
</head>
<body>
<h1>Pict2Pix.js</h1>
<div class="content" id="div1">
<img id="image-jh" src="images/jimi-hendrix.jpg">
</div>
<div class="content">Always working</div>
<div class="content" id="div2">
<img id="image-ay" src="images/angus-young.jpg">
</div>
<div class="content">Working when the mouse is over the picture</div>

<script src="https://cdn.jsdelivr.net/gh/evaristocuesta/pict2pix@0.2.0/dist/pict2pix.min.js"></script>

<script src="js/app.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions docs/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const imagejh = document.getElementById('image-jh');

window.onload = function initialize() {
pict2pix.animate({
image: imagejh,
numberOfParticles: 800,
horizontalSpeed: -1,
verticalSpeed: -1,
particleType: 'twisted-particle'
});
}

const imageay = document.getElementById('image-ay');
const div2 = document.getElementById('div2');

div2.onmouseenter = function over() {
pict2pix.animate({
image: imageay,
numberOfParticles: 800,
horizontalSpeed: 1,
verticalSpeed: 1,
particleType: 'straight-particle'
});
}

div2.onmouseleave = function out() {
pict2pix.stop(imageay.id);
}

0 comments on commit 6d84094

Please sign in to comment.