Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
a-doc-editor
Overview
Overview
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
Ramdayal Munda
a-doc-editor
Commits
3390b13d
Commit
3390b13d
authored
Dec 01, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sidebars display completed
parent
b84ed9a4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
9 deletions
+76
-9
a-doc-editor.css
dist/assets/a-doc-editor.css
+51
-3
a-doc-editor.js
dist/assets/a-doc-editor.js
+21
-6
index.html
dist/index.html
+4
-0
No files found.
dist/assets/a-doc-editor.css
View file @
3390b13d
.a-doc-editor
{
display
:
flex
;
flex-direction
:
column
;
height
:
5
9
0px
;
height
:
5
2
0px
;
}
.a-doc-editor
canvas
:focus-visible
{
/* outline: auto rgb(0, 68, 255, 50%); */
background
:
#fff
;
}
...
...
@@ -23,20 +24,45 @@
flex
:
1
;
position
:
relative
;
background-color
:
#ccc
;
overflow
:
hidden
;
transition
:
300ms
;
}
.a-doc-editor
.body
.left-sidebar
{
position
:
absolute
;
padding
:
8px
;
height
:
100%
;
width
:
17%
;
left
:
0
;
background-color
:
#be3737
;
background-color
:
#8a9a9b
;
border-radius
:
0
10px
10px
0
;
transition
:
300ms
;
}
.a-doc-editor
.body
.left-sidebar.hide
{
left
:
-16%
;
transition
:
300ms
;
}
.a-doc-editor
.body
.toggle-sidebar
{
cursor
:
pointer
;
display
:
flex
;
justify-content
:
space-between
;
}
.a-doc-editor
.body
.right-sidebar
{
position
:
absolute
;
height
:
100%
;
right
:
0
;
background-color
:
#8abe37
;
width
:
17%
;
background-color
:
#969b8a
;
border-radius
:
10px
0
0
10px
;
transition
:
300ms
;
}
.a-doc-editor
.body
.right-sidebar.hide
{
right
:
-14%
;
transition
:
300ms
;
}
.a-doc-editor
.body
.scrolling-area
{
...
...
@@ -59,3 +85,24 @@
.a-doc-editor
.body
.scrolling-area
canvas
.page
:first-child
{
margin-top
:
10px
;
}
.a-doc-editor
::-webkit-scrollbar
{
width
:
10px
;
/* Set the width of the scrollbar */
}
/* Thumb */
.a-doc-editor
::-webkit-scrollbar-thumb
{
background-color
:
#888
;
/* Set the color of the scrollbar thumb */
border-radius
:
5px
;
/* Set border radius */
}
/* Track */
.a-doc-editor
::-webkit-scrollbar-track
{
background-color
:
#f0f0f0
;
/* Set the color of the scrollbar track */
border-radius
:
5px
;
/* Set border radius */
}
\ No newline at end of file
dist/assets/a-doc-editor.js
View file @
3390b13d
...
...
@@ -76,22 +76,31 @@ var ADocEditor = function (customConfig) {
let
leftSidebarId
=
`left-sidebar-
${
new
Date
().
getTime
()}
`
let
rightSidebarId
=
`right-sidebar-
${
new
Date
().
getTime
()}
`
let
htmlSetup
=
/*html*/
`
<div class="a-doc-editor" id="
${
mainComponentId
}
">
<div class="a-doc-editor" id="
${
mainComponentId
}
">
<div class="header" id="
${
headerComponentId
}
">
<div
>Menu bar</div>
<div class="menu-bar"
>Menu bar</div>
<div>Formating tools</div>
<div>Page tools</div>
</div>
<div class="body">
<div class="scrolling-area" id="
${
scrollingAreaId
}
">
<div class="scrolling-area" id="
${
scrollingAreaId
}
"></div>
<div class="left-sidebar hide" id="
${
leftSidebarId
}
">
<div class="toggle-sidebar">
<span>Summary</span>
<span>X</span>
</div>
</div>
<div class="right-sidebar hide" id="
${
rightSidebarId
}
">
<div class="toggle-sidebar">
<span>X</span>
<span>Comments</span>
</div>
</div>
<div class="left-sidebar" id="
${
leftSidebarId
}
">Left</div>
<div class="right-sidebar" id="
${
rightSidebarId
}
">Right</div>
</div>
<div class="footer" id="
${
footerComponentId
}
">
<div>Footer Data</div>
</div>
</div>
</div>
`
container
.
innerHTML
=
htmlSetup
mainComponent
=
document
.
getElementById
(
mainComponentId
)
...
...
@@ -100,6 +109,12 @@ var ADocEditor = function (customConfig) {
footerComponent
=
document
.
getElementById
(
footerComponentId
)
leftSidebar
=
document
.
getElementById
(
leftSidebarId
)
rightSidebar
=
document
.
getElementById
(
rightSidebarId
)
mainComponent
.
getElementsByClassName
(
'toggle-sidebar'
)[
0
].
addEventListener
(
'click'
,(
e
)
=>
{
leftSidebar
.
classList
.
toggle
(
'hide'
)
})
mainComponent
.
getElementsByClassName
(
'toggle-sidebar'
)[
1
].
addEventListener
(
'click'
,(
e
)
=>
{
rightSidebar
.
classList
.
toggle
(
'hide'
)
})
...
...
dist/index.html
View file @
3390b13d
...
...
@@ -11,9 +11,13 @@
body
{
background
:
#aaa
;
}
#user-container-for-editor
{
margin
:
20px
;
}
</style>
</head>
<body>
<div
class=
"body"
></div>
<p>
Click on the canvas and start typing
</p>
<div
id=
"user-container-for-editor"
></div>
...
...
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