Recently, I encountered a problem while developing a web application using HTML, CSS, and JS in PyCharm. The issue is with the upload button that should trigger the uploading of source code. Despite being new to this, I have been unable to find a solution.
When you click or hold down the "Upload" button, it displays an unexpected visual glitch where it turns blue. Although holding it down is not necessary, even a brief click results in this blue color appearing.
View the upload button gif here
Below is the CSS code I am currently using:
.btn-primary {
background-color: #fc3e00;
border: none;
border-radius: 5px;
transition: background-color 0.3s ease, transform 0.2s ease;
color: white;
appearance: none;
}
.btn-primary:hover {
background-color: #b80c09;
}
.btn-primary:focus {
outline: none !important;
box-shadow: none !important;
background-color: #b80c09;
}
.btn-primary:active {
background-color: #b80c09;
transform: scale(0.95);
box-shadow: none !important;
}
And here is the HTML code snippet:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap Link -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<!-- CSS Link -->
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<!-- Font Link -->
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:100,100i,300,300i,400,400i,500,500i,700,700i"
rel="stylesheet"/>
<!-- Project Name -->
<title>Viewie - Source Code Visualizer</title>
</head>
<body>
<div class="container">
<h1 class="text-center mt-4">Welcome to Viewie: A Code Source Visualizer!</h1>
<h2 class="text-center mt-4">Input your Python, Javascript, or Java Code :D</h2>
<form id="codeForm" class="mt-4">
<div class="form-group">
<textarea class="form-control" id="code" rows="10" placeholder="Please upload your source code :)"></textarea>
</div>
<button type="submit" class="btn btn-primary">Upload</button>
</form>
<div id="output" class="mt-4"></div>
<div id="umlDisplay" class="mt-4"></div>
</div>
<script src="{{ url_for('static', filename='script.js') }}"></script>
</body>
</html>
I attempted setting the outline to none and adjusting the box-shadow as a fix, but so far, it has not resolved the issue. While searching for solutions, I found similar suggestions for mobile devices, but nothing specific for non-mobile platforms, unless I have overlooked something. Additionally, I have refreshed the page and tried accessing the application on a different browser like Firefox without any change in behavior.