Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:FlashEmbed: Difference between revisions

Template page
No edit summary
Tag: Reverted
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<htmltag tagname="div" style="position:relative; width:{{{width|640}}}px; height:{{{height|480}}}px;" class="flash-splash-container">
<templatestyles src="Template:FlashEmbed/styles.css" />


  <htmltag tagname="div" style="position:absolute;top:0;left:0;width:100%;height:100%;background:url('{{{splash|https://example.com/default-splash.png}}}') center center/cover no-repeat;display:flex;align-items:center;justify-content:center;cursor:pointer;" class="flash-splash-overlay">
<htmltag tagname="script"  
    <htmltag tagname="div" style="background:rgba(0,0,0,0.6);padding:10px 20px;border-radius:10px;color:white;font-size:20px;">
    src="/index.php?title=MediaWiki:RuffleLoader.js&amp;action=raw&amp;ctype=text/javascript">
      {{{button|Click to Play}}}
</htmltag>
    </htmltag>
  </htmltag>
 
  <htmltag tagname="div" style="width:100%;height:100%;display:none;" class="flash-object">
    <htmltag tagname="object" type="application/x-shockwave-flash" data="{{{url}}}" width="100%" height="100%">
      <htmltag tagname="param" name="movie" value="{{{url}}}" selfclose="true" />
      <htmltag tagname="param" name="allowScriptAccess" value="never" selfclose="true" />
    </htmltag>
  </htmltag>


<htmltag tagname="object"
    type="application/x-shockwave-flash"
    data="{{{url}}}"
    width="{{{width|600}}}"
    height="{{{height|400}}}"
    style="display:block; margin-left:auto; margin-right:auto;">
  <htmltag tagname="param" name="movie" value="{{{url}}}" selfclose="true" />
  <htmltag tagname="param" name="allowScriptAccess" value="never" selfclose="true" />
</htmltag>
</htmltag>


<htmltag tagname="script">
document.addEventListener('DOMContentLoaded', function() {
  var containers = document.querySelectorAll('.flash-splash-container');
  containers.forEach(function(container) {
    var overlay = container.querySelector('.flash-splash-overlay');
    var flashObject = container.querySelector('.flash-object');
    if (overlay && flashObject) {
      overlay.addEventListener('click', function() {
        overlay.style.display = 'none';
        flashObject.style.display = 'block';
      });
    }
  });
});
</htmltag>
</includeonly>
</includeonly>
<noinclude>
Usage:
<pre>{{FlashEmbed|url=https://example.com/yourgame.swf|width=640|height=480}}</pre>
edit JS - https://www.gamebrew.org/wiki/MediaWiki:RuffleLoader.js
edit css - https://www.gamebrew.org/wiki/Template:FlashEmbed/styles.css
</noinclude>

Latest revision as of 15:14, 18 May 2025


Usage:

{{FlashEmbed|url=https://example.com/yourgame.swf|width=640|height=480}}

edit JS - https://www.gamebrew.org/wiki/MediaWiki:RuffleLoader.js edit css - https://www.gamebrew.org/wiki/Template:FlashEmbed/styles.css

Advertising: