olyphiri / index.html

re-attempt
1 stars 0 forks source link

peter #1

Open olyphiri opened 1 year ago

olyphiri commented 1 year ago

https://github.com/olyphiri/olyphiri/assets/120086721/b0380346-e19f-4bd6-b7bd-4869dbe89514

olyphiri commented 1 year ago

python import matplotlib.pyplot as plt import matplotlib.animation as animation

Define the frames of the animation

frames = [ 'coder_black.png', 'coder_white.png', ] # Replace with your own image filenames

Define the cybersecurity text to be displayed

cyber_security_text = [ 'Cybersecurity is important to protect sensitive information.', 'Securing computer networks and systems is crucial.', 'Use strong passwords and keep your software up to date.', 'Be cautious of phishing emails and suspicious links.', 'Encrypt your data and use reputable antivirus software.', ] # Add more text lines as needed

Create the figure and axes for the animation

fig, ax = plt.subplots()

Hide the axes and set the background color to black

ax.axis('off') fig.patch.set_facecolor('black')

Create the initial text object

text = ax.text( 0.5, 0.5, '', fontsize=16, color='white', ha='center', va='center', transform=ax.transAxes )

Function to update the animation frame

def update_frame(frame):

Set the image as the background

img = plt.imread(frames[frame])
ax.imshow(img)

# Set the cybersecurity text for the frame
text.set_text(cyber_security_text[frame])

Create the animation

ani = animation.FuncAnimation( fig, update_frame, frames=len(frames), interval=2000, repeat=True )

Display the animation

plt.show()