Duplication of SVG text-paths on iOS/Safari - ios

I have an SVG on my website that displays text along a path. This works everywhere except on iOS devices. Here the text is duplicated below the paths. See the image below for what I mean by "duplicated". Any idea on why Safari behaves strangely here? If you need more information about the code let me know. The tspans at the bottom simply have a string inside them
<g>
{/* Line connecting the start of the arc with the fairy icon */}
{index >= 5 && last && <line stroke='#fff' strokeWidth="2" x1={fairyPos?.[0]} y1={fairyPos?.[1]} x2={x} y2={y} />}
{/* Rotate the whole group by 90deg in order to initially hide it */}
<g className="-rotate-90" style={{ transform: `rotate(${rotation}deg)` }}>
{/* Gradient along the path */}
<defs>
<linearGradient id={`gradient${index}`}>
<stop offset="0%" stopColor={fairyGradient?.[0]} />
<stop offset="100%" stopColor={fairyGradient?.[1]} />
</linearGradient>
</defs>
{/* Border around the arc */}
<path id={`msg${index}`} d={arc} fill="none" stroke="#fff" strokeWidth={width} strokeLinecap="round" className="drop-shadow-[4px_4px_0_rgba(0,0,0,0.25)]" />
{/* Arc container of the message */}
<path d={arc} stroke={`url(#gradient${index})`} strokeWidth={width - 4} strokeLinecap="round" fill='none' />
{/* Circle at the start of the arc */}
<circle cx={arcStart[0]} cy={arcStart[1]} r={width / 2 - 1} fill={`url(#gradient${index})`} stroke="#fff" strokeWidth="2" />
{/* Text inside the arc */}
<text color="#446688" fontSize="12px" fontFamily="'Kiwi Maru'" className="text-outline-light">
<textPath startOffset={width / 2 - 1 + 5} xlinkHref={`#msg${index}`}>
<tspan x="0" alignmentBaseline={lines > 1 ? "before-edge" : "central"} dy={lines > 1 ? -(width / 2) + 4 : -1} >{text[0]}</tspan>
{text.length > 1 && text.slice(1).map((v, i) => <tspan key={index + '-' + i} x="0" alignmentBaseline="before-edge" dy="1em">{v}</tspan>)}
</textPath>
</text>
</g>
</g>

Figured it out after individually deleting every single property on my svg elements.
The problem was the className="text-outline-light" on the <text> element. The class was used for text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; and apparently Safari doesn't like it, if you define more than one shadow at once.
I deleted that class and used paintOrder="stroke" stroke="#fff" strokeWidth="1.5", which seems a bit better to use anyways.

Related

Drake Parser error: Unable to read the 'value' attribute for the <drake:hunt_crossley_dissipation> tag

I am trying to write a URDF file for a simple pendulum that will act as a 'paddle' - i.e. upon collision with a bouncy ball, the ball will bounce off (like a volleyball player passing a volleyball).
Inspired by this bouncy ball example, I have written the URDF file given below, but loading it with parser.AddModelFromFile("filename.urdf") gives this error:
RuntimeError: filename.urdf:39: error: Unable to read the 'value' attribute for the <drake:hunt_crossley_dissipation> tag
I am surprised that this doesn't work, since it was adapted from the bouncing ball example (which does work). I would really appreciate any guidance, thanks!
URDF file:
<?xml version="1.0"?>
<robot name="pendulum-paddle">
<material name="black">
<color rgba="0 0 0 1" />
</material>
<link name="base">
<inertial>
<origin xyz="0 0 0" />
<mass value="0.01" />
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0" />
</inertial>
</link>
<joint name="base_weld" type="fixed">
<parent link="world" />
<child link="base" />
</joint>
<link name="arm">
<inertial>
<origin xyz="0 0 -1" rpy="0 0 0" />
<mass value="1" />
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
</inertial>
<visual>
<origin xyz="0 0 -.5" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 1"/>
</geometry>
<material name="black" />
</visual>
<collision name="collision">
<origin xyz="0 0 -.5" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 1"/>
</geometry>
<drake:proximity_properties>
<drake:hunt_crossley_dissipation>
0.1
</drake:hunt_crossley_dissipation>
<drake:point_contact_stiffness>
1000000
</drake:point_contact_stiffness>
</drake:proximity_properties>
</collision>
</link>
<joint name="shoulder" type="continuous">
<parent link="base"/>
<child link="arm" />
<axis xyz="0 1 0" />
</joint>
<transmission type="SimpleTransmission" name="shoulder_trans">
<actuator name="shoulder" />
<joint name="shoulder" />
<mechanicalReduction>1</mechanicalReduction>
</transmission>
</robot>
Unfortunately, the syntax is URDF is different than in SDF, and we tried to make the Drake tags comply to the standard.
https://drake.mit.edu/doxygen_cxx/group__multibody__parsing.html#tag_drake_hunt_crossley_dissipation
In urdf, the proximity properties look more like:
<drake:proximity_properties>
<drake:mu_static value="0.8"/>
<drake:mu_dynamic value="0.3"/>
</drake:proximity_properties>
so try
<drake:proximity_properties>
<drake:hunt_crossley_dissipation value="0.1"/>
<drake:point_contact_stiffness value="1000000"/>
</drake:proximity_properties>

