├── script.js ├── styles.css └── index.html /script.js: -------------------------------------------------------------------------------- 1 | // Expand/Collapse Rectangle Layers 2 | document.querySelectorAll('.layer').forEach(layer => { 3 | layer.addEventListener('click', e => { 4 | e.stopPropagation(); 5 | layer.classList.toggle('collapsed'); 6 | layer.classList.toggle('active'); 7 | }); 8 | }); 9 | 10 | // Accordion Interaction 11 | document.querySelectorAll('.acc-header').forEach(header => { 12 | header.addEventListener('click', () => { 13 | const item = header.parentElement; 14 | item.classList.toggle('active'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Segoe UI', sans-serif; 3 | background: #f9fafc; 4 | margin: 0; 5 | padding: 20px; 6 | text-align: center; 7 | } 8 | 9 | .title { 10 | margin-bottom: 20px; 11 | font-size: 1.5rem; 12 | font-weight: 600; 13 | } 14 | 15 | /* Main container ensures all components align evenly */ 16 | .diagram { 17 | width: 90%; 18 | max-width: 1200px; 19 | margin: 0 auto; 20 | display: flex; 21 | flex-direction: column; 22 | align-items: center; 23 | } 24 | 25 | /* Layer (rectangle rings) */ 26 | .layer { 27 | position: relative; 28 | border-radius: 12px; 29 | margin: 10px auto; 30 | cursor: pointer; 31 | overflow: hidden; 32 | box-shadow: 0 3px 6px rgba(0,0,0,0.15); 33 | transition: transform 0.35s ease, box-shadow 0.35s ease; 34 | } 35 | 36 | .layer .header { 37 | padding: 10px; 38 | font-weight: bold; 39 | text-transform: uppercase; 40 | } 41 | 42 | .layer .content { 43 | display: flex; 44 | flex-wrap: wrap; 45 | justify-content: center; 46 | gap: 8px; 47 | padding: 10px; 48 | max-height: 800px; 49 | overflow: hidden; 50 | transition: max-height 0.45s ease; 51 | } 52 | 53 | /* Collapsed layers */ 54 | .layer.collapsed .content { 55 | max-height: 0; 56 | padding-top: 0; 57 | padding-bottom: 0; 58 | } 59 | 60 | .layer.collapsed { 61 | opacity: 0.85; 62 | } 63 | 64 | /* Highlight layer on click */ 65 | .layer.active { 66 | box-shadow: 0 0 20px 4px rgba(0, 150, 255, 0.5); 67 | transform: scale(1.02); 68 | } 69 | 70 | /* Control labels */ 71 | .layer .content span { 72 | background: rgba(255,255,255,0.6); 73 | border: 1px solid rgba(0,0,0,0.1); 74 | padding: 6px 10px; 75 | border-radius: 8px; 76 | font-size: 0.9rem; 77 | transition: all 0.3s ease; 78 | } 79 | 80 | .layer .content span:hover { 81 | background: #fff8dc; 82 | transform: scale(1.05); 83 | } 84 | 85 | /* Layer Colors + Width Scaling */ 86 | .physical { background: #f4c69d; width: 100%; } 87 | .administrative { background: #f5b5b0; width: 85%; } 88 | .technical { background: #cfe7c7; width: 75%; } 89 | .minimum { background: #f1e4b3; width: 65%; } 90 | .crown { background: #dcd0f3; width: 50%; } 91 | 92 | /* Cyber Hygiene Section */ 93 | .cyber-hygiene { 94 | margin-top: 25px; 95 | width: 98%; 96 | background: #b4d5f9; 97 | border-radius: 12px; 98 | box-shadow: 0 3px 6px rgba(0,0,0,0.15); 99 | padding: 15px; 100 | } 101 | 102 | .cyber-hygiene .header { 103 | font-weight: bold; 104 | text-transform: uppercase; 105 | margin-bottom: 8px; 106 | color: #03396c; 107 | } 108 | 109 | .cyber-hygiene .content { 110 | font-size: 0.95rem; 111 | line-height: 1.45; 112 | } 113 | 114 | /* Accordion */ 115 | .accordion { 116 | margin-top: 15px; 117 | width: 100%; 118 | text-align: left; 119 | } 120 | 121 | .acc-item { 122 | margin-bottom: 8px; 123 | } 124 | 125 | .acc-header { 126 | width: 100%; 127 | background: #5b8fc9; 128 | color: white; 129 | border: none; 130 | padding: 10px; 131 | text-align: left; 132 | font-size: 0.95rem; 133 | cursor: pointer; 134 | border-radius: 6px; 135 | transition: background 0.3s; 136 | } 137 | 138 | .acc-header:hover { 139 | background: #4076ac; 140 | } 141 | 142 | .acc-body { 143 | max-height: 0; 144 | overflow: hidden; 145 | background: #ffffffd9; 146 | border-radius: 6px; 147 | padding: 0 12px; 148 | transition: max-height 0.45s ease, padding 0.35s ease; 149 | } 150 | 151 | .acc-item.active .acc-body { 152 | max-height: 450px; 153 | padding: 10px 12px; 154 | } 155 | 156 | .acc-body ul { 157 | margin: 5px 0 10px 18px; 158 | padding: 0; 159 | font-size: 0.92rem; 160 | line-height: 1.45; 161 | } 162 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |