Spinning elements with a gradient overlay

I have a few tasks to accomplish:

  1. Ensuring the logo scales properly within the viewport without losing relative proportions
  2. Applying a purple gradient (to transparent) specifically to the rings
  3. Having the rings rotate at varying speeds and in opposite directions while maintaining the top-to-bottom gradient

This is the desired outcome:

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: transparent;
  /* Set a background color if needed */
}

.container {
  position: relative;
}

.title {
  position: relative;
  z-index: 2;
  /* Increase z-index for the title */
}

.core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  /* Reduce z-index for the cores */
  background: linear-gradient(8c04fe, transparent);
}


/* Define different sizes for Core 1, Core 2, and Core 3 */

.core1 {
  width: 48vw;
  height: 48vw;
}

.core2 {
  width: 32vw;
  height: 32vw;
}

.core3 {
  width: 16vw;
  height: 16vw;
}

@media (max-width: 768px) {
  .title img {
    max-width: 100%;
  }
  .core {
    width: 50%;
    /* Adjust the width as needed */
    max-width: none;
  }
}
<div class="container">
  <img class="core core1" src="https://drive.google.com/uc?id=1mPcXOui7mzn4N60ZcFzmb1wFTTX_CcG9" alt="Core 1">
  <img class="core core2" src="https://drive.google.com/uc?id=1_0TthVwoC9xjU7aYw3fn5dNjidqmVwrM" alt="Core 2">
  <img class="core core3" src="https://drive.google.com/uc?id=13hP0VO5kaEw5VkBiT2jhGG3upg78zum1" alt="Core 3">
  <div class="title">
    <img src="https://drive.google.com/uc?id=1fXAwjJmIGRbKzAlKGGUmCFwAUYZnXtwx" alt="Title Image">
  </div>
</div>

I attempted to add a gradient overlay using `background: linear-gradient(8c04fe, transparent)` and other methods, but it didn't show up over the rings.

Answer №1

Perhaps this isn't exactly what you had in mind, but it could serve as a starting point for your project. Your images seem to lack transparency, causing the gradient to appear behind them.

body {
  margin: 0;
  padding: 0;
height:100vh;
  font-size: 16px;
}

.container {
  background-color: #D0D0D0;
  display: grid;
  place-items: center;
    min-height: 100vh;
}

