How to make SVG path animation work on safari? - ios

I am doing svg path animation in it works fine in all browsers except safari and IE
svg example
<svg
v-if="waveid == 6"
class="gotthard-red-pipe"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 732.36 411.6"
>
<g id="Ebene_2" data-name="Ebene 2">
<g id="Ebene_20" data-name="Ebene 20">
<rect class="bg-transparent" width="732.36" height="411.6" />
</g>
<g id="_2._Roehre" data-name="2. Roehre">
<g id="_2._Roehre_right_to_left" data-name="2. Roehre right to left">
<g id="_2_Roehre_bg" data-name="2_Roehre_bg">
<path
:id="'wave' + waveid"
filter="url(#innershadow)"
class="gothard-p3"
stroke="url(#img1)"
d="M665.66,139.6c-10.77,15.38-14.62,23.6-28.93,31s-70.26,35-137.92,60.48c-70.41,26.55-98.59,29.81-110.42,31.78a77.71,77.71,0,0,1-21.51-.82s-120.55-24.63-130.07-26.44a195.88,195.88,0,0,1-22-6.07S113,190.15,100,187.36s-30,.95-30,.95"
/>
</g>
<g style="transform: translateY(-55px);">
<foreignObject
width="30"
height="80"
transform="translate(-12 -24)"
>
<div class="valueSpan-wrapper">
<div
xmlns="http://www.w3.org/1999/xhtml"
class="valueSpan"
:id="'valueSpan' + waveid"
></div>
</div>
</foreignObject>
<animateMotion
:id="'motion' + waveid"
dur="1s"
:repeatCount=" percentageCustom / 100"
fill="freeze"
path="M665.66,139.6c-10.77,15.38-14.62,23.6-28.93,31s-70.26,35-137.92,60.48c-70.41,26.55-98.59,29.81-110.42,31.78a77.71,77.71,0,0,1-21.51-.82s-120.55-24.63-130.07-26.44a195.88,195.88,0,0,1-22-6.07S113,190.15,100,187.36s-30,.95-30,.95"
></animateMotion>
</g>
</g>
</g>
</g></svg
this code is done in vue.js
Problem is in Foreign object, it should animate on path which is same d = path in animateMotion, repeat count make path move in value what user set up in craftcms
css
.gotthard-blue-pipe,
.gotthard-green-pipe,
.gotthard-red-pipe {
position: absolute;
width: 100%;
left: 50%;
transform: translate(-50%, 0);
}
.textContainer {
width: 90%;
}
.z1{
position: absolute;
z-index: 999;
}
.z2{
position: absolute;
z-index: 998;
}
.valueSpan-wrapper{
width: 100%;
height: 100%;
position: relative;
}
.valueSpan {
position: absolute;
background-color: white;
border: 1px solid $color4;
padding: 2px;
transform: skew(15deg, 320deg) rotate(15deg);
z-index: 99;
color: #4b4d53;
font-weight: 600;
width: 30px;
font-size: 8px;
text-align: center;
bottom: 30px;
left: 0 !important;
.stand {
height: 1px;
width: 50px;
background: #87888d;
position: absolute;
transform: rotate(90deg) translateX(28px) translateY(25px);
}
}
is it possible to animate foreign object with this way also in safari or I have to use different approach?

Related

Ionic Preview & iOS preview issue

I have an issue here with 0clue what is going on. I am currently developing an application using ionic angular. The preview on the web version is totally fine and looks good reference image.
But when I deploy it into iOS the button shape is off and there is a white structure blocking part of the header reference image.
I am new to the app developing world, please bear with my stupidity on this.
Can someone guide me in the right direction, please?
ion-toolbar {
--background: #383E56;
height: 102px;
}
ion-header ion-toolbar:last-of-type {
display: flex;
align-items: center;
justify-content: center;
}
.searchbar {
width: 352px;
height: 42px;
background: #C2C3C8;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.6);
border-radius: 90px;
-webkit-position: sticky;
position: sticky;
display: flex;
justify-content: flex-end;
padding: 3px 3px;
margin: auto;
margin-top: 35px;
}
.btn2{
width: 36px;
height: 36px;
border-radius: 50%;
box-sizing: border-box;
background: #F69E7B;
box-shadow: 0.5px 0.5px 0.5px rgb(0 0 0 / 25%);
//position
position: absolute;
top: 3px;
left: 313px;
//vector size & position
font-size: 27px;
display: flex;
justify-content: flex-end;
align-items: center;
justify-content: center;
}
<ion-header>
<ion-toolbar>
<div class="searchbar">
<button class="btn2" (click)="toMorePage()">
<ion-icon name="arrow-back-outline"></ion-icon>
</button>
</div>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>

keyboard pushes up the divs on mobile views with React

