Is there a way to get rid of this awful hover effect on this button?

My friend and I have been developing a Chrome extension for the Roblox Devforum with some initial success. We started working on it yesterday, and already have our button placed in the header similar to extensions like Roblox+ or RoPro.

However, we encountered an issue with the button when hovering over it. A white square appears on the button icon, making it look unappealing. Despite researching various articles on Google, we couldn't identify the cause of this problem, which is why we are reaching out here today. The code for the extension is as follows:

modifications.js:

function getFirstulWithClass(cssClass) {
    var elements = document.getElementsByTagName('ul');
    for (var i = 0; i < elements.length; i++) {
        if((' ' + elements[i].className + ' ').indexOf(' ' + cssClass + ' ') > -1) {
            return elements[i];
        }
    }
}

var ul = getFirstulWithClass('icons d-header-icons'); 
if (ul) {
    ul.innerHTML += `
        <li class="header-dropdown-toggle dpp-dropdown">
          <a title="DPPSettings" class="icon">
            <div>
              <img src="https://i.imgur.com/suZBJ8y.png" width="45" height="29" title="DSI" class="DSI">
            </div>
          </a>
        </li>
    `
}

To explain this code, it simply locates the header element and injects the HTML code snippet into it without replacing the original Devforum header code.

We wanted to add an animation to the button to make it visually appealing, so we created a new file called modifications.css, which contains the following:


@keyframes settingsHover {
  0% {
    width: 45px;
    height: 29px;
  }
  100% {
    width: 48px;
    height: 31px;
  }
}

.DSI:hover {
  animation-name: settingsHover;
  animation-fill-mode: forwards;
  animation-duration: .01s;
}

This code adds a subtle enlargement animation to the button on hover.

We then integrated everything in our manifest.json file as shown below:


 "content_scripts": [
    {
      "matches": ["https://*.devforum.roblox.com/*"], 
      "css": ["modifications.css"],
      "js": ["modifications.js"]
    }
  ],

However, this integration resulted in a strange box being added unintentionally, as illustrated in the image below:

https://i.sstatic.net/IkgGN.png

How can we resolve this issue?

Answer №1

Essentially, the solution involved adding the following code snippet to the CSS file:

.icon {
  --primary-low: transparent !important;
}

Answer №2

Although I don't claim to be an expert in this field, it seems that the white square could potentially serve as a keyframe. Its dimensions match the specifications provided, and it's possible that a simple CSS adjustment could resolve the visual error. While it may be related to Roblox or CSS, my limited understanding of the situation prevents me from providing a definitive answer.

It's worth considering the possibility that the white square represents an HTML/CSS class on the Roblox website, which might inadvertently be causing the issue. Please acknowledge that my thoughts are based on speculation and should be taken with caution.

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

Corrupted PDF file after attempting to download through AJAX

Currently, my method involves making an API call (using cURL on the server-side) to fetch an XML file. Inside this XML file is a base64 encoded PDF, which I then extract and save on the server for future downloading. The process goes like this: <?php ...

Retrieve the 'current' scope using a 'master' controller

I have a main controller that I refer to as my 'root' controller, which is declared using the ng-controller attribute. Additionally, I have a few other controllers that are created dynamically through a $routeProvider. I want to define a function ...

Encountering an issue while setting up the ContextAPI in nextJS, where properties of undefined Provider cannot be read

I'm encountering difficulties in implementing ContextAPI with a nextjs application. The error message I keep receiving is: TypeError: Cannot read properties of undefined (reading 'Provider') This is my approach to creating the context: impo ...

Utilizing the mobile navigation layout for desktop screens without the need to adjust breakpoints

Having created a responsive site with common breakpoints established in SCSS as mixins, I am now seeking to implement the mobile breakpoint for a single page on desktop view only. Initially, my plan was to create a 'forced-mobile' class by exten ...

