溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

使用CSS3怎么制作一個(gè)抖音LOGO

發(fā)布時(shí)間:2021-05-24 16:11:55 來源:億速云 閱讀:174 作者:Leah 欄目:web開發(fā)

今天就跟大家聊聊有關(guān)使用CSS3怎么制作一個(gè)抖音LOGO,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

完成單個(gè)“J”

<div class="jitter">
    <div class="logo"></div>
</div>

添加樣式

.jitter {
  position: relative;
  width: 200px;
  margin: 100px auto;
}

// 第一部分
.logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 47px;
  height: 218px;
  z-index: 1;
  background: #24f6f0;
}
// 第二部分
.logo::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border: 40px solid #24f6f0;
  border-right: 40px solid transparent;
  border-top: 40px solid transparent;
  border-left: 40px solid transparent;
  top: -110px;
  right: -183px;
  border-radius: 100%;
  transform: rotate(45deg);
  z-index: -10;
}
// 第三部分
.logo::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border: 47px solid #24f6f0;
  border-top: 47px solid transparent;
  border-radius: 50%;
  top: 121px;
  left: -147px;
  transform: rotate(45deg);
}

第一部分,就是個(gè)矩形

第二部分,是圓環(huán)的1/4

第三部分,是圓環(huán)的3/4

使用CSS3怎么制作一個(gè)抖音LOGO

有句話叫做“方法不對(duì),努力白費(fèi)”所有的前端大神都有自己的學(xué)習(xí)方法,而學(xué)web前端的學(xué)習(xí)也基本一致,而對(duì)于一個(gè)什么都不懂的初學(xué)者,根本不會(huì)知道該怎么學(xué),這也是造成失敗的最直接原因。所以學(xué)web前端一定要有人指點(diǎn)。如果你處在迷茫期,找不到方向。可以加入我們的前端學(xué)習(xí)交流qun: 784783012 。有任何不明白的東西隨時(shí)來問我。點(diǎn)擊:前端學(xué)習(xí)圈

添加另外一個(gè)“J”

<div class="jitter">
    <div class="logo"></div>
    <div class="logo"></div>
</div>

樣式只需要添加

...
// 省略上面的樣式
...
// 和第一個(gè)J錯(cuò)開10px
.logo:last-child {
  left: 10px;
  top: 10px;
  background: #fe2d52;
  z-index: 100;
}
// 填充紅色
.logo:last-child::before {
  border: 47px solid #fe2d52;
  border-top: 47px solid transparent;
}
.logo:last-child::after {
  border: 40px solid #fe2d52;
  border-right: 40px solid transparent;
  border-top: 40px solid transparent;
  border-left: 40px solid transparent;
}

使用CSS3怎么制作一個(gè)抖音LOGO 

主角登場(chǎng) - mix-blend-mode

CSS3 新增了一個(gè)很有意思的屬性 &ndash; mix-blend-mode ,其中 mix 和 blend 的中文意譯均為混合,那么這個(gè)屬性的作用直譯過來就是混合混合模式,當(dāng)然,我們我們通常稱之為混合模式。

混合模式最常見于 photoshop 中,是 PS 中十分強(qiáng)大的功能之一。下面來看看 mix-blend-mode 有哪些屬性可以設(shè)置:

mix-blend-mode: normal;         // 正常
mix-blend-mode: multiply;       // 正片疊底
mix-blend-mode: screen;         // 濾色
mix-blend-mode: overlay;        // 疊加
mix-blend-mode: darken;         // 變暗
mix-blend-mode: lighten;        // 變亮
mix-blend-mode: color-dodge;    // 顏色減淡
mix-blend-mode: color-burn;     // 顏色加深
mix-blend-mode: hard-light;     // 強(qiáng)光
mix-blend-mode: soft-light;     // 柔光
mix-blend-mode: difference;     // 差值
mix-blend-mode: exclusion;      // 排除
mix-blend-mode: hue;            // 色相
mix-blend-mode: saturation;     // 飽和度
mix-blend-mode: color;          // 顏色
mix-blend-mode: luminosity;     // 亮度

mix-blend-mode: initial;
mix-blend-mode: inherit;
mix-blend-mode: unset;

然后我們添加 mix-blend-mode:lighten

.logo:last-child {
  ...
  mix-blend-mode: lighten;
}

看看效果:

使用CSS3怎么制作一個(gè)抖音LOGO

是不是很Ok了?

然后我們添加動(dòng)畫,讓第二個(gè)J緩慢和一個(gè)J融合。

動(dòng)畫融合

.logo:last-child {
  ...
  animation: move 10s infinite;
}
@keyframes move {
  0% {
    transform: translate(200px);
  }
  50% {
    transform: translate(0px);
  }
  100% {
    transform: translate(0px);
  }
}

看完上述內(nèi)容,你們對(duì)使用CSS3怎么制作一個(gè)抖音LOGO有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注億速云行業(yè)資訊頻道,感謝大家的支持。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI