How to custom v-carousel delimiter icon - vue.js

So I'm trying to use v-carousel for my project, but I wanna custom the delimiter icon from built-in
into something larger like this
but somehow I couldn't edit or add to change the delimiter into longer size because it's built-in. Any idea how?

In CSS do the following;
.v-carousel__controls__item.v-btn.v-btn--icon {
background-color: #ebece9; /* Background color of non-active ones */
height: 2px; /* Height you want */
width: 40px; /* Width you want */
border-radius: 0; /* Remove default border radius */
}
.v-carousel__controls__item.v-btn.v-btn--icon.v-btn--active {
background-color: #1f1f1f; /* Colour for active one */
}
.v-carousel__controls__item.v-btn.v-btn--icon:hover {
background-color: black; /* You might also want to customise the hover effect */
}
.v-btn__content .v-icon {
display: none; /* Removes the default icon */
}
Working demo

Related

How to show a dialog or popup from .net core without javascript

I want to create a .NET CORE application without using javascript at all and I am struggling to show dialogs to perform various crud operation, I want to call a controller action that will fill the dialog data and then show it to the user, without ever needing to use ajax or jquery.
How to show a dialog or popup from .net core without javascript
You could use CSS style to show the dialog or popup, code like this:
CSS style:
<style>
/* popups without javascript */
/* showing popup background */
a.popup:target {
display: block;
}
/* showing popup */
a.popup:target + div.popup {
display: block;
}
/* popup target anchor and background */
a.popup {
/* background is initially hidden */
display: none;
position: fixed;
top: 0;
left: 0;
z-index: 3; /* anything, really, but bigger than other elements on the page */
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
cursor: default;
}
/* popup window */
div.popup {
/* popup window is initially hidden */
display: none;
background: white; /* choose your color; */
width: 640px; /* width */
height: 480px; /* height */
position: fixed;
top: 50%;
left: 50%;
margin-left: -320px; /* = -width / 2 */
margin-top: -240px; /* = -height / 2 */
z-index: 4; /* z-index of popup backgroung + 1 */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
/* links to close popup */
div.popup > a.close {
color: white;
position: absolute;
font-weight: bold;
right: 10px;
}
div.popup > a.close.word {
top: 100%;
margin-top: 5px;
}
div.popup > a.close.x {
bottom: 100%;
margin-bottom: 5px;
}
</style>
Html Content:
<h1>Popup without javascript demo</h1>
<p>Open popup</p>
<p>HTML visible body ends here</p>
<!--
Popup: the key is that id of <a> tag below is the same as href of <a> tag above
- that's what opens popup
<a> below serves several purposes:
1) popup background covering the whole window,
2) anchor to show popup when #my_popup is in URL,
3) link to close popup - if you click the background popup disappears
-->
<a id="my_popup" href="#" class="popup"></a>
<div class="popup">
<h3>My popup heading</h3>
<p>Popup content</p>
<a class="close x" href="#">x</a>
<a class="close word" href="#">Close</a>
</div>
The result like this:
Code from this link, and you could also refer this sample.
I am struggling to show dialogs to perform various crud operation, I
want to call a controller action that will fill the dialog data and
then show it to the user, without ever needing to use ajax or jquery
Since you don't want to use JQuery or Ajax, the above popup content should be populated when the page load, and when executing the CURD operations, you have to refresh the whole page. To implement partial view refreshes the popup content, you have to use JQuery and Ajax.

Why can i not override the body overflow-y with a media query?

I might make a obvious mistake but somehow I am stuck with the following:
only for large screens i don't want the vertical scrollbar so i have this simple css:
#media (min-width : 2000px) {
// hacky
body {
overflow-y:hidden !important;
}
.mt-5{
margin-top: 80px !important;
}
.mb-5{
margin-bottom: 80px !important;
}
...more style definitions
but somehow this doesn't work
i am using chrome's toggle device bar tool to switch between different resolutions. All other css definitions for > 2000px are there, only body doesn't seem to be set??
#media (min-width : 2000px) {
body {
overflow-y:hidden !important;
}
.mt-5{
margin-top: 80px !important;
}
.mb-5{
margin-bottom: 80px !important;
}
}
Did you set 100% height for html and body, like this:
html, body {
height: 100%;
}
And also for possible other child elements inside body which span the whole height of body?
Otherwise one of them will get a scroll bar (not necessarily body, but it will look very similar)

