Comments (2)
一个比较*的思路:
监听帖子的 img onload 事件,然后再重新触发楼层跳转
from flarum-0x.
改好了,这里没有采用上述的办法:
而是借助 image 的 width / height 属性,指定完整的 width / height 来固定住 img 的 aspect ratio,避免 loading 过程中发生偏移。
思路:
- 在 formatter render 之前,补充 width / height 属性
- 利用 cache 和 queue 异步获取帖子图片的 width / height
细节:
- 安全考虑:增加一个
fetchImageSizeAllowList
的白名单,只有指定域名才走这里的优化策略 - 指定了 width / height 后,
max-width: 100%
情况会变形,这里为 img 补充height: auto
样式来补偿
from flarum-0x.
Related Issues (20)
- 支持自定义 slug HOT 1
- 帖子的 reaction 支持 HOT 2
- 邮件通过后台队列异步发送 HOT 3
- 阻止用户重复发送相同帖子 HOT 1
- 发布回复后,总楼层数未刷新
- 更好的分享体验
- Feed output with pure numbers as guid HOT 1
- flarum-pwa push 通知失败导致的报错 HOT 2
- 帖子历史记录 diff 部分字符展示不正常
- LaTeX行内公式格式问题 HOT 1
- 升级 flarum v1.3 版本 HOT 1
- jsdelivr.net 的 emoji 表情图片替换 HOT 4
- Optimizing the DevContainer Build Process
- CORS cache error after switch avatar storage to Cloudflare R2 HOT 1
- Show backlinks in a post HOT 1
- webhooks CJK link issue
- Use composer override instead of generate a patch for PHP class
- Upgrade to flarum v1.8
- $转义问题 HOT 1
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 flarum-0x.