I want to make a hover animation effect in scss. The idea is when cursor hover on the card, another hidden card appear on top of the hovered card.
But now I got stuck on making the hidden card scss: I am not sure how to make the card the same size and the same position as the bottom card(dark blue card). It is for the className "card-hover"
Below is the code for js:
<div className="gallery">
{data.map((item)=>
<div className="card-holder" key={item.id}>
<div className="card-head">
<img className="card-img" src={item.image} alt="project item" />
</div>
<div className="card-body">
<h2 className="item-name">{item.title}</h2>
<div className="item-date">{item.year}</div>
</div>
<div className="card-hover">
<div className="item-role">{item.role}</div>
<div className="item-type">{item.type}</div>
<div className="item-decs">{item.desc}</div>
</div>
</div>
)}
</div>
Code for scss:
.gallery{
margin-left: 10rem;
margin-right: 10rem;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 8px;
justify-content: center;
}
.card-holder{
border-radius: 4px;
margin-top: 1rem;
background-color: $darkBlue;
box-shadow: 0px 8px 56px rgb(15 80 100 / 16%);
}
.card-hover {
position: absolute;
background-color: #D62839;
display: inline;
width: 100%;
height: 100%;
}
The current result:
enter image description here
I have looked through tutorial videos of how to make this kind of hover effect, but all solutions so far were to set
width:100%;
height:100%
or
top:0;
bottom:0;
left:0;
right:0;
However, when I tried them the result is like the screenshot above. Can someone help me with this? Thank you
I am using react-icons in one of my projects and I am not able to align the icons (vertically) with the text. Following is what I am getting currently.
As you can see -- The icons are a little higher than the text.
Following is my HTML code:
<div className="route-info-container">
<div>
<p>Difficulty (1-10)</p>
<h2><AiFillFire />{route.difficulty}</h2>
</div>
<div>
<p>Length</p>
<h2><GiTrail />{route.length}</h2>
</div>
<div>
<p>Est Driving Time</p>
<h2><RiTimerFlashFill />{route.estimatedDrivingTime}</h2>
</div>
<div>
<p>Permits</p>
<h2><IoNewspaperSharp />{route.permits? 'Required': 'Not Required'}</h2>
</div>
</div>
Following is my css:
.route-info-container {
display: grid;
grid-template-columns: auto auto;
}
.route-info-container h2 {
font-size: 25px;
margin-top: 10px;
}
It' s because the svg' s alignment. You can't do too much things to svg but try to do this to h2:
h2 {
display: flex;
align-items: center;
}
When I add the filter property on a PrimeNg (7.x) p-tree it works as expected but I have a double scroll bar.
The implementation is not special
<div class="row" *ngIf="formControls.wantThemes.value">
<div class="col-4 app-notif-edit-label"></div>
<div class="col-4 app-notif-edit-content">
<h4>Themes</h4>
<p-tree
[filter]="true"
class="app-notif-p-tree"
[value]="cmtyThemesTreeNodes"
[(selection)]="selectedCmtyThemesTreeNodes"
selectionMode="checkbox"
(onNodeSelect)="nodeSelectThemes($event)"
(onNodeUnselect)="nodeSelectThemes($event)"
>
</p-tree>
</div>
</div>
I have applied the following css to limit the size of the box
.app-notif-p-tree .ui-tree {
color: $sinapseBlue;
display: block;
font-size: medium;
height: 100%;
margin: 2% auto;
max-height: 250px;
min-height: 250px;
overflow: auto;
white-space: nowrap;
width: 97%; }
If I change the overflow to hidden, I don't see the last element of my list.
Any idea why? Thanks
I have added .app-notif-p-tree .ui-tree .ui-tree-container { height: 80%; }
I'm trying to take an image from a phone and then put it through Watson Visual Recognition on Node-Red.
I've been loading my URL on my phone, and it's able to take an image, but then instantly crashes.
Does anyone have any experience in this? Thanks
My node-red flow is here
[{"id":"d2139149.736cb","type":"visual-recognition-v3","z":"12c7584.82dbca8","name":"Classify Meter","apikey":"","image-feature":"classifyImage","lang":"en","x":652.107177734375,"y":757.9999923706055,"wires":[["603c48c7.3144f8","8f4f26d2.549338","a862f46a.96305"]]},{"id":"4a935442.0b7efc","type":"http in","z":"12c7584.82dbca8","name":"","url":"/recophone","method":"get","upload":false,"swaggerDoc":"","x":115,"y":733.4404983520508,"wires":[["f235ab46.9552a8"]]},{"id":"1c640d2d.20b8b3","type":"http response","z":"12c7584.82dbca8","name":"HTTP Response","statusCode":"","headers":{},"x":1097.33349609375,"y":719.3928298950195,"wires":[]},{"id":"f235ab46.9552a8","type":"switch","z":"12c7584.82dbca8","name":"Check Url","property":"payload.imageurl","propertyType":"msg","rules":[{"t":"null"},{"t":"else"}],"checkall":"false","outputs":2,"x":311.5714111328125,"y":727.4404907226562,"wires":[["7de01baf.d96a2c"],["9b629cc.7379fe"]]},{"id":"603c48c7.3144f8","type":"template","z":"12c7584.82dbca8","name":"Report","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<html>\n<head><title>Watson Visual Recognition on Node-RED</title></head>\n<style> \nbody {background-color: white;}\nh1 {text-align: center;}\nh2 {color: black; text-align: center; font-family: verdana; font-size: 30px;}\np {color:black; text-align: center; font-family: verdana; font-size: 15px;}\ntable {color:black; text-align: center; font-family: verdana; font-size: 15px;}\nform {color:black; text-align: center; font-family: verdana; font-size: 15px;}\n</style>\n<body>\n<h1><img src=\"http://www.rousseau.com.pt/imagens/estudos/IBM_logo_blue_thumb1.png\">\n<img src=\"https://images.reevoo.com/retailers/Center/NPOWR/brand/260x200.png\"> </h1>\n<h2>Node-RED Watson Visual Recognition output</h2>\n<p>Analyzed image: {{payload}}<br/><img src=\"{{payload}}\" height='100'/></p>\n<table border='1' align=\"center\"> \n <thead><tr><th>Name</th><th>Score</th></tr></thead>\n{{#result.images.0.classifiers.0.classes}}\n <tr><td><b>{{class}}</b></td><td><i>{{score}}</i></td></tr>\n{{/result.images.0.classifiers.0.classes}}\n</table>\n<form action=\"{{req._parsedUrl.pathname}}\">\n <input type=\"submit\" value=\"Try again\"/>\n</form>\n</body>\n</html>","x":903.7618408203125,"y":756.726203918457,"wires":[["1c640d2d.20b8b3"]]},{"id":"9b629cc.7379fe","type":"change","z":"12c7584.82dbca8","name":"Convert Url","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.imageurl","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":459.33343505859375,"y":757.2500228881836,"wires":[["d2139149.736cb"]]},{"id":"8f4f26d2.549338","type":"function","z":"12c7584.82dbca8","name":"get labels","func":"//var labels = msg.result.images[0].classifiers[0].classes;\nvar confidence = msg.result.images[0].classifiers[0].classes;\n//msg.payload = labels.map(function(i){\n // return i.class;\nmsg.payload = confidence.map(function(i){\nreturn i.class + \" \" + i.score;\n//msg.payload = confidence.map(function(i){\n //return i.score;\n \n});\nreturn msg;","outputs":1,"noerr":0,"x":897.66650390625,"y":795.1071243286133,"wires":[["e10c122c.626fd"]]},{"id":"e10c122c.626fd","type":"debug","z":"12c7584.82dbca8","name":"","active":true,"console":"false","complete":"payload","x":1082.428466796875,"y":791.726203918457,"wires":[]},{"id":"a862f46a.96305","type":"debug","z":"12c7584.82dbca8","name":"","active":false,"console":"false","complete":"result","x":901.3629150390625,"y":832.3452758789062,"wires":[]},{"id":"df542a47.1a7088","type":"inject","z":"12c7584.82dbca8","name":"URL","topic":"","payload":"http://visual-recognition-demo.mybluemix.net/images/samples/2.jpg","payloadType":"str","repeat":"","crontab":"","once":false,"x":474.73809814453125,"y":795.75,"wires":[["d2139149.736cb"]]},{"id":"7de01baf.d96a2c","type":"template","z":"12c7584.82dbca8","name":"File UploadGet Image URL","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<html>\n<head>\n <style>\nbody {background-color: white;}\nh1 {text-align: center;}\nh2 {color: black; text-align: center; font-family: verdana; font-size: 30px;}\nh3 {color:black; text-align: center; font-family: verdana; font-size: 15px;}\nform {color:black; text-align: center; font-family: verdana; font-size: 15px;}\n</style>\n<title>Npower Meter Watson Visual Recognition font-family: \"Playfair Display\", serif;\nfont-size: 32px;text-align: left; </title> </head>\n<body>\n<h1> <img src=\"http://www.rousseau.com.pt/imagens/estudos/IBM_logo_blue_thumb1.png\">\n<img src=\"https://images.reevoo.com/retailers/Center/NPOWR/brand/260x200.png\"> </h1> \n \n <h2> Welcome to this demo on identifying Meter Issues via images </h2>\n <h3> Select an image URL</h3>\n<form action=\"{{req._parsedUrl.pathname}}\">\n //Code for taking picture from phone\n<form action=\"/action_page.php\">\n <input type=\"file\" name=\"pic\" accept=\"image/*\">\n <input type=\"submit\">\n <img src=\"http://static.flickr.com/3087/2648843542_3101f132ec.jpg\" height='200'/>\n <img src=\"http://static.flickr.com/3281/2719178040_e80447902d.jpg\" height='200'/>\n <img src=\"http://static.flickr.com/2308/2218597585_410d3c9148.jpg\" height='200'/>\n <img src=\"http://static.flickr.com/3072/2439552803_ed8b7d6ab1.jpg\" height='200'/>\n<br/><b>Copy above image location URL or enter any image URL:</b><br/>\n <input type=\"text\" name=\"imageurl\"/>\n <input type=\"submit\" value=\"Analyze\"/>\n</form>\n</body>\n</html>\n","x":843.5714111328125,"y":716.5833435058594,"wires":[["1c640d2d.20b8b3"]]},{"id":"7bd12438.024544","type":"comment","z":"12c7584.82dbca8","name":"Phone Upload","info":"","x":110,"y":682,"wires":[]}]
You can use the Camera node that is included in the node-red-contrib-browser-utils package.
To install it either run
npm install node-red-contrib-browser-utils
or go your Node-red instance -> Menu (top-right) -> Manage palette -> Install -> Search for node-red-contrib-browser utils
More info on the NPM registry page
I am looking for Tabs displayed top to bottom with tab navigation on the left. Is there anyway this can be achieved in Angular Material library?
This codepen by Rahul Sagore uses vanilla Material, not specifically for Angular, but it's exactly what you want. I was looking for the same thing as you; it's a shame Material doesn't offer this, but I can see how it would go against their principles and make Material too extensive.
It comprises of custom css (perhaps overriding, I'm not sure) and use of particular Material classnames. Below I've pasted the contents into a snippet.
I had an issue with the mdl-cell--n-col classes so I changed the content one from 10-col to 6-col so it wouldn't wrap the content beneath the tabs in the restrictive space of this post. You'll probably have to tinker with that yourself, or scrap that and use Material styles the way you know how. Similarly, I cannot see what the .hollow-circle spans are doing, so perhaps they aren't needed.
/*Vertical Tabs*/
.vertical-mdl-tabs {
margin-top: 30px;
}
.vertical-mdl-tabs .mdl-tabs__tab-bar {
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
padding-bottom: 35px;
height: inherit;
border-bottom: none;
border-right: 1px solid rgba(10, 11, 49, 0.20);
}
.vertical-mdl-tabs .mdl-tabs__tab {
width: 100%;
height: 35px;
line-height: 35px;
box-sizing: border-box;
letter-spacing: 2px;
}
.vertical-mdl-tabs.mdl-tabs.is-upgraded a.mdl-tabs__tab.is-active {
border-right: 2px solid #ED462F;
}
.vertical-mdl-tabs.mdl-tabs.is-upgraded .mdl-tabs__tab.is-active:after {
content: inherit;
height: 0;
}
.vertical-mdl-tabs.mdl-tabs.is-upgraded .mdl-tabs__panel.is-active, .mdl-tabs__panel {
padding: 0 30px;
}
.vertical-mdl-tabs.mdl-tabs .mdl-tabs__tab {
text-align: left;
}
<script src="https://storage.googleapis.com/code.getmdl.io/1.1.0/material.min.js"></script>
<link href="https://storage.googleapis.com/code.getmdl.io/1.1.0/material.indigo-pink.min.css" rel="stylesheet"/>
<div class="mdl-tabs vertical-mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-grid mdl-grid--no-spacing">
<div class="mdl-cell mdl-cell--2-col">
<div class="mdl-tabs__tab-bar">
<a href="#tab1-panel" class="mdl-tabs__tab is-active">
<span class="hollow-circle"></span>
Tab 1
</a>
<a href="#tab2-panel" class="mdl-tabs__tab">
<span class="hollow-circle"></span>
Tab 2
</a>
<a href="#tab3-panel" class="mdl-tabs__tab">
<span class="hollow-circle"></span>
Tab 3
</a>
</div>
</div>
<div class="mdl-cell mdl-cell--6-col">
<div class="mdl-tabs__panel is-active" id="tab1-panel">
Content 1
</div>
<div class="mdl-tabs__panel" id="tab2-panel">
Content 2
</div>
<div class="mdl-tabs__panel" id="tab3-panel">
Content 3
</div>
</div>
</div>
</div>
you can have verticval tabs by adding vertical attribute to the mat-tab-group and adding following css to your page.
mat-tab-group[vertical] .mat-tab-labels {
display: flex;
flex-direction: column!important;
}
mat-tab-group[vertical] {
display: flex;
flex-direction: row!important;
}
here's the mat-tab-group element with vertical attribute
<mat-tab-group flex="1" vertical>
<mat-tab label="Tab 1"> Loading ... </mat-tab>
<mat-tab label="Tab 2" > Loading ... </mat-tab>
</mat-tab-group>