Skip to content

Commit

Permalink
Update catroll.html
Browse files Browse the repository at this point in the history
added uniform spacing
  • Loading branch information
kelsk authored Mar 6, 2019
1 parent 08de27c commit c1a702f
Showing 1 changed file with 35 additions and 40 deletions.
75 changes: 35 additions & 40 deletions catroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,65 @@
<style>

img {
transition: 5s;
-webkit-transition: 5s;
transition: 5s;
-webkit-transition: 5s;
}
.catroll-holder {
width: 100%;
overflow: hidden;
margin: 0 -20px 0 -20px;
width: 100%;
overflow: hidden;
margin: 0 -20px 0 -20px;
}

#lois-holder {
transition: 5s;
-webkit-transition: 5s;
margin-left: -320px;
width: 450px;
transition: 5s;
-webkit-transition: 5s;
margin-left: -320px;
width: 450px;
}
.lois-spacer {
width: 100px;
display: inline-block;
width: 100px;
display: inline-block;
}
</style>

</head>


<body onkeydown="rollLois(event)">
<p>Press ctrl</p>
<div class="catroll-holder">
<div id="lois-holder">
<p class="lois-spacer"></p>
<img src="C:\Users\kelse\Documents\WebApp1`\Scratch\img\lois.bmp">

</div>
</div>
<p>Press ctrl</p>

<script type="text/javascript">
<div class="catroll-holder">
<div id="lois-holder">
<p class="lois-spacer"></p>
<img src="C:\Users\kelse\Documents\WebApp1`\Scratch\img\lois.bmp">
</div>
</div>


<script type="text/javascript">

function rollLois(e) {
var ctrlKeyPressed = e.ctrlKey;
var lois = document.getElementsByTagName("img")[0];
var loisHolder = document.getElementById("lois-holder");
var resetMargin = "0px 0px 0px -320px";

if (ctrlKeyPressed == true)
{
lois.style.transform = "rotate(1080deg)";
loisHolder.style.margin = "0px 0px 0px 1000px";
console.log(loisHolder.style.margin);
window.setInterval( function resetLois() {
lois.style.transform = "rotate(-720deg)";
loisHolder.style.margin = "0px 0px 0px -400px";
}, 5000);

};
var ctrlKeyPressed = e.ctrlKey;
var lois = document.getElementsByTagName("img")[0];
var loisHolder = document.getElementById("lois-holder");
var resetMargin = "0px 0px 0px -320px";

if (ctrlKeyPressed == true)
{
lois.style.transform = "rotate(1080deg)";
loisHolder.style.margin = "0px 0px 0px 1000px";
window.setInterval( function resetLois() {
lois.style.transform = "rotate(-720deg)";
loisHolder.style.margin = "0px 0px 0px -400px";
}, 5000);
};

};




</script>


</body>


</html>
</html>

0 comments on commit c1a702f

Please sign in to comment.