Skip to content

Commit

Permalink
添加字体颜色选择
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 29, 2023
1 parent 192047f commit ee90858
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
13 changes: 13 additions & 0 deletions annotation-setting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1alpha1
kind: AnnotationSetting
metadata:
generateName: annotation-setting-
spec:
targetRef:
group: "core.halo.run"
kind: Photo
formSchema:
- $formkit: "color"
name: "nameColor"
value: "#ffffff"
label: "字体颜色颜色"
3 changes: 1 addition & 2 deletions templates/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,7 @@ ul.icons li:last-child {
}

ul.icons li .iconfont:before {
font-size: 28px;
line-height: 1;
font-size: 25px;
height: 28px;
margin: auto;
display: contents;
Expand Down
8 changes: 4 additions & 4 deletions templates/macro/photo.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<th:block th:fragment="photo(photo)">
<article class="thumb img-area">
<article class="thumb img-area" th:with="img = ${ not #strings.isEmpty(photo.spec.cover) ? photo.spec.cover : photo.spec.url}">
<a class="image my-photo" th:alt="${photo.spec.description}" th:href="${photo.spec.url}" >
<img class="zmki_px my-photo" th:attr="onerror='this.src='+@{/assets/img/loading.gif}+';this.onerror=null'" th:data-src="${photo.spec.url}" />
<img class="zmki_px my-photo" th:attr="onerror='this.src='+@{/assets/img/loading.gif}+';this.onerror=null'" th:data-src="${img}" />
</a>
<h2>[[${photo.spec.displayName}]]</h2>
<h2 th:style="'color:' + ${#annotations.get(photo,'nameColor')}">[[${photo.spec.displayName}]]</h2>
<p></p>
<p>[[${photo.spec.description}]]</p>
<p th:style="'color:' + ${#annotations.get(photo,'nameColor')}">[[${photo.spec.description}]]</p>
<p></p>
<li class="tag-categorys"
th:each="group : ${photoFinder.groupBy()}"
Expand Down

0 comments on commit ee90858

Please sign in to comment.