关于如何在Next.js中实现设计的想法:

huangapple go评论78阅读模式
英文:

Ideas on how to implement a design in next js

问题

我正在使用Next.js和Tailwind进行前端项目开发。我已经拿到了一个Figma设计来实现。有一个部分,我需要展示一些步骤:

关于如何在Next.js中实现设计的想法:

有没有关于如何实现截图中显示的步骤的想法?

英文:

I am working on frontend project in Next.js and Tailwind. I have a been given a Figma design to implement. There is this part where I am supposed to show some steps:

关于如何在Next.js中实现设计的想法:

Any ideas of how I can implement the steps shown in the screenshot?

答案1

得分: 0

你可以考虑使用带有 clip-path 的略有重叠的元素来制作箭头形状:

<div class="flex">
  <div class="bg-orange-200 p-4 grow [clip-path:polygon(0_0,calc(100%-1rem)_0,100%_50%,calc(100%-1rem)_100%,0_100%)]">
    Step 1
  </div>
  <div class="bg-stone-200 p-4 pl-8 grow -ml-2 [clip-path:polygon(0_0,calc(100%-1rem)_0,100%_50%,calc(100%-1rem)_100%,0_100%,1rem_50%)]">
    Step 2
  </div>
  <div class="bg-stone-200 p-4 pl-8 grow -ml-2 [clip-path:polygon(0_0,calc(100%-1rem)_0,100%_50%,calc(100%-1rem)_100%,0_100%,1rem_50%)]">
    Step 3
  </div>
</div>
英文:

You could consider using slightly overlapping elements with clip-path to make the arrow shape:

<!-- begin snippet: js hide: false console: false babel: false -->

<!-- language: lang-html -->

&lt;script src=&quot;https://cdn.tailwindcss.com&quot;&gt;&lt;/script&gt;

&lt;div class=&quot;flex&quot;&gt;
  &lt;div class=&quot;bg-orange-200 p-4 grow [clip-path:polygon(0_0,calc(100%-1rem)_0,100%_50%,calc(100%-1rem)_100%,0_100%)]&quot;&gt;
    Step 1
  &lt;/div&gt;
  &lt;div class=&quot;bg-stone-200 p-4 pl-8 grow -ml-2 [clip-path:polygon(0_0,calc(100%-1rem)_0,100%_50%,calc(100%-1rem)_100%,0_100%,1rem_50%)]&quot;&gt;
    Step 2
  &lt;/div&gt;
  &lt;div class=&quot;bg-stone-200 p-4 pl-8 grow -ml-2 [clip-path:polygon(0_0,calc(100%-1rem)_0,100%_50%,calc(100%-1rem)_100%,0_100%,1rem_50%)]&quot;&gt;
    Step 3
  &lt;/div&gt;
&lt;/div&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年6月22日 03:17:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76526477.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定