Platform
Resources
Pricing
Sign in
Contact us
Fabian Iwand
Web developer and autodidact with an interest in creative coding.
Workspace
Fork
Published
Tools & Techniques
By
Fabian Iwand
Edited
Oct 5, 2020
22 stars
1
Insert cell
Insert cell
Insert cell
Insert cell
8
video
=
svg
`<svg width=400 height=300>
${
colorFilter
}
<foreignObject width=400 height=300 filter=url(#color)>
<video width=400 autoplay loop muted crossorigin=anonymous>
<source src="${
videoSrc
}">
</video>
</foreignObject>
</svg>
`
Insert cell
colorFilter
=
!
scale
?
'<filter id=color />'
:
filter
(
'color'
,
scales
[
scale
]
,
{
invert
:
options
.
includes
(
'invert'
)
,
steps
:
options
.
includes
(
'quantize'
)
?
5
:
null
,
}
)
Insert cell
videoSrc
=
options
.
includes
(
'cors'
)
?
'https://i.imgur.com/bG8t8iJ.mp4'
:
FileAttachment
(
'video.mp4'
)
.
url
(
)
Insert cell
Insert cell
// Use a global playback offset to avoid restarts when changing options.
video
.
querySelector
(
'video'
)
.
addEventListener
(
'play'
,
function
(
)
{
this
.
currentTime
=
Date
.
now
(
)
/
1000
%
this
.
duration
;
}
)
Insert cell
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
scale
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
options
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
video
Show 8 comments
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
colorFilter
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
videoSrc
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML