Fix graphical artifacts in Chrome

main
Isaiah Odhner 2018-06-29 22:28:31 -04:00
parent e619f22217
commit f15913a383
3 changed files with 9 additions and 2 deletions

View File

@ -8,7 +8,7 @@
<body>
<div id="background-animation"></div>
<div id="foreground-contents">
<a href="https://98.js.org/" target="_blank">
<a href="https://98.js.org/" target="_blank" id="os-logo-link">
<img src="../images/98.js.org.svg" alt="98.js.org" id="os-logo" height="100">
</a>
<br>

View File

@ -32,6 +32,9 @@ body {
margin-top: 10px;
overflow: auto;
}
#os-logo-link {
text-decoration: none;
}
a:link {
color: #0000CC;

View File

@ -44,7 +44,11 @@ var animate = function () {
if(something_img.complete && something_img.naturalWidth > 1){
let t = now / 5000;
ctx.globalAlpha = 0.3 + Math.max(0, Math.sin(-t) * 1);
ctx.drawImage(something_img, Math.sin(-t) * canvas.width * 0.7, Math.cos(-t) * 70);
ctx.drawImage(
something_img,
~~(Math.sin(-t) * canvas.width * 0.7),
~~(Math.cos(-t) * 70)
);
ctx.globalAlpha = 1;
}
ctx.globalCompositeOperation = "screen";