html and js not working the same with flask

i have a folder which contains server.py a templates folder with index.html and a js folder with script.js
server.py:

from flask import Flask, render_template
import random

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('index.html')

if __name__ == '__main__':
    app.run()

index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sparkle Trail and Dust Cursor</title>
</head>
<body>
    <h1>Sparkle Trail and Dust Cursor</h1>
    <script src="{{ url_for('static', filename='js/script.js') }}"></script>
</body>
</html>

script.js can be found here: https://codepen.io/sarahwfox/pen/pNrYGb its too long probably but yeah im trying to have this effect but it either doesnt show anything or it shows the trail following the cursor but not the + sparkles