svg配合css3动画_带有Adobe Illustrator,HTML和CSS的任何网站的SVG动画

svg配合css3动画

A top trend in web design for 2020 is the increased use of SVG animations on web pages and in logo design. In this article, we will implement a simple and straight forward method to create relatively complex animation. We will use Adobe Illustrator, although a similar program capable of creating SVG files will suffice. On our web page we will use HTML and CSS to animate our SVG.

2020年网页设计的主要趋势是在网页和徽标设计中增加使用SVG动画。 在本文中,我们将实现一种简单直接的方法来创建相对复杂的动画。 我们将使用Adobe Illustrator,尽管能够创建SVG文件的类似程序就足够了。 在我们的网页上,我们将使用HTML和CSS对SVG进行动画处理。

In this tutorial, we will create the IRIS WEB CORE logo.

在本教程中,我们将创建IRIS WEB CORE徽标。

So let’s begin.

因此,让我们开始吧。

Open Adobe Illustrator and hit “Create new…”, set the artboard width to 1300px and the height to 723px

打开Adobe Illustrator并单击“ Create new…”,将画板宽度设置为1300px,高度设置为723px

Type in some text and hit “ctrl + t” on your keyboard on PC or “Command + t” on Mac.

输入一些文字,然后在PC上的键盘上按“ ctrl + t”,在Mac上按“ Command + t”。

Set the font size to “72pt”, the letter tracking to “100” and the font family to “Helvetica”

将字体大小设置为“ 72pt”,字母跟踪设置为“ 100”,字体系列设置为“ Helvetica”

Image for post

Hit “Document Setup” and select “Edit Artboards”. Move the edges of the art board closer to the edges of the text.

点击“文档设置”,然后选择“编辑画板”。 将画板的边缘移到更靠近文本边缘的位置。

Image for post

Select the text and set the Fill property to “None” and the Stroke property to “White” and “2pt”

选择文本并将“填充”属性设置为“无”,将“描边”属性设置为“白色”和“ 2pt”

Image for post

Go to “File” and “Save As”. Choose the destination for the file and select from the “Save as type” dropdown list “SVG (*.SVG)” and hit “Save”

转到“文件”和“另存为”。 选择文件的目标,然后从“另存为类型”下拉列表中选择“ SVG(* .SVG)”,然后单击“保存”

Image for post

From the following menu on the Fonts group select from the “Type:” dropdown list “Convert to outline”. Hit the “SVG Code…” button. In the text editor that will open remove the first two lines of code before the <svg></svg> tag.

从“字体”组的以下菜单中,从“类型:”下拉列表中选择“转换为轮廓”。 点击“ SVG Code…”按钮。 在打开的文本编辑器中,删除<svg> </ svg>标记之前的前两行代码。

Image for post

Go to the bottom of the file and remove the unnecessary <g></g> tags

转到文件底部,然后删除不必要的<g> </ g>标记

Image for post

Copy the remaining code and paste it into your HTML document. Close Adobe Illustrator.

复制剩余的代码并将其粘贴到HTML文档中。 关闭Adobe Illustrator。

Image for post
Image for post

Remove the <style></style> tag from your html document as we will do the styling in the .css file.

从html文档中删除<style> </ style>标记,因为我们将在.css文件中进行样式设置。

Image for post

To control the size of the SVG Logo and to keep it responsive we set a “max-width: 35em;” on its parent container “.iris-logo-wide”.

为了控制SVG徽标的大小并使其保持响应状态,我们设置了“最大宽度:35em;” 在其父容器“ .iris-logo-wide”上。

Image for post

To animate our SVG we are concerned with adjusting the following parts of the SVG in our CSS — the “.st0” class and the <path></path> tag.

要为SVG设置动画,我们需要调整CSS中SVG的以下部分-“ .st0”类和<path> </ path>标记。

Copy and paste the following code into your CSS file.

将以下代码复制并粘贴到CSS文件中。

