for a project I've an issue with isotope with sorting items alphabetically which begin with an accented character.
The accented character are at the end of the list.
/* Set isotope */
var $container = $('.wall').isotope({
itemSelector: '.item',
layoutMode: 'masonry',
masonry: {
columnWidth: '.item',
gutter: 30
},
getSortData: {
name: 'h2'
}
})
$('button.alpha').on('click',function(){
$container.isotope({ sortBy: 'name',sortAscending:getOrderBy() });
})
$('button.original-order').on('click',function(){
$container.isotope({ sortBy: 'original-order',sortAscending:getOrderBy() });
})
$('button.orderby').on('click',switchOrderBy);
function getOrderBy(){
return $('.orderby').hasClass('asc');
}
function switchOrderBy(){
$('.orderby').toggleClass('asc');
$('.orderby').text(($('.orderby').hasClass('asc'))?'ASC':'DESC');
$container.isotope({ sortBy: 'name',sortAscending:getOrderBy() });
}
.item{
font-size: .8em;
font-weight: normal;
font-family: verdana,sans-serif;
border-bottom: 1px solid #ccc;
line-height: .8;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://isotope.metafizzy.co/isotope.pkgd.min.js"></script>
<!--
ISOTOPE SORTING
Remove accents for sorting
by http://mi-ca.ch
3rd feb. 2015
-->
<button class="alpha">alpha</button>
<button class="original-order">original order</button>
<button class="orderby asc">ASC</button>
<div class="wall">
<div class="item">
<h2>ï</h2>
</div>
<div class="item">
<h2>z</h2>
</div>
<div class="item">
<h2>a</h2>
</div>
<div class="item">
<h2>b</h2>
</div>
<div class="item">
<h2>y</h2>
</div>
<div class="item">
<h2>c</h2>
</div>
<div class="item">
<h2>x</h2>
</div>
<div class="item">
<h2>d</h2>
</div>
<div class="item">
<h2>w</h2>
</div>
<div class="item">
<h2>e</h2>
</div>
<div class="item">
<h2>v</h2>
</div>
<div class="item">
<h2>f</h2>
</div>
<div class="item">
<h2>u</h2>
</div>
<div class="item">
<h2>g</h2>
</div>
<div class="item">
<h2>t</h2>
</div>
<div class="item">
<h2>i</h2>
</div>
<div class="item">
<h2>j</h2>
</div>
<div class="item">
<h2>s</h2>
</div>
<div class="item">
<h2>r</h2>
</div>
<div class="item">
<h2>k</h2>
</div>
<div class="item">
<h2>é</h2>
</div>
<div class="item">
<h2>è</h2>
</div>
<div class="item">
<h2>q</h2>
</div>
<div class="item">
<h2>p</h2>
</div>
<div class="item">
<h2>l</h2>
</div>
<div class="item">
<h2>o</h2>
</div>
<div class="item">
<h2>m</h2>
</div>
<div class="item">
<h2>n</h2>
</div>
</div>
exemple : http://jsfiddle.net/mica/fduz9c3p/
I just find a prototype that remove Accented characters
/**
* Remove Accents to a string
*/
String.prototype.removeAccents = function(){
return this
.toLowerCase()
.replace(/[áàãâä]/gi,"a")
.replace(/[éèëê]/gi,"e")
.replace(/[íìïî]/gi,"i")
.replace(/[óòöôõø]/gi,"o")
.replace(/[úùüû]/gi, "u")
.replace(/[ç]/gi, "c")
.replace(/[ñ]/gi, "n")
.replace(/[^a-zA-Z0-9]/g," ");
}
Here is a working example:
/**
* Remove Accents to a string
*/
String.prototype.removeAccents = function() {
return this
.toLowerCase()
.replace(/[áàãâä]/gi, "a")
.replace(/[éèëê]/gi, "e")
.replace(/[íìïî]/gi, "i")
.replace(/[óòöôõø]/gi, "o")
.replace(/[úùüû]/gi, "u")
.replace(/[ç]/gi, "c")
.replace(/[ñ]/gi, "n")
.replace(/[^a-zA-Z0-9]/g, " ");
}
/* Set isotope */
var $container = $('.wall').isotope({
itemSelector: '.item',
layoutMode: 'masonry',
masonry: {
columnWidth: '.item',
gutter: 30
},
// prepare sorting data
getSortData: {
// this function find h2 and remove accents
name: function(itemElem) { // function
return String($(itemElem).find('h2').text()).removeAccents();
}
}
})
$('button.alpha').on('click', function() {
$container.isotope({
sortBy: 'name',
sortAscending: getOrderBy()
});
})
$('button.original-order').on('click', function() {
$container.isotope({
sortBy: 'original-order',
sortAscending: getOrderBy()
});
})
$('button.orderby').on('click', switchOrderBy);
function getOrderBy() {
return $('.orderby').hasClass('asc');
}
function switchOrderBy() {
$('.orderby').toggleClass('asc');
$('.orderby').text(($('.orderby').hasClass('asc')) ? 'ASC' : 'DESC');
$container.isotope({
sortBy: 'name',
sortAscending: getOrderBy()
});
}
.item {
font-size: .8em;
font-weight: normal;
font-family: verdana, sans-serif;
border-bottom: 1px solid #ccc;
line-height: .8;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://isotope.metafizzy.co/isotope.pkgd.min.js"></script>
<!--
ISOTOPE SORTING
Remove accents for sorting
by http://mi-ca.ch
3rd feb. 2015
-->
<button class="alpha">alpha</button>
<button class="original-order">original order</button>
<button class="orderby asc">ASC</button>
<div class="wall">
<div class="item">
<h2>ï</h2>
</div>
<div class="item">
<h2>z</h2>
</div>
<div class="item">
<h2>a</h2>
</div>
<div class="item">
<h2>b</h2>
</div>
<div class="item">
<h2>y</h2>
</div>
<div class="item">
<h2>c</h2>
</div>
<div class="item">
<h2>x</h2>
</div>
<div class="item">
<h2>d</h2>
</div>
<div class="item">
<h2>w</h2>
</div>
<div class="item">
<h2>e</h2>
</div>
<div class="item">
<h2>v</h2>
</div>
<div class="item">
<h2>f</h2>
</div>
<div class="item">
<h2>u</h2>
</div>
<div class="item">
<h2>g</h2>
</div>
<div class="item">
<h2>t</h2>
</div>
<div class="item">
<h2>i</h2>
</div>
<div class="item">
<h2>j</h2>
</div>
<div class="item">
<h2>s</h2>
</div>
<div class="item">
<h2>r</h2>
</div>
<div class="item">
<h2>k</h2>
</div>
<div class="item">
<h2>é</h2>
</div>
<div class="item">
<h2>è</h2>
</div>
<div class="item">
<h2>q</h2>
</div>
<div class="item">
<h2>p</h2>
</div>
<div class="item">
<h2>l</h2>
</div>
<div class="item">
<h2>o</h2>
</div>
<div class="item">
<h2>m</h2>
</div>
<div class="item">
<h2>n</h2>
</div>
</div>
http://jsfiddle.net/mica/edfr00aj/1/
Related
var priceListItem = document.getElementsByClassName("priceListItem");
var priceListItemCirclePrice = document.getElementsByClassName("priceListItemCirclePrice");
for(var i = 0; i < priceListItem.length; i++){
priceListItem[i].onmouseover = funckiaNefunkcia;
function funckiaNefunkcia(){
for(var a = 0; a < priceListItemCirclePrice.length; a++){
priceListItemCirclePrice[a].style.display = "block";
}
};
priceListItem[i].onmouseout = funckiaNefunkciaLeave;
function funckiaNefunkciaLeave(){
for(var a = 0; a < priceListItemCirclePrice.length; a++){
priceListItemCirclePrice[a].style.display = "none";
}
}
}
<div id="priceList">
<div class="container">
<div id="sectionName">Cenník</div>
<div class="row text-center" id="priceLists">
<div class="col-md-3 priceListItem">
<div class="priceListItemTop">
<h4>Strih dlhé vlasy</h4>
</div>
<div class="priceListItemBottom">
<ul style="text-align: left">
<li>strih podľa požiadavky</li>
<li>umytie vlasov</li>
<li>vlasová kozmentika</li>
<li>procedúry</li>
</ul>
</div>
<div class="priceListItemCirclePrice">
<p>30 EUR</p>
</div>
</div>
<div class="col-md-3 priceListItem">
<div class="priceListItemTop">
<h4>Strih krátke vlasy</h4>
</div>
<div class="priceListItemBottom">
<ul style="text-align: left">
<li>strih podľa požiadavky</li>
<li>umytie vlasov</li>
<li>vlasová kozmetika</li>
<li>procedúry</li>
<li>farbenie vlasov</li>
</ul>
</div>
<div class="priceListItemCirclePrice">
<p>40 EUR</p>
</div>
</div>
<div class="col-md-3 priceListItem">
<div class="priceListItemTop">
<h4>Spoločenské príležitostné účesy</h4>
</div>
<div class="priceListItemBottom">
<ul style="text-align: left">
<li>strih podľa požiadavky</li>
<li>umytie vlasov</li>
<li>vlasová kozmentika</li>
<li>doplnky do vlasov</li>
</ul>
</div>
<div class="priceListItemCirclePrice">
<p>50 EUR</p>
</div>
</div>
<div class="col-md-3 priceListItem">
<div class="priceListItemTop">
<h4>Individuálne požiadavky</h4>
</div>
<div class="priceListItemBottom">
<ul style="text-align: left">
<li>strih podľa požiadavky</li>
<li>umytie vlasov</li>
<li>vlasová kozmentika</li>
<li>procedúry</li>
<li>farbenie vlasov</li>
<li>doplnky do vlasov</li>
<li>iné požiadavky</li>
</ul>
</div>
<div class="priceListItemCirclePrice">
<p>70 EUR</p>
</div>
</div>
</div>
</div>
</div>
Element by class name priceListItemCirclePrice is display: none, I want to set display: block after onmouseover on priceListItem. Now when I do onmouseover on the priceListItem it show all priceListItemCirclePrice, on all 4 elements.
I need to change style to display: block on only one element - I´m currently mouseover.
Thank you
I have vue.js components in my app. This is the first time ever receiving this message in the console.
The picture where 3 boxes are shown is the local machine, where it works and shows the users info.
The next picture only show 1 out of 3 boxes, with the "example" component.
Code:
The component:
<template>
<div>
<loading-spinner v-if="!data_is_fetched"></loading-spinner>
<div v-else-if="data_is_fetched">
<!-- Modalbox -->
<div>
<div v-if="modalbox" #close="modalbox = false">
<edit-user-information-modal v-if="modalboxType === 1" #close="modalbox = false" #postSucces="fetchData()"
:student="record.user">
</edit-user-information-modal>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-6 col-sm-12">
<div class="card box-shadow border-0">
<div class="card-header bg-transparent justify-content-between d-flex align-text-center">
Min bruger
</div>
<div class="card-body">
<div class="row">
<div class="col-6">
<p><span class="font-weight-bold">Navn:</span></p>
<p><span class="font-weight-bold">Fødselsdato:</span></p>
<p><span class="font-weight-bold">Email:</span></p>
<p><span class="font-weight-bold">Telefonnummer:</span></p>
<p><span class="font-weight-bold">Brugertype:</span></p>
<p><span class="font-weight-bold">Vejnavn & husnummer:</span></p>
<p><span class="font-weight-bold">Postnummer og by:</span></p>
<p><span class="font-weight-bold">Land:</span></p>
</div>
<div class="col-6">
<p>
<span v-if="record.user.name">{{ record.user.name }}</span>
<span v-else class="font-italic">Intet navn</span>
</p>
<p>
<span v-if="record.user.birthday">{{ record.user.birthday }}</span>
<span v-else class="font-italic">Ingen fødselsdato</span>
</p>
<p>
<span v-if="record.user.email">{{ record.user.email }}</span>
<span v-else class="font-italic">Ingen email</span>
</p>
<p>
<span v-if="record.user.phone">{{ record.user.phone }}</span>
<span v-else class="font-italic">Intet telefonnummer</span>
</p>
<p>
<span v-if="record.user.role_id = 1">Elev</span>
<span v-else-if="record.user.role_id = 2">Kørelærer</span>
<span v-else-if="record.user.role_id = 3">Køreskoleadministrator</span>
<span v-else-if="record.user.role_id = 4">MitKørekort - Support</span>
<span v-else-if="record.user.role_id = 5">MitKørekort - Superbruger</span>
</p>
<p>
<span v-if="record.user.address_1">{{ record.user.address_1 }}</span>
<span v-else class="font-italic">Ingen addresse</span>
</p>
<p>
<span v-if="record.user.zip_code">{{ record.user.zip_code }}</span>
<span v-else class="font-italic">Intet postnummer</span>
</p>
<p>
<span v-if="record.user.country">{{ record.user.country }}</span>
<span v-else class="font-italic">Intet land</span>
</p>
</div>
</div>
<button class="btn btn-primary" #click="modalbox = true; modalboxType = 1">Rediger</button>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="card box-shadow border-0">
<div class="card-header bg-transparent">Ny adgangskode?</div>
<div class="card-body text-center">
<a class="mt-2 btn btn-primary btn-block" href="/nulstil/kodeord">Nulstil min adgangskode</a>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import FormMixin from '../../FormMixin.js';
export default {
mixins: [ FormMixin ],
data() {
return {
record: {},
fetchUrl: 'v1/account/fetch',
data_is_fetched: false,
modalbox: false,
modalboxType: 0,
}
},
mounted() {
console.log('Component mounted.')
this.fetchData()
},
methods: {
fetchData() {
axios.get(this.fetchUrl)
.then(response => (
this.record = response.data
))
.finally( this.data_is_fetched = true)
},
},
}
</script>
The component registration
// Account
// Profile page
Vue.component('page-show-account', require('./pages/account/Show.vue').default);
My issue was that the server had the newest compiled files in "public" and not "public_html".
So there wasn't anything missing or wrong in the code itself, but the server didn't use the correct files.
Can you drop your code?
I guess maybe you have a problem with registering the component, maybe you did not type correct path, or etc.
My advice is to read carefully
https://v2.vuejs.org/v2/guide/components-registration.html
I tried to get data but it says computed method is undefined in vue dev tool
my methods are
<script>
export default{
name:"about",
mounted(){
this.$store.dispatch('getFrontAbouts');
},
computed:{
about(){
return this.$store.getters.about;
}
},
}
</script>
store2.js file where i get those data by axios call
export default{
state: {
aboutData:[],
},
getters:{
about(state){
return state.aboutData;
},
},
actions:{
getFrontAbouts(data){
axios.get("get-front-about").then((response)=>{
data.commit('about',response.data.about);
}).catch((error)=>{
})
},
},
mutations: {
about(state,data){
return state.aboutData = data;
},
}
}
my controller file where i am fetching data
public function about(){
$about = About::where('publication_status',1)->orderBy('id','ASC')->take(1)->first();
return response()->json(['about',$about],200);
}
here is my vue component where computed about method is being executed
<div class="row topmargin bottommargin gutter-lg-50 align-items-center">
<div class="col-lg-12 p-lg-5">
<div class="heading-block border-bottom-0 mb-0">
<h2 class="nott font-weight-semibold mb-4 text-secondary" style="color: #1ABC9C;">Our Story</h2>
<p v-if="about">{{about.about_us}}</p>
<div class="row">
<div class="col-6 col-sm-6 mb-4">
<div class="counter color font-weight-semibold"><span data-from="1" data-to="3" data-refresh-interval="2" data-speed="600"></span>+</div>
<h5 class="mt-0 font-weight-medium">Branches</h5>
</div>
<div class="col-6 col-sm-6 mb-4">
<div class="counter color font-weight-semibold"><span data-from="1" data-to="37" data-refresh-interval="11" data-speed="900"></span>+</div>
<h5 class="mt-0 font-weight-medium">Single Studios</h5>
</div>
<div class="col-6 col-sm-6 mb-4">
<div class="counter color font-weight-semibold"><span data-from="1" data-to="21" data-refresh-interval="3" data-speed="1000"></span>+</div>
<h5 class="mt-0 font-weight-medium">Events per Month</h5>
</div>
<div class="col-6 col-sm-6 mb-4">
<div class="counter color font-weight-semibold"><span data-from="100" data-to="4500" data-refresh-interval="100" data-speed="1500"></span>+</div>
<h5 class="mt-0 font-weight-medium">Active Members</h5>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div class="row justify-content-center topmargin-sm">
<div class="col-md-5 offset-md-1">
<h3 class="text-dark"><i class="icon-line-circle-check color mr-1 position-relative" style="top: 2px;color: #1ABC9C;"></i> Why do you choose DreamsEye?</h3>
<p v-if="about">{{about.choice_us}}</p>
</div>
<div class="col-md-5 pl-md-5">
<h3 class="text-dark"><i class="icon-line-circle-check color mr-1 position-relative" style="top: 2px;color: #1ABC9C;"></i> Our Address</h3>
<p v-if="about">{{about.address}}</p>
</div>
<div class="clear"></div>
</div>
</div>
here is my vue dev tool screenshot
enter image description here
here is my response screenshot
enter image description here
You are accessing the computed property using about, but the computed property is defined as About.
JavaScript is case sensitive.
First it is a typo change this About() to thisabout() . it is because vuejs is case sensitive.
Second as you are geting about in array type you need to loop through it to get the data of each column so try this
<div v-for="abt in about" :key="abt.id"class="heading-block border-bottom-0 mb-0">
<h2 class="nott font-weight-semibold mb-4 text-secondary" style="color: #1ABC9C;">Our Story</h2>
<p v-if="about">{{abt.about_us}}</p>
you guys just look at my methods and vue component...But the actual problem was in my controller where...
$about = About::where('publication_status',1)->orderBy('id','ASC')->take(1)->first();
return response()->json(['about',$about],200);
to
$about = About::where('publication_status',1)->orderBy('id','ASC')->take(1)->first();
return response()->json(['about'=>$about],200);
My code:
.items {
display: grid;
grid-template-columns: repeat(3, 1fr);
box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.3);
}
How can I properly display my images as a 3 column grid?
<section id="work-a" class="text-center py-3">
<div class="container">
<h2 class="section-title">My Work</h2>
<div class="bottom-line"></div>
<p class="lead">
Check out some of my projects
</p>
<div class="items">
<div class="item">
<div class="item-image">
<img src="img/items/item1.png" alt="">
</div>
<div class="item-text">
<div class="item-text-wrap">
<p class="item-text-category">Design</p>
<h2 class="item-text-title">Great Gradients</h2>
</div>
</div>
</div>
<div class="item">
<div class="item-image">
<img src="img/items/item2.png" alt="">
</div>
<div class="item-text">
<div class="item-text-wrap">
<p class="item-text-category">Design</p>
<h2 class="item-text-title">Great Gradients</h2>
</div>
</div>
</div>
<div class="item">
<div class="item-image">
<img src="img/items/item3.png" alt="">
</div>
<div class="item-text">
<div class="item-text-wrap">
<p class="item-text-category">Design</p>
<h2 class="item-text-title">Great Gradients</h2>
</div>
</div>
</div>
</div>
</div>
</section>
I built this mock-up:
I was wondering if this type of gallery is possible to build with bootstrap, I did not start to code yet because I think that it will not work because of the rows.
I would like some second opinions, from people who have worked with bootstrap for longer than me.
I found something that actualy works!! and it's responsive! :D
.poligono, .poligono div {
margin: 0 auto;
transform-origin: 50% 50%;
overflow: hidden;
width: 250px;
height: 250px;
}
.poligono {
transform: rotate(45deg) translateY(10px);
}
.poligono .los1 {
width: 355px;
height: 355px;
transform: rotate(-45deg) translateY(-74px);
}
.poligono .los1 img {
width: 100%;
height: auto;
-moz-transition: all 0.6s;
-webkit-transition: all 0.6s;
transition: all 0.6s;
}
.poligono:hover img {
-moz-transform: scale(1.3);
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
<div id="projects" class="projects">
<div class="container">
<div class="row">
<div class="col-md-offset-9 col-md-3">
<h2>Projects</h2>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
<p class="descricao">Cenas maradas acontecem</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-offset-2 col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-offset-2 col-md-4">
<div class="poligono img-responsive">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono img-responsive">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
</div>
<div class="row margin-bottom">
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
<div class="col-md-4">
<div class="poligono">
<div class="los1">
<img class=" img-responsive" src="img/project_1.jpg" alt="Projecto 1 UNlogical"/>
</div>
</div>
</div>
</div>
</div>
</div>
If you are asking if there is a default bootstrap for this the answer is no.
But yes this is possible with your own css.
I don't see why not you could not skew the image with something like the following:
img.tilted{
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
If you want this "mask like behaviour" i don't see why you couldn't put all the images on a layer bellow and put a transparent image on the top
Or you can try to css clip it like this http://www.html5rocks.com/en/tutorials/masking/adobe/