It looks like you're new here. If you want to get involved, click one of these buttons!
body { background-color: #C3D6D6; } html.anx0 { background-color: #C3D6D6; } html.anx1 { background-color: #C6D6CE; } html.anx2 { background-color: #C9D6C6; } html.anx3 { background-color: #CCD6BF; } html.anx4 { background-color: #CFD6B7; } html.anx5 { background-color: #D2D6AF; } html.anx6 { background-color: #D5D6A8; } html.anx7 { background-color: #D9D6A0; } html.anx8 { background-color: #DCD698; } html.anx9 { background-color: #D7D691; } html.anx10 { background-color: #E2D689; } html.anx11 { background-color: #E5D681; } html.anx12 { background-color: #E8D67A; } html.anx13 { background-color: #EBD67A; } html.anx14 { background-color: #EBD672; } html.anx15 { background-color: #EFD76B; } html.imp1 { background: -webkit-linear-gradient(rgba(230,141,189,0), rgba(230,141,189,0.2), rgba(230,141,189,1)); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(rgba(230,141,189,0), rgba(230,141,189,0.2), rgba(230,141,189,1)); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(rgba(230,141,189,0), rgba(230,141,189,0.2), rgba(230,141,189,1)); /* For Firefox 3.6 to 15 */ background: linear-gradient(rgba(230,141,189,0), rgba(230,141,189,0.2), rgba(230,141,189,1)); /* Standard syntax (must be last) */ position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .container { position: relative; } .bgthing { position: absolute; display: none; }
{ <div class="container"> <div class="bgthing"> (if: $socialanx < 1)[ <img src="!@#$" onerror="$('html').addClass('anx0')" />] (if: $socialanx is 1)[ <img src="!@#$" onerror="$('html').addClass('anx1')" />] (if: $socialanx is 2)[ <img src="!@#$" onerror="$('html').addClass('anx2')" />] (if: $socialanx is 3)[ <img src="!@#$" onerror="$('html').addClass('anx3')" />] (if: $socialanx is 4)[ <img src="!@#$" onerror="$('html').addClass('anx4')" />] (if: $socialanx is 5)[ <img src="!@#$" onerror="$('html').addClass('anx5')" />] (if: $socialanx is 6)[ <img src="!@#$" onerror="$('html').addClass('anx6')" />] (if: $socialanx is 7)[ <img src="!@#$" onerror="$('html').addClass('anx7')" />] (if: $socialanx is 8)[ <img src="!@#$" onerror="$('html').addClass('anx8')" />] (if: $socialanx is 9)[ <img src="!@#$" onerror="$('html').addClass('anx9')" />] (if: $socialanx is 10)[ <img src="!@#$" onerror="$('html').addClass('anx10')" />] (if: $socialanx is 11)[ <img src="!@#$" onerror="$('html').addClass('anx11')" />] (if: $socialanx is 12)[ <img src="!@#$" onerror="$('html').addClass('anx12')" />] (if: $socialanx is 13)[ <img src="!@#$" onerror="$('html').addClass('anx13')" />] (if: $socialanx is 14)[ <img src="!@#$" onerror="$('html').addClass('anx14')" />] (if: $socialanx > 14)[ <img src="!@#$" onerror="$('html').addClass('anx15')" />] (if: $impatience > 2)[ <img src="!@#$" onerror="$('html').addClass('imp1')" />]</div></div> }
Comments
So you need to create a new div in the global html structure if you want to layer backgrounds. For every new layered effect in a Twine game there needs to be a new div. The story format most suited to this is SugarCube in Twine 1.4.2 due to the ability to directly edit the html, but you should be able to use JavaScript to create divs in Harlowe.
Unfortunately I don't know the best way to create divs in JavaScript in Harlowe.
Once you figure that part out, you're best off creating a new div for each variable and then classes for each. For example