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

Add spinning logo on loading #117

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Add spinning logo on loading #117

merged 1 commit into from
Nov 22, 2024

Conversation

pburkholder
Copy link
Contributor

@pburkholder pburkholder commented Nov 22, 2024

Changes proposed in this pull request:

  • Adds a spinning GIF logo

Things to check

  • For any logging statements, is there any chance that they could be logging sensitive data?
    N/A
  • Are log statements using a logging library with a logging level set? Setting a logging level means that log statements "below" that level will not be written to the output. For example, if the logging level is set to INFO and debugging statements are written with log.debug or similar, then they won't be written to the otput, which can prevent unintentional leaks of sensitive data.
    N/A

Security considerations

None. Adds a logo

@pburkholder pburkholder requested a review from a team as a code owner November 22, 2024 22:08
@pburkholder
Copy link
Contributor Author

Here's the gist of the generation script:

# Input and output files
input="input.gif"
output="spinning.gif"

# Number of frames for one full rotation
frames=19

# Temporary directory for frames
mkdir -p frames

# Generate each frame
for i in $(seq 0 $((frames - 1))); do
  # Calculate the angle of rotation (0 to 360 degrees)
  angle=$((i * 180 / frames))

  # Calculate horizontal scaling factor to simulate perspective
  scale=$(echo "abs(c($angle * 3.14159 / 180))" | bc -l )
  scale_percent=$( echo "100 * $scale" | bc )
  echo resize $scale_percent%x100% 

  # Scale the image horizontally (mimics the 3D spin effect)
  convert "$input" \
    -resize $scale_percent%x100% \
    -gravity center \
    -background "#f0f2f4" \
    -extent 109x144 \
    frames/frame-$(printf "%02d" $i).gif
done

# Combine the frames into an animated GIF
convert -delay 15 -loop 0 frames/frame-*.gif "$output"

With some help from AIs out there.

@pburkholder pburkholder merged commit 05f98e2 into main Nov 22, 2024
2 checks passed
@pburkholder pburkholder deleted the peterb/spin-logo branch November 22, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants