Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!-- サムネイルとして表示される動画 -->
<video class="popup" src="" type="video/mp4"></video>
<video class="popup" src="" type="video/mp4"></video>

<div id="modal" class="modal">
    <!-- モーダルでフルサイズで表示される動画コンテナ -->
    <div id="modalContent" class="modal-content">
        <!-- 事前にmodal内にvideo要素を配置 -->
        <video id="modalVideo" controls style="width: 100%;">
            <source id="videoSource" type="video/mp4">
    <span id="close">&times;</span>


                .modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); /* 背景色 */
    opacity: 0; /* 初期状態では透明 */
    visibility: hidden; /* 初期状態では不可視 */
    transition: opacity 0.5s, visibility 0.5s; /* アニメーション効果 */

.modal-content {
    display: block;
    width: 80%;
    max-width: 700px;

#close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;

video {
    width: 200px;
    cursor: pointer;



                const modal = document.getElementById('modal');
const videos = document.querySelectorAll('.popup'); // ここは動画を示す要素に適したセレクタに変更してください
const modalVideo = document.getElementById('modalVideo');
const closeSpan = document.getElementById('close'); // 閉じるボタンの処理は既に設定されているとします

for (let video of videos) {
    video.onclick = function() { = "1"; = "visible";
        modalVideo.src = this.src; // ここで直接クリックされたvideoのsrcを取得
        modalVideo.load(); // 新しいソースを読み込む; // 動画を再生

closeSpan.onclick = function() { = "0"; = "hidden";
    modalVideo.pause(); // モーダルを閉じると動画を停止

window.onclick = function(event) {
    if ( == modal) { = "0"; = "hidden";
        modalVideo.pause(); // モーダルを閉じると動画を停止