Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ferhat tamer
tanecik
Commits
ca44984b
Commit
ca44984b
authored
Sep 02, 2022
by
ferhat tamer
💬
Browse files
Initial commit
parents
Changes
4
Hide whitespace changes
Inline
Side-by-side
tanecik.css
0 → 100644
View file @
ca44984b
*
{
margin
:
0
;
padding
:
0
;
box-sizing
:
border-box
;
font-family
:
sans-serif
;
}
body
{
height
:
auto
;
width
:
auto
;
background
:
black
;
}
canvas
{
width
:
100%
;
height
:
100%
;
}
\ No newline at end of file
tanecik.html
0 → 100644
View file @
ca44984b
<!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>
Tanecik
</title>
<link
rel=
"stylesheet"
href=
"tanecik.css"
>
</head>
<body>
<canvas
id=
"canvas"
></canvas>
<script
src=
"tanecik.js"
></script>
</body>
</html>
\ No newline at end of file
tanecik.jpg
0 → 100644
View file @
ca44984b
794 KB
tanecik.js
0 → 100644
View file @
ca44984b
const
c
=
document
.
getElementById
(
"
canvas
"
);
const
ctx
=
c
.
getContext
(
"
2d
"
);
c
.
width
=
window
.
innerWidth
;
c
.
height
=
window
.
innerHeight
;
const
width
=
c
.
width
;
const
height
=
c
.
height
;
class
Partikul
{
constructor
(
x
,
y
,
r
){
this
.
x
=
x
;
this
.
y
=
y
;
this
.
r
=
r
;
}
ciz
()
{
ctx
.
fillStyle
=
"
white
"
;
ctx
.
beginPath
();
ctx
.
arc
(
this
.
x
,
this
.
y
,
this
.
r
,
0
,
Math
.
PI
*
2
);
ctx
.
closePath
();
ctx
.
fill
();
}
guncelle
()
{
this
.
x
+=
Math
.
random
()
*
2
+
1
;
this
.
y
+=
Math
.
random
()
*
2
+
1
;
}
}
function
animasyon
()
{
ctx
.
clearRect
(
0
,
0
,
width
,
height
);
tanecikler
.
forEach
(
p
=>
{
p
.
guncelle
();
p
.
ciz
();
})
requestAnimationFrame
(
animasyon
);
}
function
init
()
{
for
(
var
y
=
100
;
y
<
900
;
y
+=
50
){
//900
for
(
var
x
=
100
;
x
<
1600
;
x
+=
50
){
//1600
tanecikler
.
push
(
new
Partikul
(
x
,
y
,
2
));
}
}
animasyon
();
}
var
tanecikler
=
[];
init
();
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment