Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed spinner issue #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ <h2>Settings</h2>
</footer>
</article>
<div hidden id="spinner" class="spinner">
<svg viewBox="25 25 50 50">
<!-- <svg viewBox="25 25 50 50">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committing commented up code isn't a best practise

<circle cx="50" cy="50" r="20"></circle>
</svg>
</svg> -->
</div>
</body>
</html>
23 changes: 12 additions & 11 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,18 @@ body {
}

.spinner {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Names in my code may not be clear, but as you can see this spinner class was rather an overlay, it was like this for a reason. Without blocking the whole screen, the user can now, changing settings while the image loads, which can cause major lags.
The svg tag was used for the actual spinner.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Thanks for pointing out my mistakes, I am working to remedy them.

The old spinner was alternating arc size while spinning. The entire bug in #4 was related to that arc-changing animation that doesn't work not rotating itself.

Also, I am not able to understand what you mean by alternating arc size. Do you mean changing the arc size while rotating?

Copy link
Owner

@KonradLinkowski KonradLinkowski Oct 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the comparison, the same size, the same place on the screen

original yours
good bad

As you can see yours is moved slightly and doesn't work like the old one
To achieve centered element using your method it's required to use transform: translate(-50%, -50%) because top and left don't count for element's width and height.

z-index: 1000;
background-color: #0006;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;

display: flex;
justify-content: center;
align-items: center;
position:absolute;
bottom: 45%;
left:45%;

border: 10px solid rgba(243, 243, 243, 0.05);
border-radius: 50%;
border-top: 10px solid #d65a31;
border-right: 10px solid #d65a31;
border-bottom: 10px solid #d65a31;
width: 100px;
height: 100px;
animation: rotate 2s linear infinite;
}

.spinner svg {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You left unused code :/

Expand Down