Home Web Front-end JS Tutorial jQuery + CSS realizes romantic confession! (with code)

jQuery + CSS realizes romantic confession! (with code)

Jun 30, 2020 am 10:02 AM
css jquery

This article will introduce to you the necessary page to use jQuery CSS to realize romantic confession. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

JQ CSS necessary page to realize romantic confession

Rendering:

jQuery + CSS realizes romantic confession! (with code)

Picture material:

jQuery + CSS realizes romantic confession! (with code)jQuery + CSS realizes romantic confession! (with code)jQuery + CSS realizes romantic confession! (with code)jQuery + CSS realizes romantic confession! (with code)jQuery + CSS realizes romantic confession! (with code)jQuery + CSS realizes romantic confession! (with code)

jQuery + CSS realizes romantic confession! (with code)

jQuery + CSS realizes romantic confession! (with code)

jQuery + CSS realizes romantic confession! (with code)

#The code is as follows, copy and use:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>浪漫表白 By:阿杜</title>

    <style type = "text/css">
        
        *{
            margin:0px;
            padding:0px;
            }
        html,body{
            height:100%;
            }    
        body{
            font-family:"微软雅黑";        <!-- 此处需要自己修改图片路径 -->
            background:url(images/b1j.jpg) no-repeat fixed;
            background-size:cover;
            
            }    
        .top{
            width:500px;
            height:150px;
            margin:50px auto;
            font-size:30px;
            color:#ea544d;
            }
            
        .box{
            width:310px;
            height:310px;
            margin:0px auto;
            perspective:800px;
            margin-top:-40px;
            }    
        .box .wrap{
            width:210px;
            height:210px;
            position:relative;
            transform-style:preserve-3d;
            animation:play 10s linear infinite;
            }
        .box .wrap ul li{
            list-style:none;
            position:absolute;
            top:0;left:0;
            }    
        @keyframes play{
            from{transform:rotateY(0deg);}
            to{transform:rotateY(360deg);}
            }
            
        .xin,.xin1{
            position:absolute;
            }
            
        .xin{
            animation:xin 8s linear infinite;
            }    
        @keyframes xin{
            0%{top:0%;left:50%;opacity:1;}
            20%{top:20%;left:80%;opacity:0;}
            40%{top:50%;left:50%;opacity:1;}
            60%{top:80%;left:40%;opacity:0;}
            80%{top:50%;left:20%;opacity:1;}
            100%{top:10%;left:0%;opacity:0;}
            }
            .xin1{
            animation:xin 15s linear infinite;
            }
            
        @keyframes xin1{
            0%{top:10%;right:50%;opacity:1;}
            20%{top:50%;right:80%;opacity:0;}
            40%{top:40%;right:50%;opacity:1;}
            60%{top:60%;right:40%;opacity:0;}
            80%{top:50%;right:20%;opacity:1;}
            100%{top:0%;right:0%;opacity:0;}
            }
        .text{
            width:60%;
            margin:0 auto;
            margin-top:-60px;
            font-size:20px;
            line-height:30px;
            font-weight:500;
            animation:color 10s linear infinite;
            }
        @keyframes color{
            0%{color:#039;}
            20%{color:#9C3;}
            40%{color:#6C6;}
            60%{color:#66F;}
            80%{color:#FC9;}
            100%{color:#9FF;}
            }    
                                    
    </style>
    
</head>

<body>
    
    <!--S top-->
    <div class = "top">
        <marquee behavior="alternate">Love Page By:阿杜</marquee>
    </div>
    <!--E top-->
    
    <!--S box-->
    <div class = "box">
        <div class = "wrap">        <!-- 此处需要自己修改图片路径 -->
            <ul>
                <li><img src="images/1.gif" height="210px" width="210px"/></li>
                <li><img src="images/2.gif" height="210px" width="210px"/></li>
                <li><img src="images/3.gif" height="210px" width="210px"/></li>
                <li><img src="images/4.gif" height="210px" width="210px"/></li>
                <li><img src="images/5.gif" height="210px" width="210px"/></li>
                <li><img src="images/6.gif" height="210px" width="210px"/></li>
            </ul>
        </div>
    </div>
    <!--E box -此处需要自己修改图片路径-->
    <div class = "xin">
        <img src="images/xin.png" width="100px" height="100px"/>
    </div>
    
    <div class = "xin1">
        <img src="images/xin.png" width="100px" height="100px"/>
    </div>
    
    <div class = "text">
        <p id = "test"></p>
    </div>    <!-- 此处需要自己修改音频路径 -->
    <embed src="sound/bg.mp3" hidden="true"/>
    <!-- 此处需要自己修改JQ路径 -->
    <script type = "text/javascript" src="js/jquery.min.js"></script>
    
    <script type = "text/javascript">
        
        $(function(){
            
            $(".wrap ul li").each(function(i){
                    var Deg = 360/$(".wrap ul li").size();
                    $(this).css({
                        "transform":"rotateY("+Deg*i+"deg) translateZ(220px)"
                    });
                
                });
            });
            
            window.onload = function autoplay(){
                var b = [&#39;能够遇见你,对我来说是最大的幸福。有了你,我的生活变的无限宽广,有了你,世界变得如此迷人。你是世界,世界是你。我愿意用自己的心,好好的陪着你,爱着你。陪你到你想去的地方,用心走完我们人生的余下的旅程。在未来的日子里,也许什么都无法确定,但唯一可以确定的是,我爱的人是你,无论现在还是将来,我想我这里都会是你最温暖的港湾,都是为你遮风避雨的城墙。无论狂风,无论暴雨。我都会陪在你的身旁,让你不会感到丝毫的担心和惶恐。我会珍惜和你在一起的每一刻,每一分,每一秒。谁叫你是我最爱的人,谁叫你是第二幸福的人(因为爱上她你是最幸福的了,哈哈)。为了你,我愿用自己的双手为你撑起一片艳阳!&#39;];
                //  分隔字符串
                var str = b.join(""),i=0,arr = str.split(&#39;&#39;);
                
                var ms_stop = setInterval(function(){
                //  设置自动出现文字
                    if(i>str.length-1){
                        i = 0;
                        document.getElementById(&#39;test&#39;).innerHTML=&#39;&#39;;
                        }
                        document.getElementById(&#39;test&#39;).innerHTML=document.getElementById(&#39;test&#39;).innerHTML+arr[i];
                        i++;
                    },200);
            }
            
    </script>
</body>
</html>

If you have better ideas or more functions, you can share them with us. If there are any errors, please contact me Correction, thank you very much! ! !

More cool CSS3, html5, javascript, jQuery special effects codes, all in:

js special effects collection

The above is the detailed content of jQuery + CSS realizes romantic confession! (with code). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1504
276
How to use the CSS backdrop-filter property? How to use the CSS backdrop-filter property? Aug 02, 2025 pm 12:11 PM

Backdrop-filter is used to apply visual effects to the content behind the elements. 1. Use backdrop-filter:blur(10px) and other syntax to achieve the frosted glass effect; 2. Supports multiple filter functions such as blur, brightness, contrast, etc. and can be superimposed; 3. It is often used in glass card design, and it is necessary to ensure that the elements overlap with the background; 4. Modern browsers have good support, and @supports can be used to provide downgrade solutions; 5. Avoid excessive blur values and frequent redrawing to optimize performance. This attribute only takes effect when there is content behind the elements.

What are user agent stylesheets? What are user agent stylesheets? Jul 31, 2025 am 10:35 AM

User agent stylesheets are the default CSS styles that browsers automatically apply to ensure that HTML elements that have not added custom styles are still basic readable. They affect the initial appearance of the page, but there are differences between browsers, which may lead to inconsistent display. Developers often solve this problem by resetting or standardizing styles. Use the Developer Tools' Compute or Style panel to view the default styles. Common coverage operations include clearing inner and outer margins, modifying link underscores, adjusting title sizes and unifying button styles. Understanding user agent styles can help improve cross-browser consistency and enable precise layout control.

How to style links in CSS? How to style links in CSS? Jul 29, 2025 am 04:25 AM

The style of the link should distinguish different states through pseudo-classes. 1. Use a:link to set the unreached link style, 2. a:visited to set the accessed link, 3. a:hover to set the hover effect, 4. a:active to set the click-time style, 5. a:focus ensures keyboard accessibility, always follow the LVHA order to avoid style conflicts. You can improve usability and accessibility by adding padding, cursor:pointer and retaining or customizing focus outlines. You can also use border-bottom or animation underscore to ensure that the link has a good user experience and accessibility in all states.

What is the CSS aspect-ratio property and how to use it? What is the CSS aspect-ratio property and how to use it? Aug 04, 2025 pm 04:38 PM

Theaspect-ratioCSSpropertydefinesthewidth-to-heightratioofanelement,ensuringconsistentproportionsinresponsivedesigns.1.Itisapplieddirectlytoelementslikeimages,videos,orcontainersusingsyntaxsuchasaspect-ratio:16/9.2.Commonusecasesincludemaintainingres

how to center a div css how to center a div css Jul 30, 2025 am 05:34 AM

Tocenteradivhorizontally,setawidthandusemargin:0auto.2.Forhorizontalandverticalcentering,useFlexboxwithjustify-content:centerandalign-items:center.3.Alternatively,useCSSGridwithplace-items:center.4.Forolderbrowsers,useabsolutepositioningwithtop:50%,l

How to create a bouncing animation with CSS? How to create a bouncing animation with CSS? Aug 02, 2025 am 05:44 AM

Define@keyframesbouncewith0%,100%attranslateY(0)and50%attranslateY(-20px)tocreateabasicbounce.2.Applytheanimationtoanelementusinganimation:bounce0.6sease-in-outinfiniteforsmooth,continuousmotion.3.Forrealism,use@keyframesrealistic-bouncewithscale(1.1

How to overlap elements in CSS? How to overlap elements in CSS? Jul 30, 2025 am 05:43 AM

To achieve CSS element overlap, you need to use positioning and z-index attributes. 1. Use position and z-index: Set elements to non-static positioning (such as absolute, relative, etc.), and control the stacking order through z-index, the larger the value, the higher the value. 2. Common positioning methods: absolute is used for precise layout, relative is used for relatively offset and overlap adjacent elements, fixed or sticky is used for fixed positioning of suspended layers. 3. Actual example: By setting the parent container position:relative, child element position:absolute and different z-index, the card overlap effect can be achieved.

How to use the CSS :empty pseudo-class? How to use the CSS :empty pseudo-class? Aug 05, 2025 am 09:48 AM

The:emptypseudo-classselectselementswithnochildrenorcontent,includingspacesorcomments,soonlytrulyemptyelementslikematchit;1.Itcanhideemptycontainersbyusing:empty{display:none;}tocleanuplayouts;2.Itallowsaddingplaceholderstylingvia::beforeor::after,wh

See all articles