小程序酷炫动态登录页源码(动态水滴)

简介: 小程序酷炫动态登录页源码(动态水滴)

1. 页面效果

登陆页面一般都要酷炫好看一点,这里分享一个动态登录页面,页面有三个流动的小水滴。一个水滴放登录框。剩下两个水滴跳转页面和打开弹窗。

2. 代码内容

<template>
  <view class="login-page">
    <u-gap height="80" ></u-gap>
    <div class="container">
      <div class="drop">
        <div class="content">
          <h2 style="font-weight: bolder">XXXX平台</h2>
          <form>
            <div class="inputBox">
              <input type="text" v-model="loginForm.username" placeholder="请输入平台手机号">
            </div>
            <div class="inputBox" style="margin-top: 20rpx">
              <input type="password" v-model="loginForm.password" placeholder="请输入平台密码">
            </div>
            <div class="inputBox" style="margin-top: 30rpx;width: 80%;margin-left: 10%;text-align: center;" @click="submitLogin">
              <span class="submit" >登录</span>
            </div>
          </form>
        </div>
      </div>
    </div>
    <a href="#" class="btns" @click="openReg">注册</a>
    <a href="#" class="btns signup" @click="goToWechart">微信登录</a>
  </view>
</template>
<script>
  import UGap from "../../uview-ui/components/u-gap/u-gap.vue";
  export default {
    components: {UGap},
    data() {
      return {
        loginForm:{
          username:'',
          password:''
        },
      }
    },
    onLoad(option) {
      uni.hideHomeButton()
      // if (option.url) {
      //  this.url = option.url;
      // }
    },
    methods: {
      submitLogin(){
        if(this.loginForm.phone==''){
          this.$interactive.toast('平台手机号不能为空')
          return;
        }else if(this.loginForm.password==''){
          this.$interactive.toast('平台密码号不能为空')
          return;
        }
      },
      isPhone(phone){
        const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
        if (regMobile.test(phone)) {
          return true;
        }else{
          return false;
        }
      },
      goToWechart(){
        uni.clearStorageSync()
        uni.reLaunch({
          url: '/pages/index/index',
        });
      }
    }
  }
