{"id":1906,"date":"2021-08-26T12:09:19","date_gmt":"2021-08-26T03:09:19","guid":{"rendered":"https:\/\/suzutukiblog.com\/?p=1906"},"modified":"2023-01-06T19:35:13","modified_gmt":"2023-01-06T10:35:13","slug":"animation1","status":"publish","type":"post","link":"https:\/\/suzutukiblog.com\/index.php\/2021\/08\/26\/animation1\/","title":{"rendered":"Text Animation\u3092\u4f5c\u308b1(\u30c6\u30ad\u30b9\u30c8\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3)"},"content":{"rendered":"<h3><a href=\"https:\/\/suzutukiblog.com\/index.php\/2021\/08\/25\/javascript4\/\">\u305d\u306e4\u304b\u3089\u7d9a\u304f<\/a><\/h3>\n<h3>\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3089\u767a\u706b\u3059\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01<\/h3>\n<h3>HTML\u306e\u8a18\u8ff0<\/h3>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"UTF-8\"&gt;\r\n&lt;meta http-equiv=\"X-UA-Compatible\"content=\"IE=edge\"&gt;\r\n&lt;meta name=\"viewport\"content=\"width=device-width, initial-scale=1.0\"&gt;\r\n&lt;title&gt;Document&lt;\/title&gt;\r\n&lt;link rel=\"stylesheet\"href=\"style.css\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n  &lt;div id=\"container\"&gt;\r\n  &lt;div class=\"animate-title\"&gt;\r\n    &lt;spanclass=\"char\"&gt;A&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;N&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;I&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;M&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;A&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;T&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;I&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;O&lt;\/span&gt;\r\n    &lt;spanclass=\"char\"&gt;N&lt;\/span&gt;\r\n  &lt;\/div&gt;\r\n  &lt;button onclick=\"document.querySelector('.animate-title').classList.toggle('inview');\"&gt;Animation&lt;\/button&gt;\r\n&lt;\/button&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<\/div>\n<h3>mixin\u306e\u8a18\u8ff0<\/h3>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-scss\" data-lang=\"SCSS\"><code>@mixin animation(\r\n  $name,\r\n  $duration: 1s,\r\n  $timing-function: ease,\r\n  $delay: 0s,\r\n  $iteration-count: 1,\r\n  $direction: normal,\r\n  $fill-mode: forwards\r\n) {\r\nanimation: {\r\n  name: $name;\r\n  duration: $duration;\r\n  timing-function: $timing-function;\r\n  delay: $delay;\r\n  iteration-count: $iteration-count;\r\n  direction: $direction;\r\n  fill-mode: $fill-mode;\r\n }\r\n}<\/code><\/pre>\n<\/div>\n<div>\n<h3>SCSS\u306e\u8a18\u8ff0<\/h3>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-scss\" data-lang=\"SCSS\"><code>@import \"mixin\";\r\n\/\/ \u30d6\u30e9\u30a6\u30b6\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30de\u30fc\u30b8\u30f3\u3092\u3051\u3057\u3066\u4f59\u767d\u3092\u306a\u304f\u3059\r\nbody {\r\n  margin: 0;\r\n}\r\n\r\n#container {\r\n  position: relative;\r\n\/\/ \u753b\u9762\u3092\u7e26\u3044\u3063\u3071\u3044\u306b\u3059\u308b\r\n  height: 100vh;\r\n  background-color: teal;\r\n}\r\n\r\n.animate-title {\r\n  position: absolute;\r\n\/\/ \u30b3\u30f3\u30c6\u30ca\u306e\u771f\u3093\u4e2d\u3067\u8868\u793a\u3057\u305f\u3044\u305f\u3081\r\n  top: 50%;\r\n  left: 50%;\r\n\/\/ \u4e2d\u592e\u5bc4\u305b\r\n  transform: translate(-50%, -50%);\r\n  color: White;\r\n  opacity: 0;\r\n  font-size: 2em;\r\n  font-family: \"Teko\", sans-serif;\r\n\r\n  &amp;.inview {\r\n\/\/ invuiew\u304c\u632f\u3089\u308c\u305f\u3068\u304d\u900f\u660e\u5ea6\u3092\u89e3\u9664\r\n  opacity: 1;\r\n  &amp;.char {\r\n\/\/ \u4e0a\u304b\u3089\u964d\u308a\u3066\u304f\u308b\u3088\u3046\u306b\u3059\u308b\u3002span\u306a\u306e\u3067inline-block\u306b\u3057\u306a\u3044\u3068\u30c0\u30e1\r\n  display: inline-block;\r\n\/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\r\n  @includeanimation(\r\n    $name: kf-animate-chars,\r\n    $duration: 0.5s,\r\n    $timing-function: cubic-bezier(0.39, 1.57, 0.58, 1),\r\n    $fill-mode: both\r\n);\r\n\/\/ for\u6587\u3092\u4f7f\u3063\u30661\u304b\u30899\u307e\u3067\u306e\u51e6\u7406\u3092\u30eb\u30fc\u30d7\u3055\u305b\u3066\u3044\u308b\u3088\r\n  @for $i from 1 through 9 {\r\n  &amp;:nth-child(#{$i}) {\r\n    animation-delay: $i * 0.04s;\r\n       }\r\n      }\r\n     }\r\n    }\r\n   }\r\n@keyframes kf-animate-chars {\r\n  0% {\r\n\/\/ \u6700\u521d\u900f\u660e\u3067\u4e0a\u65b9\u541150\uff05\u306e\u3068\u3053\u308d\u306b\u3044\u308b\r\n    opacity: 0;\r\n    transform: translateY(-50%);\r\n}\r\n  100% {\r\n\/\/ \u900f\u660e\u5316\u3092\u89e3\u9664\u3057\u306650\uff05\u304b\u3089\u539f\u70b9\u306b\u623b\u308b\u3053\u3068\u3067\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3057\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u305b\u308b\r\n    opacity: 1;\r\n    transform: translateY(0);\r\n}\r\n}<\/code><\/pre>\n<\/div>\n<h3>\u5b8c\u6210\u30a4\u30e1\u30fc\u30b8<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/08\/4abf595c350f36d39a8935a86771c1ef.png\" alt=\"\" width=\"500\" height=\"373\" class=\"alignnone size-full wp-image-7203\" srcset=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/08\/4abf595c350f36d39a8935a86771c1ef.png 500w, https:\/\/suzutukiblog.com\/wp-content\/uploads\/2021\/08\/4abf595c350f36d39a8935a86771c1ef-300x224.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<h3>\u203b\u30c6\u30ad\u30b9\u30c8\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u307e\u3068\u3081<\/h3>\n<h3>HTML\u306e\u90e8\u5206<\/h3>\n<div class=\"normal-box2-blue\">\n<ol>\n<li><strong>\u307e\u305a\u521d\u3081\u306b&lt;div id=&#8221;container&#8221;&gt;\u306e\u4e2d\u306b\u5165\u308c\u308b<\/strong><\/li>\n<li><strong> &lt;div class=&#8221;animate-title&#8221;&gt;\u306e\u4e2d\u306b<\/strong>\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3057\u305f\u3044\u6587\u8a00\u3092\u5165\u308c\u308b<\/li>\n<li>\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3057\u3066<strong>inview<\/strong>\u306e\u3068\u304d\u306b<strong>\u30af\u30ea\u30c3\u30af<\/strong>\u3057\u305f\u3089\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/li>\n<\/ol>\n<\/div>\n<h3>SCSS\u306e\u90e8\u5206<\/h3>\n<div class=\"normal-box2-pink\">\n<p>1.mixin\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3002mixin\u3068\u306f\u30e2\u30b8\u30e5\u30fc\u30eb<\/p>\n<p>2.body\u3084container\u3067\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3046(\u4f59\u767d\u6d88\u3057\u305f\u308a\u80cc\u666f\u8272\u6c7a\u3081\u305f\u308a)<\/p>\n<p>3..animate-title\u306b\u3066\u753b\u9762\u771f\u3093\u4e2d\u306b\u4e2d\u592e\u5bc4\u305b\u3067\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3002<\/p>\n<p>4.inview\u306e\u72b6\u614b\u306e\u6642\u900f\u660e\u5ea6\u3092\u89e3\u9664\u3059\u308b\u8a2d\u5b9a\u3092\u3059\u308b\u3002<\/p>\n<p>5..char\u306b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308b<\/p>\n<p>6.<strong>@includeanimation\u306b\u3066\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5177\u4f53\u7684\u306a\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/strong><\/p>\n<\/div>\n<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2021\/09\/12\/javascript5\/\">\u305d\u306e5\u306b\u7d9a\u304d\u307e\u3059<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e4\u304b\u3089\u7d9a\u304f \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3089\u767a\u706b\u3059\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01 HTML\u306e\u8a18\u8ff0 &lt;!DOCTYPE html&gt; &lt;html lang=&#8221;en&#8221;&gt; &lt;head&gt; &#038;lt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[17,27,14],"tags":[],"class_list":["post-1906","post","type-post","status-publish","format-standard","hentry","category-javascript","category-programming-note","category-scss"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/1906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=1906"}],"version-history":[{"count":23,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/1906\/revisions"}],"predecessor-version":[{"id":7281,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/1906\/revisions\/7281"}],"wp:attachment":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=1906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=1906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=1906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}