-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
809f743
commit 59951d9
Showing
4 changed files
with
398 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,228 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<style> | ||
li, | ||
div { | ||
margin: 0.5em; | ||
} | ||
li { | ||
background-color: gainsboro; | ||
padding: 0.5em; | ||
cursor: pointer; | ||
border: 2px solid white; | ||
} | ||
ul { | ||
list-style-type: none; | ||
} | ||
span { | ||
margin-right: 1em; | ||
} | ||
.colorbox { | ||
background-color: black; | ||
padding: 1em; | ||
padding-left: 2em; | ||
padding-right: 2em; | ||
margin: 0em; | ||
margin-top: -0.1em; | ||
margin-bottom: -0.3em; | ||
display: inline-block; | ||
} | ||
</style> | ||
<div style="display: flex;"> | ||
<div> | ||
<iframe id="iframe" width="853" height="505" | ||
src="https://www.youtube.com/embed/dLmyw-rO7HY?enablejsapi=1"></iframe> | ||
</div> | ||
<div> | ||
<ul> | ||
|
||
<li onclick="seekTime(765.0)" id="time_765.0"> | ||
<span>0:12:45</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(275.71324626192717, 58.38283121323795%, 87.09770403888045%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(235.35989152447743, 38.367907948460214%, 30.75040783033972%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 5349.0</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(1560)" id="time_1560"> | ||
<span>0:26:00</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(346.51903201494054, 54.95240461994383%, 14.225161464980541%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(250.06798714634334, 42.61208858837161%, 33.24312151265581%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 6308.9</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(1720.95)" id="time_1720.95"> | ||
<span>0:28:40</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(275.4722482881586, 58.22635674872168%, 87.71622347569166%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(234.95864529657845, 38.65692461218765%, 31.160068590168542%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 5351.7</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(3720)" id="time_3720"> | ||
<span>1:02:00</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(253.23542909424853, 47.735554772141484%, 23.192252510760422%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(250.54686999899516, 48.231203476490734%, 29.21639561459447%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 7595.3</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(3795.0)" id="time_3795.0"> | ||
<span>1:03:15</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(253.46400600281723, 45.000945582125816%, 22.01226859458872%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(252.09986415247232, 51.412043900930094%, 25.21198177647165%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 4796.8</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(3855.0)" id="time_3855.0"> | ||
<span>1:04:15</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(275.4288935879253, 58.79719656508387%, 87.49039314218136%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(236.73288136755133, 37.73702996679098%, 30.157242838134778%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 5417.1</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(8070.0)" id="time_8070.0"> | ||
<span>2:14:30</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(275.75699475500386, 59.64296351930041%, 87.06989772653237%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(238.0752591290745, 38.30954636589811%, 29.383987323453425%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 5380.8</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(8446.875)" id="time_8446.875"> | ||
<span>2:20:46</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(18.417881873760248, 2.7271576978328245%, 87.80556842159436%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(289.7750730662851, 48.22712726993102%, 6.845442299057454%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 5368.3</span> | ||
|
||
</li> | ||
|
||
<li onclick="seekTime(10723.125)" id="time_10723.125"> | ||
<span>2:58:43</span> | ||
|
||
<div class="colorbox" style="background-color: hsl(31.04511394320399, 58.465471208337526%, 77.87610619469012%);"></div> | ||
|
||
<div class="colorbox" style="background-color: hsl(227.3007906806897, 30.1191731786634%, 27.63073833966725%);"></div> | ||
|
||
<span></span> | ||
|
||
<span>temp: 5312.8</span> | ||
|
||
</li> | ||
|
||
</ul> | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
var timeToItems = [ | ||
|
||
[765.0, "time_765.0"], | ||
|
||
[1560, "time_1560"], | ||
|
||
[1720.95, "time_1720.95"], | ||
|
||
[3720, "time_3720"], | ||
|
||
[3795.0, "time_3795.0"], | ||
|
||
[3855.0, "time_3855.0"], | ||
|
||
[8070.0, "time_8070.0"], | ||
|
||
[8446.875, "time_8446.875"], | ||
|
||
[10723.125, "time_10723.125"], | ||
|
||
]; | ||
|
||
var tag = document.createElement('script'); | ||
tag.id = 'iframe-demo'; | ||
tag.src = 'https://www.youtube.com/iframe_api'; | ||
var firstScriptTag = document.getElementsByTagName('script')[0]; | ||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | ||
|
||
var player; | ||
function onYouTubeIframeAPIReady() { | ||
player = new YT.Player('iframe', { | ||
events: { | ||
'onReady': onPlayerReady, | ||
} | ||
}); | ||
} | ||
function onPlayerReady(event) { | ||
setInterval(() => { | ||
highlightTime(); | ||
}, 500); | ||
} | ||
function highlightTime() { | ||
var time = player.getCurrentTime(); | ||
|
||
timeToItems.forEach((timestamp) => { | ||
document.getElementById(timestamp[1]).style.border = "2px solid white"; | ||
}); | ||
|
||
// Find the index that matches the current time. | ||
var reversedTimeToItems = timeToItems.toReversed(); | ||
var idx = reversedTimeToItems.findIndex((timestamp) => { | ||
return timestamp[0] < time; | ||
}); | ||
if (idx == -1) { | ||
return | ||
} | ||
|
||
document.getElementById(reversedTimeToItems[idx][1]).style.border = "2px solid black"; | ||
} | ||
function seekTime(time) { | ||
player.seekTo(time, true); | ||
player.playVideo(); | ||
} | ||
</script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
{ | ||
"url": "https://www.youtube.com/watch?v=dLmyw-rO7HY", | ||
"updates": [ | ||
{ | ||
"time": 765.0, | ||
"hue": [ | ||
[ | ||
0.7658701285053532, | ||
0.5838283121323795, | ||
0.8709770403888045 | ||
], | ||
[ | ||
0.6537774764568818, | ||
0.3836790794846021, | ||
0.3075040783033972 | ||
] | ||
], | ||
"temp": [ | ||
5348.95458817482 | ||
] | ||
}, | ||
{ | ||
"time": 1560, | ||
"hue": [ | ||
[ | ||
0.9625528667081681, | ||
0.5495240461994383, | ||
0.1422516146498054 | ||
], | ||
[ | ||
0.6946332976287315, | ||
0.4261208858837161, | ||
0.3324312151265581 | ||
] | ||
], | ||
"temp": [ | ||
6308.900368213654 | ||
] | ||
}, | ||
{ | ||
"time": 1720.95, | ||
"hue": [ | ||
[ | ||
0.7652006896893294, | ||
0.5822635674872167, | ||
0.8771622347569167 | ||
], | ||
[ | ||
0.6526629036016068, | ||
0.3865692461218765, | ||
0.31160068590168544 | ||
] | ||
], | ||
"temp": [ | ||
5351.726496219635 | ||
] | ||
}, | ||
{ | ||
"time": 3720, | ||
"hue": [ | ||
[ | ||
0.7034317474840237, | ||
0.47735554772141486, | ||
0.23192252510760422 | ||
], | ||
[ | ||
0.6959635277749866, | ||
0.48231203476490736, | ||
0.2921639561459447 | ||
] | ||
], | ||
"temp": [ | ||
7595.312416553497 | ||
] | ||
}, | ||
{ | ||
"time": 3795.0, | ||
"hue": [ | ||
[ | ||
0.704066683341159, | ||
0.4500094558212582, | ||
0.2201226859458872 | ||
], | ||
[ | ||
0.7002774004235343, | ||
0.5141204390093009, | ||
0.2521198177647165 | ||
] | ||
], | ||
"temp": [ | ||
4796.773195266724 | ||
] | ||
}, | ||
{ | ||
"time": 3855.0, | ||
"hue": [ | ||
[ | ||
0.7650802599664591, | ||
0.5879719656508388, | ||
0.8749039314218137 | ||
], | ||
[ | ||
0.6575913371320871, | ||
0.37737029966790975, | ||
0.3015724283813478 | ||
] | ||
], | ||
"temp": [ | ||
5417.088836431503 | ||
] | ||
}, | ||
{ | ||
"time": 8070.0, | ||
"hue": [ | ||
[ | ||
0.765991652097233, | ||
0.5964296351930041, | ||
0.8706989772653237 | ||
], | ||
[ | ||
0.6613201642474292, | ||
0.38309546365898106, | ||
0.29383987323453425 | ||
] | ||
], | ||
"temp": [ | ||
5380.828392505646 | ||
] | ||
}, | ||
{ | ||
"time": 8446.875, | ||
"hue": [ | ||
[ | ||
0.05116078298266736, | ||
0.027271576978328244, | ||
0.8780556842159436 | ||
], | ||
[ | ||
0.8049307585174585, | ||
0.48227127269931014, | ||
0.06845442299057454 | ||
] | ||
], | ||
"temp": [ | ||
5368.269377946854 | ||
] | ||
}, | ||
{ | ||
"time": 10723.125, | ||
"hue": [ | ||
[ | ||
0.08623642762001109, | ||
0.5846547120833753, | ||
0.7787610619469012 | ||
], | ||
[ | ||
0.631391085224138, | ||
0.301191731786634, | ||
0.2763073833966725 | ||
] | ||
], | ||
"temp": [ | ||
5312.769460678101 | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.