Created
September 3, 2023 23:32
-
-
Save Elijah-glitch/15a066244ee5d1ea4a428d8056b64a8c to your computer and use it in GitHub Desktop.
Particles + Plyr
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
<div class="wrapper"> | |
<canvas class="background"></canvas> | |
</div> | |
<div class="empty"> | |
<div id="container"> | |
<div class="vid"> | |
<video id="player"> | |
<source src="https://hw14.cdn.asset.aparat.com/aparat-video/5b48ea849185dc2e47f532387c17b29f13219888-720p__19987.mp4" type="video/mp4"> | |
</video> | |
</div> | |
</div> | |
</div> |
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
window.onload = function() { | |
Particles.init({ | |
// normal options | |
selector: ".background", | |
maxParticles: 450, | |
color: "#090979", | |
// options for breakpoints | |
responsive: [ | |
{ | |
breakpoint: 768, | |
options: { | |
maxParticles: 200, | |
color: "#000000", | |
connectParticles: false | |
} | |
}, | |
{ | |
breakpoint: 425, | |
options: { | |
maxParticles: 100, | |
connectParticles: true | |
} | |
}, | |
{ | |
breakpoint: 320, | |
options: { | |
maxParticles: 0 | |
// disables particles.js | |
} | |
} | |
] | |
}); | |
}; | |
const player = new Plyr('#player'); |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.2.2/particles.min.js"></script> | |
<script src="https://cdn.plyr.io/3.4.7/plyr.js"></script> |
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
body { | |
margin: 0; | |
padding: 0; | |
height: 100vh; | |
overflow: hidden; | |
display: flex; | |
flex-direction:column; | |
background: #fbffe9; | |
} | |
.background { | |
position: absolute; | |
display: block; | |
width: 100%; | |
height: 100%; | |
background: linear-gradient(180deg, rgba(34,193,195,1) 0%, rgba(253,187,45,0) 100%); | |
top: 0; | |
left: 0; | |
z-index: 0; | |
} | |
.wrapper{ | |
position: relative; | |
width: 100vw; | |
height: 50vh; | |
margin: 0 auto; | |
} | |
.empty{ | |
/* background: pink; */ | |
height: 50vh; | |
width: 99vw; | |
} | |
#container{ | |
width: 100%; | |
height: 100%; | |
display: flex; | |
} | |
.vid{ | |
width: 848px; | |
height: 488px; | |
margin: -200px auto; | |
box-shadow: 0 40px 85px rgba(0,0,0,0.3); | |
border-radius:10px; | |
} | |
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
<link href="https://cdn.plyr.io/3.4.7/plyr.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment