导航

萌即是正义!时不时分享一些ACG活动记录与有趣代码的小站!

侧边栏
热门文章
1页面
程序员老黄历&求签
热度
1105
2推文
让AI生成了头像的表情包,都好可爱呀!
热度
117
3推文
用几乎纯 AI 写维基萌公会联盟这款游戏也有段时间了,可以分享一些 AI 写项目的心得了。 先说结果,现阶段面向个人的几大 AI 模型用来开发个人小项目,实现个人的一些想法是够用的。但是用在商业项目还有待商榷。 目前用下来的问题包括但不仅限于: · 不会总结需求功能中哪些函数或者组件应该共通化,同样的功能写的到处都是。 · 由于上面的问题,修改BUG的时候经常只会改一处就觉得自己解决问题了。 · AI 有时候倾向掩盖问题而不是解决问题。比如有几次指挥解决日志中的错误,结果 AI 选择遇到此类问题不输出日志。 · 受到上下文最大输入限制,现在的 AI 是以总结交接的形式将前面的信息传递到下一任 AI ,这就导致了一旦发生交接,这段代码质量会急剧下降。 · 不约束代码习惯的时候,AI 更倾向写可读性很差的语法糖。 · UI交互设计不加详细描述就会写的一团糟。 · 游戏玩法设计幻觉严重。 当然优点也有很多。最大的优点就是减少了我自己的心智负担。并且用自己的描述成功让 AI 完美实现时的成功感。我现在算是明白为什么那么多人喜欢玩抽卡游戏了。
热度
117
4博文
360度带你看《超时空辉夜姬》联动KTV联动房间
热度
91
5博文
3DS模拟器简体中文字库 | Citra3ds字库 | 符文工房4乱码解决字库 | shared_font.bin
热度
91
6博文
大开眼界的《憧憬成为魔法少女非常热闹哟大感谢祭》S场
热度
78
7博文
《孤独摇滚》圣地巡礼——下北泽&下北泽咖喱节2023
热度
52
8页面
友链
热度
52
9推文
让AI生成了一个记账网页应用。 完全按照我自己的需求定制的记账应用。当然也有一定的通用性。 支持响应式布局,所以手机也能用。 本人只贡献了需求和修改了一丢丢UI体验。 成品还是很满意的,看来AI时代,小工具根本不需要下什么APP了。 直接自己定制应用的好时代来了呀! 项目地址:https://github.com/eeg1412/wikimoeBookkeeping ※截图是测试数据,不是我发财了。
热度
39
10博文
探访日本的废校:《轻音少女》圣地巡礼之丰乡小学校旧校舍群
热度
39
最新评论
广树管理员
2026-04-16 19:18
@Asuna:几乎是的
广树管理员
2026-04-16 19:18
@ZeroCounter:让AI实现过一版,但是修改内容比预想的多太多了,根本没时间审查😅
广树管理员
2026-04-16 19:17
@Zrzzz:说不定有了呢
Asuna
2026-04-16 06:31
佬用的是 Opus 嘛,Claude 神力!😭
ZeroCounter
2026-04-15 12:40
好可爱!建议实装到评论区(什么
攻略中
告别回忆 双想 ~Not always true~
暂无评分
Steam告别回忆 双想 ~Not always true~
2026年3月10日 22时 ~ 攻略中
已累计游玩1个月7天
“我觅见了生命中的唯一,而后——”
亚路塔:狐狸狐途的面包冒险
暂无评分
Steam亚路塔:狐狸狐途的面包冒险
2026年2月12日 19时 ~ 攻略中
已累计游玩2个月3天
一场席卷全世界的面包革命现在开始! 主人公查雅阴错阳差之下,开始了在荒废的岛屿上经营面包店的生活。 出外冒险搜集食材、研发崭新面包配方、遇见性格各异的伙伴们,建造更丰富的设施,用面包香气使无人问津的广场再次热闹起来!
ToHeart
暂无评分
SteamToHeart
2025年6月26日 19时 ~ 攻略中
已累计游玩9个月24天
AQUAPLUS推出的“温暖人心的校园恋爱游戏”将以高清全3D形式焕新归来!
fault - StP - LIGHTKRAVTE
暂无评分
Steamfault - StP - LIGHTKRAVTE
2025年5月29日 20时 ~ 攻略中
已累计游玩10个月22天
全球累计销量超过50万份的“fault”系列最新作!故事的舞台是一个融合了奇幻与科幻的超前世界——卢森海德王国。本作讲述了生活在此地的一个平凡又平庸的究极普通市民——名为果子的少年的故事。
PSN奖杯卡

PSN奖杯卡

归档
赞助商广告

【CSS3】「CSS3各种图像功能」的案例

作者:广树时间:2016-04-04 10:45:02分类:CSS/HTML

「CSS3各种图像功能」案例

text-shadow的案例

单纯的文本阴影

CSS
text-shadow: 2px 2px 4px #444;

多重文本阴影

CSS
text-shadow:
     0     0    4px #fff,
     1px  -5px  4px #ff3,
     2px -10px  6px #fd3,
    -2px -15px 11px #f80,
     2px -25px 18px #f20;

border-radius与box-shadow的案例

单纯的阴影

background-color: #fff4e0;
border-radius: 8px;
box-shadow: 4px 4px 4px 2px #ccc;

指定了inset的阴影

background-color: #fff4e0;
border-radius: 8px;
box-shadow: inset 4px 4px 4px 2px #ccc;

inset和一般的阴影并用

background-color: #fff4e0;
border-radius: 8px;
box-shadow:
    4px 4px 4px 2px #ccc,
    inset 2px 4px 4px 2px #ffe;

多重阴影叠加

background-color: #fff4e0;
border-radius: 8px;
border: 1px solid #876;
box-shadow: inset 4px 6px 20px #fff,
            inset -4px -4px 10px #ccbba0,
            inset 0 -45px #fec,
            0 0 4px #876,
            4px 4px 6px 2px #ccc;

linear-gradient 的案例

单纯垂直的渐变

background: linear-gradient(#feb, #fb0);

指定了角度的渐变

background: linear-gradient(
  -45deg, #feb, #fb0);

指定多重渐变

background: linear-gradient(
  #feb, #fc4 50%, #fb0 51%, #fd9);

圆形渐变

background: radial-gradient(
  circle farthest-side, #feb, #fb0);

重复渐变

background: repeating-linear-gradient(
  -45deg, #feb, #fb0 20px, #feb 40px);

描边渐变

border-image: linear-gradient(
  #feb, #fb0 100px) 20/20px stretch;

和图像组合

background:
  radial-gradient(
    circle closest-side,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 90%, white),
  url(图片地址);

重复渐变组合

background:
  repeating-linear-gradient(
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.3) 10px,
    transparent 10px, transparent 20px),
  repeating-linear-gradient(
    0deg, rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.3) 10px,
    transparent 10px, transparent 20px),
  #44c;

transition 的案例

背景图像的过渡(鼠标经过显示)

.transition1 {
  background: #c44;
  transition: background-color 1s;
}
.transition1:hover {
  background: #44c;
}

多重属性的过渡(鼠标经过显示)

.transition2 {
  background: #c44;
  width: 100px;
  transition:
    background-color 1s, width 1s;
}
.transition2:hover {
  background: #44c;
  width: 200px;
}

delay与curve(鼠标经过显示)

.transition3 {
  background: #c44;
  width: 100px;
  transition:
    background-color 0.5s linear 0.5s,
    width 1s linear;
}
.transition3:hover {
  background: #44c;
  width: 200px;
}

JavaScript与过渡(鼠标点击显示)

<div style="background: #c44;
            width:100px; height:80px;
            transition: width 1s;"
     onclick="this.style.width='200px';">
</div>

animation 的案例

单纯的动画

.animation1 {
  animation: anim1 4s infinite;
}

@keyframes anim1 {
0%, 100% { left:0px; }
50% { left:280px; }
}

根据关键帧的timing-function

.animation2 {
  animation: anim2 4s ease-in infinite;
}

@keyframes anim2 {
0%   { left:0px; }
50%  { left:280px;
       animation-timing-function:ease-out; }
100% { left:0px; }
}

鼠标经过动画

.animation3 div {
  animation: anim3 4s infinite;
  animation-play-state: paused;
}

.animation3:hover div {
  animation-play-state: running;
}

@keyframes anim3 {
0%, 100% { left:0px; }
50% { left:280px; }
}

多重效果动画

.animation4 {
  animation:
    anim4-1 0.5s infinite ease-out alternate,
    anim4-2 4s infinite linear alternate;
}

@keyframes anim4-1 {
0% { top:50px; }
100% { top:0px; }
}

@keyframes anim4-2 {
0% { left:0px; }
100% { left:280px; }
}

transform 的案例

平移

@keyframes tf1 {
0%, 100% { transform:translateX(0); }
50% { transform:translateX(280px); }
}

旋转

@keyframes tf2 {
0%   { transform:rotate(0);
       animation-timing-function:linear; }
100% { transform:rotate(360deg); }
}

放大缩小

@keyframes tf3 {
0%, 100% { transform:scale(2, 0.5); }
50% { transform:scale(0.5, 2); }
}

斜变形

@keyframes tf4 {
0%, 100% { transform:skewX(-45deg); }
50% { transform:skewX(+45deg); }
}

transform-origin

.transform6 {
  animation: tf6 4s infinite;
  transform-origin: left top;
}

@keyframes tf6 {
0%   { transform:rotate(0);
       animation-timing-function:linear; }
100% { transform:rotate(360deg); }
}

多重变化叠加

@keyframes tf5 {
0% {
  transform:translateX(0) rotate(0);
  animation-timing-function:linear;
}
50% {
  transform:translateX(260px) rotate(180deg);
  animation-timing-function:linear;
}
100% {
  transform:translateX(0) rotate(360deg);
}
}

根据变化顺序不同结果也不一样

translateX rotate 的顺序
rotate translateX 的顺序
<style>
  .transform7 {
    width:20px; height:20px; background:#c44;
  }
  @keyframes tf7-1 {
    0%   { transform:translateX(40px) rotate(0); }
    100% { transform:translateX(40px) rotate(360deg); }
  }
  @keyframes tf7-2 {
    0%   { transform:rotate(0) translateX(40px); }
    100% { transform:rotate(360deg) translateX(40px); }
  }
</style>
<div class="transform7" style="animation: tf7-1 4s infinite linear;
                               margin:20px auto;"></div>
<div class="transform7" style="animation: tf7-2 4s infinite linear;
                               margin:50px auto;"></div>

DOM阶层与transform的关系

<style>
.t8 {
  width:8px; height:40px; background:#c44;
  animation:tf8 4s infinite;
  transform-origin:center top;
}
@keyframes tf8 {
  0%, 100% { transform:translateY(40px) rotate(-20deg); }
  50% { transform:translateY(40px) rotate(+20deg); }
}
</style>
<div class="t8">             <!-- 根  -->
  <div class="t8">           <!-- 第二节 -->
    <div class="t8">         <!-- 第三节 -->
      <div class="t8"></div> <!-- 最前端  -->
    </div>
  </div>
</div>

根据平行投影做三维变化

@keyframes tf9 {
0% {
  transform:rotateX(60deg) rotateZ(0);
  animation-timing-function:linear;
}
100% {
  transform:rotateX(60deg) rotateZ(360deg);
}
}

加上透视的三维变化

<style>
.transform10 {
  width:80px; height:80px;
  background:url(image.jpg);
  /*关键帧和前面通用 */
  animation:tf9 4s infinite;
}
</style>
<div style="perspective:100px;">
  <div class="transform10"></div>
</div>

perspective-origin的效果

默认
perspective-origin:50% 90%;
perspective-origin:90% 50%;
perspective-origin:50% 10%;

backface-visibility的效果

backface-
visivility:visible;
backface-visivility:hidden;

transform-style 的效果

transform-style: flat;
transform-style: preserve-3d;
<style>
  .t13-outer { perspective:100px; }
  .t13-parent {
    margin:0 auto; width:80px; height:80px;
    background:url(image.jpg);
    animation: tf9 4s infinite; /* 参考「三维旋转」的关键帧 */ }
  .t13-child {
    width:40px; height:40px; background:#c44;
    transform:translateZ(10px); /* 子元素前移10px */ }
</style>
<div class="t13-outer">
  <div class="t13-parent"><div class="t13-child"></div></div>
</div>
<div class="t13-outer">
  <div class="t13-parent" style="transform-style:preserve-3d;">
    <div class="t13-child"></div>
  </div>
</div>

CSS滤镜的案例

预设的滤镜

grayscale(100%)
sepia(100%)
saturate(100%)
hue-rotate(90deg)
invert(100%)
opacity(30%)
brightness(30%)
contrast(50%)
blur(2px)
drop-shadow
(2px 2px 4px black)

donate.png


telegram banner (1).png