How to customise ag-grid icons?

I am trying to achieve few customisations in ag-grid such as:
Change icons of Grid Header - Sort Icon, Filter Menu Icon, Icons of different menu items in Filter Menu, etc.
Change position of the Icons.
Can anyone point me to a possible solution?
According to the docs, you can try this CSS after the loading of the ag-grid.css (or scss) file and the ag-theme-<themename>.css file. In my example, that theme file is for Balham theme ag-theme-balham.css. This CSS will change the icons from default black (using the SVG) to white.
/*
* The override should be placed after the import of the theme.
* Alternatively, you can aso increase the selector's specificity.
*/
.ag-theme-balham .ag-icon-desc,
.ag-theme-balham .ag-icon-asc,
.ag-theme-balham .ag-icon-menu
{
font-family: "Font Awesome 5 Free";
/* FontAwesome uses font-weight bold */
font-weight: bold;
}
.ag-theme-balham .ag-icon-desc::before
{
content: '\f063';
color: white;
}
.ag-theme-balham .ag-icon-asc::before
{
content: '\f062';
color: white;
}
.ag-theme-balham .ag-icon-menu::before
{
content: '\f0c9';
color: white;
}
This Worked for me. Just overide the color
.ag-theme-balham .ag-icon-menu:before,
.ag-theme-balham .ag-icon-asc:before,
.ag-theme-balham .ag-icon-desc:before,
.ag-theme-balham .ag-icon-filter:before{
color: #FFFFFF;
}

Using rulesets in LESS for media queries

When using Sass I would do something global like this (which I got from CSS-tricks btw)
// Variables for MQ's
$mq-mobile-portrait : 320px !default;
$mq-mobile-landscape : 480px !default;
$mq-tablet-portrait : 768px !default;
$mq-tablet-landscape : 1024px !default;
$mq-desktop : 1382px !default;
Then I would create mixins for the media queries like this (I'll only include a few to give you an idea
// Mixins
// Both portrait and landscape
#mixin mobile-only {
#media (max-width : $mq-mobile-landscape) {
#content;
}
}
// Everything up to and including the portrait width of the phone
// Since it's the smallest query it doesn't need a min
#mixin mobile-portrait-only {
#media (max-width : $mq-mobile-portrait) {
#content;
}
}
So Sass has this #content which is great because it means that I don't have to declare the content within the mixin but can do an #include mixinName and it creates the parent wrapper for any CSS properties I need to put into it across different files. I discovered that this worked well for my work flow.
So here's an example of that in a partial .scss file:
section.footer {
height: 90px;
padding: 0 10px;
#include mobile-portrait-only {
padding-top: 10px;
background: $gum;
div.ftrLogo {
display: inline-block;
margin: 0;
height: 70px;
width: 45%;
div.smlLogo {
display: block;
background: url('../images/svg/small-logo2.svg');
width: 106px;
height: 49px;
margin: 0 auto;
padding: 0;
}
p.footer {
font-size: .375em;
color: $white;
text-align: center;
}
}
}
So as you can probably gather the #content allows you to just call an empty media query wrapper anywhere in your files (obviously you have to import all of your partials into one main file) but this is great.
Today I'm using LESS on a project and I like it a lot the problem is I can't seem to find an equivalent solution in LESS-land.
I was reading up on passing rulesets http://lesscss.org/features/#detached-rulesets-feature which looks like it's close to what I want but my brain is not understanding it today; I'm optimistic about tomorrow.
If anyone has tried anything like this or can immediately see the error in my ways; please provide your two cents. I really want to figure it out and thought to ask this gifted community of SO'ers.
Thank you in advance you're a baller!
// Variables for MQ's
#mq-mobile-portrait: 320px;
// Mixins
.mobile-portrait-only(#rules) {
#media (min-width: #mq-mobile-portrait) {
#rules();
}
}
Now you can use the following code:
div {
color: white;
.mobile-portrait-only({
color: white;
width: 100%;
max-width: 500px;
});
}
The above will compile into CSS code as follows:
div {
color: white;
}
#media (min-width: 320px) {
div {
color: white;
width: 100%;
max-width: 500px;
}
}
So detached rules are rules between {} assigned to a variable:
#detached: {};
Detached rules can be used as an argument for a mixin:
.mixin(#detached){}
You as call the above mixin with a detached rule as a parameter:
.mixin({color: red;});
or
#detached: {color: red;} // watch out for the last declaration wins rule for variables
.mixin(#detached);
Inside the mixin you should call the detached rules set to copy its properties and selectors (in fact you don't copy but insert them read for processing):
.mixin(#detached-rules) {
#detached-rules(); // parenthesis are required here
}
Finally for your example your code should look like that shown below:
#gum: url();
#white: white;
// Variables for MQ's
#mq-mobile-portrait: 320px;
// Mixins
.mobile-portrait-only(#rules) {
#media (min-width: #mq-mobile-portrait) {
#rules();
}
}
section.footer {
height: 90px;
padding: 0 10px;
.mobile-portrait-only( {
padding-top: 10px;
background: #gum;
div.ftrLogo {
display: inline-block;
margin: 0;
height: 70px;
width: 45%;
div.smlLogo {
display: block;
background: url('../images/svg/small-logo2.svg');
width: 106px;
height: 49px;
margin: 0 auto;
padding: 0;
}
p.footer {
font-size: .375em;
color: #white;
text-align: center;
}
}
});
}
I hadn't thought of doing it like Bass Jobsen suggested (although I've now seen that his approach is basically how the less docs do it), but I invented a mixin which I think is a bit more flexible. Though they are similar in result, I think the following solution allows for more customization and is easier to implement on the fly.
First I define the different sizes I want to use - to keep it simple, I'll just do two using a 'mobile first approach' (meaning if I don't include a media query, the rules will apply to all sizes and I should only include queries for sizes larger than mobile).
#tablet:~"(min-width:768px)";
#desktop:~"(min-width:1100px)";
Then the mixin:
.respond(#_size;#_rules){
#media #_size {
#_rules();
}
}
And Used Like the following:
.selector {
background:green;
.respond(#tablet,{
color:red;
background:blue;
});
}
And That Outputs:
.selector {
background:green;
}
#media (min-width:768px){
.selector{
color:red;
background:blue
}
}
With only two sizes to remember, it is easy enough just to do it the way Bass Jobsen suggested, but in practice, depending on how fine-grained I want my control to be, I may define up to 8 different media sizes (though I rarely use them all), and my approach above makes the process like calling one function rather than defining 8 different functions ( as I would do were I using the alternate approach ).
Hope this helps someone. It saves me a ton of time.

