Contenido de comentario de interfaz de usuario semántica

Semantic UI es un marco de código abierto que utiliza CSS y jQuery para crear excelentes interfaces de usuario. Es lo mismo que un bootstrap para usar y tiene grandes elementos diferentes para usar para hacer que su sitio web se vea más increíble. Utiliza una clase para agregar CSS a los elementos.

Los comentarios son una excelente manera de mostrar los comentarios de los usuarios e interactuar sobre el contenido con otros usuarios. La interfaz de usuario semántica nos proporciona un elemento de comentario con estilo. Echemos un vistazo a varios contenidos de comentarios .

Variaciones de comentarios de la interfaz de usuario semántica:

  • Avatar : Esta clase nos permite agregar avatares que representan la imagen social de un usuario.
  • Metadatos : Esta clase nos permite agregar metadatos a los comentarios como fecha de origen, número de me gusta, número de no me gusta
  • Acciones : Esta clase nos permite interactuar con el comentario, como guardar el comentario, dar me gusta al comentario, no me gusta el comentario, etc.
  • Formulario de respuesta : esta clase nos permite agregar un formulario de respuesta para comentar. El usuario puede responder directamente al comentario utilizando este formulario.

Sintaxis:

<div class="ui comments">
 <div class="comment">
   ...
   <div class="content">
    ...
   </div>
 </div>
</div>

Nota: Utilice la sintaxis anterior según la necesidad mediante una combinación de las clases mencionadas anteriormente. Consulte los ejemplos a continuación para una mejor comprensión de las clases.

Ejemplo 1: En el siguiente ejemplo, hemos creado un avatar de comentario .

HTML

<!DOCTYPE html>
<html>
 
<head>
    <title>Semantic UI Comment Content</title>
    <link href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
          rel="stylesheet" />
</head>
 
<body>
    <div class="ui container">
        <h2 class="ui green header">GeeksforGeeks</h2>
        <h4>Semantic UI Comment Content</h4>
        <hr>
        <br />
        <div class="ui comments">
            <h2 class="ui dividing header">Comments</h2>
            <div class="comment">
              <a class="avatar">
                <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
              </a>
              <div class="content">
                <a class="author">Mr. Anonymous</a>
                <div class="text">
                  I am watching you. I know all about you.
                </div>
                <div class="actions">
                  <a class="reply">Reply</a>
                </div>
              </div>
            </div>
            <div class="comment">
                <a class="avatar">
                  <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                  <a class="author">Praneeth</a>
                  <div class="text">
                    Lol. You know nothing about me.
                  </div>
                  <div class="actions">
                    <a class="reply">Reply</a>
                  </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Producción:

Contenido de comentario de interfaz de usuario semántica

Contenido de comentario de interfaz de usuario semántica

Ejemplo 2 : en el siguiente ejemplo, hemos creado comentarios con metadatos .

HTML

<!DOCTYPE html>
<html>
 
<head>
    <title>Semantic UI Comment Content</title>
    <link href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
          rel="stylesheet" />  
</head>
 
<body>
    <div class="ui container">
        <h2 class="ui green header">GeeksforGeeks</h2>
        <h4>Semantic UI Comment Content</h4>
        <hr>
        <br />
        <div class="ui comments">
            <h2 class="ui dividing header">Comments</h2>
            <div class="comment">
                <a class="avatar">
                    <img src=
    "https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                    <a class="author">Mr. Anonymous</a>
                    <div class="metadata">
                        <div class="date">5 minutes ago</div>
                        <div class="rating">
                            <i class="thumbs up icon"></i>
                            100 Likes
                        </div>
                        <div class="rating">
                            <i class="thumbs down icon"></i>
                            5 Likes
                        </div>
                    </div>
                    <div class="text">
                        I am watching you. I know all about you.
                    </div>
                    <div class="actions">
                        <a class="reply">Reply</a>
                    </div>
                </div>
            </div>
            <div class="comment">
                <a class="avatar">
                    <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                    <a class="author">Praneeth</a>
                    <div class="metadata">
                        <div class="date">3 minutes ago</div>
                        <div class="rating">
                            <i class="thumbs up icon"></i>
                            6 Likes
                        </div>
                        <div class="rating">
                            <i class="thumbs down icon"></i>
                            58 Likes
                        </div>
                    </div>
                    <div class="text">
                        Lol. You know nothing about me.
                    </div>
                    <div class="actions">
                        <a class="reply">Reply</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Producción:

Contenido de comentario de interfaz de usuario semántica

Contenido de comentario de interfaz de usuario semántica

Ejemplo 3: En el siguiente ejemplo, hemos creado comentarios con acciones .

HTML

<!DOCTYPE html>
<html>
 
<head>
    <title>Semantic UI Comment Content</title>
    <link href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
          rel="stylesheet" />  
