Last active
February 25, 2021 14:11
-
-
Save imjameshall/f2a2c29ff0fece777956b74f99db511b to your computer and use it in GitHub Desktop.
SVG mask + video
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
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="1920px" height="1080px" preserveAspectRatio="xMidYMid slice"> | |
<defs> | |
<mask id="mask" x="0" y="0" width="100%" height="100%" > | |
<rect x="0" y="0" width="100%" height="100%"/> | |
<text x="960" y="1em">Hello</text> | |
<text x="960" y="90%">SVG</text> | |
</mask> | |
</defs> | |
<rect x="0" y="0" width="100%" height="100%"/> | |
</svg> | |
<!-- | |
<video id="video" autoplay="autoplay" muted="muted" preload="auto" loop="loop"> | |
<source src="http://mazwai.com/system/posts/videos/000/000/123/original/victor_ciurus--5d_mark_iii_magic_lantern_14_bits_raw_video.mp4?1412890624" type="video/mp4"> | |
<source src="http://mazwai.com/system/posts/videos/000/000/123/webm/victor_ciurus--5d_mark_iii_magic_lantern_14_bits_raw_video.webm?1412890624" type="video/webm"> | |
</video> | |
--> | |
<div style='background-color:black;height:1080px;'></div> | |
<div style='background-color:red;height:1080px;'></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
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
html{ | |
height: 100%; | |
overflow:hidden; | |
font-weight:100; | |
} | |
body { | |
font-family: 'Roboto', sans-serif; | |
font-size: 35em; | |
letter-spacing:-0.03em; | |
height: 100%; | |
} | |
svg { | |
width: 100%; | |
height: 100%; | |
position:absolute; | |
} | |
svg text { | |
text-anchor: middle; | |
} | |
svg mask rect { | |
fill: rgba(255, 255, 255, 0.9); | |
} | |
svg > rect { | |
fill: white; | |
-webkit-mask: url(#mask); | |
mask: url(#mask); | |
} | |
video{ | |
position: absolute; | |
top: 0%; | |
left: 0%; | |
min-width: 100%; | |
min-height: 100%; | |
width: auto; | |
height: auto; | |
z-index: -1; | |
overflow: hidden; | |
} | |
@media only screen and (max-width: 768px) { | |
html{ | |
font-size:0.5em; | |
font-weight:400; | |
} | |
} |
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://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment