Here's a potential modern-style webpage design for Demon Slayer characters, with a sliding down effect for each character's details:
HTML Structure
<!-- Container for the character showcase -->
<div class="character-showcase">
<!-- Character cards will be generated dynamically -->
<div class="character-card" v-for="(character, index) in characters" :key="index">
<!-- Character image and name -->
<div class="character-info">
<img :src="character.image" :alt="character.name">
<h2>{{ character.name }}</h2>
</div>
<!-- Character details (initially hidden) -->
<div class="character-details">
<p>{{ character.description }}</p>
<ul>
<li>Age: {{ character.age }}</li>
<li>Breathing Style: {{ character.breathingStyle }}</li>
<li>Personality: {{ character.personality }}</li>
</ul>
</div>
</div>
</div>
CSS Styling
.character-showcase {
position: relative;
width: 100%;
height: 100vh;
overflow-y: hidden;
}
.character-card {
position: relative;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-size: cover;
background-position: center;
transition: transform 0.5s ease-in-out;
}
.character-info {
z-index: 1;
text-align: center;
}
.character-info img {
width: 200px;
height: 200px;
border-radius: 50%;
object-fit: cover;
}
.character-details {
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
padding: 20px;
transition: transform 0.5s ease-in-out;
}
.character-card:hover .character-details {
transform: translateY(-100%);
}
.character-details ul {
list-style: none;
padding: 0;
margin: 0;
}
.character-details li {
margin-bottom: 10px;
}
JavaScript (using Vue.js)
// Sample data for Demon Slayer characters
const characters = [
{
name: 'Tanjiro Kamado',
image: 'tanjiro.jpg',
description: 'The main protagonist of the series, Tanjiro is a kind and determined young boy who becomes a demon slayer to avenge his family and cure his sister.',
age: 16,
breathingStyle: 'Water Breathing',
personality: 'Compassionate, Determined'
},
{
name: 'Zenitsu Agatsuma',
image: 'zenitsu.jpg',
description: 'A cowardly but lovable character, Zenitsu is a fellow demon slayer who joins Tanjiro on his journey.',
age: 16,
breathingStyle: 'Thunder Breathing',
personality: 'Timid, Loyal'
},
{
name: 'Inosuke Hashibira',
image: 'inosuke.jpg',
description: 'A hot-headed and fierce fighter, Inosuke is a young demon slayer who is also a companion of Tanjiro.',
age: 16,
breathingStyle: 'Beast Breathing',
personality: 'Aggressive, Confident'
}
// Add more characters here...
];
new Vue({
el: '.character-showcase',
data: {
characters
}
});
How it works
- The HTML structure consists of a container element
.character-showcase that holds multiple .character-card elements, each representing a Demon Slayer character.
- The CSS styling is used to create a full-screen, scrolling effect for each character card. The
.character-details element is initially hidden and slides down when the user hovers over the character card.
- The JavaScript code uses Vue.js to generate the character cards dynamically based on the
characters data array. Each character card is bound to a specific character object, which contains the character's details.
Example Use Case
To add more characters to the showcase, simply append more objects to the characters array in the JavaScript code. For example:
const characters = [
// ... existing characters ...
{
name: 'Nezuko Kamado',
image: 'nezuko.jpg',
description: 'Tanjiro\'s sister, Nezuko is a demon who is also the main reason for Tanjiro\'s journey.',
age: 14,
breathingStyle: 'None',
personality: ' Gentle, Protective'
}
];
This will generate a new character card for Nezuko Kamado, with the specified details.