Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

31
LINES

< > BotCompany Repo | #1032361 // HFullScreenDim

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4273L/24K).

sclass HFullScreenDim {
  S id = "dimThePage";
  int zIndex = 999;
  S color = "black";
  double opacity = 0.5;
  S onUndim;
  
  S html() {
    ret hcss("#" + id + replaceDollarVars([[ {
       position:fixed;
      top:0;
      bottom:0;
      left:0;
      right:0;
      background: $color;
      opacity: $opacity;
      z-index: $zIndex;
      /*pointer-events: none;*/
      visibility: hidden;
    }]], +color, +opacity, +zIndex))
      + div("", +id, onclick := nemptyLinesLL(js_undim(), onUndim));
  }
  
  S js_dim() {
    ret js_dollarVars([[document.getElementById($id).style.visibility = "visible";]], +id);
  }
  
  S js_undim() {
    ret js_dollarVars([[document.getElementById($id).style.visibility = "hidden";]], +id);
  }
}

Author comment

Began life as a copy of #1032360

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032361
Snippet name: HFullScreenDim
Eternal ID of this version: #1032361/8
Text MD5: b041bae9932b7b26307759504e5b8261
Transpilation MD5: 2211800b1823bd050f8340a3cf0b7368
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-31 17:43:50
Source code size: 772 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 99 / 219
Version history: 7 change(s)
Referenced in: [show references]