I was looking for help displaying a JavaScript file onto the front of my webpage. When connecting js file to html it doesn’t display the file onto the webpage. looking into inspect it shows that the canvas is there as well as testing to see if the js file is connected through console shows that it is connected. I don’t know how to fix this. here is the image that shows the canvas is on the webpage 
here is the code for the js file :
var canvas = document.createElement('canvas');
var c = canvas.getContext('2d');
const numStars = 500;
let stars = [];
function setup() {
createCanvas(500,500);
stroke(255);
strokeWeight(2);
for(let i = 0; i < numStars; i ++) {
stars.push(new Star(random(width), random(height)));
}
}
function draw() {
background(0, 50);
const acc = map(mouseX, 0, width, 0.005, 0.2);
stars = stars.filter(star => {
star.draw();
star.update(acc);
return star.isActive();
});
while(stars.length < numStars) {
stars.push(new Star(random(width), random(height)));
}
}
class Star {
constructor(x, y) {
this.pos = createVector(x, y);
this.prevPos = createVector(x, y);
this.vel = createVector(0, 0);
this.ang = atan2(y - (height/2), x - (width/2));
}
isActive() {
return onScreen(this.prevPos.x, this.prevPos.y);
}
update(acc) {
this.vel.x += cos(this.ang) * acc;
this.vel.y += sin(this.ang) * acc;
this.prevPos.x = this.pos.x;
this.prevPos.y = this.pos.y;
this.pos.x += this.vel.x;
this.pos.y += this.vel.y;
}
draw() {
const alpha = map(this.vel.mag(), 0, 3, 0, 255);
stroke(255, alpha);
line(this.pos.x, this.pos.y, this.prevPos.x, this.prevPos.y);
}
}
function onScreen(x, y) {
return x >= 0 && x <= width && y >= 0 && y <= height;
}
here is the code in my css file
@import url("https://fonts.googleapis.com/css2?family=DynaPuff:wght@600&family=Shadows+Into+Light&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "DynaPuff", cursive;
}
.canvas {
height: 100%;
width: 100%;
display: flex;
position: absolute;
}
body {
min-height: 25%;
background: linear-gradient(#868686, #000000);
}
.navbar-container {
display: flex;
}
.navbar {
max-width: 1560px;
padding: 20px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
margin: auto;
}
ul {
text-transform: uppercase;
font-weight: 600;
display: flex;
justify-content: center;
align-items: center;
}
ul li {
list-style: none;
margin-left: 20px;
}
ul li a {
text-decoration: none;
padding: 6px 15px;
color: #ffff;
border-radius: 20px;
transition: all 0.3s ease-in-out;
}
ul li a:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
ul li a:active{
box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
transition: all 0.3s ease-in-out
}
.jumping-letters { /* make the transformation smooth over 0.5 seconds */
animation: jump 1s infinite;
transition: all 0.3s ease-in-out; /* apply the jump animation */
}
@keyframes jump {
50% {
transform: translateY(-5px);
transition: all 0.3s ease-in-out /* move the letters up by 10 pixels */
}
}
.hello {
color: #ffff;
display: grid;
margin: 0;
padding: 100px;
place-items: center;
min-height: 100vh;
width: 100%;
text-align: center;
}
.text {
flex: auto;
color: white;
white-space: nowarp;
font-size: 5vw;
font-size: 1em;
z-index: 5;
}
.projects {
position: relative;
color: #000000;
}
.education {
position: relative;
color: #000000;
}
.aboutme {
position: relative;
color: #000000;
}
.resume {
position: relative;
color: #000000;
}
.body-container1 {
background-color: #fff;
align-items: center;
border-radius: 6px;
box-sizing: content-box;
margin: 0px auto;
max-width: 75vw;
padding: 15px;
width: 100%;
}
.body-container1 {
background-color: #fff;
align-items: center;
border-radius: 6px;
box-sizing: content-box;
margin: 0px auto;
max-width: 75vw;
padding: 15px;
width: 100%;
}
.body-container2 {
background-color: #fff;
align-items: center;
border-radius: 6px;
box-sizing: content-box;
margin: 0px auto;
max-width: 75vw;
padding: 15px;
width: 100%;
}
.body-container3 {
background-color: #fff;
align-items: center;
border-radius: 6px;
box-sizing: content-box;
margin: 0px auto;
max-width: 75vw;
padding: 15px;
width: 100%;
}
.body-container4 {
background-color: #fff;
align-items: center;
border-radius: 6px;
box-sizing: content-box;
margin: 0px auto;
max-width: 75vw;
padding: 15px;
width: 100%;
}
.sec {
padding-bottom: 50px;
border-radius: 6px;
}
here is the full code in 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>Mustafa Said</title>
<link rel="stylesheet" href="./style.css" />
</head>
<div>
# <canvas class="canvas">
# <script src="space.js"></script>
# </canvas>
<div class="container">
<div class="navbar-container">
<div class="navbar">
<ul class="jumping-letters">
<li><a href="#projects">Projects</a></li>
<li><a href="#education">Education</a></li>
<li><a href="#aboutme">About me</a></li>
<li><a href="#resume">Resume</a></li>
</ul>
</div>
</div>
<div class="container">
<div class="hello">
<div>
<p class="jumping-letters2">Hello, I'm</p>
<h1 class="jumping-letters2">Mustafa Said</h1>
<h3 class="jumping-letters2">but most call me moosee</h3>
</div>
</div>
</div>
</div>
<section id="projects" class="sec projects">
<div class="container">
<div class="body-container1">
<div class="column1">
<h2>Projects</h2>
<div class="desc">
<h3>The Illumihat - Python</h3>
<p>
The Illumihat is a wearable device designed to assist visually
impaired individuals with daily tasks. It uses radioactive and
photosynthetic sensors to detect the surrounding environment and
provide feedback to the user through various means, such as audio
output or haptic feedback. Using a bredboard and a Raspberry pi,
Python was used to implemented the code needed to run these
sensors.
</p>
<h3>Project Snowflake - JavaScript</h3>
<p></p>
<h3>Personal Portfolio - HTML, CSS</h3>
you're looking right at it :)
</div>
</div>
</div>
</div>
</section>
<section id="education" class="sec education">
<div class="container">
<div class="body-container2">
<div class="Education">
<h2>Education</h2>
<div class="desc">
<h3>
Computer Science Software Engineering - ASU (Arizona State
University)
</h3>
<p>
- Completed courses: CSE 205 (OBJECT-ORIENTED PROGRAM & DATA
STRUCTURES), CSE110 (PRINCIPLES OF PROGRAMMING), FSE 100
(INTRODUCTION TO ENGINEERING), MAT 266 (CALCULUS II), MAT 265
(CALCULUS I) - Currently enrolled courses: CSE 120 (DIGITAL DESIGN
FUNDAMENTALS), CSE 240 (INTRO TO PROGRAMMING LANGUAGES), MAT267
(CALCULUS III)
</p>
</div>
</div>
</div>
</div>
</section>
<section id="aboutme" class="sec aboutme">
<div class="container">
<div class="body-container3">
<div class="column1">
<h2>About Me</h2>
<div class="desc">
<p>
My name is Mustafa Said and i am a current sophmore at ASU
studying Computer Science under the Fulton Schools of Engineering.
</p>
</div>
</div>
</div>
</div>
</section>
<section id="resume" class="sec resume">
<div class="container">
<div class="body-container4">
<div class="column1">
<h2>Resume</h2>
<div class="desc">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quod
quaerat nemo, voluptate maiores minima corporis omnis, ratione
</p>
</div>
</div>
</div>
</div>
</section>
<footer></footer>
</div>
</html>