
Description
page ๊ตฌ์ฑ ์์๋ก Youtube Iframe์ ์ถ๊ฐํ ์ ์์.
๋จ์ํ Iframe์ ์ถ๊ฐํจ.
(์ถํ์ customํด์ ์ํ๋ ์์์ ๊ฐ๋จํ๊ฒ ๋ณ๊ฒฝํ ์ ์๋๋ก ํ ์์ )
Required
none.
Source
View
path: quartz/components/custom/MusicBox.tsx
import { QuartzComponent, QuartzComponentConstructor } from "../types"
import style from "../styles/custom/musicBox.scss"
const MusicBox: QuartzComponent = () => {
return (
<div className="music-box">
<h3 className="music-box-title">Music</h3>
<div className="iframe-container">
<iframe
src="https://www.youtube.com/embed/tI-5uv4wryI?si=kLiQKCxDLzhLqSuC&autoplay=1&mute=1&controls=0&loop=1&playlist=tI-5uv4wryI"
title="YouTube video player"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerPolicy="strict-origin-when-cross-origin"
allowFullScreen
></iframe>
</div>
</div>
)}
MusicBox.css = style
export default (() => MusicBox) satisfies QuartzComponentConstructorCSS
path:quartz/components/styles/musicBox.scss
.music-box-title {
margin: 0;
color: var(--textHighlight);
}
.iframe-container {
border-radius: 5px;
overflow: hidden;
display: inline-block;
margin: .5em 0;
}
iframe {
border: none;
width: 100%;
height: 100%;
display: block;
}