tailwind实现主题切换的图片悬浮转换个人信息卡片效果代码

代码语言:html

所属分类:悬停

代码描述:tailwind实现主题切换的图片悬浮转换个人信息卡片效果代码

代码标签: tailwind 主题 切换 图片 悬浮 转换 个人 信息 卡片

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tailwindcss.3.4.3.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
  

  
</head>


  <body class="bg-gradient-to-r from-violet-300 via-amber-200 to-violet-300   text-black flex flex-col  justify-center  items-center min-h-screen px-4 
            [&_*]:transition-all 
            [&_*]:ease-in-out 
            [&_*]:duration-500
            [&>section:hover]:!duration-700
            [&>section:hover>div>*]:!duration-700
            [&>section:hover>div>*]:!translate-y-0
        ">

  <!-- theme toggle radio -->
  <input type="checkbox" id="theme" class="sr-only peer" checked>

  <section class="group max-w-md size-24 rounded-3xl bg-white p-2 cursor-pointer shadow-xl origin-top relative flex flex-col items-center text-center gap-8 overflow-hidden relative delay-50 
                hover:p-4
                sm:hover:p-8
                hover:w-[14rem]
                hover:h-[24rem]
                min-[400px]:hover:w-[22rem]
                min-[400px]:hover:h-[22rem]
                peer-checked:bg-violet-300
                peer-checked:delay-150
                peer-checked:shadow-violet-950
            ">
    <img src="//repo.bfw.wiki/bfwrepo/image/64700adadc9a0.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_300,h_300,/quality,q_90" class="size-20 rounded-2xl shadow-md shadow-violet-950 group-hover:size-32 group-hover:delay-700" alt="Frances S. Cady">

    <div class="space-y-4 [&>*]:translate-y-96 ">
      <hgroup class="w-60 mx-auto  delay-200 group-hover:delay-1000">
        <h2 class="font-semibold">Frances S. Cady</h2>
        <p class="text-sm opacity-70 mb-8">Building nex-gen energy tech product at Company</p>
      </hgroup>

      <div class="grid min-[400px]:grid-cols-2  gap-4 delay-200 group-hover:delay-[1500ms]
                        *:flex
                        *:items-center
                        *:justify-center
                        *:gap-2
                        *:rounded-full
                        *:text-xs
                        *:whitespace-nowrap
                        *:py-2
                        *:px-4
                        *:relative
                        *:isolate
                        [&>button>span]:text-base
                        first:[&>button>span]:-translate-x-6
                        first:[&>button>span]:opacity-0
                        last:[&>button>span]:-translate-x-3
                        first:[&>button:hover>span]:opacity-100
                        [&>button:hover>span]:!translate-x-0

                        before:*:absolute
                        before:*:inset-0
                        before:*:rounded-full
                        before:*:bg-violet-400/50
                        before:*:transition-all
               .........完整代码请登录后点击上方下载按钮下载查看

网友评论0