Error when applying box-shadow style in CSS - Rails

I would like to use the following box-shadow effect:
box-shadow: 0 1px 20px 0 rgb(231 238 242 / 8%);
It works well when directly applied to the element. But when placed in the .css file, it returns the error:
wrong number of arguments (1 for 3) for `rgb'
May I know what is the root cause please?
Maybe you need to use:
box-shadow: 0 1px 20px 0 rgb(231 238 242/8%);
The whitespace is problem.
In your box-shadow: 0 1px 20px 0 rgb(231 238 242 / 8%); the error in your coloring check your number of arugments for proper color:
You can try this:
box-shadow: 0 1px 20px 0 rgb(231 238 242)

SVG image flickers on iOS 13.3/XS when animated using SMIL. In Safari or Chrome. No difference

Animation works great on all desktop browsers as well as on iPhone 6 or 8 with iOS 12.
On iPhone XS with iOS 13.3 installed, periodic flickering is observed.
<style type="text/css">
#-webkit-keyframes anim_pet {
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(-360deg); transform: rotate(-360deg); }
}
#keyframes anim_pet {
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(-360deg); transform: rotate(-360deg); }
}
.anim_pet {
-webkit-animation: anim_pet 120s infinite linear;
animation: anim_pet 120s infinite linear;
}
</style>
<defs>
<symbol id="symbol_pet">
<path d="M0 0 L0.54 0.26 L0.79 1.29 L0.59 2.16 L-0.07 3.25 L-1.4 4.43 L-3.66 5.45 L-7.07 5.87 L-11.73 5.07 L-14.5 3.94 L-17.52 2.15 L-20.71 -0.43 L-23.96 -3.95 L-27.11 -8.57 L-29.97 -14.44 L-32.27 -21.69 L-33.7 -30.44 L-33.87 -40.75 L-32.32 -52.65 L-28.55 -66.09 L-21.95 -80.91 L-11.89 -96.83 L2.34 -113.45 L21.46 -130.14 L46.2 -146.11 L77.24 -160.3 L115.21 -171.39 L160.59 -177.78 L213.65 -177.54 L274.38 -168.44 L342.41 -147.92 L416.87 -113.12 L496.27 -60.93 "/>
</symbol>
</defs>
<radialGradient id = "gra1" cx = "0%" cy = "0%" r = "424px" gradientUnits="userSpaceOnUse">
<stop stop-color = "rgb(176,156,184)" offset = "0.2">
<animate restart="never" attributeName="offset" calcMode="spline" values="0.2; 0.8" keySplines="0.0 0.0 1.0 1.0" dur="8.0s" repeatCount="1" fill="freeze"/>
</stop>
</radialGradient>
<g id="flower" stroke="url(#gra1)">
<g>
<use class="anim_pet" xlink:href="#symbol_pet"/>
<g transform="scale(-1,1)">
<use class="anim_pet" xlink:href="#symbol_pet"/>
</g>
</g>
<g transform="rotate(-30)">
<use class="anim_pet" xlink:href="#symbol_pet"/>
<g transform="scale(-1,1)">
<use class="anim_pet" xlink:href="#symbol_pet"/>
</g>
</g>
...
<g transform="rotate(-330)">
<use class="anim_pet" xlink:href="#symbol_pet"/>
<g transform="scale(-1,1)">
<use class="anim_pet" xlink:href="#symbol_pet"/>
</g>
</g>
</g>
Also, if I remove the gradient and fill the path, the flicker disappears.
... <g id="flower" stroke="blue"> ...
As I see it, this is a bug in the operating system, because it is observed both in Chrome and in Safari.
Or maybe I'm wrong?
Why exactly in the very latest iphone does this absurdity appear?
This is not in any of the browsers since 2012 :) At least as much as I support.

Multiple Realsense Cameras in URDF File

I have been working with ROS for only a couple weeks, sorry if i misunderstand things. I have made a URDF file with a robot in it. Now I wanted to add two Real-sense D435 cameras onto it so I can see it in Rviz. Following the test file given by Intel I got one camera to show up in the model however, when I try to create a second camera it just doesn't show up.
Question: How can I get two Real-sense cameras on my robot?
This is my URDF file:
<?xml version="1.0" ?>
<robot name="mrm" xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- BGN - Include -->
<xacro:include filename="$(find mrm_description)/urdf/robot_parameters.xacro" />
<xacro:include filename="$(find mrm_description)/urdf/links_joints.xacro" />
<xacro:include filename="$(find realsense2_camera)/urdf/_r435.urdf.xacro"/>
<xacro:include filename="$(find realsense2_camera)/urdf/_r430.urdf.xacro"/>
<m_link_box name="${link_00_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0"
mass="1024"
ixx="170.667" ixy="0" ixz="0"
iyy="170.667" iyz="0"
izz="170.667"
size="1 1 1" />
<m_joint name="${link_00_name}__${link_01_name}" type="revolute"
axis_xyz="0 0 1"
origin_rpy="0 0 0" origin_xyz="0 0 0.5"
parent="base_link" child="link_01"
limit_e="1000" limit_l="-3.14" limit_u="3.14" limit_v="0.5" />
<m_link_mesh name="${link_01_name}"
origin_rpy="0 0 0" origin_xyz="0 0 -0.1"
mass="157.633"
ixx="13.235" ixy="0" ixz="0"
iyy="13.235" iyz="0"
izz="9.655"
meshfile="package://mrm_description/meshes/Link1-v2.stl"
meshscale="0.001 0.001 0.001" />
<m_joint name="${link_01_name}__${link_02_name}" type="revolute"
axis_xyz="0 1 0"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
parent="link_01" child="link_02"
limit_e="1000" limit_l="0" limit_u="0.5" limit_v="0.5" />
<m_link_cylinder name="${link_02_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
mass="57.906"
ixx="12.679" ixy="0" ixz="0"
iyy="12.679" iyz="0"
izz="0.651"
radius="0.15" length="0.8" />
<m_joint name="${link_02_name}__${link_03_name}" type="revolute"
axis_xyz="0 1 0"
origin_rpy="0 0 0" origin_xyz="0 0 0.8"
parent="link_02" child="link_03"
limit_e="1000" limit_l="0" limit_u="0.75" limit_v="0.5" />
<m_link_cylinder name="${link_03_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
mass="57.906"
ixx="12.679" ixy="0" ixz="0"
iyy="12.679" iyz="0"
izz="0.651"
radius="0.15" length="0.8" />
<m_joint name="${link_03_name}__${link_04_name}" type="revolute"
axis_xyz="0 1 0"
origin_rpy="0 0 0" origin_xyz="0 0 0.8"
parent="link_03" child="link_04"
limit_e="1000" limit_l="0" limit_u="0.75" limit_v="0.5" />
<m_link_cylinder name="${link_04_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
mass="57.906"
ixx="12.679" ixy="0" ixz="0"
iyy="12.679" iyz="0"
izz="0.651"
radius="0.15" length="0.8" />
<m_joint name="${link_04_name}__${link_05_name}" type="revolute"
axis_xyz="0 0 1"
origin_rpy="0 0 0" origin_xyz="0 0 0.8"
parent="link_04" child="link_05"
limit_e="1000" limit_l="-3.14" limit_u="3.14" limit_v="0.5" />
<m_link_cylinder name="${link_05_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.125"
mass="18.056"
ixx="0.479" ixy="0" ixz="0"
iyy="0.479" iyz="0"
izz="0.204"
radius="0.15" length="0.25" />
<sensor_r435 name="Camera 1" parent="${link_05_name}">
<origin xyz="0 0 0" rpy="1 0 0"/>
</sensor_r435>
<sensor_r435 name="Camera 2" parent="${link_05_name}">
<origin xyz="0.17 0 0" rpy="0 0 0"/>
</sensor_r435>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
</plugin>
</gazebo>
</robot>
Looks like the realsense xacro doesn't have a "name" parameter which you are supplying, so it doesn't seem to do anything. Ideally, you can modify the intel xacro line -
<xacro:macro name="sensor_d415" params="parent *origin">
to
<xacro:macro name="sensor_d415" params="sensor_name parent *origin">
then add ${sensor_name}to every link and frame name in the intel xacro. Thus when you include this xacro in your URDF with different sensor_name, you recreate the full description each time.
If you get this working cleanly, please do submit a pull request to the intel github page.
In the meantime while waiting for a response I made a second file and added 2 to the end of each variable and that worked. Of course I knew this was not a permanent solution and that I should just keep it to one file. Thanks to Vik I have a solution. I took all the variables from my second file and replaced them with ${sensor_name}. For some reason the camera doesn't show up in rviz anymore. I'm not given any error messages but they just disappeared. Are there any issues with my code that people can see?
<?xml version="1.0"?>
<!--
License: Apache 2.0. See LICENSE file in root directory.
Copyright(c) 2017 Intel Corporation. All Rights Reserved
This is the URDF model for the Intel RealSense 430 camera, in it's
aluminum peripherial evaluation case.
-->
<robot name="sensor_d4352" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="sensor_d415" params="sensor_name parent *origin">
<xacro:property name="M_PI" value="3.1415926535897931" />
<!-- The following values are approximate, and the camera node
publishing TF values with actual calibrated camera extrinsic values -->
<xacro:property name="d435_cam_depth_to_left_ir_offset" value="0.0"/>
<xacro:property name="d435_cam_depth_to_right_ir_offset" value="-0.050"/>
<xacro:property name="d435_cam_depth_to_color_offset" value="0.015"/>
<!-- The following values model the aluminum peripherial case for the
D435 camera, with the camera joint represented by the actual
peripherial camera tripod mount -->
<xacro:property name="d435_cam_width" value="0.090"/>
<xacro:property name="d435_cam_height" value="0.025"/>
<xacro:property name="d435_cam_depth" value="0.02505"/>
<xacro:property name="d435_cam_mount_from_center_offset" value="0.0149"/>
<!-- The following offset is relative the the physical D435 camera peripherial
camera tripod mount -->
<xacro:property name="d435_cam_depth_px" value="${d435_cam_mount_from_center_offset}"/>
<xacro:property name="d435_cam_depth_py" value="0.0175"/>
<xacro:property name="d435_cam_depth_pz" value="${d435_cam_height/2}"/>
<material name="aluminum${sensor_name}">
<color rgba="0.5 0.5 0.5 1"/>
</material>
<!-- camera body, with origin at bottom screw mount -->
<joint name="camera_joint${sensor_name}" type="fixed">
<xacro:insert_block name="origin" />
<parent link="${parent}"/>
<child link="camera_bottom_screw_frame${sensor_name}" />
</joint>
<link name="camera_bottom_screw_frame${sensor_name}"/>
<joint name="camera_link_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_py} ${d435_cam_depth_pz}" rpy="0 0 0"/>
<parent link="camera_bottom_screw_frame${sensor_name}"/>
<child link="camera_link${sensor_name}" />
</joint>
<link name="camera_link${sensor_name}">
<visual>
<origin xyz="${d435_cam_mount_from_center_offset} ${-d435_cam_depth_py} 0" rpy="${M_PI/2} 0 ${M_PI/2}"/>
<geometry>
<!-- <box size="${d435_cam_width} ${d435_cam_height} ${d435_cam_depth}"/> -->
<mesh filename="package://realsense2_camera/meshes/d435.dae" />
<!--<mesh filename="package://realsense2_camera/meshes/d435/d435.dae" />-->
</geometry>
<material name="aluminum"/>
</visual>
<collision>
<origin xyz="0 ${-d435_cam_depth_py} 0" rpy="0 0 0"/>
<geometry>
<box size="${d435_cam_depth} ${d435_cam_width} ${d435_cam_height}"/>
</geometry>
</collision>
<inertial>
<!-- The following are not reliable values, and should not be used for modeling -->
<mass value="0.564" />
<origin xyz="0 0 0" />
<inertia ixx="0.003881243" ixy="0.0" ixz="0.0" iyy="0.000498940" iyz="0.0" izz="0.003879257" />
</inertial>
</link>
<!-- camera depth joints and links -->
<joint name="camera_depth_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="camera_link${sensor_name}"/>
<child link="camera_depth_frame${sensor_name}" />
</joint>
<link name="camera_depth_frame${sensor_name}"/>
<joint name="camera_depth_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_depth_frame${sensor_name}" />
<child link="camera_depth_optical_frame${sensor_name}" />
</joint>
<link name="camera_depth_optical_frame${sensor_name}"/>
<!-- camera left IR joints and links -->
<joint name="camera_left_ir_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_to_left_ir_offset} 0" rpy="0 0 0" />
<parent link="camera_depth_frame${sensor_name}" />
<child link="camera_left_ir_frame${sensor_name}" />
</joint>
<link name="camera_left_ir_frame${sensor_name}"/>
<joint name="camera_left_ir_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_left_ir_frame${sensor_name}" />
<child link="camera_left_ir_optical_frame${sensor_name}" />
</joint>
<link name="camera_left_ir_optical_frame${sensor_name}"/>
<!-- camera right IR joints and links -->
<joint name="camera_right_ir_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_to_right_ir_offset} 0" rpy="0 0 0" />
<parent link="camera_depth_frame${sensor_name}" />
<child link="camera_right_ir_frame${sensor_name}" />
</joint>
<link name="camera_right_ir_frame${sensor_name}"/>
<joint name="camera_right_ir_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_right_ir_frame${sensor_name}" />
<child link="camera_right_ir_optical_frame${sensor_name}" />
</joint>
<link name="camera_right_ir_optical_frame${sensor_name}"/>
<!-- camera color joints and links -->
<joint name="camera_color_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_to_color_offset} 0" rpy="0 0 0" />
<parent link="camera_depth_frame" />
<child link="camera_color_frame${sensor_name}" />
</joint>
<link name="camera_color_frame${sensor_name}"/>
<joint name="camera_color_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_color_frame${sensor_name}" />
<child link="camera_color_optical_frame${sensor_name}" />
</joint>
<link name="camera_color_optical_frame"/>
</xacro:macro>
</robot>

Rails: Bootstrap Editing Forms CSS

I'd like to edit the forms CSS of bootstrap.
bootstrap-sass / vendor / assets / stylesheets / bootstrap / _forms.scss
I grabbed..
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
background-color: $inputBackground;
border: 1px solid $inputBorder;
#include box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
#include transition(border linear .2s, box-shadow linear .2s);
// Focus state
&:focus {
border-color: rgba(82,168,236,.8);
outline: 0;
outline: thin dotted \9; /* IE6-9 */
#include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6));
}
}
And I attempted to change the rgba values of the focus state.
#include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(200,168,136,.6)
But then I get the following error:
Mixin transition takes 1 argument but 2 were passed.
I think I'm not allowed to just "override" the box-shadow mixin? But I'm not sure how to fix this issue. I appreciate any help.
you want to escape the argument :
#include box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(200,168,136,.6)")
notice the ~ (tilde) and the " (quotation marks). This clears confusion about the comma, that less interprets as a seperation between two arguments. See the "escaping" part on less documentation for more info.

Resources