Skip to content

Elerium-115/influence-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Influence CSS

Work in progress...

Styling recommended for embedding tools and content into the Influence game client, for example via influence-tools-chrome-extension.

Live example

https://elerium-115.github.io/influence-css/example/

Dev notes

The /example folder contains a minimal page and styling that can help you to preview a page, before trying to embed it in-game. The actual contents of your page should be placed inside the <div class="example-main"> element. You can then use the following classes on the <body> element:

  • body.mock-embed will mock a background that looks similar to the game layout, so you can test your content as if it were embedded in-game:

  • body.embed defines the style that will be used when the page is actually embedded in-game. For example, it is highly recommended to use a transparent background, along with some of the basic in-game styles reproduced in /style/influence-index.css.

    Note: You will likely want to set the embed class only when the page is being shown in an iframe - i.e. not on direct visits to your page, outside the game:

    function inIframe() {
        try {
            return window.self !== window.top;
        } catch (e) {
            return true;
        }
    }
    
    if (inIframe()) {
        document.body.classList.add('embed');
    }
    
  • body without any of the above classes defines the style that will be used in all contexts, including on direct visits to your page, outside the game.

Note: The maximum screen width available for your page, when embedded in-game, is 1290 pixels.


Created by @elerium115 for the space strategy sandbox MMO Influence.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published