I have this message thread component that has a header, content and a textarea and everytime. The issue here is in mobile views, when I want to type a message the keyboard on IOS (Iphones) pushes the divs up so the header would be hidden, I don't want this behavior, for Android it doesn't behave like this. This app is using React and scss and the code is this:
<div className="message-thread-wrapper d-flex flex-column">
<div className="messages-header d-flex flex-row justify-content-between align-items-center">
<Icon
className="back-btn d-lg-none"
icon="chevron-left"
onClick={(e) => {
e.stopPropagation();
actions.closeMessage();
}}
/>
<h5 className="messages-title text-truncate">
{participant.firstname && participant.lastname ? `${participant.firstname} ${participant.lastname}` : participant.name}
</h5>
<div className="messages-header-right d-flex flex-row align-items-center">
<Icon
className="settings-btn"
icon="settings"
onClick={(e) => {
e.stopPropagation();
this.toggleDeleteMenu();
}}
/>
}
<Icon
className="close-btn-cross d-none d-lg-block"
icon="cross"
onClick={(e) => {
e.stopPropagation();
this.setState(
{isMinimized: false},
actions.closeMessage
);
}}
/>
</div>
</div>
{showDeleteMenu &&
<DeleteMenu onClick={this.archiveMessage} onClickOutside={this.toggleDeleteMenu}/>
}
{
this.renderMessages()
}
<div
className="bottom-actions d-flex flex-row flex-nowrap justify-content-between align-items-center">
<TextArea
ref={ref => this.messageInput = ref}
className="input blue d-block"
name="msgText"
placeholder="Type your message..."
.
.
.
.
autoFocus
/>
<Button
className={`send-btn circle ${IS_SAFARI ? 'safari-fix-button' : ''}`}
icon="paper-plane"
onClick={this.onSendMessage}
/>
</div>
}
</div>
and the scss file:
.message-thread-wrapper {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0;
z-index: 950;
.messages-header {
padding: 19px 16px 14px 16px;
width: 100%;
flex-basis: 57px;
color: white;
pointer-events: none;
position:sticky;
.back-btn {
pointer-events: auto;
}
.close-btn-cross {
width: 18px;
height: 18px;
pointer-events: auto;
}
.settings-btn {
width: 25px;
height: 26px;
pointer-events: auto;
}
}
.delete-menu {
border-radius: 2px;
background-color: white;
position: absolute;
top: 53px;
right: 0px;
z-index: 1;
.menu-arrow {
width: 15px;
height: 15px;
position: absolute;
top: 0;
right: 0;
background: white;
border-right: none;
border-bottom: none;
}
a {
padding: 18px;
font-size: 16px;
line-height: 1.5;
text-decoration: none;
z-index: 1;
cursor: pointer;
}
}
.messages-content {
height: 100%;
padding: 16px;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
.dateline {
margin: 28px 0 11px 0;
line-height: 1.33;
text-align: center;
}
}
.bottom-actions {
bottom: 0;
width: 100%;
max-height: 130px;
min-height: 70px;
overflow-y: hidden;
padding: 0 0 0 24px;
background-color: white;
box-shadow: 0 -1px 3px 0 #d9dbdc;
.form-group-wrapper {
padding-top: 10px;
width: 100%;
align-self: stretch;
overflow: auto;
&.text-area-wrapper {
padding-right: 71px;
textarea {
min-height: 48px;
}
.form-bar {
display: none;
}
}
}
.button.circle {
width: 34px;
height: 34px;
padding: 9px 12px 9px 8px;
position: fixed;
right: 26px;
&.safari-fix-button {
bottom: 22px;
}
}
}
}
Note I deleted the properties that are not important for this question so it won't be too long.
This is how it currently behaves:
Iphone:
Android - Pixel 2XL:
I would appreciate if Any could help me. Thank you in advance!

Stellar.js - multiple backgrounds inside one element

I'm trying to use Stellar.js as multiple backgrounds inside of single element such as content. Anything that I've tried not working at all..
Default output look like this:
.photo {
background-attachment: fixed;
background-position: 50% 0;
background-repeat: no-repeat;
height: 450px;
position: relative;
}
.photo span {
bottom: 0;
color: white;
display: block;
left: 50%;
margin-left: -640px;
font-size: 38px;
padding: 10px;
position: absolute;
text-shadow: 0 2px 0 black, 0 0 10px black;
width: 1280px;
}
.summer {
background-image: url(images/1.png);
}
.autumn {
background-image: url(images/2.png);
}
.winter {
background-image: url(images/3.png);
}
.spring {
background-image: url(images/4.png);
}
<div class="photo summer" data-stellar-background-ratio="0.5"><span>Summer</span></div>
<div class="photo autumn" data-stellar-background-ratio="0.5"><span>Autumn</span></div>
<div class="photo winter" data-stellar-background-ratio="0.5"><span>Winter</span></div>
<div class="photo spring" data-stellar-background-ratio="0.5"><span>Spring</span></div>
<div class="photo summer" data-stellar-background-ratio="0.5"><span>Summer</span></div>
<div class="photo autumn" data-stellar-background-ratio="0.5"><span>Autumn</span></div>
<div class="photo winter" data-stellar-background-ratio="0.5"><span>Winter</span></div>
<div class="photo spring" data-stellar-background-ratio="0.5"><span>Spring</span></div>
But I want it to be something like that
.photo {
background-attachment: fixed;
background-position: 50% 0;
background-repeat: no-repeat;
height: 450px;
position: relative;
}
.photo span {
bottom: 0;
color: white;
display: block;
left: 50%;
margin-left: -640px;
font-size: 38px;
padding: 10px;
position: absolute;
text-shadow: 0 2px 0 black, 0 0 10px black;
width: 1280px;
background-image: url(images/1.png), url(images/2.png), url(images/3.png), url(images/4.png);
}
<div class="photo" data-stellar-background-ratio="1.0"><div>content</div></div>
I'm quite new to this and need some help. Maybe it just couldn't work as I want?