</head>
 
<body>
    <div class="ui container">
        <h2 class="ui green header">GeeksforGeeks</h2>
        <h4>Semantic UI Comment Content</h4>
        <hr>
        <br />
        <div class="ui comments">
            <h2 class="ui dividing header">Comments</h2>
            <div class="comment">
                <a class="avatar">
                    <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                    <a class="author">Mr. Anonymous</a>
                    <div class="metadata">
                        <div class="date">5 minutes ago</div>
                        <div class="rating">
                            <i class="thumbs up icon"></i>
                            100 Likes
                        </div>
                        <div class="rating">
                            <i class="thumbs down icon"></i>
                            5 Likes
                        </div>
                    </div>
                    <div class="text">
                        I am watching you. I know all about you.
                    </div>
                    <div class="actions">
                        <a class="reply">Reply</a>
                        <a class="like">
                            <i class="thumbs up icon"></i>
                            Like
                        </a>
                        <a class="dislike">
                            <i class="thumbs down icon"></i>
                            Dislike
                        </a>
                        <a class="save">
                            Save
                        </a>
                    </div>
                </div>
            </div>
            <div class="comment">
                <a class="avatar">
                    <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                    <a class="author">Praneeth</a>
                    <div class="metadata">
                        <div class="date">3 minutes ago</div>
                        <div class="rating">
                            <i class="thumbs up icon"></i>
                            6 Likes
                        </div>
                        <div class="rating">
                            <i class="thumbs down icon"></i>
                            58 Likes
                        </div>
                    </div>
                    <div class="text">
                        Lol. You know nothing about me.
                    </div>
                    <div class="actions">
                        <a class="reply">Reply</a>
                        <a class="like">
                            <i class="thumbs up icon"></i>
                            Like
                        </a>
                        <a class="dislike">
                            <i class="thumbs down icon"></i>
                            Dislike
                        </a>
                        <a class="save">
                            Save
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Producción:

Contenido de comentario de interfaz de usuario semántica

Contenido de comentario de interfaz de usuario semántica

Ejemplo 4: En el siguiente ejemplo, hemos creado comentarios con un formulario de respuesta .

HTML

<!DOCTYPE html>
<html>
 
<head>
    <title>Semantic UI Comment Content</title>
    <link href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
         rel="stylesheet" />
</head>
 
<body>
    <div class="ui container">
        <h2 class="ui green header">GeeksforGeeks</h2>
        <h4>Semantic UI Comment Content</h4>
        <hr>
        <br />
        <div class="ui comments">
            <h2 class="ui dividing header">Comments</h2>
            <div class="comment">
                <a class="avatar">
                    <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                    <a class="author">Mr. Anonymous</a>
                    <div class="metadata">
                        <div class="date">5 minutes ago</div>
                        <div class="rating">
                            <i class="thumbs up icon"></i>
                            100 Likes
                        </div>
                        <div class="rating">
                            <i class="thumbs down icon"></i>
                            5 Likes
                        </div>
                    </div>
                    <div class="text">
                        I am watching you. I know all about you.
                    </div>
                    <div class="actions">
                        <a class="reply">Reply</a>
                        <a class="like">
                            <i class="thumbs up icon"></i>
                            Like
                        </a>
                        <a class="dislike">
                            <i class="thumbs down icon"></i>
                            Dislike
                        </a>
                        <a class="save">
                            Save
                        </a>
                    </div>
                </div>
            </div>
            <div class="comment">
                <a class="avatar">
                    <img src=
"https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg">
                </a>
                <div class="content">
                    <a class="author">Praneeth</a>
                    <div class="metadata">
                        <div class="date">3 minutes ago</div>
                        <div class="rating">
                            <i class="thumbs up icon"></i>
                            6 Likes
                        </div>
                        <div class="rating">
                            <i class="thumbs down icon"></i>
                            58 Likes
                        </div>
                    </div>
                    <div class="text">
                        Lol. You know nothing about me.
                    </div>
                    <div class="actions">
                        <a class="reply">Reply</a>
                        <a class="like">
                            <i class="thumbs up icon"></i>
                            Like
                        </a>
                        <a class="dislike">
                            <i class="thumbs down icon"></i>
                            Dislike
                        </a>
                        <a class="save">
                            Save
                        </a>
                    </div>
                    <form class="ui reply form">
                        <div class="field">
                          <textarea></textarea>
                        </div>
                        <div class="ui primary submit labeled icon button">
                          <i class="icon edit"></i> Add Reply
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Producción:

Contenido de comentario de interfaz de usuario semántica

Contenido de comentario de interfaz de usuario semántica

Referencia: https://semantic-ui.com/views/comment.html

Publicación traducida automáticamente

Artículo escrito por coder_srinivas y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *