Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drawing-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
drawing-app
Commits
b2df1883
Commit
b2df1883
authored
5 years ago
by
Giovanni Caruso
Browse files
Options
Downloads
Patches
Plain Diff
Implement palette
parent
0545fde4
No related branches found
No related tags found
1 merge request
!38
Colouredlines
Pipeline
#102303
passed
5 years ago
Stage: fetch
Stage: deps
Stage: check
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
public/index.html
+78
-2
78 additions, 2 deletions
public/index.html
public/styles.css
+27
-13
27 additions, 13 deletions
public/styles.css
src/app.js
+4
-0
4 additions, 0 deletions
src/app.js
src/elements.js
+2
-0
2 additions, 0 deletions
src/elements.js
with
111 additions
and
15 deletions
public/index.html
+
78
−
2
View file @
b2df1883
...
@@ -68,11 +68,87 @@
...
@@ -68,11 +68,87 @@
<h2>
Pen properties
</h2>
<h2>
Pen properties
</h2>
</div>
</div>
<div
class=
"pen-body"
>
<div
class=
"pen-body"
>
<h3>
Brush colour
</h3>
<div
id=
"brush-colour"
>
<div
class=
"rectangle"
></div>
<h3>
Brush colour
</h3>
</div>
<div
id=
"rectangle"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"palette"
class=
"properties"
>
<div
class=
"palette-selector"
>
<svg
id=
"wheel"
viewBox=
"0 0 100 100"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<defs>
<path
id=
"piePiece"
d=
"M 42.2,78.9 46.1,64.4 Q 50,65 53.88,64.48 L 57.7,78.9 Q 50,80 42.2,78.9Z"
/>
</defs>
<use
xlink:href=
"#piePiece"
fill=
"#2D8633"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(30,50,50)"
fill=
"#43a1cd"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(60,50,50)"
fill=
"#639b47"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(90,50,50)"
fill=
"#9ac147"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(120,50,50)"
fill=
"#e1e23b"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(150,50,50)"
fill=
"#f7941e"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(180,50,50)"
fill=
"#ba3e2e"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(210,50,50)"
fill=
"#9a1d34"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(240,50,50)"
fill=
"#662a6c"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(270,50,50)"
fill=
"#272b66"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(300,50,50)"
fill=
"#2d559f"
/>
<use
xlink:href=
"#piePiece"
transform=
"rotate(330,50,50)"
fill=
"#A9AA39"
/>
</svg>
</div>
</div>
<button
id=
"eraser-tool"
><i
class=
"fa fa-eraser"
></i></button>
<button
id=
"eraser-tool"
><i
class=
"fa fa-eraser"
></i></button>
<div
id=
"connected-room-info"
>
<div
id=
"connected-room-info"
>
You are connected to a room:
<span
id=
"connected-room-id"
></span>
You are connected to a room:
<span
id=
"connected-room-id"
></span>
...
...
This diff is collapsed.
Click to expand it.
public/styles.css
+
27
−
13
View file @
b2df1883
...
@@ -160,17 +160,17 @@ button.selected {
...
@@ -160,17 +160,17 @@ button.selected {
}
}
.properties
{
.properties
{
display
:
none
;
/* Hidden by default */
display
:
none
;
position
:
fixed
;
/* Stay in place */
position
:
fixed
;
z-index
:
1
;
/* Sit on top */
z-index
:
1
;
padding-top
:
100px
;
padding-top
:
100px
;
left
:
0
;
left
:
0
;
top
:
0
;
top
:
0
;
width
:
100%
;
/* Full width */
width
:
100%
;
height
:
100%
;
/* Full height */
height
:
100%
;
overflow
:
auto
;
/* Enable scroll if needed */
overflow
:
auto
;
background-color
:
rgb
(
0
,
0
,
0
);
/* Fallback color */
background-color
:
rgb
(
0
,
0
,
0
);
background-color
:
rgba
(
0
,
0
,
0
,
0.4
);
/* Black w/ opacity */
background-color
:
rgba
(
0
,
0
,
0
,
0.4
);
}
}
.pen-contents
{
.pen-contents
{
...
@@ -202,12 +202,14 @@ button.selected {
...
@@ -202,12 +202,14 @@ button.selected {
.pen-header
{
.pen-header
{
padding
:
2px
16px
;
padding
:
2px
16px
;
background-color
:
#
5cb85c
;
background-color
:
#
2f2f2f
;
color
:
white
;
color
:
white
;
}
}
.pen-body
{
.pen-body
{
padding
:
2px
16px
;
padding
:
2px
16px
;
display
:
flex
;
align-items
:
center
;
}
}
@keyframes
animatetop
{
@keyframes
animatetop
{
...
@@ -221,8 +223,20 @@ button.selected {
...
@@ -221,8 +223,20 @@ button.selected {
}
}
}
}
.rectangle
{
#rectangle
{
height
:
50px
;
height
:
20px
;
width
:
100px
;
width
:
30px
;
background-color
:
#555
;
background-color
:
blue
;
}
.palette-selector
{
position
:
relative
;
background-color
:
#fefefe
;
margin
:
auto
;
padding
:
0
;
border
:
1px
solid
#888
;
width
:
500px
;
height
:
500px
;
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
6px
20px
0
rgba
(
0
,
0
,
0
,
0.1
);
font-family
:
"Martel"
,
serif
;
}
}
This diff is collapsed.
Click to expand it.
src/app.js
+
4
−
0
View file @
b2df1883
...
@@ -82,6 +82,10 @@ window.addEventListener("click", (event) => {
...
@@ -82,6 +82,10 @@ window.addEventListener("click", (event) => {
}
}
})
})
HTML
.
rectangle
.
addEventListener
(
"
click
"
,
()
=>
{
HTML
.
palette
.
style
.
display
=
"
block
"
})
HTML
.
eraserButton
.
addEventListener
(
"
click
"
,
()
=>
{
HTML
.
eraserButton
.
addEventListener
(
"
click
"
,
()
=>
{
currentTool
=
tools
.
ERASER
currentTool
=
tools
.
ERASER
HTML
.
penButton
.
classList
.
remove
(
"
selected
"
)
HTML
.
penButton
.
classList
.
remove
(
"
selected
"
)
...
...
This diff is collapsed.
Click to expand it.
src/elements.js
+
2
−
0
View file @
b2df1883
...
@@ -17,3 +17,5 @@ export const connectedRoomInfoContainer = document.getElementById(
...
@@ -17,3 +17,5 @@ export const connectedRoomInfoContainer = document.getElementById(
export
const
properties
=
document
.
getElementById
(
"
pen-properties
"
)
export
const
properties
=
document
.
getElementById
(
"
pen-properties
"
)
export
const
span
=
document
.
getElementsByClassName
(
"
close
"
)[
0
]
export
const
span
=
document
.
getElementsByClassName
(
"
close
"
)[
0
]
export
const
palette
=
document
.
getElementById
(
"
palette
"
)
export
const
rectangle
=
document
.
getElementById
(
"
rectangle
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment