0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

プログレスバーの作り方をメモ:時折現れ、どうつくろうか〜

Last updated at Posted at 2023-07-11

時々出てきて、どうつくろう〜となるプログレスバーの作り方をメモ
タイトルはChatGPTに任せた結果

使ったもの

Rails(7)のテンプレートエンジン
Tailwind CSS

こう書くと

<div class='rounded-full w-full h-2 border border-secondary'>
    <div class='bg-secondary h-full' style="width: calc((<%= step %> / 13) * 100%)"></div>
</div>

stepが進捗
13は合計のstep数だけれど、直書きせずに〇〇.sizeとかでstepの合計をプログラムで取得して渡した方がstepが増えた時とか不具合が起きなくてすみそう

こういう感じのものができる

スクリーンショット 2023-07-10 22.30.56.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?