Skip to content
Snippets Groups Projects
Commit 275b864c authored by Devyani Ravi's avatar Devyani Ravi
Browse files

making collapsable cards

parent faaf2822
No related branches found
No related tags found
No related merge requests found
Pipeline #453195 passed
<template> <template>
<div class="iterative-cycle"> <div class="collapsible-cards">
<!-- Module Selector Tabs --> <!-- Module Selector Tabs -->
<div class="module-tabs"> <div class="module-tabs">
<div <div
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
<!-- Cycles Display --> <!-- Cycles Display -->
<div v-if="selectedModule !== null" class="cycle"> <div v-if="selectedModule !== null" class="cycle">
<h2>{{ modules[selectedModule].title }}</h2> <h2>{{ modules[selectedModule].title }}</h2>
<div v-for="(cycle, index) in modules[selectedModule].cycles" :key="index" class="cycle-container"> <div v-for="(cycle, index) in modules[selectedModule].cycles" :key="index" class="card">
<button @click="toggleCycle(index)" class="cycle-button"> <h4 @click="toggleCycle(index)">
{{ cycle.title }} {{ cycle.title }}
</button> <span v-if="isCycleOpen(index)"></span>
<div v-if="isCycleOpen(index)" class="cycle-details"> <span v-else></span>
</h4>
<div v-if="isCycleOpen(index)" class="content">
<h3>Phases:</h3> <h3>Phases:</h3>
<ul> <ul>
<li v-for="(phase, phaseIndex) in cycle.phases" :key="phaseIndex"> <li v-for="(phase, phaseIndex) in cycle.phases" :key="phaseIndex">
...@@ -51,24 +53,7 @@ export default { ...@@ -51,24 +53,7 @@ export default {
{ title: 'Learn', description: 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.' }, { title: 'Learn', description: 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.' },
] ]
}, },
{ // Add more cycles as needed
title: 'Cycle 2',
phases: [
{ title: 'Design', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' },
{ title: 'Build', description: 'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' },
{ title: 'Test', description: 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.' },
{ title: 'Learn', description: 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.' },
]
},
{
title: 'Cycle 3',
phases: [
{ title: 'Design', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' },
{ title: 'Build', description: 'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' },
{ title: 'Test', description: 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.' },
{ title: 'Learn', description: 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.' },
]
}
] ]
}, },
{ {
...@@ -78,33 +63,13 @@ export default { ...@@ -78,33 +63,13 @@ export default {
title: 'Cycle 1', title: 'Cycle 1',
phases: [ phases: [
{ title: 'Design', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' }, { title: 'Design', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' },
{ title: 'Build', description: 'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' } { title: 'Build', description: 'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' },
]
}
]
},
{
title: 'Module 3: Design Only',
cycles: [
{
title: 'Cycle 1',
phases: [
{ title: 'Design', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' }
] ]
} },
// Add more cycles as needed
] ]
}, },
{ // Add more modules as needed
title: 'Module 4: Design Only',
cycles: [
{
title: 'Cycle 1',
phases: [
{ title: 'Design', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' }
]
}
]
}
] ]
}; };
}, },
...@@ -128,19 +93,40 @@ export default { ...@@ -128,19 +93,40 @@ export default {
</script> </script>
<style scoped> <style scoped>
/* Layout styles */ .collapsible-cards {
.iterative-cycle { display: flex;
font-family: 'Arial', sans-serif; flex-direction: column;
max-width: 800px; gap: 20px;
margin: 20px auto; margin: 20px 0;
}
.card {
background-color: #e3f2fd;
border: 1px solid #ccc;
border-radius: 10px;
padding: 20px; padding: 20px;
border: 1px solid #ddd; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px; cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
background-color: #f9f9f9;
.card h4 {
color: #396d7e;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
.card .content {
margin-top: 10px;
font-size: 1.1em;
color: #333;
}
h1,
h3 {
color: #396d7e;
} }
/* Module Selector Tabs */
.module-tabs { .module-tabs {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -167,57 +153,4 @@ export default { ...@@ -167,57 +153,4 @@ export default {
color: white; color: white;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
} }
</style>
/* Cycle section */
.cycle {
margin-top: 20px;
}
.cycle-container {
margin: 10px 0;
}
.cycle-button {
width: 100%;
padding: 10px;
font-size: 16px;
background-color: #a3c88a; /* Updated button color */
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.cycle-button:hover {
background-color: #8fb379;
}
.cycle-details {
margin-top: 10px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #ffffff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
/* Typography */
h2 {
color: #2c3e50;
text-align: center;
}
h3 {
color: #3498db;
margin-bottom: 10px;
}
ul {
margin-left: 20px;
}
li {
color: #555;
}
</style>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment