修正源目录:改用 shitoucuo 的 1.1.3 副本(此前误推 sangushui 旧版 1.1.2)
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
> 本文件记录本插件的所有修改与变化。仓库建立于 2026-12-03,此前历史见插件目录内的 `更新日志.MD`。
|
||||
|
||||
## 2026-12-03 · 修正源目录:改用 shitoucuo 的 1.1.3 副本(此前误推 sangushui 旧版 1.1.2)
|
||||
|
||||
- 同步源码更新 2 个文件(新增/修改 2,删除 0)。
|
||||
|
||||
## 插件信息
|
||||
|
||||
- 名称:FlexPhoto(图片横排)
|
||||
|
||||
10
Plugin.php
10
Plugin.php
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
/**
|
||||
* FlexPhoto图片并列排版工具
|
||||
* 图片横排
|
||||
*
|
||||
* @package FlexPhoto
|
||||
* @author XIGE
|
||||
* @version 1.1.2
|
||||
* @link https://www.sangushui.com/
|
||||
* @author 石头厝
|
||||
* @version 1.1.3
|
||||
* @link https://www.shitoucuo.com/
|
||||
*/
|
||||
class FlexPhoto_Plugin implements Typecho_Plugin_Interface
|
||||
{
|
||||
@@ -56,7 +56,7 @@ class FlexPhoto_Plugin implements Typecho_Plugin_Interface
|
||||
|
||||
public static function skinhead(){
|
||||
?>
|
||||
<link rel="stylesheet" href="<?php Helper::options()->pluginUrl(); ?>/FlexPhoto/style.css?20261111c">
|
||||
<link rel="stylesheet" href="<?php Helper::options()->pluginUrl(); ?>/FlexPhoto/style.css?20261203a">
|
||||
<?php
|
||||
}
|
||||
public static function tutu($data, $ojbk,$last)
|
||||
|
||||
51
style.css
51
style.css
@@ -32,7 +32,6 @@
|
||||
object-fit: cover;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.flexphoto.diycol figure {
|
||||
flex: none;
|
||||
/* 正确计算宽度:100%均分 - 分摊的间距 */
|
||||
@@ -40,19 +39,59 @@
|
||||
/* 关键:给figure设置最小高度,避免img的height:100%无参考 */
|
||||
}
|
||||
.flexphoto.diycol{
|
||||
--col-num: var(--desktop-col, 4);
|
||||
--col-num: var(--desktop-col, 4);
|
||||
}
|
||||
|
||||
/* 平板端(≤1024px):读取data-tablet-col */
|
||||
@media (max-width: 1024px) {
|
||||
.flexphoto.diycol {
|
||||
.flexphoto.diycol {
|
||||
--col-num: var(--tablet-col, 3);
|
||||
}
|
||||
}
|
||||
|
||||
/* 手机端(≤768px):读取data-mobile-col */
|
||||
@media (max-width: 768px) {
|
||||
.flexphoto.diycol {
|
||||
.flexphoto.diycol {
|
||||
--col-num: var(--mobile-col, 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
* 兼容层:任何「包了一层再放图」的插件(如七牛的 EXIF 浮层容器)
|
||||
* 把包裹元素当作 figure 的同级替身,flex 子项语义、列宽、比例与裁切
|
||||
* 全部下沉到包裹层,内部的 figure 退化为撑满即可。
|
||||
* 这样无论包裹层在外(.flexphoto 的直接子项)还是在内(<a> 里面),
|
||||
* 横排都不会被顶掉。
|
||||
* ------------------------------------------------------------------ */
|
||||
.flexphoto > .qiniu-exif-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
aspect-ratio: var(--flexphoto-ratio);
|
||||
overflow: hidden; /* 与 figure 的封面裁切保持一致的圆角/裁切观感 */
|
||||
border-radius: 10px;
|
||||
}
|
||||
.flexphoto.diycol > .qiniu-exif-container {
|
||||
flex: none;
|
||||
width: calc((100% / var(--col-num)) - (var(--gap) * (var(--col-num) - 1) / var(--col-num)));
|
||||
}
|
||||
/* 包裹层已经承担了比例,内部 figure 不能再按 4:3 二次约束,否则高度会被压缩 */
|
||||
.flexphoto > .qiniu-exif-container > figure {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
aspect-ratio: auto;
|
||||
margin: 0;
|
||||
}
|
||||
/* 包裹层落在 <a> 内部的情况:让 a 与包裹层都撑满格子 */
|
||||
.flexphoto .flexphoto-link > .qiniu-exif-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.flexphoto .qiniu-exif-container img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user