Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fullscreen label #19

Open
leoVolk opened this issue Jan 3, 2020 · 5 comments
Open

Remove fullscreen label #19

leoVolk opened this issue Jan 3, 2020 · 5 comments

Comments

@leoVolk
Copy link

leoVolk commented Jan 3, 2020

Hello there!
Is there a way to remove the fullscreen label or edit its styling? The standard fullscreen label is clashing with my footer.

Still: thank you for this awesome component, you saved me a lot of time!
Have a great day

@votetake
Copy link
Owner

Hi, have you tried using the attribute hideFooter?
Example:

<template>
  <unity hideFooter=true src="static/Build/game.json" width="1000" height="600" unityLoader="static/Build/UnityLoader.js" ></unity>  
</template>

@masseydigital
Copy link

The above does not work for me... I'm still seeing the footer after adding hideFooter=true

@ellepin
Copy link

ellepin commented Jun 30, 2020

Hello, it works now.
It sounds like you can pass some other parameters this way.

<template>
<unity v-bind="{hideFooter: true}" src="static/Build/game.json" unityLoader="static/Build/UnityLoader.js" ></unity>  
</template>

@MEAN-James
Copy link

MEAN-James commented Jan 16, 2021

The issue is the footer Unity.vue component doesn't match the index.html and static/TemplateData/style.css file that unity gives you. So if you include it the different footers will "clash". A kind of hacky solution for this is to select the element with the fullscreen class in the mounted lifecycle hook and set its text content to an empty string, Unfortunately, the label will still appear for a brief moment before being removed.

Alternatively you could opt to not include the static/TemplateData/style.css. Then nothing will clash but the fullscreen text will still be there and can be hidden using :hide-footer="true" attribute. this also allows you to remove a few files from your templateData folder like the webgl-logo.png, fullscreen.png and style.css for starters. I kind of like not having all that stuff in the footer personally.

On a side note, I tried to just edit the source template but it didn't seem to change anything for some reason. I tried rerunning the dev script and also deleting any service workers so I'm kind of confused there... I assume it has something to do with the JavaScript file that comes with the package.

<!-- the components footer html as is-->
<div class="footer" v-if="hideFooter !== true">
  <a class="fullscreen" @click.prevent="fullscreen">Fullscreen</a>
</div>
mounted() {
  document.querySelector('.fullscreen').textContent = ''
},

@wenwen1995
Copy link

Just in mounted function , use this code, set it to be hidden:

mounted() {
    // hide fullScreen
    const fullScreenEl = document.querySelector('.fullscreen');
    fullScreenEl.style.display = 'none';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants