Adding logo to title slide - xaringan

How do I properly add logos to the top of the title slide?
After some trial and error, I came up with this which I add to the css file.
.title-slide.remark-slide-content:before{
position: absolute;
content:url(logo.svg);
height:60px;
}
This seems to work for one logo and it's positioned on the top right. I would like to add another logo on the top left too. Is there a better way to do this?

One way would be to create a custom title slide using seal: false with some divs.
---
title: "Presentation Ninja"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
date: "2016/12/12"
output:
xaringan::moon_reader:
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
seal: false
---
<div class="my-logo-left"></div>
<div class="my-logo-right"></div>
# hello
---
CSS
.my-logo-left {
content: "";
position: absolute;
top: 15px;
left: 20px;
height: 40px;
width: 120px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(https://www.r-project.org/logo/Rlogo.png);
}
.my-logo-right {
content: "";
position: absolute;
top: 15px;
right: 8px;
height: 40px;
width: 120px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(https://www.r-project.org/logo/Rlogo.png);
}

Related

How can I add an image to the title slide in Rmarkdown (xaringan)?

I am making a presentation using xaringan. I would like to add the logo of my university in the background of the title slide. I would also like to know how to set the position of this image
Mi code is as follows:
---
title: "My presentations"
author: "My name"
date: "`r Sys.Date()`"
output:
xaringan::moon_reader:
chakra: libs/remark-latest.min.js
css: [xaringan-themer.css, my-theme.css]
nature:
countIncrementalSlides: false
titleSlideClass: ["left", "middle", "inverse"]
highlightLines: true
highlightStyle: solarized-dark
includes:
in_header: header.html
---
And this is the my-theme.css file
.title-slide a, a > code {
color: #aadff2;
text-decoration: none;
}
}
div.my-footer {
background-color: #E7EEF0;
position: absolute;
bottom: 0px;
left: 0px;
height: 30px;
width: 100%;
}
div.my-footer span {
font-size: 14pt;
color: #005f9b;
position: absolute;
left: 20px;
bottom: 10px;
}
.inverse {
background-color: #13306a;
color: #E7EEF0;
}
This worked for me when I was working on my theme. I used Joseph V. Casillas's Rutgers theme and Tuo Wang's UW Madison theme as a reference.
.title-slide {
background-image: url(https://commkit.gsu.edu/files/2019/06/PrimaryLogo3color.jpg);
background-position: 100% 0%; ## just start changing this
background-size: 300px;
background-color: #fff;
padding-left: 100px; /* delete this for 4:3 aspect ratio */
}

How to fix transition of transform on IE with property: transform: scaleX(-1) translateY(-50%);

[enter image description here][1]
[1]: the image of the button
[2] There are styles for this button. Please looking at the line (.btnDefault:hover:after).
.btnDefault {
position: relative;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
padding: 0 46px 0 25px;
background-color: #fff;
width: 160px;
height: 48px;
font-size: 16px;
letter-spacing: 2px;
text-align: center;
border-radius: 50px;
box-shadow: 0px 12px 51px 0px rgba(88, 49, 33, .4);
transition: opacity .3s ease-in-out;
}
.btnDefault:after {
content: '';
position: absolute;
top: 50%;
right: 25px;
width: 22px;
height: 22px;
background: url('https://i.stack.imgur.com/pPcvP.png') no-repeat;
background-size: contain;
transform: translateY(-50%);
transition: transform .3s ease-in-out;
}
.btnDefault:hover {
opacity: .7;
}
.btnDefault:hover:after {
transform: scaleX(-1) translateY(-50%);
}
[3] this is button HTML
<a class="btnDefault">VIEW MORE</a>

Fabs With Labels In Ionic 3

I am using the Ionic 3 Framework and want to insert the following type of fab menu in my Ionic 3 App.
Special Fab Menu:
In your SCSS file:
button[ion-fab] {
overflow: visible;
position: relative;
ion-label {
position: absolute;
top: -8px;
right: 40px;
color: white;
background-color: rgba(0,0,0,0.7);
line-height: 24px;
padding: 4px 8px;
border-radius: 4px;
}
}
.fab{
contain: layout;
}
Your HTML file:
<ion-fab bottom right >
<button ion-fab>Share</button>
<ion-fab-list side="top">
<button ion-fab>
<ion-icon name="logo-facebook"></ion-icon>
<ion-label>Facebook</ion-label>
</button>
</ion-fab-list>
</ion-fab>
Please refer to this link...
whats the correct way of inserting label in an Ionic FAB list
This one is fairly easy to impelement. I've tested this on Ionic 3 and it works
Thanks to #mark. for right to left languages (rtl) you should alter the scss file according to this: (add left: 45px; instead of right: 40px;)
button[ion-fab] {
overflow: visible;
position: relative;
ion-label {
position: absolute;
top: -8px;
// this is the difference:
left: 45px;
color: white;
background-color: rgba(70, 70, 70, 0.7);
line-height: 24px;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px
}
}
.fab{
contain: layout;
}
I also changed the background color of ion-label and its font size to appear more beautiful.
And your html file should be like the #mark:
<ion-fab bottom right >
<button ion-fab>Share</button>
<ion-fab-list side="top">
<button ion-fab>
<ion-icon name="logo-facebook"></ion-icon>
<ion-label>Facebook</ion-label>
</button>
</ion-fab-list>
</ion-fab>

Cannot change the color of navbar on ionic 3

I'm trying to set the color of the header like this, but i can't.Any suggestions, in order to change the background color?
<ion-header >
<ion-navbar >
<img src="../../assets/img/Header.png">
</ion-navbar>
</ion-header>
and the css is
img {
display: block;
height: 20%;
width: 20%;
margin-left: auto;
margin-right: auto;
color: "#D3C3B4x";
background-color:"#cccccc";
}
.ion-navbar{
color: "#D3C3B4x";
background-color:"#cccccc";
}
.ion-header
{
background-color:"#cccccc";
position: absolute;
top: 5%;
left: 5%;
}
You can add it to the $colors array from your variables.scss file:
$colors: (
// ...
custom-color: #cccccc,
//...
);
And then use it in the view:
<ion-header >
<ion-navbar color="custom-color">
<img src="../../assets/img/Header.png">
</ion-navbar>
</ion-header>
it doesn't work that, but i did that
loginmodal-page{
$color:#D1C3B0;
img {
display: block;
height: 20%;
width: 20%;
margin-left: auto;
margin-right: auto;
color: "#D3C3B4x";
background-color:"#cccccc";
}
.ion-header
{
background-color:$color;
position: absolute;
top: 5%;
left: 5%;
}
}
and it works fine
Put the following into \src\theme\variables.scss
$toolbar-background: #cccccc;
$toolbar-border-color: #cccccc !default;
$toolbar-active-color: #cccccc !default;

How to center-align svg-based Google Charts (since they have position: absolute)

Does anybody please have an idea how to center-align the new (i.e. svg-based) Google Charts?
When I inspect the chart elements at my web page (please scroll down to the jQuery Tabs with several Google Charts at that page), I see that the chart itself is given an absolute position:
<div style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; ">
<svg width="800" height="500" style="overflow: hidden; ">
I'm not sure why Google does it, but it breaks my layout (other than that the charts work well for me):
My CSS-code:
h1,h2,h3,p,div,form {
text-align: center;
}
And I've also tried adding there:
margin-left: auto;
margin-right: auto;
My JavaScript-code:
var money_data;
var money_chart;
var money_options = {
width: 800,
height: 500,
legend: {position: 'top'},
areaOpacity: 1.0,
vAxis: {format: '# $'},
hAxis: {title: 'Номер недели', titleTextStyle: {color: 'blue'}, slantedText: true, viewWindow: {min: 39, max: 52}},
colors: ['CCFFCC', '66CC66', 'FF9999'],
animation: {duration: 1000, easing: 'out'}
};
function initMoney() {
$.ajax({
url: '/money-json.php',
data: { id: 'OK408547485023' },
dataType: 'json'
}).done(function(jsonData) {
money_data = new google.visualization.DataTable(jsonData);
money_chart = new google.visualization.SteppedAreaChart(document.getElementById('money_chart'));
google.visualization.events.addListener(money_chart, 'ready', function() {
$('#money_slider').slider('enable');
});
drawMoney();
});
}
function drawMoney() {
money_chart.draw(money_data, money_options);
}
If no CSS-based solution possible here, could I maybe use JavaScript to move the SVG to the same x-position as the money_slider while enabling the latter (please see the above code)?
You could set the size of money_chart DIV to the size of the graph ( I am guessing 800px ) and use auto margins like this.
#money_chart{
margin-left: auto;
margin-right: auto;
width: 800px;
}
You will need to make the chart side another div here is my code and it works for me
.chart_outside{
position:relative;
display: inline;
border: 2px solid #FFF;
width: 500px;
height: 460px;
background: #000;
margin: 5px 5px 5px 5px;
}
.chart_inside{
position:absolute;
right:0px
;top:0px;
}