Nivo Slider - Two Sliders on one web page

I copied the code from dev7 studio's example of how to insert two nivo sliders on one web page, but I am unsure how to tweak the individual settings of each slider, such as how to get the first slider to just use arrows, while the second slider only uses bullets. Also how would I adjust the height & width of each slider in terms of location of arrows & bullets.
Here is the style.css:
/*=================================*/
/* Nivo Slider Demo
/* November 2010
/* By: Gilbert Pellegrom
/* http://dev7studios.com
/*=================================*/
/*====================*/
/*=== Reset Styles ===*/
/*====================*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin:0;
padding:0;
border:0;
outline:0;
font-weight:inherit;
font-style:inherit;
font-size:100%;
font-family:inherit;
vertical-align:baseline;
}
body {
line-height:1;
color:black;
background:white;
}
table {
border-collapse:separate;
border-spacing:0;
}
caption, th, td {
text-align:left;
font-weight:normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:"";
}
blockquote, q {
quotes:"" "";
}
/* HTML5 tags */
header, section, footer,
aside, nav, article, figure {
display: block;
}
/*===================*/
/*=== Main Styles ===*/
/*===================*/
body {
font:14px/1.6 Georgia, Palatino, Palatino Linotype, Times, Times New Roman, serif;
color:#333;
background:#eee;
}
a, a:visited {
color:blue;
text-decoration:none;
}
a:hover, a:active {
color:#000;
text-decoration:none;
}
#dev7link {
position:absolute;
top:0;
left:50px;
background:url(images/dev7logo.png) no-repeat;
width:60px;
height:67px;
border:0;
display:block;
text-indent:-9999px;
}
.default #slider {
margin:100px auto 0 auto;
width:960px; /* Make sure your images are the same size */
height:310px; /* Make sure your images are the same size */
}
.default #slider2 {
margin:100px auto 0 auto;
width:280px; /* Make sure your images are the same size */
height:65px; /* Make sure your images are the same size */
}
slider-wrapper,
lider-wrapper {
margin-top:150px;
}
/*====================*/
/*=== Other Styles ===*/
/*====================*/
.clear {
clear:both;
}
Here is the default.css:
/*
Skin Name: Nivo Slider Default Theme
Skin URI: http://nivo.dev7studios.com
Skin Type: flexible
Description: The default skin for the Nivo Slider.
Version: 1.0
Author: Gilbert Pellegrom
Author URI: http://dev7studios.com
*/
.default .nivoSlider {
position:relative;
background:#fff url(loading.gif) no-repeat 50% 50%;
margin-bottom:50px;
-webkit-box-shadow: 0px 1px 5px 0px #4a4a4a;
-moz-box-shadow: 0px 1px 5px 0px #4a4a4a;
box-shadow: 0px 1px 5px 0px #4a4a4a;
}
.default .nivoSlider img {
position:absolute;
top:0px;
left:0px;
display:none;
}
.default .nivoSlider a {
border:0;
display:block;
}
.default .nivo-controlNav {
position:absolute;
left:70px;
bottom:25px;
margin-left:-40px; /* Tweak this to center bullets */
z-index:300;
}
.default .nivo-controlNav a {
display:block;
width:22px;
height:22px;
background:url(bullets.png) no-repeat;
text-indent:-9999px;
border:0;
margin-right:1px;
float:left;
}
.default .nivo-controlNav a.active {
background-position:0 -22px;
}
.default .nivo-directionNav a {
display:block;
width:30px;
height:30px;
background:url(arrows.png) no-repeat;
text-indent:-9999px;
border:0;
}
.default a.nivo-nextNav {
background-position:-30px 0;
right:15px;
}
.default a.nivo-prevNav {
left:15px;
}
.default .nivo-caption {
font-family: Helvetica, Arial, sans-serif;
}
.default .nivo-caption a {
color:#fff;
border-bottom:1px dotted #fff;
}
.default .nivo-caption a:hover {
color:#fff;
}
To use more than one slider on your webpage, you will firstly want to change the #ID elements to .CLASSES, both in the HTML and in the CSS, as we're creating more than one slider now...
If you are looking at changing each one of your slider's appearances, this would relate to your HTML inline-styling and how the skin (default, light, dark etc.) is being output. Simply change this to the desired skin in your demo.html file. It should look something like this:
div class="slider-wrapper theme-default"
Now replace "theme-default" with for example, theme-light.
To modify the bullets in the default skin slider, you're wanting to play with:
.default .nivo-controlNav` and .default .nivo-controlNav a {
To modify the arrows in the default skin slider, you're wanting to play with:
.default .nivo-directionNav a {
ID of each slider should be different and then initialization and settings can be written individually for each one.
<div id="slider" class="nivoSlider">
<img src="slide1.jpg" alt="" />
<img src="slide2.jpg" alt="" />
<img src="slide3.jpg" alt="" />
<img src="slide4.jpg" alt="" />
</div>
<script type="text/javascript">
$('#slider').nivoSlider({
effect: 'slideInLeft', // Specify sets like: 'fold,fade,sliceDown'
slices: 1, // For slice animations
boxCols: 8, // For box animations
boxRows: 4, // For box animations
animSpeed: 500, // Slide transition speed
pauseTime: 3000, // How long each slide will show
startSlide: 0, // Set starting Slide (0 index)
directionNav: true, // Next & Prev navigation
controlNav: true, // 1,2,3... navigation
controlNavThumbs: false, // Use thumbnails for Control Nav
pauseOnHover: true, // Stop animation while hovering
manualAdvance: false, // Force manual transitions
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
randomStart: false, // Start on a random slide
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){} // Triggers when slider has loaded
});
</script>
The ID part in each jQuery function should be different following the two different IDs you used to identify each slider in the HTML.
$('#slider').nivoSlider({
Meaning you will have two copies of this code, one per each slider.
Different CSS styles per slider can be attained via these IDs referenced in a CSS file.
Note the .nivoSlider class of the slider container is common in both instances, since it's connected to general styles needed for the slider to work.