Text aligns with the curve, ViewBox trims the characters

I'm stuck with an issue regarding a rotating text on a circle. The problem is that the copy gets cropped by the viewbox. I've tried adjusting the viewbox parameters to "zoom out", but whenever I change the current value of 141, instead of zooming, the shape moves (see screenshot).

https://i.sstatic.net/tcgjx.png

Any suggestions or thoughts on how to resolve this? Thank you in advance!

body {
  min-height: 100vh;
  width: 100%,
}

.containerSpinText {
  -webkit-box-align: center;
  align-items: center;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  flex: 1;
  overflow: hidden;
  min-height: 100vh;
  font-family: BasisGrotesquePro-Regular;
  font-size: 20px;
  position: relative;
}

@media (max-width: 600px) {
  .containerSpinText {
    margin-top: 0;
    font-size: 18px;
  }
}

.logo {
  margin: 0 auto;
  min-width: auto;
  border-radius: 50%;
  height: 26em;
  width: 26em;
  position: relative;
}

.logo svg {
  display: block;
  position: relative;
}

.white {
  fill: white;
  transition: .3s;
}

.logo svg.nav {
  cursor: pointer;
  position: absolute;
  top: 0;
  animation: spin 1000s linear infinite;
  z-index: 100;
  animation-name: spin;
  animation-duration: 15000ms;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.logo svg.nav path {
  fill: none;
}

@media (max-width: 600px) {
  .logo {
    margin: 0 auto;
    min-width: auto;
    border-radius: 50%;
    height: 20em;
    width: 20em;
    position: relative;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
<div class="containerSpinText">
  <div class="logo">
    <svg viewBox="0 0 141 141" class="nav">

            <path id="SVGID_x5F_3_x5F_" class="st0" d="M92.3,14.6c30.9,12,46.1,46.8,34.1,77.7c-12,30.9-46.8,46.1-77.7,34.1
            c-30.9-12-46.1-46.8-34.1-77.7S61.4,2.6,92.3,14.6z"/>
            <text id='testo'><textPath  xlink:href="#SVGID_x5F_3_x5F_">
            <tspan>Christmas 2020. Have a holly jolly one! :)</tspan></textPath>
            </text>
          </circle>
        </div>
  </div>

Answer №1

It appears that the overflow is currently set to hidden. To address this issue with zooming, you can encapsulate your view box within a div and then implement a zoom out effect on that particular div. Here's an example:

.exampleDiv {
 zoom: 50%;
}

Alternatively,

.logo svg{
overflow: visible;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Create an HTML button with dual functionality

I currently have a button in my HTML that triggers the opening of the sidebar on mobile devices. <a href="#header" class="button scrolly">Contact Me</a> There is also a label element that, when clicked, selects the name field in the contact f ...

React Download Button: Easy way to offer file downloads on

I am trying to create a download button for users to download zip files from Cloudinary using React. I have attempted different methods to implement this feature, but so far, I have been unsuccessful. Whenever I click on the button, it modifies the route i ...

Mastering the Art of Aligning Avatars: Effortless Right Alignment

Here's the updated version of the navigation bar: <nav class="navbar navbar-expand-md navbar-dark bg-dark static-top"> <button class="navbar-toggler" type="button" data-toggle="collapse"> ...

Bootstrap 4's responsive table design simplifies form fields by condensing them when the text is not visible

How can I resolve the issue of form field values not being visible when selected, especially when the table fits the screen? I want the table to be scrollable and ensure that the form fields are clearly visible. This problem is particularly noticeable in t ...

Do not generate an HTML cookie

I've encountered an issue while trying to create a cookie using the following code: window.onload = function() { var value = readCookie('username'); if(value == null){ alert("null"); document.cookie = "username=Bob; expires=Thu, 18 ...

Tips on choosing vml elements using jquery or vanilla javascript

I am trying to select a VML element using jQuery without relying on 'id' or 'class', but my attempts have been unsuccessful so far. <v:oval id="vmlElement" style='width:100pt;height:75pt' fillcolor="red"> </v:oval> ...

Safari in iOS8 experiencing problems with -webkit-overflow-scrolling: touch;

Our team has been developing a web app for a client that functioned perfectly on iOS7 in Safari. However, upon testing the app on iOS8, some significant bugs were discovered. After a user opens and closes the sidebar, content within a <section style=" ...

What are some strategies for preventing the $window.alert function from being triggered within an AngularJS controller's scope?

How can I prevent the alert from appearing on my dashboard? Do you have any suggestions? Thank you! I attempted to override the alert empty function in my controller, but I am still encountering the window alert when I navigate to my page. $window.alert ...

What exactly does Apple consider as a "user action"?

In the midst of my current web project, I am facing a challenge with initiating video playback after a swipe event. Despite utilizing the HTML5 video player and JavaScript to detect swipes, I have encountered difficulties in achieving this functionality. I ...

Limit the number of words in an HTML input box

Is it possible to set a maximum word limit for a textbox that a user can input, rather than limiting the number of characters? I did some research and discovered a way to determine the number of words a user has entered using regular expressions, but I& ...

What's the reason for not being able to customize classes for a disabled element in Material-UI?

Currently, I am utilizing Material-UI to style my components. However, I am facing challenges when trying to customize the label class for disabled buttons. Despite setting a reference as "&$disabled", it does not yield the desired results. import Rea ...

Ways to format table using flex-wrap sans the use of flexbox

My HTML and CSS structure is as follows: .item { background: white; padding: 5px; display: inline-block; text-align: center; } .item > div { background: yellow; width: 60px; height: 60px; border-radius: 50%; display: table-cell; ...

Tips for utilizing browser cache in AJAX requests to prevent loading the refreshed JSON file

It may seem like a strange question, but I'm experiencing an issue with an AJAX call to a JSON file. Both the request and response headers do not indicate to not use cache, and in the browser settings, the Disable cache option is not checked. What mor ...

The background color property of the CSS class "ui-layout-north

Currently working with primefaces 4.3 and incorporating it into my main UI. My goal is to modify the background color of the north unit to red, as currently only the top 80% of the unit is affected. .ui-layout-north .ui-layout-unit-content { backgro ...

Is it possible to filter JavaScript Array while ensuring that select options do not contain duplicate IDs?

I am utilizing two datatables with drag and drop functionality. Each row in the datatables contains IDs. When I drag a row from table 1 to table 2, the data is stored in an Array. I have an addArray function that pushes the IDs into the Array, filters out ...

Option and Select elements in iOS have unique font sizes

I noticed that the font size of my option is different from my select in Chrome PC compared to IOS. The sizes are exaggerated in the snippet provided. I experimented with and without using optgroup. .styled-select { overflow: hidden; height: 74px; float ...

The array is producing accurate results, however it is displaying as undefined in the HTML output

I have encountered a problem while working on my project. I am utilizing an API to fetch an array of platforms where a video game is available. Although the array is returning the correct data, I am facing difficulty in displaying these values in my HTML a ...

Picture remains unchanged in Chrome

I'm struggling to understand why my images do not resize when I shrink or resize my Chrome window. Can someone help me out with an explanation? I've been trying for some time now but still can't seem to crack it, and I haven't found the ...

Exploring JSON data using Mustache JS

I've been attempting to use Mustache JS to iterate through JSON Data and populate a table that follows this format: { "Pay":[ [ "Regular Hours", "$75.00", "$75.00" ] ], "Earnings":[ [ "Re ...

What factors influence the timing of Chrome's spell-check feature for a particular word?

Currently, I am troubleshooting a bug in our code that is related to text input behavior. The issue at hand is that in one field, when you start typing on Chrome, the word does not get red underlined until you press space. However, in another field, Chrom ...