.images-container {
  grid-column: 1;
  grid-row: 1;
  background: linear-gradient(#8c04fe, transparent);
  border-radius: 50%;
  width: 25vw;
}

.title {
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
  border: solid 1px red;
}

.core-container {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  justify-items: center;
  align-items: center;
  aspect-ratio: 1 / 1;
 padding: 0.25em;
}

img.core { 
  grid-column: 1;
  grid-row: 1;
}


/* Different sizes for Core 1, Core 2, and Core 3 */

img.core.core1 {
  width: 96%;
}

img.core.core2 {
  width: 64%;
}

img.core.core3 {
  width: 32%;
}

@media (max-width: 768px) {
  .title img {
    max-width: 100vw;
  }
  .core-container {
    max-height: 50%;
  }
}

.core {
  animation: spin 4s linear infinite;
}

.core.core2 {
  animation: spinleft 4s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinleft {
  100% {
    transform: rotate(-360deg);
  }
}
<div class="container">
  <div class="images-container">
    <div class="core-container">
      <img class="core core1" src="https://drive.google.com/uc?id=1mPcXOui7mzn4N60ZcFzmb1wFTTX_CcG9">
      <img class="core core2" src="https://drive.google.com/uc?id=1_0TthVwoC9xjU7aYw3fn5dNjidqmVwrM">
      <img class="core core3" src="https://drive.google.com/uc?id=13hP0VO5kaEw5VkBiT2jhGG3upg78zum1">
    </div>
  </div>
  <div class="title">
    <img src="https://drive.google.com/uc?id=1fXAwjJmIGRbKzAlKGGUmCFwAUYZnXtwx" alt="Title Image">
  </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the solution to removing the bottom margin from the jumbotron in the bootstrap framework?

I am building a website for my high school robotics team and I am new to HTML and CSS (bootstrap). I want to get rid of the gap between my banner and navbar on my site. Is there a way to remove that space? Check out our website: www.robotichive3774.com & ...

Background color of a scrolling overflow-x panel-primary in Bootstrap

Seeking help with a CSS issue related to a Bootstrap panel. When the overflow-x property is activated, the blue background color of the panel-heading transitions to white instead of staying blue. Any suggestions on how to maintain the blue color while keep ...

Is there a way to convert various elements sharing the same class into a list of array items?

Essentially, I am dealing with multiple elements sharing the same class name. My goal is to retrieve an array of integers from an API and then iterate through each element with this class name, replacing them with elements from the array sequentially. For ...

Tips on effectively utilizing CSS sprites without a border on images

I am currently working on optimizing my website by using sprite images. The image I am using is in png format and looks like this: https://i.sstatic.net/pFhPq.png Here is a snippet of my CSS code: .bg-upperbar_1 { width: 55px; height: 55px; bac ...

Adding constantly changing information into unchanging HTML

My goal is to dynamically insert content from a Database into a static HTML file. I have successfully achieved this on the client side using JavaScript. Specifically, I need to retrieve values from the Database and place them in designated fields within t ...

Use ajax to dynamically update the contents of a textbox

As a newbie programmer, I recently created my own JavaScript update function for my program. However, the code is not updating as expected. Can someone please help me troubleshoot and get it working properly? What I want to achieve is that when I change t ...

Hiding an HTML image element by setting its display to none will prevent it from being visible if later changed to block display

I am currently developing a web-based game that can be played on both desktop computers and mobile devices. However, for the optimal experience on mobile devices, players need to rotate their device to landscape mode. To prompt users to rotate their devic ...

Arranging cards in a row using HTML or CSS for a dynamic reveal effect

Could someone assist me with my HTML code? I am struggling to figure out why my two cards are not displaying side by side on my webpage. I would also like them to be able to resize based on the size of the page. In the past, I was able to achieve this wi ...

Issues arise when dealing with the CSS division layout in Internet Explorer 7

Currently in the process of developing a new website and encountering issues with IE7. The first image showcases how it should appear, while the second image depicts how IE7 actually renders it (utilizing IETester to assess older IE versions). The primary ...

Bring to life a dashed slanted line

After incorporating the code from this post on Stack Overflow about animating diagonal lines, I was pleasantly surprised with how well it worked. However, my next goal is to style the line in such a way that it appears dotted or dashed, as opposed to one ...

What steps should I take to adjust the price when multiple items are chosen?

I am working on a school project that requires JavaScript programming assistance. You can view the code here: https://jsfiddle.net/zvov1jpr/3/ HTML: <script src="java.js"></script> <div id="formular"> <div id=&qu ...

Why should one incorporate semantic markup into their HTML documents?

During my studies, I learned that tags provide a definition to content in HTML. For example: <section>It's a section</section> <article>It's an article</article> By correctly using semantic markup in my HTML, the documen ...

Comparison between WAMP and Live server integration with Facebook for connecting applications

I've been facing some challenges while integrating my website with Facebook Connect. I have been following the instructions provided in this guide. When attempting to run the following code from localhost, please note that for security reasons, my ap ...

creating nested columns within a parent column using flexbox techniques

Struggling with column height issues in Bootstrap 3? Consider using flexboxes for a simpler solution. Check out the design image I created using Bootstrap 3: https://i.sstatic.net/PVCKm.png Can this design be replicated with flexboxes? I have successfull ...

vue-router: A guide to disabling the outline property of the CSS in router-link

I am having trouble disabling the outline of a css link element. I successfully disabled the outline of a regular link using a css class, but I am unable to do so with the <router-link> element. How can I disable the outline for this? .page-link, .p ...

Assigning numerical ratings to a web-based questionnaire in HTML

In my questionnaire, I have radio buttons and checkboxes that need to be graded. The format of the input elements looks like this: <input type="radio" name="1" value="Yes" onclick="document.getElementById('pls').setAttribute('requi ...

jquery allows you to toggle the visibility of content

There are two divs with a button positioned above them. Initially, only one div, the catalogusOrderBox, is visible. When the button named manualButton is clicked, it should display the manualOrderBox div while hiding the catalogusOrderBox div. The text on ...

Update the div on the current page using externally retrieved information

Once again, I find myself stuck on a problem. Allow me to explain. Within this div, I have retrieved data using HTML SIMPLE DOM from another site. Like so: <div id="data">.....</div> Currently, the data refreshes whenever the user reloads th ...

How to use jQuery to disable td and ul elements

Has anyone successfully disabled a "td" or "ul" element using jQuery, similar to how we disable textboxes and other input types? I attempted to use the "prop" and "attr" functions in jQuery, but they did not seem to work. Is there a way to achieve this? ...

Issue with locating an item in a dropdown menu while using Selenium

I am currently attempting to locate an element within a dropdown list in my Selenium test. Despite identifying the xpath using Firebug, the Selenium code is unable to find it. My goal is to pinpoint option value number 2 in the following html snippet: < ...