Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: Add herecomesbitcoin animations #4254

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions _includes/animations/herecomesbitcoin/astronaut.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<html xmlns="http://www.w4.org/1999/xhtml"
<meta charset="UTF-8">
<head>
<style>
#animation-astronaut{
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
}

</style>
</head>
<body>
<div id="animation-astronaut"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/astronaut.json")
.then((response) => response.json())
.then((animationData) => {

var params = {
container: document.getElementById('animation-astronaut'),
renderer: 'svg',
loop: false,
autoplay: true,
animationData
};

var anim;

anim = lottie.loadAnimation(params);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
40 changes: 40 additions & 0 deletions _includes/animations/herecomesbitcoin/cat.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<html xmlns="http://www.w4.org/1999/xhtml">
<meta charset="UTF-8">
<head>
<style>
#animation-cat{
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
}

</style>
</head>
<body>
<div id="animation-cat"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/cat.json")
.then((response) => response.json())
.then((animationData) => {

var params = {
container: document.getElementById('animation-cat'),
renderer: 'svg',
loop: true,
autoplay: true,
animationData
};

var anim;

anim = lottie.loadAnimation(params);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
40 changes: 40 additions & 0 deletions _includes/animations/herecomesbitcoin/coder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<html xmlns="http://www.w4.org/1999/xhtml">
<meta charset="UTF-8">
<head>
<style>
#animation-coder{
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
}

</style>
</head>
<body>
<div id="animation-coder"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/coder.json")
.then((response) => response.json())
.then((animationData) => {

var params = {
container: document.getElementById('animation-coder'),
renderer: 'svg',
loop: true,
autoplay: true,
animationData
};

var anim;

anim = lottie.loadAnimation(params);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
59 changes: 59 additions & 0 deletions _includes/animations/herecomesbitcoin/construction.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<html xmlns="http://www.w4.org/1999/xhtml">
<meta charset="UTF-8">
<head>
<style>
#animation-construction{
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
}

</style>
</head>
<body>
<div id="animation-construction"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/construction.json")
.then((response) => response.json())
.then((animationData) => {
var params = {
container: document.getElementById('animation-construction'),
renderer: 'svg',
loop: false,
autoplay: false,
animationData
};

var animConstruction;

animConstruction = lottie.loadAnimation(params);

function playConstructionAnimation() {
if (
animConstruction.firstFrame === animConstruction.currentFrame ||
animConstruction.currentFrame === animConstruction.totalFrames - 1
) {
animConstruction.goToAndPlay(animConstruction.firstFrame);
}
}

const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting && entry.intersectionRatio > 0.8) {
playConstructionAnimation();
}
});
}, { threshold: [0.8] });

const element = document.querySelector('#animation-construction');
observer.observe(element);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
51 changes: 51 additions & 0 deletions _includes/animations/herecomesbitcoin/fairy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<meta charset="UTF-8">
<head>
<style>
#animation-fairy {
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
}
</style>
</head>
<body>

<div id="animation-fairy"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/fairy.json")
.then((response) => response.json())
.then((animationData) => {
var params = {
container: document.getElementById('animation-fairy'),
renderer: 'html',
loop: false,
autoplay: false,
animationData
};

var animFairy;

animFairy = lottie.loadAnimation(params);

function playFairyAnimation() {
if (
animFairy.firstFrame === animFairy.currentFrame ||
animFairy.currentFrame === animFairy.totalFrames - 1
) {
animFairy.goToAndPlay(animFairy.firstFrame);
}
}

document.querySelector('#animation-fairy').addEventListener('click', playFairyAnimation);
//document.querySelector('#animation-fairy').addEventListener('touchstart', playFairyAnimation);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
37 changes: 37 additions & 0 deletions _includes/animations/herecomesbitcoin/fancy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
#animation-fancy {
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
}
</style>
</head>
<body>
<div id="animation-fancy"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/fancy.json")
.then((response) => response.json())
.then((animationData) => {
var params = {
container: document.getElementById('animation-fancy'),
renderer: 'svg',
loop: true,
autoplay: true,
animationData
};

var anim;

anim = lottie.loadAnimation(params);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
50 changes: 50 additions & 0 deletions _includes/animations/herecomesbitcoin/flower_heads.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<html xmlns="http://www.w4.org/1999/xhtml"
<meta charset="UTF-8">
<head>
<style>
#animation-flower-heads {
width:100%;
height:100%;
display:block;
overflow: hidden;
transform: translate3d(0,0,0);
text-align: center;
opacity: 1;
pointer-events: none;
}
</style>
</head>
<body>
<div id="animation-flower-heads"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/flower_heads.json")
.then((response) => response.json())
.then((animationData) => {
var params = {
container: document.getElementById('animation-flower-heads'),
renderer: 'svg',
loop: false,
autoplay: false,
animationData
};

var animFlower;

animFlower = lottie.loadAnimation(params);

function playFlowerAnimation() {
if (
animFlower.firstFrame === animFlower.currentFrame ||
animFlower.currentFrame === animFlower.totalFrames - 1
) {
animFlower.goToAndPlay(animFlower.firstFrame);
}
}

document.querySelector('#flower-heads-hoverable').addEventListener('mouseenter', playFlowerAnimation);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
37 changes: 37 additions & 0 deletions _includes/animations/herecomesbitcoin/sir.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
#animation-sir {
width: 100%;
height: 100%;
display: block;
overflow: hidden;
transform: translate3d(0, 0, 0);
text-align: center;
opacity: 1;
}
</style>
</head>
<body>
<div id="animation-sir"></div>
<script type="text/javascript" src="/js/lottie.min.js"></script>
<script>
fetch("/json/sir.json")
.then((response) => response.json())
.then((animationData) => {
var params = {
container: document.getElementById("animation-sir"),
renderer: "html",
loop: true,
autoplay: true,
animationData,
};

var animSir;

animSir = lottie.loadAnimation(params);
})
.catch((e) => console.error("Error loading animation data: ", e));
</script>
</body>
</html>
1 change: 1 addition & 0 deletions _includes/layout/base/footer-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<p class="donate-text">{% translate donate-community-support layout %}
<a class="donate-link" href="bitcoin:bc1qx3u4njquj0ux63030r4nat8awqrlm0x2zlt96h" target="_blank">bc1qx3u4njquj0ux63030r4nat8awqrlm0x2zlt96h</a>
</p>
{% include animations/herecomesbitcoin/construction.html %}
</div>
</div>
</div>
Expand Down
Loading