impress / impress.js

It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.
http://impress.js.org
MIT License
37.62k stars 6.67k forks source link

fallback-message not hidden correctly #839

Closed janishutz closed 1 year ago

janishutz commented 1 year ago

I have been playing around with the fallback messages a little lately, I have copied the code over from the demo and it did not hide properly. I have read through the source code and found no code that takes care of that (except I did overlook something). I will add a fix for this today and open a PR

janishutz commented 1 year ago

Does anybody know if I am right or not?

fnogatz commented 1 year ago

The div of class fallback-message is hidden via CSS. See for instance css/impress-demo.css: https://github.com/impress/impress.js/blob/64d66bf77feda50c6dcdf4d01bf5ef22a79e4df4/css/impress-demo.css#L156-L158

The impress-supported class is added to HTML's <body> element as part of the impress.js script: https://github.com/impress/impress.js/blob/64d66bf77feda50c6dcdf4d01bf5ef22a79e4df4/src/impress.js#L219-L220

@henrikingo, I would suggest to move this CSS snippet to css/impress-common.css instead. This is supported by the fact that this snippet is currently present in all of the CSS files in the examples directory.

@simplePCBuilding, would you mind to create a pull request following these suggestions?

janishutz commented 1 year ago

Right, why don't we hide it in JS if it exists? This would eliminate the need for extra CSS code

fnogatz commented 1 year ago

We basically do by adding the impress-supported CSS class via JS. Don't worry about the extra CSS code, IMO it is easier to maintain and more common to just use two classes (here: impress-not-supported and impress-supported) in JS and do everything else via CSS.

janishutz commented 1 year ago

Fair point. I will fix this once I am home

janishutz commented 1 year ago

Opened a PR

fnogatz commented 1 year ago

Linking here to pull request #840 which aims to resolve what I suggested in https://github.com/impress/impress.js/issues/839#issuecomment-1351347696:

@henrikingo, I would suggest to move this CSS snippet to css/impress-common.css instead. This is supported by the fact that this snippet is currently present in all of the CSS files in the examples directory.