ホームページ > ウェブフロントエンド > CSSチュートリアル > 愛バージョンの読み込み効果を達成するための CSS

愛バージョンの読み込み効果を達成するための CSS

小云云
リリース: 2018-02-07 09:14:42
オリジナル
2310 人が閲覧しました

この記事では、純粋な CSS で愛バージョンの読み込みエフェクトを記述するためのサンプル コードに関する関連情報を主に紹介します。編集者が非常に優れていると考えたので、参考として共有します。編集者をフォローして見てみましょう。皆さんのお役に立てれば幸いです。

愛を持って待つことの効果は次のとおりです:

インターネット時代には非常に多くの Web サイトがあり、それぞれに独自のスタイルがありますが、どのようなスタイルがユーザーを滞在させて視聴させることができるでしょうか?読み込みに関する限り、多くの読み込み効果は同じスタイルです。ユーザーは Web サイトに頻繁にアクセスすることに慣れている可能性があります。読み込み時間が他の Web サイトよりも長いにもかかわらず、効果が同じであれば、Web サイトを閉じて移動する可能性があります。ただし、ローディング効果が独特で特徴的であれば、ユーザーがローディング効果を見たときに Web サイトが開かれる可能性があるため、ユーザーはすぐに Web サイトを閉じることはありません。

今日の愛バージョンの読み込みエフェクトは、純粋な CSS コードで記述されています。少しの労力と少量のコードだけでユーザーを維持できるので、ぜひ実行してみてください。

記事を共有する前に、編集者が私のフロントエンド学習グループをお勧めします: 542827633。このグループにはフロントエンドを学習している人がたくさんいます。クールな特殊効果を作成してフロントエンドの知識を学びたい場合は、編集者が参加することを歓迎します。 。エディターは、私が注意深くコンパイルしたフロントエンド チュートリアルなど、役立つソース コードをグループ内で随時共有します。興味のある友人の皆様を歓迎します。

html コード:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

<p class="flex-container">

  <p class="unit">

    <p class="heart">

      <p class="heart-piece-0"></p>

      <p class="heart-piece-1"></p>

      <p class="heart-piece-2"></p>

      <p class="heart-piece-3"></p>

      <p class="heart-piece-4"></p>

      <p class="heart-piece-5"></p>

      <p class="heart-piece-6"></p>

      <p class="heart-piece-7"></p>

      <p class="heart-piece-8"></p>

    </p>

    <p>equal love</p>

  </p>

</p>

ログイン後にコピー

css コード:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

<style>

    @import url("https://fonts.googleapis.com/css?family=Lato:100");

html,

body {

  width: 100%;

  height: 100%;

}

.flex-container {

  width: 100%;

  height: 100%;

  position: relative;

  display: -webkit-box;

  display: -ms-flexbox;

  display: flex;

  -ms-flex-wrap: wrap;

      flex-wrap: wrap;

  -webkit-box-pack: center;

      -ms-flex-pack: center;

          justify-content: center;

  -webkit-box-align: center;

      -ms-flex-align: center;

          align-items: center;

}

body {

  background-color: #262e6f;

}

.unit {

  text-align: center;

}

.unit p {

  margin-top: 100px;

  font-family: &#39;Lato&#39;, sans-serif;

  font-weight: 100;

  text-transform: uppercase;

  color: #fff;

}

.heart {

  position: relative;

  font-size: 0;

  width: 138px;

}

[class*="heart-piece-"] {

  position: absolute;

  top: -5px;

  width: 10px;

  height: 10px;

  border-radius: 5px;

}

.heart-piece-4 {

  -webkit-animation: piece-4 3.2s infinite;

          animation: piece-4 3.2s infinite;

}

.heart-piece-3,

.heart-piece-5 {

  -webkit-animation: piece-3 3.2s infinite;

          animation: piece-3 3.2s infinite;

}

.heart-piece-2,

.heart-piece-6 {

  -webkit-animation: piece-2 3.2s infinite;

          animation: piece-2 3.2s infinite;

}

.heart-piece-1,

.heart-piece-7 {

  -webkit-animation: piece-1 3.2s infinite;

          animation: piece-1 3.2s infinite;

}

.heart-piece-0,

.heart-piece-8 {

  -webkit-animation: piece-0 3.2s infinite;

          animation: piece-0 3.2s infinite;

}

.heart-piece-0 {

  left: 0px;

  -webkit-animation-delay: 0s;

          animation-delay: 0s;

  background-color: #ec2d73;

}

.heart-piece-1 {

  left: 16px;

  -webkit-animation-delay: 0.15s;

          animation-delay: 0.15s;

  background-color: #eb5324;

}

.heart-piece-2 {

  left: 32px;

  -webkit-animation-delay: 0.3s;

          animation-delay: 0.3s;

  background-color: #fdc800;

}

.heart-piece-3 {

  left: 48px;

  -webkit-animation-delay: 0.45s;

          animation-delay: 0.45s;

  background-color: #47b264;

}

.heart-piece-4 {

  left: 64px;

  -webkit-animation-delay: 0.6s;

          animation-delay: 0.6s;

  background-color: #1470bd;

}

.heart-piece-5 {

  left: 80px;

  -webkit-animation-delay: 0.75s;

          animation-delay: 0.75s;

  background-color: #76469a;

}

.heart-piece-6 {

  left: 96px;

  -webkit-animation-delay: 0.9s;

          animation-delay: 0.9s;

  background-color: #ec2d73;

}

.heart-piece-7 {

  left: 112px;

  -webkit-animation-delay: 1.05s;

          animation-delay: 1.05s;

  background-color: #eb5324;

}

.heart-piece-8 {

  left: 128px;

  -webkit-animation-delay: 1.2s;

          animation-delay: 1.2s;

  background-color: #fdc800;

}

@-webkit-keyframes piece-4 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 94px;

    top: -23px;

  }

}

@keyframes piece-4 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 94px;

    top: -23px;

  }

}

@-webkit-keyframes piece-3 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 90px;

    top: -31px;

  }

}

@keyframes piece-3 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 90px;

    top: -31px;

  }

}

@-webkit-keyframes piece-2 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 80px;

    top: -37px;

  }

}

@keyframes piece-2 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 80px;

    top: -37px;

  }

}

@-webkit-keyframes piece-1 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 60px;

    top: -31px;

  }

}

@keyframes piece-1 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 60px;

    top: -31px;

  }

}

@-webkit-keyframes piece-0 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 30px;

    top: -15px;

  }

}

@keyframes piece-0 {

  0%, 10%, 90%, 100% {

    height: 10px;

    top: -5px;

  }

  45%, 55% {

    height: 30px;

    top: -15px;

  }

}

  </style>

ログイン後にコピー

関連する推奨事項:

WEB で愛を描く

愛を描く方法の html5 キャンバスの例

実装方法ハートを描くCSSサンプルコード共有

以上が愛バージョンの読み込み効果を達成するための CSSの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

関連ラベル:
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート