Commit 7065804e by ramdayalmunda

selection fixes, caret fixes, heading fixes, arrow keys fixes, backspace fixes

parent f5d9a42e
...@@ -127,20 +127,21 @@ canvas:focus-visible { ...@@ -127,20 +127,21 @@ canvas:focus-visible {
width: 200px; width: 200px;
background-color: #408640; background-color: #408640;
padding: 5px; padding: 5px;
white-space: nowrap; /* Prevent text wrapping */ white-space: nowrap;
text-overflow: ellipsis; /* Add ellipsis ( ... ) */ /* Prevent text wrapping */
text-overflow: ellipsis;
/* Add ellipsis ( ... ) */
} }
.content-area .left-sidebar, .content-area .left-sidebar,
.content-area .page-list, .content-area .page-list,
.content-area .right-sidebar { .content-area .right-sidebar {
flex-shrink: 0; flex-shrink: 0;
height: 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden;
text-wrap: nowrap; text-wrap: nowrap;
transition: 0.5s; transition: 0.5s;
margin-top: 0; margin-top: 0;
border-radius: 0 10px 10px 0;
} }
.left-sidebar .toggle-btn, .left-sidebar .toggle-btn,
...@@ -150,6 +151,13 @@ canvas:focus-visible { ...@@ -150,6 +151,13 @@ canvas:focus-visible {
top: 0; top: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 25px;
padding: 0;
margin: 0;
border: none;
background: none;
cursor: pointer;
transition: 400ms;
} }
.left-sidebar .content, .left-sidebar .content,
...@@ -160,7 +168,7 @@ canvas:focus-visible { ...@@ -160,7 +168,7 @@ canvas:focus-visible {
.left-sidebar.hide, .left-sidebar.hide,
.right-sidebar.hide { .right-sidebar.hide {
width: 50px; width: 30px;
} }
.left-sidebar.hide .content, .left-sidebar.hide .content,
...@@ -172,37 +180,55 @@ canvas:focus-visible { ...@@ -172,37 +180,55 @@ canvas:focus-visible {
position: relative; position: relative;
display: block; display: block;
overflow-y: auto; overflow-y: auto;
overflow-x: auto;
background: #858585; background: #858585;
gap: 20px; gap: 20px;
align-items: center; align-items: center;
overflow-x: hidden; 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; background-color: #fff;
width: 210mm; width: 210mm;
height: auto; height: auto;
display: block; display: block;
position: relative; position: absolute;
margin-top: 20px; margin: 0;
margin-bottom: 20px; }
margin-right: 2px; .page-list .page canvas.selection {
background-color: transparent;
width: 210mm;
height: auto;
display: block;
position: absolute;
margin: 0;
pointer-events: none;
} }
.footer { .footer {
position: relative; position: relative;
display: block; display: block;
width: 100%; width: 100%;
background-color: red; background-color: red;
} }
.toolbar .item ul.dropdown { .toolbar .item ul.dropdown {
position: absolute; position: absolute;
max-height: 300px; max-height: 300px;
width: max-content; width: max-content;
min-width: 100px; min-width: 100px;
padding: 0; padding: 10px 5px;
border: 1px #000 solid; 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-y: auto;
overflow-x: hidden; overflow-x: hidden;
list-style-type: none; list-style-type: none;
...@@ -210,17 +236,17 @@ canvas:focus-visible { ...@@ -210,17 +236,17 @@ canvas:focus-visible {
display: none; display: none;
background: white; background: white;
} }
.toolbar .item ul.dropdown.show
{ .toolbar .item ul.dropdown.show {
display: block; display: block;
} }
.toolbar .item ul.dropdown li{
.toolbar .item ul.dropdown li {
padding: 5pt; padding: 5pt;
width: 100%; border-radius: 5px;
} }
.toolbar .item ul.dropdown li:hover, .toolbar .item ul.dropdown li:hover {
.toolbar .item ul.dropdown li.selected {
background: #09f; background: #09f;
} }
...@@ -232,6 +258,10 @@ a#submit { ...@@ -232,6 +258,10 @@ a#submit {
z-index: 1; z-index: 1;
} }
.rotate{
transform: rotate(180deg);
transition: 400ms;
}
@keyframes shineAnimation { @keyframes shineAnimation {
0% { 0% {
......
...@@ -35,46 +35,40 @@ function setData() { ...@@ -35,46 +35,40 @@ function setData() {
if (!extractedData) extractedData = JSON.parse( localStorage.getItem('oldData') ) if (!extractedData) extractedData = JSON.parse( localStorage.getItem('oldData') )
if(extractedData){ if(extractedData){
editor.setDocumentData(extractedData) editor.setDocumentData(extractedData)
editor.focusOnPage()
} }
} }
setTimeout( ()=>{
setData()
}, 500 )
function generatePDF() { function generatePDF() {
editor.generatePDF("your_doc-pdf-lib.pdf") 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/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/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/FiraSans-Regular.woff2", "./assets/fonts/FiraSans-Regular.ttf"], 'Fira Sans')
editor.addFonts(["./assets/fonts/EduTASBeginner-VariableFont_wght.woff2", "./assets/fonts/EduTASBeginner-VariableFont_wght.ttf"], 'Edu TAS Beginner') // editor.addFonts(["./assets/fonts/Kanit-Regular.woff2", "./assets/fonts/Kanit-Regular.ttf"], 'Kanit')
editor.addFonts(["./assets/fonts/FiraSans-Regular.woff2", "./assets/fonts/FiraSans-Regular.ttf"], 'Fira Sans') // editor.addFonts(["./assets/fonts/Merriweather-Regular.woff2", "./assets/fonts/Merriweather-Regular.ttf"], 'Merriweather')
editor.addFonts(["./assets/fonts/IndieFlower-Regular.woff2", "./assets/fonts/IndieFlower-Regular.ttf"], 'Indie Flower') // editor.addFonts(["./assets/fonts/Montserrat-VariableFont_wght.woff2", "./assets/fonts/Montserrat-VariableFont_wght.ttf"], 'Montserrat')
editor.addFonts(["./assets/fonts/Kanit-Regular.woff2", "./assets/fonts/Kanit-Regular.ttf"], 'Kanit') // editor.addFonts(["./assets/fonts/Mulish-VariableFont_wght.woff2", "./assets/fonts/Mulish-VariableFont_wght.ttf"], 'Mulish')
editor.addFonts(["./assets/fonts/Karla-VariableFont_wght.woff2", "./assets/fonts/Karla-VariableFont_wght.ttf"], 'Karla') // editor.addFonts(["./assets/fonts/NotoSans-VariableFont_wdth,wght.woff2", "./assets/fonts/NotoSans-VariableFont_wdth,wght.ttf"], 'Noto Sans')
editor.addFonts(["./assets/fonts/Kenia-Regular.woff2", "./assets/fonts/Kenia-Regular.ttf"], 'Kenia') // editor.addFonts(["./assets/fonts/Nunito-VariableFont_wght.woff2", "./assets/fonts/Nunito-VariableFont_wght.ttf"], 'Nunito')
editor.addFonts(["./assets/fonts/Lato-Regular.woff2", "./assets/fonts/Lato-Regular.ttf"], 'Lato') // editor.addFonts(["./assets/fonts/OpenSans-VariableFont_wdth,wght.woff2", "./assets/fonts/OpenSans-VariableFont_wdth,wght.ttf"], 'Open Sans')
editor.addFonts(["./assets/fonts/LibreFranklin-VariableFont_wght.woff2", "./assets/fonts/LibreFranklin-VariableFont_wght.ttf"], 'Libre Franklin') // editor.addFonts(["./assets/fonts/Pacifico-Regular.woff2", "./assets/fonts/Pacifico-Regular.ttf"], 'Pacifico')
editor.addFonts(["./assets/fonts/Lora-Regular.woff2", "./assets/fonts/Lora-Regular.ttf"], 'Lora') // editor.addFonts(["./assets/fonts/Poppins-Regular.woff2", "./assets/fonts/Poppins-Regular.ttf"], 'Poppins')
editor.addFonts(["./assets/fonts/Macondo-Regular.woff2", "./assets/fonts/Macondo-Regular.ttf"], 'Macondo') // editor.addFonts(["./assets/fonts/Prompt-Regular.woff2", "./assets/fonts/Prompt-Regular.ttf"], 'Prompt')
editor.addFonts(["./assets/fonts/Merriweather-Regular.woff2", "./assets/fonts/Merriweather-Regular.ttf"], 'Merriweather') // editor.addFonts(["./assets/fonts/Rajdhani-Regular.woff2", "./assets/fonts/Rajdhani-Regular.ttf"], 'Rajdhani')
editor.addFonts(["./assets/fonts/Montserrat-VariableFont_wght.woff2", "./assets/fonts/Montserrat-VariableFont_wght.ttf"], 'Montserrat') // editor.addFonts(["./assets/fonts/Roboto-Regular.woff2", "./assets/fonts/Roboto-Regular.ttf"], 'Roboto')
editor.addFonts(["./assets/fonts/Mulish-VariableFont_wght.woff2", "./assets/fonts/Mulish-VariableFont_wght.ttf"], 'Mulish') // editor.addFonts(["./assets/fonts/Rubik-VariableFont_wght.woff2", "./assets/fonts/Rubik-VariableFont_wght.ttf"], 'Rubik')
editor.addFonts(["./assets/fonts/NotoSans-VariableFont_wdth,wght.woff2", "./assets/fonts/NotoSans-VariableFont_wdth,wght.ttf"], 'Noto Sans') // editor.addFonts(["./assets/fonts/SourceCodePro-VariableFont_wght.woff2", "./assets/fonts/SourceCodePro-VariableFont_wght.ttf"], 'Source Code Pro')
editor.addFonts(["./assets/fonts/Nunito-VariableFont_wght.woff2", "./assets/fonts/Nunito-VariableFont_wght.ttf"], 'Nunito') // editor.addFonts(["./assets/fonts/Teko-VariableFont_wght.woff2", "./assets/fonts/Teko-VariableFont_wght.ttf"], 'Teko')
editor.addFonts(["./assets/fonts/OpenSans-VariableFont_wdth,wght.woff2", "./assets/fonts/OpenSans-VariableFont_wdth,wght.ttf"], 'Open Sans') // editor.addFonts(["./assets/fonts/Ubuntu-Regular.woff2", "./assets/fonts/Ubuntu-Regular.ttf"], 'Ubuntu')
editor.addFonts(["./assets/fonts/Outfit-VariableFont_wght.woff2", "./assets/fonts/Outfit-VariableFont_wght.ttf"], 'Outfit') // editor.addFonts(["./assets/fonts/WorkSans-Regular.woff2", "./assets/fonts/WorkSans-Regular.ttf"], 'Work Sans')
editor.addFonts(["./assets/fonts/Pacifico-Regular.woff2", "./assets/fonts/Pacifico-Regular.ttf"], 'Pacifico') // editor.addFonts(["./assets/fonts/Afacad-VariableFont_wght.woff2", "./assets/fonts/Afacad-VariableFont_wght.ttf"], 'Afacad')
editor.addFonts(["./assets/fonts/Poppins-Regular.woff2", "./assets/fonts/Poppins-Regular.ttf"], 'Poppins') // editor.addFonts(["./assets/fonts/Bitter-VariableFont_wght.woff2", "./assets/fonts/Bitter-VariableFont_wght.ttf"], 'Bitter')
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')
// end of file // end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment