rainbow – Thingography.com https://thingography.com More than a Photo Gallery Tue, 06 Nov 2018 14:19:16 +0000 en-US hourly 1 Rainbow Made with Pure CSS https://thingography.com/css-rainbow/ https://thingography.com/css-rainbow/#respond Sat, 10 Mar 2018 14:15:48 +0000 http://thingography.com/?p=1851 .ani-box {width: 100%; height: auto; overflow: hidden;} #half { width: 80%; height: 85%; position: absolute; top: 30px; left: 50%; margin-left: -40%; } .rainbow { margin: 0px auto 0px auto; width: 80%; height: 150%; } .red, .orange, .yellow, .green, .blue, .indigo, .violet { border-radius: 50%; position: absolute; width: 100%; height: 200%; background: transparent; } /* ====== Big rainbow is hidden to better show the small rainbow on small screen less than 720px ===== */ @media screen and (max-width: 699px) { #half {visibility: hidden;} } .red { border: 2% solid #FF0000; top: 2%; left: 1%; box-shadow: 0px 0px 3em 0px red, 0px 0px 4em 0px red inset; width: 98% } .orange { border: 2% solid #FF9900; top: 4%; left: 2%; box-shadow:0px 0px 4em 0px orange, 0px 0px 4em 0px orange inset; width: 96% } .yellow { border: 2% solid yellow; top: 6%; left: 3%; box-shadow:0px 0px 4em 0px yellow, 0px 0px 4em 0px yellow inset; width: 94%; } .green { border: 2% solid #66FF33; top: 8%; left: 4%; box-shadow:0px 0px 4em 0px #66FF33, 0px 0px 4em 0px #66FF33 inset; width: 92%; } .blue { border: 2% solid blue; top: 10%; left: 5%; box-shadow:0px 0px 4em 0px blue, 0px 0px 4em 0px blue inset; width: 90%; } .indigo { border: 2% solid #4b0082; top: 12%; left: 6%; box-shadow:0px 0px 4em 0px #4b0082, 0px 0px 4em 0px #4b0082 inset; width: 88%; } .violet { border: 2% solid #ee82ee; top: 14%; left: 7%; box-shadow:0px 0px 4em 0px #ee82ee, 0px 0px 3em 0px #ee82ee inset; width: 86%; } /* ===== The Little Rainbow ===== */ .rb2 { margin: 0em auto 1em auto; width: 225px; height: 125px; position: relative; z-index: 1000; overflow: hidden; } .rainbow2 { margin: 30px auto 0px auto; width: 200px; height: 100px; position: relative; } .red2, .orange2, .yellow2, .green2, .blue2, .indigo2, .violet2 { /* New Colors needed to make the smaller rainbow colors more definitive */ border-radius: 50%; position: absolute; width: 100%; height: 200%; background: transparent; } .red2 { border: 2% solid #FF0000; top: 2%; left: 1%; box-shadow: 0px 0px 15px 0px red; /* box-shadows changed from big rainbow = more defintive colors */ width: 98% } .orange2 { border: 2% solid #FF9900; top: 4%; left: 2%; box-shadow:0px 0px 15px 0px orange; width: 96% } .yellow2 { border: 2% solid yellow; top: 6%; left: 3%; box-shadow:0px 0px 15px 0px yellow; width: 94%; } .green2 { border: 2% solid #66FF33; top: 8%; left: 4%; box-shadow:0px 0px 15px 0px #66FF33; width: 92%; } .blue2 { border: 2% solid blue; top: 10%; left: 5%; box-shadow:0px 0px 15px 0px blue; width: 90%; } .indigo2 { border: 2% solid #4b0082; top: 12%; left: 6%; box-shadow:0px 0px 15px 0px #4b0082; width: 88%; } .violet2 { border: 2% solid #ee82ee; top: 14%; left: 7%; box-shadow:0px 0px 15px 0px #ee82ee; width: 86%; } /* ===== End Little Rainbow CSS ===== */ /* ====== Text in the content ======= */ .panel { margin: 120px auto 10px auto; padding: 0.5em 1em 2em 1em; width: 80%; display: block; z-index: 10; position: relative; font-size: 1em; } .contentpanel { padding: 0em 0.5em 0.5em 0.5em; width: 90%; margin: 0 auto 2em auto; color: #000000; font-size: 1.1em; letter-spacing: 0.05em; position: relative; } .contentpanel p { color: #000000; text-align: left; }

    The rainbows on this page are created with pure CSS. (The large background rainbow is hidden on screens less than 699px – too big to fit nicely on a small screen.) Using DIV’s with transparent backgrounds, colored borders, and border-radii allowed for the curved arch. Box-shadows were used to enhance the appearance of the rainbow. Trying to keep the rainbow on the page when the page is resized was my concern. My solution was to use percentages in the CSS and keep the rainbow in a fixed position. There are probably a number of methods to achieve the rainbow using pure CSS, this was mine.

    The large rainbow will flex with the page size. The height and width will adjust to be the height and the width of the page. Changing the CSS can adjust the size and shape to the desired appearance. The little rainbow is a fixed size. The HTML and CSS code for both are shown below. Please note any CSS animations created here were made for desktop compurers – created before “Mobilegeddon”, and later quick fixed (to the best of our ability) to fit hand held devices.

]]>
https://thingography.com/css-rainbow/feed/ 0