What is the best way to format a date input field so that when a user enters a year (yyyy), a hyphen (-

Need help with date formatting in the format yyyy-mm-dd. Seeking a way to prompt user input for the year and automatically append "-" to the date as needed. Also utilizing a datepicker tool for selecting dates. ...

In Node.js, I encountered an issue where req.body was returning as undefined, despite the fact that when I logged req, I could

I am having trouble logging the req.body to the console in my Twilio text app. When I try console.log(req), the body and its contents show up, but it says that the body is undefined when I try to log it on its own. Any help would be greatly appreciated. ...

"Angularjs feature where a select option is left blank as a placeholder, pointing users

Currently, I am working with AngularJS (version < 1.4). When using ng-repeat in select-option, I encounter an extra blank option which is typical in AngularJS. However, selecting this blank option automatically picks the next available option. In my sce ...

Angular JS's flawed accuracy in subtracting two decimal numbers

Within my AngularJS application, there exists an object containing three distinct amounts. When examining the Chrome browser debugger, I encountered the following information: The calculation for payment.amountForClosing is derived from subtracting paymen ...

"Centering an Image in ASP.NET HyperLink Control: A Step-by-Step

Here is the setup for my control: <asp:HyperLink CssClass="link-image" ID="Link1" runat="server"/> Code-behind in C#: Link1.ImageUrl = "imagePath"; Resulting HTML code: <a class="link-image" id="MainContent_Link1"> <img alt="" src=" ...

"Emphasize menu items with an underline as you navigate through the

I am using Gatsby with React and have a navigation menu with links. I would like to make it so that when a link is clicked, a border bottom appears to indicate the current page, rather than only on hover. <ul className="men" id="menu"> ...

Leveraging the filter functionality within an AngularJS table

I'm currently developing a web application using AngularJS with MVC. I am trying to implement data filtering within my table, but encountering an error during debugging. Here is the specific error message: link to error description Error: $rootSco ...

How to toggle the visibility of a search bar in ReactJS?

I am trying to implement a simple search bar in reactjs without a dedicated close button. I want the same button to toggle between opening and closing the search bar. Below is the code snippet I have experimented with, but unfortunately, it's not fun ...

Using Ajax to send data from a parent JSP to a child JSP and then refresh the page

Can anyone assist me in resolving my issue? I'm attempting to incorporate an existing JSP partial (child) into another JSP page (parent). These pages are controlled by Java Controller classes in a Weblogic 12c environment using Spring. The child JSP i ...

Using jQuery and HTML to create numerous links that direct to a solitary iframe

I created a basic overlay setup using css, html, and jQuery. Here's how it looks: <a class="activator" id="activator" style="" href="#">hello</a> <div class="overlay" id="overlay" style="display:none;"></div> <div style="d ...

Creating Consistent Button Padding in Material UI

I am working with a series of Material UI buttons that are defined as follows: <Button className={classes.button}>Edit</Button> <Button className={classes.button}>Duplicate</Button> <hr /> <Button c ...

Effective ways to manage text/javascript API outputs in Delphi (as application/json)

Whenever I send a request to the iTunes search API, the data returned is formatted as JSON, but the response's content-type is text/javascript instead of application/json. :https://i.sstatic.net/0xGQC.jpg (the green one is from an API that is expect ...

Angular is encountering an issue where double braces are not being evaluated and are instead being passed through

I'm working on an angular project and have the following code snippet: <div vh-accordion-group id="{{$index}}" panel-class="panel-info"> <div vh-accordion-header> </div> <div vh-accordion-body> </div> </div> ...

Launching the server with a custom path in Nuxt.js: Step-by-step guide

My Nuxt.js application has several nested routes. . ├── index │   ├── _choice │   │   ├── city │   │   │   ├── index.vue │   │   │   ├── _zipCode │   │   │   │   ├── i ...

Obtain the file path relative to the project directory from a Typescript module that has been compiled to JavaScript

My directory structure is as follows: - project |- build |- src |- index.ts |- file.txt The typescript code is compiled to the build directory and executed from there. I am seeking a dependable method to access file.txt from the compiled module without ...

Encounter an issue while using CreateAsyncThunk due to a 400 Bad Request

I have encountered an issue with my asynchronous thunk. Even when the status code is 400, the request result remains fulfilled. How can I handle a 400 error using createAsyncThunk and the fetch API? This is the action code: import { createSlice, creat ...