.st0{
fill:#000;
stroke:#000;
stroke-width:2;
stroke-miterlimit:10;
}path{
stroke:#000;
fill: #000;
stroke-dasharray:1800;
opacity: 10;
animation: animate 3s cubic-bezier(0,0.23,1,.1);
}@keyframes animate{
0%{
opacity:0;
fill:none;
stroke-dashoffset:1800;
}

30%{
opacity:1;
fill:none;
stroke-dashoffset:1800;
}

90%{
fill:rgba(0,0,0,0);
}
100%{
opacity: 1;
fill:rgba(0,0,0,0);
stroke-dashoffset:0;
}
}

We can set up the colors of the stroke and fill of our SVG in the “.st0” class and the <path></path> tag. We have set them up here to black #000. Notice that we started with a white #FFF stroke and no fill color. in Adobe Illustrator. This is valid for all the properties of the SVG, they can be changed in our .css file.

我们可以在“ .st0”类和<path> </ path>标记中设置笔划和SVG填充的颜色。 我们将其设置为黑色#000。 请注意,我们从白色#FFF笔划开始,没有填充颜色。 在Adobe Illustrator中。 这对SVG的所有属性均有效,可以在我们的.css文件中更改它们。

We want to animate the <path></path> tag so we create an animation “@keyframes animate”. At 0% we start with “opacity:0;” “fill:none;” “stroke-dashoffset:1800;” and at 100% we finish with “opacity: 1;” “fill:rgba(0,0,0,0);” “stroke-dashoffset:0;”.

我们要设置<path> </ path>标签的动画,因此我们创建了动画“ @keyframes animate”。 在0%时,我们从“ opacity:0;”开始 “填充:无;” “ stroke-dashoffset:1800;” 并以100%的“不透明度:1”结束 “ fill:rgba(0,0,0,0);” “ stroke-dashoffset:0;”。

This is the result

这是结果

Image for post
Image for post

You can absolutely customise the animation. Notice that we have used a cubic-bezier animation above. Here is a good place to customize your animation https://cubic-bezier.com/

您可以绝对自定义动画。 注意,我们在上面使用了三次方贝塞尔曲线动画。 这是自定义动画的好地方https://cubic-bezier.com/

Find the full code for our web page below

在下面找到我们网页的完整代码

HTML

HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0"><title>iris Web Core</title>


<meta name="description" content="IRIS WEB CORE is a Website Design and Digital Marketing Agency experienced in delivering customers through attractive design, strategic SEO and Social Media management." /><meta name="author" content="COPYRIGHT 2020 IRIS WEB CORE LTD ALL RIGHTS RESERVED (developed with care by Fabio Aleksiev at irisWebCore)" />



<link href="site.css" rel="stylesheet" type="text/css">

</head><body><div class="hero"><div class="iris-logo-wide">

