@@ -29,17 +29,34 @@ export function scrollWindow(option) {
2929 }
3030}
3131
32- export const footerElement = document . getElementById ( "footer" ) ;
32+ // Pour redimensionner le footer sur des petits écrans
33+ function resizeFooterForSmallScreenToSpecificHeight ( CSSheight ) {
34+ const style = document . createElement ( "style" ) ;
35+ style . id = "styleControlsIfNoFooter" ;
36+ style . textContent = `
37+ @media screen and (max-width: 500px) {
38+ #controls {
39+ height: ${ CSSheight } !important;
40+ }
41+ }
42+ ` ;
43+ document . head . appendChild ( style ) ;
44+ }
3345
3446// Pour cacher le footer
35- export function hideFooter ( userInput ) {
47+ export function hideFooter ( isUserInputVisible ) {
3648 const controlsElement = document . getElementById ( "controls" ) ;
49+ const footerElement = document . getElementById ( "footer" ) ;
50+
3751 footerElement . style . display = "none" ;
38- controlsElement . style . height = "70px!important" ;
39- const styleControls = userInput
40- ? "@media screen and (max-width: 500px) { #controls {height:110px!important}}"
41- : "@media screen and (max-width: 500px) { #controls {height:70px!important}}" ;
42- const styleSheet = document . createElement ( "style" ) ;
43- styleSheet . innerText = styleControls ;
44- document . head . appendChild ( styleSheet ) ;
52+ controlsElement . style . height = "70px" ;
53+
54+ const smallScreenFooterHeight = isUserInputVisible ? "110px" : "50px" ;
55+ resizeFooterForSmallScreenToSpecificHeight ( smallScreenFooterHeight ) ;
56+ }
57+
58+ // Pour définir le contenu du footer
59+ export function setContentOfFooter ( html ) {
60+ const footerElement = document . getElementById ( "footer" ) ;
61+ footerElement . innerHTML = html ;
4562}
0 commit comments