找回密码
 立即注册
搜索
查看: 18|回复: 1

文本3d排版效果一例 转自馬黑教程专版

[复制链接]

1561

主题

3295

回帖

1万

积分

管理员

积分
13328
发表于 昨天 21:58 | 显示全部楼层 |阅读模式

1561

主题

3295

回帖

1万

积分

管理员

积分
13328
 楼主| 发表于 昨天 22:01 | 显示全部楼层

<style>
    body {
        background: black;
        perspective: 1000px;
    }
    .pa {
        font: bold 3vw sans-serif;
        color: green;
        text-shadow:
            -2px -2px 2px lightgreen,
            2px 2px 2px darkgreen,
            -10px -10px 100px green;
        transform-style: preserve-3d;
        display: grid;
        place-items: center;
        margin-top: 100px;
        /* 行标签3d旋转 */
        p {
            margin: 20px 0;
            transform: rotate3d(1, -1, -0.15, 30deg); /* 3d旋转 */
        }
        /* 偶数行3d旋转 */
        p:nth-of-type(odd) {
            transform: rotate3d(1, 1, 0, 30deg);
        }
    }
</style>

<div class="pa">
    <p>绿蚁新醅酒</p>
    <p>红泥小火炉</p>
    <p>晚来天欲雪</p>
    <p>能饮一杯无</p>
</div>

<script>
    // 偶数行倒转字符串(可以不要)
    document.querySelectorAll('.pa p').forEach((p, k) => {
        if (k % 2 !== 0) p.innerText = [...p.innerText].reverse().join('');
    });
</script>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

协同嘉业科技有限公司 ( 京ICP备2024053108号-1 )

GMT+8, 2026-9-16 17:24 , Processed in 0.082947 second(s), 28 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表