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
7065804e
Commit
7065804e
authored
Feb 14, 2024
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selection fixes, caret fixes, heading fixes, arrow keys fixes, backspace fixes
parent
f5d9a42e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
51 deletions
+76
-51
a-doc-editor.css
dist/assets/a-doc-editor.css
+49
-19
a-doc-editor.js
dist/assets/a-doc-editor.js
+0
-0
script.js
dist/script.js
+27
-32
No files found.
dist/assets/a-doc-editor.css
View file @
7065804e
...
...
@@ -127,20 +127,21 @@ canvas:focus-visible {
width
:
200px
;
background-color
:
#408640
;
padding
:
5px
;
white-space
:
nowrap
;
/* Prevent text wrapping */
text-overflow
:
ellipsis
;
/* Add ellipsis ( ... ) */
white-space
:
nowrap
;
/* Prevent text wrapping */
text-overflow
:
ellipsis
;
/* Add ellipsis ( ... ) */
}
.content-area
.left-sidebar
,
.content-area
.page-list
,
.content-area
.right-sidebar
{
flex-shrink
:
0
;
height
:
100%
;
overflow-x
:
hidden
;
overflow-y
:
hidden
;
text-wrap
:
nowrap
;
transition
:
0.5s
;
margin-top
:
0
;
border-radius
:
0
10px
10px
0
;
}
.left-sidebar
.toggle-btn
,
...
...
@@ -150,6 +151,13 @@ canvas:focus-visible {
top
:
0
;
width
:
100%
;
text-align
:
center
;
font-size
:
25px
;
padding
:
0
;
margin
:
0
;
border
:
none
;
background
:
none
;
cursor
:
pointer
;
transition
:
400ms
;
}
.left-sidebar
.content
,
...
...
@@ -160,7 +168,7 @@ canvas:focus-visible {
.left-sidebar.hide
,
.right-sidebar.hide
{
width
:
5
0px
;
width
:
3
0px
;
}
.left-sidebar.hide
.content
,
...
...
@@ -172,37 +180,55 @@ canvas:focus-visible {
position
:
relative
;
display
:
block
;
overflow-y
:
auto
;
overflow-x
:
auto
;
background
:
#858585
;
gap
:
20px
;
align-items
:
center
;
overflow-x
:
hidden
;
}
.page-list
.page
{
background-color
:
#fff
;
width
:
fit-content
;
height
:
fit-content
;
display
:
block
;
position
:
relative
;
margin
:
20px
2px
20px
2px
;
}
.page-list
canvas
{
.page-list
.page
canvas
{
background-color
:
#fff
;
width
:
210mm
;
height
:
auto
;
display
:
block
;
position
:
relative
;
margin-top
:
20px
;
margin-bottom
:
20px
;
margin-right
:
2px
;
position
:
absolute
;
margin
:
0
;
}
.page-list
.page
canvas
.selection
{
background-color
:
transparent
;
width
:
210mm
;
height
:
auto
;
display
:
block
;
position
:
absolute
;
margin
:
0
;
pointer-events
:
none
;
}
.footer
{
position
:
relative
;
display
:
block
;
width
:
100%
;
background-color
:
red
;
}
.toolbar
.item
ul
.dropdown
{
position
:
absolute
;
max-height
:
300px
;
width
:
max-content
;
min-width
:
100px
;
padding
:
0
;
border
:
1px
#000
solid
;
padding
:
10px
5px
;
border
:
1px
rgba
(
0
,
0
,
0
,
0.2
)
solid
;
border-radius
:
10px
;
box-shadow
:
0
4px
5px
rgba
(
0
,
0
,
0
,
0.5
);
overflow-y
:
auto
;
overflow-x
:
hidden
;
list-style-type
:
none
;
...
...
@@ -210,17 +236,17 @@ canvas:focus-visible {
display
:
none
;
background
:
white
;
}
.toolbar
.item
ul
.dropdown.show
{
.toolbar
.item
ul
.dropdown.show
{
display
:
block
;
}
.toolbar
.item
ul
.dropdown
li
{
.toolbar
.item
ul
.dropdown
li
{
padding
:
5pt
;
width
:
100%
;
border-radius
:
5px
;
}
.toolbar
.item
ul
.dropdown
li
:hover
,
.toolbar
.item
ul
.dropdown
li
.selected
{
.toolbar
.item
ul
.dropdown
li
:hover
{
background
:
#09f
;
}
...
...
@@ -232,6 +258,10 @@ a#submit {
z-index
:
1
;
}
.rotate
{
transform
:
rotate
(
180deg
);
transition
:
400ms
;
}
@keyframes
shineAnimation
{
0
%
{
...
...
dist/assets/a-doc-editor.js
View file @
7065804e
This diff is collapsed.
Click to expand it.
dist/script.js
View file @
7065804e
...
...
@@ -35,46 +35,40 @@ function setData() {
if
(
!
extractedData
)
extractedData
=
JSON
.
parse
(
localStorage
.
getItem
(
'oldData'
)
)
if
(
extractedData
){
editor
.
setDocumentData
(
extractedData
)
editor
.
focusOnPage
()
}
}
setTimeout
(
()
=>
{
setData
()
},
500
)
function
generatePDF
()
{
editor
.
generatePDF
(
"your_doc-pdf-lib.pdf"
)
}
editor
.
addFonts
([
"./assets/fonts/Caveat-VariableFont_wght.woff2"
,
"./assets/fonts/Caveat-VariableFont_wght.ttf"
],
'Caveat'
)
editor
.
addFonts
([
"./assets/fonts/Comfortaa-VariableFont_wght.woff2"
,
"./assets/fonts/Comfortaa-VariableFont_wght.ttf"
],
'Comfortaa'
)
editor
.
addFonts
([
"./assets/fonts/CrimsonText-Regular.woff2"
,
"./assets/fonts/CrimsonText-Regular.ttf"
],
'Crimson Text'
)
editor
.
addFonts
([
"./assets/fonts/EduTASBeginner-VariableFont_wght.woff2"
,
"./assets/fonts/EduTASBeginner-VariableFont_wght.ttf"
],
'Edu TAS Beginner'
)
editor
.
addFonts
([
"./assets/fonts/FiraSans-Regular.woff2"
,
"./assets/fonts/FiraSans-Regular.ttf"
],
'Fira Sans'
)
editor
.
addFonts
([
"./assets/fonts/IndieFlower-Regular.woff2"
,
"./assets/fonts/IndieFlower-Regular.ttf"
],
'Indie Flower'
)
editor
.
addFonts
([
"./assets/fonts/Kanit-Regular.woff2"
,
"./assets/fonts/Kanit-Regular.ttf"
],
'Kanit'
)
editor
.
addFonts
([
"./assets/fonts/Karla-VariableFont_wght.woff2"
,
"./assets/fonts/Karla-VariableFont_wght.ttf"
],
'Karla'
)
editor
.
addFonts
([
"./assets/fonts/Kenia-Regular.woff2"
,
"./assets/fonts/Kenia-Regular.ttf"
],
'Kenia'
)
editor
.
addFonts
([
"./assets/fonts/Lato-Regular.woff2"
,
"./assets/fonts/Lato-Regular.ttf"
],
'Lato'
)
editor
.
addFonts
([
"./assets/fonts/LibreFranklin-VariableFont_wght.woff2"
,
"./assets/fonts/LibreFranklin-VariableFont_wght.ttf"
],
'Libre Franklin'
)
editor
.
addFonts
([
"./assets/fonts/Lora-Regular.woff2"
,
"./assets/fonts/Lora-Regular.ttf"
],
'Lora'
)
editor
.
addFonts
([
"./assets/fonts/Macondo-Regular.woff2"
,
"./assets/fonts/Macondo-Regular.ttf"
],
'Macondo'
)
editor
.
addFonts
([
"./assets/fonts/Merriweather-Regular.woff2"
,
"./assets/fonts/Merriweather-Regular.ttf"
],
'Merriweather'
)
editor
.
addFonts
([
"./assets/fonts/Montserrat-VariableFont_wght.woff2"
,
"./assets/fonts/Montserrat-VariableFont_wght.ttf"
],
'Montserrat'
)
editor
.
addFonts
([
"./assets/fonts/Mulish-VariableFont_wght.woff2"
,
"./assets/fonts/Mulish-VariableFont_wght.ttf"
],
'Mulish'
)
editor
.
addFonts
([
"./assets/fonts/NotoSans-VariableFont_wdth,wght.woff2"
,
"./assets/fonts/NotoSans-VariableFont_wdth,wght.ttf"
],
'Noto Sans'
)
editor
.
addFonts
([
"./assets/fonts/Nunito-VariableFont_wght.woff2"
,
"./assets/fonts/Nunito-VariableFont_wght.ttf"
],
'Nunito'
)
editor
.
addFonts
([
"./assets/fonts/OpenSans-VariableFont_wdth,wght.woff2"
,
"./assets/fonts/OpenSans-VariableFont_wdth,wght.ttf"
],
'Open Sans'
)
editor
.
addFonts
([
"./assets/fonts/Outfit-VariableFont_wght.woff2"
,
"./assets/fonts/Outfit-VariableFont_wght.ttf"
],
'Outfit'
)
editor
.
addFonts
([
"./assets/fonts/Pacifico-Regular.woff2"
,
"./assets/fonts/Pacifico-Regular.ttf"
],
'Pacifico'
)
editor
.
addFonts
([
"./assets/fonts/Poppins-Regular.woff2"
,
"./assets/fonts/Poppins-Regular.ttf"
],
'Poppins'
)
editor
.
addFonts
([
"./assets/fonts/Prompt-Regular.woff2"
,
"./assets/fonts/Prompt-Regular.ttf"
],
'Prompt'
)
editor
.
addFonts
([
"./assets/fonts/Rajdhani-Regular.woff2"
,
"./assets/fonts/Rajdhani-Regular.ttf"
],
'Rajdhani'
)
editor
.
addFonts
([
"./assets/fonts/Roboto-Regular.woff2"
,
"./assets/fonts/Roboto-Regular.ttf"
],
'Roboto'
)
editor
.
addFonts
([
"./assets/fonts/Rubik-VariableFont_wght.woff2"
,
"./assets/fonts/Rubik-VariableFont_wght.ttf"
],
'Rubik'
)
editor
.
addFonts
([
"./assets/fonts/SourceCodePro-VariableFont_wght.woff2"
,
"./assets/fonts/SourceCodePro-VariableFont_wght.ttf"
],
'Source Code Pro'
)
editor
.
addFonts
([
"./assets/fonts/Teko-VariableFont_wght.woff2"
,
"./assets/fonts/Teko-VariableFont_wght.ttf"
],
'Teko'
)
editor
.
addFonts
([
"./assets/fonts/TitilliumWeb-Regular.woff2"
,
"./assets/fonts/TitilliumWeb-Regular.ttf"
],
'Titillium Web'
)
editor
.
addFonts
([
"./assets/fonts/Ubuntu-Regular.woff2"
,
"./assets/fonts/Ubuntu-Regular.ttf"
],
'Ubuntu'
)
editor
.
addFonts
([
"./assets/fonts/VarelaRound-Regular.woff2"
,
"./assets/fonts/VarelaRound-Regular.ttf"
],
'Varela Round'
)
editor
.
addFonts
([
"./assets/fonts/WorkSans-Regular.woff2"
,
"./assets/fonts/WorkSans-Regular.ttf"
],
'Work Sans'
)
// editor.addFonts(["./assets/fonts/Caveat-VariableFont_wght.woff2", "./assets/fonts/Caveat-VariableFont_wght.ttf"], 'Caveat')
// editor.addFonts(["./assets/fonts/Comfortaa-VariableFont_wght.woff2", "./assets/fonts/Comfortaa-VariableFont_wght.ttf"], 'Comfortaa')
// editor.addFonts(["./assets/fonts/FiraSans-Regular.woff2", "./assets/fonts/FiraSans-Regular.ttf"], 'Fira Sans')
// editor.addFonts(["./assets/fonts/Kanit-Regular.woff2", "./assets/fonts/Kanit-Regular.ttf"], 'Kanit')
// editor.addFonts(["./assets/fonts/Merriweather-Regular.woff2", "./assets/fonts/Merriweather-Regular.ttf"], 'Merriweather')
// editor.addFonts(["./assets/fonts/Montserrat-VariableFont_wght.woff2", "./assets/fonts/Montserrat-VariableFont_wght.ttf"], 'Montserrat')
// editor.addFonts(["./assets/fonts/Mulish-VariableFont_wght.woff2", "./assets/fonts/Mulish-VariableFont_wght.ttf"], 'Mulish')
// editor.addFonts(["./assets/fonts/NotoSans-VariableFont_wdth,wght.woff2", "./assets/fonts/NotoSans-VariableFont_wdth,wght.ttf"], 'Noto Sans')
// editor.addFonts(["./assets/fonts/Nunito-VariableFont_wght.woff2", "./assets/fonts/Nunito-VariableFont_wght.ttf"], 'Nunito')
// editor.addFonts(["./assets/fonts/OpenSans-VariableFont_wdth,wght.woff2", "./assets/fonts/OpenSans-VariableFont_wdth,wght.ttf"], 'Open Sans')
// editor.addFonts(["./assets/fonts/Pacifico-Regular.woff2", "./assets/fonts/Pacifico-Regular.ttf"], 'Pacifico')
// editor.addFonts(["./assets/fonts/Poppins-Regular.woff2", "./assets/fonts/Poppins-Regular.ttf"], 'Poppins')
// editor.addFonts(["./assets/fonts/Prompt-Regular.woff2", "./assets/fonts/Prompt-Regular.ttf"], 'Prompt')
// editor.addFonts(["./assets/fonts/Rajdhani-Regular.woff2", "./assets/fonts/Rajdhani-Regular.ttf"], 'Rajdhani')
// editor.addFonts(["./assets/fonts/Roboto-Regular.woff2", "./assets/fonts/Roboto-Regular.ttf"], 'Roboto')
// editor.addFonts(["./assets/fonts/Rubik-VariableFont_wght.woff2", "./assets/fonts/Rubik-VariableFont_wght.ttf"], 'Rubik')
// editor.addFonts(["./assets/fonts/SourceCodePro-VariableFont_wght.woff2", "./assets/fonts/SourceCodePro-VariableFont_wght.ttf"], 'Source Code Pro')
// editor.addFonts(["./assets/fonts/Teko-VariableFont_wght.woff2", "./assets/fonts/Teko-VariableFont_wght.ttf"], 'Teko')
// editor.addFonts(["./assets/fonts/Ubuntu-Regular.woff2", "./assets/fonts/Ubuntu-Regular.ttf"], 'Ubuntu')
// editor.addFonts(["./assets/fonts/WorkSans-Regular.woff2", "./assets/fonts/WorkSans-Regular.ttf"], 'Work Sans')
// editor.addFonts(["./assets/fonts/Afacad-VariableFont_wght.woff2", "./assets/fonts/Afacad-VariableFont_wght.ttf"], 'Afacad')
// editor.addFonts(["./assets/fonts/Bitter-VariableFont_wght.woff2", "./assets/fonts/Bitter-VariableFont_wght.ttf"], 'Bitter')
// end of file
\ 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