Editing User:Toad64/Sandbox

Jump to navigation Jump to search
Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:


<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// gemini code
// In your Common.js
// In your Common.js
$(document).ready(function() {
$(document).ready(function() {
    // Find every native audio player generated by the wiki
     $('audio').each(function() {
     $('audio').each(function() {
         const $this = $(this);
        // Create your custom component
         const src = $this.attr('src');
         const myPlayer = document.createElement('audio-player');
          
        // Transfer the source
        myPlayer.setAttribute('track', $(this).attr('src'));
          
          
         // Log what we found to the console so we can see why it's undefined
         // Replace the native player with your custom one
         console.log("Processing element:", this);
         $(this).replaceWith(myPlayer);
        console.log("Source found:", src);
 
        if (src) {
            const myPlayer = document.createElement('audio-player');
            myPlayer.setAttribute('track', src);
            $this.replaceWith(myPlayer);
        } else {
            console.warn("Skipping element because src is undefined:", this);
        }
     });
     });
});
});
Line 40: Line 33:
             align-items: center;
             align-items: center;
             gap: 12px;
             gap: 12px;
           
             width: 100%;
             width: 100%;
             max-width: 400px;
             max-width: 400px;
padding: 10px 15px;
            background: var(--background-color-base-subtle);
            padding: 10px 15px;
             border-radius: 50px;
             border-radius: 50px;
           
            background: var(--background-color-base-subtle);
             color: var(--color-base);
             color: var(--color-base);
             font-family: sans-serif;
             font-family: sans-serif;
            box-sizing: border-box;
overflow: hidden;
           }
           }
         
           .playBtn {
           .playBtn {
            flex-shrink: 0;
         
             width: 30px;
             width: 30px;
             height: 30px;
             height: 30px;
            background: var(--background-color-interactive);
             border: none;
             border: none;
            color: var(--color-base);
             border-radius: 50%;
             border-radius: 50%;
           
            align-items: center;
    justify-content: center;
           
            background: var(--background-color-interactive);
            color: var(--color-base);
             cursor: pointer;
             cursor: pointer;
              
             flex-shrink: 0;
          }
         
          .playBtn:hover {
        background: var(--background-color-interactive-subtle);
           }
           }
         
           .seek {
           .seek {
        flex: 1;
            -webkit-appearance: none;
        -webkit-appearance: none;
             flex: 1;
             appearance: none;
           
             height: 6px;
             height: 6px;
            background: var(--color-base);
             border-radius: 5px;
             border-radius: 5px;
           
            background: var(--color-base);
             cursor: pointer;
             cursor: pointer;
           }
           }
            
            
           .seek::-webkit-slider-thumb {
           .seek::-webkit-slider-thumb {
         -webkit-appearance: none;
         -webkit-appearance: none; /* Override default look */
         appearance: none;
         appearance: none;
        
         border-radius: 50px;
         width: 15px;
         width: 15px;
         height: 15px;
         height: 15px;
        border-radius: 50px;
       
         background: var(--link-color);
         background: var(--link-color);
         cursor: pointer;
         cursor: pointer;
Line 99: Line 71:
        
        
       .seek::-moz-range-thumb {
       .seek::-moz-range-thumb {
    -webkit-appearance: none;
        border-radius: 50px;
        appearance: none;
       
         width: 15px;
         width: 15px;
         height: 15px;
         height: 15px;
        border-radius: 50px;
       
         background: var(--link-color);
         background: var(--link-color);
         cursor: pointer;
         cursor: pointer;
           }
           }
         
           .time { font-size: 12px; opacity: 0.8; white-space: nowrap; }
           .time {  
        font-size: 12px;  
        opacity: 0.8;  
        white-space: nowrap;  
          }
         </style>
         </style>
          
          
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)