Why does iOs Safari show full size of background-image?

I'm working on a site where you have some boxes with background-images as thumbnails. I have to use background-image because the CMS we are working on is pretty old-dated and the client won't change (mon€y is the main-problem).
i figured out a strange behavior in the iOs Safari on the iPad2 & iPhone5 (latest iOS) and don't know why.
Here's my code:
a img,
.thumb,
figcaption,
a:hover .thumb {
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.thumb {
height: 250px;
margin-bottom: 28px;
overflow: hidden;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
figcaption {
background-color: #b61910;
background-color: rgba(182, 25, 16, .85);
position: absolute;
height: 39px;
bottom: 35px;
color: white;
width: calc(100% - 30px);
}
figcaption h3 {
font-style: normal;
position: absolute;
bottom: 5px;
margin-top: 0;
margin-bottom: 0;
padding: 10px 0 0 5px;
transition: transform 0.3s;
transform: translate3d(0, 0%, 0);
}
a:hover h3 {
transform: translate3d(0, -20%, 0);
text-shadow: 1px 1px 1px #000;
}
a:hover figcaption {
height: 5px;
}
a:hover .thumb {
background-size: 120% 120%;
opacity: .8
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<a href="">
<div class="col-sm-12">
<figure class="thumb" style="background-image:url(http://lorempixel.com/output/food-h-c-850-890-7.jpg)">
<figcaption>
<h3>Product-Title</h3>
</figcaption>
</figure>
</div>
</a>
</div>
</div>
On my Desktop it shows the whole image but on iOS it looks like it shows the original size inside the thumbnail-box.
How can i solve this problem?
Any help would be great :)
Thanks
moesphemie
Maybe? https://css-tricks.com/forums/topic/full-page-backgrounds-on-ios-background-size-cover/
Code:
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;

Need to vertically align images beside div

Heading
I need to align tags beside the price in featured products (the tags in the example feature the text "Aussie Made").
I need to vertically align the "Aussie Made" images beside the price (bottom align). The price can dynamically change in width and height. Can someone give me some ideas on how to make the "Aussie made" image/icon float on the right and still be on the bottom of the div aligned?
I tried to put
position:absolute;
bottom:0px on the div containing the Aussie Made icon. However it didn't work. Can someone please help me on this?
Did you try using position RELATIVE?
As in relative to the PARENT container?
This should give you an ideia:
CSS
.container{position:relative; height:200px; width: 200px; outline: 1px solid #000; }
.image { position: absolute; bottom:0px; right:0px; width: 10px; height: 10px; outline: 1px solid #000; }
HTML
<div class="container"><div class="image"></div></div>
I beg your pardon, your quite right, its ABSOLUTE not RELATIVE...
Although Absolute position actually makes the contents relative to the parent.
See the photo below.
and the code...
<style type="text/css">
.Main
{
position: absolute;
left: 400px;
top: 200px;
width: 469px;
height: 280px;
}
.Photo
{
width: 469px;
height: 280px;
z-index: 1;
}
.Caption
{
position: absolute;
left: 0px;
top: 250px;
width: 461px;
height:32px;
padding-left: 8px;
background-color: #FF0000;
color: #FFFFFF;
font-family: tahoma;
font-size: 20pt;
text-align: left;
vertical-align: middle;
z-index: 2;
}
.Price
{
position: absolute;
left: 330px;
top: 215px;
width: 122px;
height: 40px;
text-align: center;
vertical-align: middle;
z-index: 3;
color: #CC3300;
font-size: 20pt;
background-color: #FFFF00;
}
.MiniText
{
top: 4px;
color: #111111;
font-size: 8pt;
font-weight: bold;
font-family: Tahoma;
}
</style>
<div style="left: 0px; top: 0px; height: 800px;">
<div class="Main">
<img class="Photo" alt="" src="http://202.92.83.79/medias/sys_master/images/8796157247518/Package-img1.jpg" />
<div class="Price" style="z-index: 4">
<div class="MiniText">First of it's kind!</div>
£100.97p
</div>
<div class="Caption" style="z-index: 3">Sooper Dooper Wotsit Thingy</div>
</div>
</div>

Resources