<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 640 72" style="enable-background:new 0 0 640 72;" xml:space="preserve"><g>
<path class="st0" d="M7.1,9.9h7.1v51.6H7.1V9.9z"/>
<path class="st0" d="M33.5,9.9h23.9c3.9,0,7.2,0.6,9.7,1.7c4.9,2.2,7.3,6.3,7.3,12.2c0,3.1-0.6,5.6-1.9,7.6c-1.3,2-3.1,3.6-5.4,4.7
c2,0.8,3.5,1.9,4.6,3.2s1.6,3.5,1.7,6.5l0.2,6.9c0.1,2,0.2,3.4,0.5,4.4c0.4,1.6,1.2,2.7,2.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17.5h31.4v6.2h-38.2V9.9z"/>
<path class="st0" d="M331.7,9.9h22.2c6,0,10.3,1.8,12.9,5.4c1.5,2.1,2.3,4.6,2.3,7.4c0,3.3-0.9,5.9-2.8,8c-1,1.1-2.3,2.1-4.1,3
c2.6,1,4.6,2.1,5.9,3.4c2.3,2.3,3.5,5.4,3.5,9.3c0,3.3-1,6.3-3.1,9c-3.1,4-8.1,6-14.9,6h-21.8V9.9z M351.3,31.7
c3,0,5.3-0.4,6.9-1.2c2.6-1.3,3.9-3.6,3.9-7c0-3.4-1.4-5.6-4.1-6.8c-1.5-0.7-3.8-1-6.9-1h-12.5v16H351.3z M353.7,55.5
c4.3,0,7.3-1.2,9.2-3.7c1.1-1.6,1.7-3.5,1.7-5.7c0-3.7-1.7-6.3-5-7.7c-1.8-0.7-4.1-1.1-7.1-1.1h-13.9v18.2H353.7z"/>
<path class="st0" d="M451.3,13.6c3.6,3.4,5.6,7.4,6,11.7h-6.8c-0.8-3.3-2.3-6-4.6-7.9c-2.3-1.9-5.5-2.9-9.7-2.9
c-5.1,0-9.2,1.8-12.3,5.4c-3.1,3.6-4.7,9.1-4.7,16.4c0,6,1.4,11,4.2,14.7s7,5.6,12.6,5.6c5.2,0,9.1-2,11.8-5.9
c1.4-2.1,2.5-4.8,3.2-8.2h6.8c-0.6,5.4-2.6,10-6,13.7c-4.1,4.4-9.6,6.6-16.6,6.6c-6,0-11-1.8-15.1-5.4c-5.4-4.8-8.1-12.2-8.1-22.3
c0-7.6,2-13.9,6-18.7c4.4-5.3,10.4-7.9,18-7.9C442.6,8.4,447.7,10.2,451.3,13.6z"/>
<path class="st0" d="M516.1,17.2c3.4,4.6,5.1,10.4,5.1,17.5c0,7.7-2,14.1-5.9,19.2c-4.6,6-11.1,9-19.7,9c-7.9,0-14.2-2.6-18.7-7.9
c-4.1-5.1-6.1-11.5-6.1-19.2c0-7,1.7-13,5.2-17.9c4.5-6.4,11-9.6,19.8-9.6C504.9,8.4,511.7,11.4,516.1,17.2z M509.9,50.1
c2.8-4.4,4.1-9.5,4.1-15.2c0-6.1-1.6-11-4.8-14.7c-3.2-3.7-7.5-5.6-13-5.6c-5.3,0-9.7,1.8-13.1,5.5c-3.4,3.7-5.1,9.1-5.1,16.2
c0,5.7,1.4,10.5,4.3,14.5c2.9,3.9,7.6,5.9,14.1,5.9C502.7,56.8,507.1,54.5,509.9,50.1z"/>
<path class="st0" d="M537.6,9.9h23.9c3.9,0,7.2,0.6,9.7,1.7c4.9,2.2,7.3,6.3,7.3,12.2c0,3.1-0.6,5.6-1.9,7.6s-3.1,3.6-5.4,4.7
c2,0.8,3.5,1.9,4.6,3.2s1.6,3.5,1.7,6.5l0.2,6.9c0.1,2,0.2,3.4,0.5,4.4c0.4,1.6,1.2,2.7,2.3,3.2v1.2h-8.6c-0.2-0.4-0.4-1-0.6-1.7
s-0.3-2.1-0.4-4.1l-0.4-8.6c-0.2-3.4-1.4-5.6-3.8-6.8c-1.3-0.6-3.4-0.9-6.3-0.9h-15.9v22.1h-7V9.9z M560.7,33.5
c3.3,0,5.9-0.7,7.8-2c1.9-1.3,2.9-3.7,2.9-7.1c0-3.7-1.3-6.2-4-7.5c-1.4-0.7-3.3-1.1-5.7-1.1h-17.1v17.6H560.7z"/>
<path class="st0" d="M596.6,9.9h37.7v6.3h-30.8v15.7h28.5v6h-28.5v17.5h31.4v6.2h-38.2V9.9z"/>
</g>
</svg></div></div></body></html>

CSS

CSS

