In the midst of working on SVG, I'm trying to implement a color change effect upon hover. The desired functionality is such that when hovering over the .business div, the color of the SVG business path should also change accordingly as specified in the initial div. Similarly, if hovering over the SVG element itself, the color of the surrounding div should shift.
Whether you hover over the .business div or the SVG, the color change should take place
. Furthermore, I aim to incorporate an active state upon hover for any SVG or div. Additionally, I seek assistance in adjusting the spacing between SVG paths
. Can someone guide me through this?
.tp-section {
position: relative;
display: flex;
justify-content: center;
margin: 0 50px;
height: 100vh;
}
.tpc-info {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.tpc {
flex-basis: 50%;
height: 26%;
}
.tp-circle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.tp-block {
width: 35%;
}
.right {
float: right;
}
.frag {
fill: #4472c4;
stroke: #FFFFFF;
transition: fill 0.3s;
}
.center {
fill: #00b0f0;
}
a:hover .frag6 {
fill: #FFC722;
}
.tpc.tp-content-business:hover,
.frag6:hover .tpc-tp-content-business {
background: #FFC722;
}
.tpc-tp-content-business:hover .frag6 {
fill: #FFC722;
}
text {
font-size: 10px;
fill: #FFFFFF;
}
<div class="tp-section">
<div class="tp-circle">
<svg width="400" height="840" viewBox="-2 -2 202 203" shape-rendering="geometricPrecision">
<a xlink:href="#"><path class="frag1" d="M100,100 v-100 a100,100 1 0,1 86.6025,50" /><text x="135" y="42.5" text-anchor="middle">Tech</text></a>
<a xlink:href="#"><path class="frag2" d="M100,100 l86.6025,-50 a100,100 1 0,1 0,100" /><text x="170" y="105" text-anchor="middle">ERP</text></a>
<a xlink:href="#"><path class="frag3" d="M100,100 l86.6025,50 a100,100 1 0,1 -86.6025,50" /><text x="135" y="170" text-anchor="middle">trans</text></a>
<a xlink:href="#"><path class="frag4" d="M100,100 v100 a100,100 1 0,1 -86.6025,-50" /><text x="65" y="170" text-anchor="middle">Mergers</text></a>
<a xlink:href="#"><path class="frag5" d="M100,100 l-86.6025,50 a100,100 1 0,1 0,-100" /><text x="27.5" y="105" text-anchor="middle">Inno</text></a>
<a xlink:href="#"><path class="frag6" d="M100,100 l-86.6025,-50 a100,100 1 0,1 86.0025,-50" /><text x="65" y="42.5" text-anchor="middle">Busi</text></a>
<a xlink:href="#"><path class="center" d="M100,100 v-50 a50,50 1 0,1 0,100 a50,50 1 0,1 0,-100" /></a>
</svg>
</div>
<div class="tpc-info">
<div class="tpc tp-content-business">
<div class="tp-block">
<p>Business etur adipiscing elit. </p>
</div>
</div>
<div class="tpc tp-content-innovation">
<div class="tp-block right">
<p>Innovation consecnaeos.</p>
</div>
</div>
<div class="tpc tp-content-mergers">
<div class="tp-block">
<p>Mergers adipiscing eaeos.</p>
</div>
</div>
<div class="tpc tp-content-trans">
<div class="tp-block right">
<p>Trans consectceptos himenaeos.</p>
</div>
</div>
<div class="tpc tp-content-erp">
<div class="tp-block">
<p>ERP onsectetur enaeos.</p>
</div>
</div>
<div class="tpc tp-content-tech">
<div class="tp-block right">
<p>Tech adiptos himenaeos.</p>
</div>
</div>
</div>
</div>