https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-type
文章加密
2022年12月29日 星期四
2022年6月9日 星期四
sign in with apple
<divid="appleid-signin"data-mode="center-align"data-color="black"data-border="false"data-border-radius="16"data-size="32"></div>
https://appleid.apple.com/signinwithapple/button
程式串接:
apple open id 要先連到
https://appleid.apple.com/auth/authorize?
response_type=code
&redirect_uri={redirect_uri}
&client_id={client_id}
&scope=openid%20email
&response_mode=form_post
完成之後會轉頁到
{redirect_uri}?code=*********
然後後端再用code 去串apple api 拿到用戶資料
登入後會轉頁到 我們定義的 {redirect_uri} 網址,後面會帶上 code參數
後端再拿那個參數 跟 apple 取得會員資料
or...
或是你也可以直接使用apple官方提供的方式
埋入div#appleid-signin 跟script,他就也會 div#appleid-signin 產生 一個圖示 連結到
https://appleid.apple.com/auth/authorize?
response_type=code
&redirect_uri={redirect_uri}
&client_id={client_id}
&scope=openid%20email
&response_mode=form_post
2022年5月23日 星期一
DPI Scaling make "border: 1px solid #ccc" thinkness inconsistent
https://stackoverflow.com/questions/71674803/html-tables-has-a-weird-bold-horizontal-line-due-to-border-collapse-property
If you have a 1px border and DPI Scaling
set to, for example 150%, the border would technically be 1.5px. Because the browser doesn't use sub-pixel rendering, it alternates between 1px and 2px.
There are multiple ways to deal with it.
1. Set the border-width
to 0.01px
A quick and dirty workaround, because the Browser will fallback to at least 1px
2. Use resolution
media queries
Change the border-width to the appropriate decimal per scaling level.
@media (min-resolution: 120dpi) {
table, th, td {
border-width: 0.75px;
}
}
@media (min-resolution: 144dpi) {
table, th, td {
border-width: 0.666px;
}
}
@media (min-resolution: 192dpi) {
table, th, td {
border-width: 0.5px;
}
}
Here's an overview of the different DPI Scaling Levels and their values
DPI Scaling Level
- Smaller 100% (default) = 96 dpi
- Medium 125% = 120 dpi
- Larger 150% = 144 dpi
- Extra Large 200% = 192 dpi
3. JavaScript
Change the border-width to the appropriate decimal per scaling level with JavaScript using the window.devicePixelRatio
variable.