</script>
<style>
*
{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body
{
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background: #eff0f4;
}
.container
{
  position: relative;
  /*left: -80px;*/
  display: flex;
  justify-content: center;
}
.container .drop
{
  position: relative;
  width: 650rpx;
  height: 650rpx;
  box-shadow: inset 20px 20px 20px rgba(0,0,0,0.05),
  25px 35px 20px rgba(0,0,0,0.05),
  25px 30px 30px rgba(0,0,0,0.05),
  inset -20px -20px 25px rgba(255,255,255,0.9);
  transition: 0.5s;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 52% 48% 33% 67% / 38% 45% 55% 62%;
  animation: move 8s linear infinite forwards;
}
.container .drop:hover
{
  border-radius: 50%;
}
.container .drop::before
{
  content: '';
  position: absolute;
  top: 80rpx;
  left: 119rpx;
  width: 45rpx;
  height: 45rpx;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
}
.container .drop::after
{
  content: '';
  position: absolute;
  top: 130rpx;
  left: 160rpx;
  width: 25rpx;
  height: 25rpx;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
}
.container .drop .content
{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  padding: 40px;
  gap: 15px;
}
.container .drop .content h2
{
  position: relative;
  color: #333;
  font-size: 1.5em;
}
.container .drop .content form
{
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
}
.container .drop .content form .inputBox
{
  position: relative;
  width: 425rpx;
  box-shadow: inset 2px 5px 10px rgba(0,0,0,0.1),
  inset -2px -5px 10px rgba(255,255,255,1),
  15px 15px 10px rgba(0,0,0,0.05),
  15px 10px 15px rgba(0,0,0,0.025);
  border-radius: 25px;
  display: flex;
  font-weight: bolder;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.container .drop .content form .inputBox::before
{
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 65%;
  height: 5px;
  background: rgba(255,255,255,0.5);
  border-radius: 5px;
}
.container .drop .content form .inputBox input
{
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 1em;
  padding: 10px 15px;
}
.container .drop .content form .inputBox .submit
{
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.1em;
  font-weight: 500;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 1em;
  padding: 10px 15px;
}
.container .drop .content form .inputBox:last-child
{
  width: 300rpx;
  background: #ff0f5b;
  box-shadow: inset 2px 5px 10px rgba(0,0,0,0.1),
  15px 15px 10px rgba(0,0,0,0.05),
  15px 10px 15px rgba(0,0,0,0.025);
  transition: 0.5s;
}
.container .drop .content form .inputBox:last-child:hover
{
  width: 300rpx;
}
.btns
{
  position: absolute;
  right: 60rpx;
  bottom: 0;
  width: 120px;
  height: 120px;
  background: #c61dff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  line-height: 1.2em;
  letter-spacing: 0.1em;
  font-size: 0.8em;
  transition: 0.25s;
  text-align: center;
  box-shadow: inset 10px 10px 10px rgba(190,1,254,0.05),
  15px 25px 10px rgba(190,1,254,0.1),
  15px 20px 20px rgba(190,1,254,0.1),
  inset -10px -10px 15px rgba(255,255,255,0.5);
  border-radius: 44% 56% 65% 35% / 57% 58% 42% 43%;
  animation: move2 8s linear infinite forwards;
  /*去掉蓝色色块*/
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.btns::before
{
  content: '';
  position: absolute;
  top: 15px;
  left: 30px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.45;
}
.btns.signup
{
  bottom: 280rpx;
  left: 60rpx;
  width: 80px;
  height: 80px;
  border-radius: 49% 51% 52% 48% / 63% 59% 41% 37%;
  background: #01b4ff;
  box-shadow: inset 10px 10px 10px rgba(1,180,255,0.05),
  15px 25px 10px rgba(1,180,255,0.1),
  15px 20px 20px rgba(1,180,255,0.1),
  inset -10px -10px 15px rgba(255,255,255,0.5);
  animation: move3 8s linear infinite forwards;
}
.btns.signup::before
{
  left: 20px;
  width: 15px;
  height: 15px;
}
.btns:hover
{
  border-radius: 50%;
}
@keyframes move {
  30% {
    border-radius: 30% 57% 36% 64% / 30% 52% 48% 70%;
  }
  60% {
    border-radius: 30% 57% 61% 39% / 30% 52% 48% 70%;
  }
}@keyframes move2 {
   30% {
     border-radius: 36% 64%  30% 60% / 48% 70% 30% 52% ;
   }
   60% {
     border-radius: 61% 39%  30% 60% / 48% 70%  30% 52%;
   }
}
@keyframes move3 {
  30% {
    border-radius: 60%  30% 64%  36% /52% 30% 70% 48% ;
  }
  60% {
    border-radius: 60%  30% 39% 61%  /52% 30% 70% 48% ;
  }
}
</style>


目录
相关文章
|
9天前
|
小程序 前端开发 算法
|
1月前
|
存储 移动开发 小程序
小程序界面设计软件源码生成器
小程序界面设计软件源码生成器
60 5
|
1月前
|
移动开发 小程序 数据可视化
一招学会DIY官网可视化设计支持导出微擎、UNIAPP、H5、微信小程序源码
一招学会DIY官网可视化设计支持导出微擎、UNIAPP、H5、微信小程序源码
34 2
|
1月前
|
小程序 算法 前端开发
微信小程序---授权登录
微信小程序---授权登录
72 0
|
1月前
|
数据可视化 小程序 Cloud Native
DIY可视化业界领先的可视化快速生成FinClip小程序源码
DIY可视化业界领先的可视化快速生成FinClip小程序源码
28 0
|
3月前
|
JSON 小程序 JavaScript
微信小程序制作 购物商城首页 【内包含源码】
这篇文章提供了一个微信小程序购物商城首页的实现方法和源码,包括页面布局、数据结构、核心代码以及如何配置tabBar和搜索框组件。
微信小程序制作 购物商城首页 【内包含源码】
|
3月前
|
小程序 安全 Java
|
3月前
|
存储 小程序 JavaScript
|
3月前
|
小程序 JavaScript API
|
3月前
|
缓存 开发框架 JavaScript
人人都能看懂的鸿蒙 “JS 小程序” 数据绑定原理 | 解读鸿蒙源码
人人都能看懂的鸿蒙 “JS 小程序” 数据绑定原理 | 解读鸿蒙源码
下一篇
无影云桌面