Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
Webinar-14
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulpybaev Ilyas
Webinar-14
Commits
56fdfef7
Commit
56fdfef7
authored
Sep 13, 2023
by
Kulpybaev Ilyas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Дз-26 задание 5
parent
f7129fcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
circles.html
circles.html
+13
-0
circle.js
js/circle.js
+26
-0
No files found.
circles.html
0 → 100644
View file @
56fdfef7
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<script
src=
"js/jQuery.js"
></script>
<title>
Document
</title>
</head>
<body>
<script
src=
"js/circle.js"
></script>
</body>
</html>
\ No newline at end of file
js/circle.js
0 → 100644
View file @
56fdfef7
const
getRandomNum
=
(
min
,
max
)
=>
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
+
1
)
+
min
);
const
getPosition
=
(
min
,
max
)
=>
{
console
.
log
(
min
,
max
);
return
getRandomNum
(
min
,
max
);
}
const
drawCircles
=
(
count
)
=>
{
for
(
let
i
=
0
;
i
<
count
;
i
++
){
let
element
=
document
.
createElement
(
'div'
);
let
size
=
getRandomNum
(
50
,
200
);
let
color
=
`rgba(
${
getRandomNum
(
1
,
255
)}
,
${
getRandomNum
(
1
,
255
)}
,
${
getRandomNum
(
1
,
255
)}
, 0.8)`
element
.
style
.
width
=
size
+
'px'
;
element
.
style
.
height
=
size
+
'px'
;
element
.
style
.
position
=
'absolute'
;
element
.
style
.
borderRadius
=
'50%'
;
element
.
style
.
backgroundColor
=
color
;
element
.
style
.
left
=
getPosition
(
0
,
window
.
innerWidth
-
size
)
+
'px'
;
element
.
style
.
top
=
getPosition
(
0
,
window
.
innerHeight
-
size
)
+
'px'
;
document
.
body
.
appendChild
(
element
);
}
};
let
counter
=
prompt
(
'Enter a count'
);
drawCircles
(
parseInt
(
counter
));
\ 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