From a906213bd092aabff9a94fc69993021ae4351254 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 28 Oct 2022 16:33:38 +0200 Subject: [PATCH] Change background rendering system --- examples/index.css | 27 +++++++++++++++++++++++---- examples/index.html | 1 + 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/examples/index.css b/examples/index.css index b6e49dd..2dd908c 100644 --- a/examples/index.css +++ b/examples/index.css @@ -1,21 +1,40 @@ -#body { - background-image: url("Space_Default.jpg"); - background-attachment: fixed; - background-size: cover; +#background { + width: 100vw; + height: 120vh; + position: fixed; + z-index: -1; + + object-fit: cover; + object-position: center; +} + +#body { padding: 0 16px; } +#background { + margin: 0 -16px; +} + @media screen and (max-width: 800px) { #body { padding: 0 8px; } + + #background { + margin: 0 -8px; + } } @media screen and (max-width: 400px) { #body { padding: 0 4px; } + + #background { + margin: 0 -4px; + } } #body .chapter-1 > .panel, diff --git a/examples/index.html b/examples/index.html index 55eee88..a89e524 100644 --- a/examples/index.html +++ b/examples/index.html @@ -28,6 +28,7 @@ Bluelib +