@charset "UTF-8";
/* CSS Document */html,
html * {
padding: 0;
margin: 0 auto;
box-sizing: border-box;
max-width: 1300px;
}.iris-logo-wide {
margin: 0 auto;
max-width: 35em;}body {

padding: 1em;
height: 100em;
background-image: url("https://s3.wasabisys.com/core/Model_G_@80.jpg");
background-repeat: no-repeat;
background-position: top;
background-size: cover;

}.st0{
fill:#000;
stroke:#000;
stroke-width:2;
stroke-miterlimit:10;
}path{
stroke:#000;
fill: #000;
stroke-dasharray:1800;
opacity: 10;
animation: animate 3s cubic-bezier(0,0.23,1,.1);
}@keyframes animate{
0%{
opacity:0;
fill:none;
stroke-dashoffset:1800;
}

30%{
opacity:1;
fill:none;
stroke-dashoffset:1800;
}

90%{
fill:rgba(0,0,0,0);
}
100%{
opacity: 1;
fill:rgba(0,0,0,0);
stroke-dashoffset:0;
}
}

Get Adobe Illustrator from here https://www.adobe.com/products/illustrator.html

从这里https://www.adobe.com/products/illustrator.html获取Adobe Illustrator

That is it my friends, if you liked this article visit our Facebook page and our website IRIS WEB CORE.

就是我的朋友们,如果您喜欢这篇文章,请访问我们的Facebook页面和我们的网站IRIS WEB CORE 。

And as always have a great day!

一如既往的美好!

Find me on LinkedIn: https://www.linkedin.com/in/fabio-aleksiev-irsctx

在LinkedIn上找到我: https : //www.linkedin.com/in/fabio-aleksiev-irsctx

翻译自: https://uxdesign.cc/svg-animation-for-any-website-with-adobe-illustrator-html-and-css-87acaf1a2044

svg配合css3动画

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274219.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于pt100温度计仿真_基于8pt网格的设计系统

基于pt100温度计仿真重点 (Top highlight)This article is the 2nd in a two part series — to the previous chapter in which I demonstrate how to establish an 8pt grid.本文是该系列文章的第二部分 &#xff0c;这是上一章 的第二部分 &#xff0c;在上一章中&#xff0…

利用 k8s 建立软件商店_为企业建立应用商店

利用 k8s 建立软件商店It’s June 2019. I’m sitting in a conference room in Research Triangle Park in North Carolina. At the end of the table are the two executives that have been tapped to lead a new endeavor on behalf of IBM’s $34 billion acquisition of …

苹果复兴_类型复兴的故事:来自Type West的经验教训

苹果复兴Last Fall, I began the 去年秋天&#xff0c;我开始 在旧金山的Type West program at the Letterform档案库中Letterform Archive in San Francisco. For those of you who don’t know, the Letterform Archive is creative heaven — a type nerd’s letter art co…

C#调用ATL COM

作者&#xff1a;朱金灿 来源&#xff1a;http://blog.csdn.net/clever101 简单介绍C#程序如何调用ATL编写的COM组件。 首先新建一个ATL工程&#xff0c;具体如下&#xff1a; 1. 填写工程名称和路径&#xff0c;如下图&#xff1a; 2. 选择工程的服务器类型为动态链接库&a…

浪潮世科和浪潮软件什么关系_社交图形浪潮

浪潮世科和浪潮软件什么关系Nowadays, the cornucopia of graphics seems like a given. However, it was not so long ago that infographics were scarce and lived in closed ecosystems. The majority of graphics were published in newspapers, magazines, or books, and…

PHP图形图像的典型应用 --常用图像的应用(验证码)

php生成动态的验证码&#xff0c;是php防止恶意登陆或者注册等常规手段-废话不多说&#xff0c;直接看例子。&#xff08;只是一个简单的应用&#xff0c;如果要安全或者更复杂的&#xff0c;请期待我以后的文章&#xff09; PHP生成验证码核心文件 (checks.php): <?php/*成…

写saas创业的书_我在SaaS创业公司担任UX设计师的第一个月中学到的三件事

写saas创业的书I recently transitioned from being a copywriter at an ad agency to a UX Designer at a SaaS startup. To add more multidisciplinary skills into the mix, I graduated with a Bachelor in Accountancy.我最近从一名广告代理商的撰稿人过渡到了SaaS初创公…

ui项目答辩中学到了什么_我在UI设计9年中学到的12件事

