Skip to content

Commit

Permalink
added option to specify video parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Latourelle authored and Will Latourelle committed May 6, 2020
1 parent ed12e74 commit 167c8f6
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 14 deletions.
15 changes: 13 additions & 2 deletions dist/background-animations/cloudy.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/13e0s6coh6ayapvdyqnv.hd.mp4",
"https://cdn.flixel.com/flixel/aorl3skmssy7udwopk22.hd.mp4",
Expand Down
15 changes: 13 additions & 2 deletions dist/background-animations/fog.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/vwqzlk4turo2449be9uf.hd.mp4",
"https://cdn.flixel.com/flixel/5363uhabodwwrzgnq6vx.hd.mp4"
Expand Down
15 changes: 13 additions & 2 deletions dist/background-animations/mostlycloudy.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/e95h5cqyvhnrk4ytqt4q.hd.mp4",
"https://cdn.flixel.com/flixel/l2bjw34wnusyf5q2qq3p.hd.mp4",
Expand Down
15 changes: 13 additions & 2 deletions dist/background-animations/night.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/x9dr8caygivq5secll7i.hd.mp4",
"https://cdn.flixel.com/flixel/v26zyfd6yf0r33s46vpe.hd.mp4",
Expand Down
15 changes: 13 additions & 2 deletions dist/background-animations/rainy.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/f0w23bd0enxur5ff0bxz.hd.mp4"
];
Expand Down
15 changes: 13 additions & 2 deletions dist/background-animations/sunny.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/hlhff0h8md4ev0kju5be.hd.mp4",
"https://cdn.flixel.com/flixel/zjqsoc6ecqhntpl5vacs.hd.mp4",
Expand Down
15 changes: 13 additions & 2 deletions dist/background-animations/sunset.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@
<source src="" type="video/mp4">
</video>
<script>
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
function randomIntFromInterval(min, max) { // min and max included
var return_int = Math.floor(Math.random() * (max - min + 1) + min);
if(window.location.search){
var search = new URLSearchParams(window.location.search);
var video = search.get("video");
if(!isNaN(video)){
if(video < cinemagraphs.length && video >=0){
return_int = video;
}
}
}
return return_int;
}

var cinemagraphs = [
"https://cdn.flixel.com/flixel/hlhff0h8md4ev0kju5be.hd.mp4",
"https://cdn.flixel.com/flixel/zjqsoc6ecqhntpl5vacs.hd.mp4",
Expand Down

0 comments on commit 167c8f6

Please sign in to comment.