0
0

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 3 years have passed since last update.

ニューモーフィズムを実装してみた

Last updated at Posted at 2021-11-30

neumorphism.png

言語

  • html
  • css

用いたツール

  • neumorphism.io

実装例

以下の実装で上記の様に実装できます。

sample.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
    <link rel="stylesheet" href="sample.css">
</head>
<body>
    <div class = "contents">
        <div class="button1">
            <a class="icon" href="#">
                <i class="fas fa-user-alt"></i>
            </a>
        </div>
        <div class="button2">
            <a class="icon" href="#">
                <i class="fas fa-search"></i>
            </a>
        </div>
        <div class="button3">
            <a class="icon" href="#">
                <i class="fas fa-heart" style="color: #902727;"></i>
            </a>
        </div>
        <div class="button4">
            <a class="icon" href="#">
                <i class="fas fa-home"></i>
            </a>
        </div>
    </div>
</body>
</html>
sample.css
body{
    background: #ebebeb;
}
.icon{
    display: block;
    font-size: 2em;
    margin-top: 25px;
    align-items: center;   
    color: rgb(88, 88, 88);
}
.contents{
    text-align: center;

}
.button1{
    width: 100px;
    height: 100px;
    margin: 10px;
    display: inline-block;
    border-radius: 20px;
    background: #ebebeb;
    box-shadow:  24px 24px 20px #d1d1d1,
                 -24px -24px 20px #ffffff;
}
.button2{
    width: 100px;
    height: 100px;
    margin: 10px;
    display: inline-block;
    border-radius: 50px;
    background: linear-gradient(145deg, #d4d4d4, #fbfbfb);
    box-shadow:  24px 24px 20px #d1d1d1,
                 -24px -24px 20px #ffffff;
}
.button3{
    width: 100px;
    height: 100px;
    margin: 10px;
    display: inline-block;
    border-radius: 20px;
    background: linear-gradient(145deg, #fbfbfb, #d4d4d4);
    box-shadow:  24px 24px 20px #d1d1d1,
                 -24px -24px 20px #ffffff;
}
.button4{
    width: 100px;
    height: 100px;
    margin: 10px;
    display: inline-block;
    border-radius: 50px;
    background: #ebebeb;
    box-shadow: inset 24px 24px 20px #d1d1d1,
                inset -24px -24px 20px #ffffff;
}
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?