Comments (6)
I try to use this lib https://www.npmjs.com/package/html-to-image, and it solve this issue & this one #144
[x] no need to rescaling
[x] use filter to remove download button
// element.classList.remove(...classLists);
// saveIcon?.classList.add("invisible");
htmlToImage.toBlob(element, {
width: element.offsetWidth * 1.5,
height: element.offsetHeight * 1.5,
style: {
transformOrigin: 'top left',
width: element.offsetWidth + 'px',
height: element.offsetHeight + 'px',
},
filter: (node) => !node.classList?.contains('button-save')
}).then(blob => {
saveAs(blob, `quotes-nyandev-id-${Date.now()}.png`);
});
Sorry I can't make a complete code right now for PR. Maybe you can try it!
I was try to use the same configuration with current lib (dom-to-image-improved), but it still blurry.
from quotes.
Here is the different.
- dom-to-image-improved (current result)
- html-to-image (with configuration above)
from quotes.
unfortunately yes, we need to do that because we need to normalize our css before we turn it into a image
from quotes.
I haven't use that library, so there is no way to download without that animation?
from quotes.
I try to use this lib https://www.npmjs.com/package/html-to-image, and it solve this issue & this one #144
[x] no need to rescaling [x] use filter to remove download button
// element.classList.remove(...classLists); // saveIcon?.classList.add("invisible"); htmlToImage.toBlob(element, { width: element.offsetWidth * 1.5, height: element.offsetHeight * 1.5, style: { transformOrigin: 'top left', width: element.offsetWidth + 'px', height: element.offsetHeight + 'px', }, filter: (node) => !node.classList?.contains('button-save') }).then(blob => { saveAs(blob, `quotes-nyandev-id-${Date.now()}.png`); });Sorry I can't make a complete code right now for PR. Maybe you can try it!
Cool, i just realize that html-to-image
is fork version from the original dom-to-image
and have been written into Typescript. I think we can use that.
I was try to use the same configuration with current lib (dom-to-image-improved), but it still blurry.
And i believe that blurry effect still exist in both library.
from quotes.
Awesome @ngekoding , the result is better than the current one. The resolution is also better. Nice one!
from quotes.
Related Issues (20)
- Search feature infinite scroll didn't work HOT 1
- Improve UX for search or filter result HOT 1
- Github API is Limited and Slow HOT 1
- Blurry download result HOT 2
- no like or save for localstorage HOT 6
- Improve or fix search reactivity HOT 4
- Move Deployment from Cloudflare Pages to Vercel HOT 2
- Add hover effect on quote filter HOT 4
- Duplicate or same quotes HOT 2
- Double open quote page HOT 4
- Search by user HOT 1
- Synchronization between searches and favorite quotes HOT 5
- Better empty message for favorite quotes HOT 3
- Build issues? HOT 1
- haloo HOT 2
- build error due github unavailable and type checking error
- Domain Moved from `quotes.nyandev.id` to `quotes.nyan.my.id`
- Want to add contribution.md file in English Language HOT 1
- want to contribute an english quote
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quotes.