ui项目答辩中学到了什么重点 (Top highlight)I know these can seem a bit clich but I will try to explain everything from my own experience.我知道这些内容似乎有些陈词滥调&#xff0c;但我会尝试根据自己的经验来解释所有内容。 第一名 (No.1 Never assume) The first…

ux的重要性_UX中清晰的重要性

ux的重要性重点 (Top highlight)Times, since the very first occurrences of web design in the 90’s, have changed a lot design-wise. The particular technology and its applications got more stable. Human-computer interaction (HCI) was deeply researched, design…

可靠消息最终一致性设计_如何最终启动您的设计产品组合

可靠消息最终一致性设计It’s not a secret that most designers procrastinate on their portfolios whether it is to update them or to create them in the first place.大多数设计师在更新产品组合时还是拖延产品组合并不是秘密。 首先创建它们 。 Hopefully, by the e…

游戏用户体验指标_电子游戏如何超越游戏化的用户体验

游戏用户体验指标游戏UX (GAMES UX) During a time when the time spent on video games has reached record breaking heights, due to excessive time indoors, gamification has more of a place now than ever before.d uring的时候花在视频游戏的时间已经达到了 破纪录的高…

JAVA编程心得-JAVA实现CRC-CCITT(XMODEM)算法

CRC即循环冗余校验码&#xff08;Cyclic Redundancy Check&#xff09;&#xff1a;是数据通信领域中最常用的一种差错校验码&#xff0c;其特征是信息字段和校验字段的长度可以任意选定。 1 byte checksum CRC-16 CRC-16 (Modbus) CRC-16 (Sick) …

什么字体字母和数字大小一样_字母和字体如何适应我们的屏幕

什么字体字母和数字大小一样Writing went through many iterations before it became what is today. Times New Roman wasn’t the default script for ancient Egyptians, in fact, paper didn’t even exist when the first words were written.写作经历了许多迭代&#xff…

jenkins 通过批处理自动构建 非标准项目

之前介绍了java和vs2010的项目构建&#xff0c;这些都是比较常见的&#xff0c;所以都用专门的工具。但但难免会遇到一些不常见的项目&#xff0c;下面介绍通过批处理进行构建&#xff0c;并用jenkins调用.我们这里使用plc语言&#xff0c;没有标准环境&#xff0c;只有使用bat…

效果图底图 线框图_5分钟的线框图教程

效果图底图 线框图为什么使用线框&#xff1f; (Why wireframe?) Simply put, wireframes provide a structure and layout for content and assets.简而言之&#xff0c;线框提供了内容和资产的结构和布局。 You can wireframe just about any kind of presentation, from p…

多线程 - 你知道线程栈吗

问题 1. local 变量的压栈和出栈过程 void func1(){ int a 0; int b 0; } 系统中有一个栈顶指针&#xff0c;每次分配和回收local 变量时&#xff0c;其实就是移动栈指针。 2. static local变量的分配风险 void func2(){ static int a 0; } 这个变量a可能会被分…

怎么让qt发声_第3部分:添加网络字体-让我们的单词发声

怎么让qt发声This is a big week for the project. While it was an important step last week to establish some basic responsiveness, we couldn’t really nail down the typography until we added the typeface. Too many aspects of the feel, proportions, and overal…

名词解释:对等知识互联网_网站设计理论:比较和对等

名词解释:对等知识互联网Equivalence and contrast, connection and distinction, categorization and non-categorization are all ways to distinguish the same or different elements. Based on the information they carry, we hope that the equivalent elements can hav…

饥饿的盛世读后感_满足任何设计师饥饿感的原型制作工具

饥饿的盛世读后感Tell me if this story sounds familiar to you. You just wrapped up a design in Sketch -a design that took you hours, and now you want to bring it to life. Sketch’s built-in prototyping tool doesn’t allow you to create all the interactions …

figma 安装插件_我制作Figma插件的经验

figma 安装插件Since Figma released the Figma Community (Beta), I’ve been working on Figma plugins in my free time while I study the code. With the help of an engineer friend of mine, I’ve developed four small plugins so far. As I continue to update these…