Advertisement
izuemis

cr femcel2006 misc

Nov 17th, 2022
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. -- SFX FOR ICONS --
  2. <script>
  3. document.getElementById('gallery01').onclick = function() {
  4. document.getElementById('sound').play();
  5. }
  6. </script>
  7. <audio id="sound" src="https://cdn.discordapp.com/attachments/916511538410569829/1006909357981712414/mouse_click_fx.mp3" preload="auto"></audio>
  8.  
  9. -- SFX --
  10. <script>
  11.  
  12. // Mouseover/ Click sound effect- by JavaScript Kit (www.javascriptkit.com)
  13. // Visit JavaScript Kit at http://www.javascriptkit.com/ for full source code
  14.  
  15. //** Usage: Instantiate script by calling: var uniquevar=createsoundbite("soundfile1", "fallbackfile2", "fallebacksound3", etc)
  16. //** Call: uniquevar.playclip() to play sound
  17.  
  18. var html5_audiotypes={ //define list of audio file extensions and their associated audio types. Add to it if your specified audio file isn't on this list:
  19. "mp3": "audio/mpeg",
  20. "mp4": "audio/mp4",
  21. "ogg": "audio/ogg",
  22. "wav": "audio/wav"
  23. }
  24.  
  25. function createsoundbite(sound){
  26. var html5audio=document.createElement('audio')
  27. if (html5audio.canPlayType){ //check support for HTML5 audio
  28. for (var i=0; i<arguments.length; i++){
  29. var sourceel=document.createElement('source')
  30. sourceel.setAttribute('src', arguments[i])
  31. if (arguments[i].match(/\.(\w+)$/i))
  32. sourceel.setAttribute('type', html5_audiotypes[RegExp.$1])
  33. html5audio.appendChild(sourceel)
  34. }
  35. html5audio.load()
  36. html5audio.playclip=function(){
  37. html5audio.pause()
  38. html5audio.currentTime=0
  39. html5audio.play()
  40. }
  41. return html5audio
  42. }
  43. else{
  44. return {playclip:function(){throw new Error("Your browser doesn't support HTML5 audio unfortunately")}}
  45. }
  46. }
  47.  
  48. //Initialize two sound clips with 1 fallback file each:
  49.  
  50. var mouseoversound=createsoundbite("https://cdn.discordapp.com/attachments/916511538410569829/1006909357981712414/mouse_click_fx.mp3")
  51. var clicksound=createsoundbite("https://cdn.discordapp.com/attachments/916511538410569829/1006909357981712414/mouse_click_fx.mp3")
  52.  
  53. </script>
  54.  
  55. -- FONT --
  56. @font-face {
  57. font-family: Pixelated MS Sans Serif;
  58. src:url(https://dl.dropbox.com/s/as51v4gboqenc1b/ms-sans-serif.ttf)
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement