1643708640
In this article, we'll discuss information about the Food Farmer Finance project and FFF token. What is Food Farmer Finance (FFF) | What is FFF token?
FFF is a collective of established DeFi 3.0 innovators, advisors, developers, yield farmers, and investors who have come together to provide the community with a quality offering within the Farming-as-a-Service sector via ownership of FFF tokens.
Food Farmer Finance aims to solve the problems of prior cryptocurrencies and DeFi investments, including yield farming and index funds. Yield farming can be highly lucrative but requires know-how and constant monitoring to succeed, while yield farming remains of interest due to its opportunities. We propose allowing users to participate in a smart contract DeFi hedge fund to produce yields on your behalf.
We see FFF as an asset allocation tool that provides token holders with exposure to yield farming strategies that are otherwise complicated, time-consuming, and high-risk in nature. Within our framework, we manage funds that have been raised via our pre-sale and treasury to provide our holders with exposure to the performance of our strategy and passive income generation.
In our view, this is early-stage adoption of FaaS / Defi 3.0 and we believe this project has a significant advantage in being one of the first movers who are deploying a team of experts with managed investment experience.
In our "Meet the Team" section, you can read further information on our accomplishments and experience to get to know us better.
$FFF
The FFF token represents fractionalized ownership in Food Farmer Finance, a tokenized DeFi hedge fund that offers holders exposure to a range of high-performing strategies such as yield farming. The project's objective is to raise funds via a pre-sale and tax system that is then managed and grown by our internal teams to provide exposure to an appreciating asset base and income stream to holders of the token via claiming reflections and rewards using the FFF Dapp.
Our lead farmer and support team have a track record of success in building current FaaS projects and the deployment and management of treasury balances. Through ownership of FFF tokens, holders receive fractionated exposure to the performance of our treasury and, via our many platforms, have direct access to our educational services, expertise, and community discussion.
Our mandate is to deploy community funds across a robust strategy that offers superior risk management, performance, diversification, and income to alternatives currently available in the market.
Why should you own $FFF?
FFF offers a compelling advantage within the Defi 3.0 / FaaS landscape; at the time of deployment, FFF has the most compelling valuation, and the timing of deployment of funds has been opportunistic given the recent sell-off in the market.
Our team has a track record of success, our holder base is comprised of a diverse range of respected Defi 2.0 projects and fellow FaaS plays, which provides potential holders with a unique level of validation that has been otherwise unseen in the space.
When it comes to trading, the exceptional opportunities in the market are often reserved for those with larger wallets. We aim to provide the community with access to these opportunities through ownership of our tokens.
Our Vision
Our vision is to be the leading Farming-as-a-Service collective across blockchain as a whole, to challenge the legacy financial industry, and offer easy access to the best DeFi exposure available through strategic spot investments, and expert-curated optimization of yield farming across multiple blockchains.
Our decentralized FaaS token shifts fоundаtiоnаl trust away from lеgасу centralized authorities to an easily accessible, transparent, peer-to-peer blосkсhаin thаt is rapid аnd реrmiѕѕiоnlеѕѕ. Unlikе traditional hedge funds.
Our Strategy
FFF strategies include a combination of low, medium, and high-risk strategic investments that are meticulously crafted and planned to detail utilizing every potential arbitrage at hand.
We deploy our treasury over volatile assets and stable coins. FFF aims to capture the DeFi equivalent to the risk-adjusted investment approach that Ray Dalio co-chairs at Bridgewater Associates.
Through our existing relationships within DeFi, we intend to align our project with some of the best minds in the industry to continue to provide our community with access to premium opportunities.
Our Goals
Our goal is to be the frontier solution within the FaaS industry and lead the charge to a decentralized self-governed future.
To grow FFF to become the DeFi equivalent to leading TradFi asset management providers such as Blackrock, Fidelity, NIKKO AM, Vanguard.
To inspire individuals and businesses to join us on our mission towards a decentralized tomorrow.
To create something truly remarkable.
Distribution of FFF tokens, and vesting schedule.
1 FFF = 1 FFF
Presale priced at 0.001 and public sale priced at 0.001, strict vesting rules in place for founders and presale participants via contract.
Team allocation, presale, and vesting
The total amount of FFF tokens is 1,000,000,000 at launch, we reserve the right to buy back and burn FFF tokens.
We are implementing a vesting schedule internally and against all presale allocations, with the following breakdown:
Team
A total of 10% of the supply is dedicated towards the team and is vested for twelve months.
Presale
A total of 60% of supply is dedicated towards presale, a vesting schedule is applied against all presale allocations, with the following breakdown:
33.3% available at public launch.
33.3% available at 1 month after launch.
33.3% available at 2 months after launch.
Public launch
30% available at public launch.
Utilization of funds
Funds raised via our pre-sale will be allocated on a 50 / 50 basis across our treasury and liquidity pool. This will provide us with an initial farming wallet of roughly 125 ETH and $300,000 USD in liquidity in addition to the 300,000,000 tokens we have allocated from the free float.
Taxation distribution
Every transaction is liable to 12% taxation and is distributed as follows:
8% Treasury
2% Reflections
2% Liquidity pool
In addition to the above, we also reserve the right to buy back the FFF token and burn it supporting and increasing the price floor while depreciating the supply.
Reflection rewards
Frictionless, static reflections accumulate by simply holding your $FFF token and feature an innovative hold-farming reward structure that stands out from the standard. This function aims to eliminate token dependencies and reward participation on top of profits.
Reflection rewards are claimable via our Dapp, and users have the option to either reinvest the rewards as FFF tokens (converted from ETH to FFF) or claim the ETH to their wallet directly.
Automatic liquidity acquisition
Liquidity is crucial in any trading environment. By definition, decentralized liquidity is the accessibility of tokens operated, controlled, and hosted by a decentralized exchange governed by a smart contract.
This mechanism acts as a resistance securing the volume of FFF; the added liquidity pool creates stability from the supplied liquidity by adding the Tax to the overall liquidity of the token. As the pool increases, the price stability mirrors this with the benefit of a substantial price floor and cushion for holders.
Treasury
Money in the treasury is used to farm across multiple chains and return the profits as dividends back to $FFF holders.
Return on investment
Core thesis
One of the core drivers behind creating this project was to offer the community a vehicle that provides a high level of ROI to holders. We intend to do this at Food farmer financial via three avenues:
Treasury growth = Market capitalization growth
We aim to grow our treasury rapidly. While there is no correlation between treasury growth and token price, we believe the market will price FFF tokens based on the underlying performance and value of the holdings and may even apply basic run-rate metrics to the project, treasury and market cap intends to provide holders with ROI via token price appreciation.
Staking
Staking will be available early, and we intend to incentivize users to provide liquidity with additional rewards to any participants in our FFF / ETH liquidity pool that shall be accessible on Uniswap. These rewards will be paid out in ETH that is claimable within our Dapp.
Reflections
Two percent of transactions reflect automatically to all FFF participants. Reflection rewards are claimable via our Dapp, and users have the option to either reinvest the rewards as FFF tokens (converted from ETH to FFF) or claim the ETH to their wallet directly.
Summary
We will continue to build out the utility of the token over time, with the view to operate across multiple chains, in the short term, our goals include launching across FTM, AVAX & BSC chains. There will be additional stores of value generated and additional avenues for further ROI as the project matures.
Liquidity Pool
We have elected to launch staking as one of the first items on our roadmap. One of the headwinds we have seen in other projects is the lack of funds available in LPs and the inability to deploy across multiple chains rapidly.
We will have an FFF/ETH pool available on Uniswap to provide investors with a location to stake their FFF tokens and generate a dynamic APR.
We intend to apply the same model as we deploy across multiple blockchains, and our first targets include Fantom, Avalanche, and Binance Smart Chain.
How and Where to Buy FFF token?
FFF token is now live on the ETH mainnet. The token address for FFF is 0xc16b2419494ae0604432297d40cdf0e8d68de8d6. Be cautious not to purchase any other token with a smart contract different from this one (as this can be easily faked). We strongly advise to be vigilant and stay safe throughout the launch. Don’t let the excitement get the best of you.
Just be sure you have enough ETH in your wallet to cover the transaction fees.
You will have to first buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
We will use Binance Exchange here as it is one of the largest crypto exchanges that accept fiat deposits.
Once you finished the KYC process. You will be asked to add a payment method. Here you can either choose to provide a credit/debit card or use a bank transfer, and buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
Step by Step Guide : What is Binance | How to Create an account on Binance (Updated 2022)
Next step
You need a wallet address to Connect to Uniswap Decentralized Exchange, we use Metamask wallet
If you don’t have a Metamask wallet, read this article and follow the steps
☞ What is Metamask wallet | How to Create a wallet and Use
Transfer $ETH to your new Metamask wallet from Binance wallet
Next step
Connect Metamask Wallet to Uniswap Decentralized Exchange and Buy, Swap FFF token
Contract: 0xc16b2419494ae0604432297d40cdf0e8d68de8d6
Read more: What is Uniswap | Beginner's Guide on How to Use Uniswap
The top exchange for trading in FFF token is currently: Uniswap (V2)
Top exchanges for token-coin trading. Follow instructions and make unlimited money
☞ Binance ☞ Bittrex ☞ Poloniex ☞ Bitfinex ☞ Huobi ☞ MXC ☞ ProBIT ☞ Gate.io ☞ Coinbase
🔺DISCLAIMER: The Information in the post isn’t financial advice, is intended FOR GENERAL INFORMATION PURPOSES ONLY. Trading Cryptocurrency is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money.
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community ☞ **-----https://geekcash.org-----**⭐ ⭐ ⭐
Find more information FFF token ☞ Website
I hope this post will help you. Don't forget to leave a like, comment and sharing it with others. Thank you!
1666940328
Google map API with multiple addresses, custom marker, custom info box window and custom map style.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Info windows</title>
<link href="css/style.css" rel="stylesheet" />
</head>
<body>
<div id="map" style="width: 900px; height: 500px;"></div>
<a href="javascript:void(0);" id="reset"> Reset </a>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="js/infobox.js"></script>
<script type="text/javascript">
/* Styling map */
var customMapType = new google.maps.StyledMapType([{
stylers : [ {
hue : "#cccccc"
}, {
saturation : -100
}]
}, {
featureType : "road",
elementType : "geometry",
stylers : [ {
lightness : 100
}, {
visibility : "simplified"
}]
}, {
featureType : "road",
elementType : "labels",
stylers : [ {
visibility : "on"
}]
}, {
featureType: "poi",
stylers: [ {
visibility: "off"
}]
}]);
var customMapTypeId = 'custom_style';
$(document).on('touchend', '.closeInfo', function(e) {
e.preventDefault();
infobox.open(null,null);
});
$(document).on('click', '.closeInfo', function(e) {
e.preventDefault();
infobox.open(null,null);
});
/* Map options */
var delay = 100;
var latlng = new google.maps.LatLng();
var mapOptions = {
zoom: 5,
center: latlng,
panControl: false,
zoomControl: true,
mapTypeControl: false,
scaleControl: false,
streetViewControl: true,
overviewMapControl: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.RIGHT_TOP
},
streetViewControlOptions: {
position: google.maps.ControlPosition.RIGHT_TOP
},
mapTypeId: google.maps.MapTypeId.ROADMAP, customMapTypeId
}
/* Info window settings */
var infobox = new InfoBox({
disableAutoPan: false,
maxWidth: 202,
pixelOffset: new google.maps.Size(-101, -282),
zIndex: null,
boxStyle: {
background: "url('images/infobox-bg.png') no-repeat",
opacity: 1,
width: "202px",
height: "245px"
},
closeBoxMargin: "28px 26px 0px 0px",
closeBoxURL: "",
infoBoxClearance: new google.maps.Size(1, 1),
pane: "floatPane",
enableEventPropagation: false
}), locations, i;
var geocoder = new google.maps.Geocoder();
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
var bounds = new google.maps.LatLngBounds();
map.mapTypes.set(customMapTypeId, customMapType);
map.setMapTypeId(customMapTypeId);
function geocodeAddress(address, siteimage, subtitle, permalinkview, next) {
geocoder.geocode({address:address}, function (results,status){
if (status == google.maps.GeocoderStatus.OK) {
var p = results[0].geometry.location;
var lat=p.lat();
var lng=p.lng();
createMarker(address, siteimage, subtitle, permalinkview, lat, lng);
} else {
if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
nextAddress--;
delay++;
}
}
next();
});
}
/* Address to display */
var locations = [
['London Eye, London'],
['Palace of Westminster, London'],
['Abbey Wood, London'],
['Angel, London'],
['Ardleigh Green, London'],
['Arnos Grove, London'],
['Bankside, London'],
['Barbican, London']
];
/* For images*/
var siteimages=[
['images/avatar.png'],
['images/avatar.png'],
['images/avatar.png'],
['images/avatar.png'],
['images/avatar.png'],
['images/avatar.png'],
['images/avatar.png'],
['images/avatar.png']
];
/* For sub address*/
var subtitle=[
['this is sub address one'],
['This is sub addess two'],
['This is sub addess three'],
['This is sub addess four'],
['This is sub addess five'],
['This is sub addess six'],
['This is sub addess seven'],
['This is sub addess eight']
];
/* For Permalink view*/
var permalinkview=[
['http://google.com/'],
['http://google.com/'],
['http://google.com/'],
['http://google.com/'],
['http://google.com/'],
['http://google.com/'],
['http://google.com/'],
['http://google.com/']
];
/* Marker */
function createMarker(add, siteimage, subtitle, permalinkview, lat, lng) {
var cnt = mycontent(add, siteimage, subtitle, permalinkview);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat,lng),
map: map,
icon: 'images/marker-green.png',
draggable: true,
animation: google.maps.Animation.DROP
});
/* Onclick show infowindow */
google.maps.event.addListener(marker, 'click', function() {
map.setZoom(16);
singlePos(lat, lng);
infobox.setContent(cnt);
infobox.open(map,marker);
});
bounds.extend(marker.position);
}
function singlePos(lat, lng){ // For centering a specific position on map.
map.setCenter(new google.maps.LatLng(lat, lng));
}
$('#reset').on('click', function(){
theNext();
infobox.open(null,null);
});
var nextAddress = 0;
function theNext() {
if (nextAddress < locations.length) {
setTimeout('geocodeAddress("'+locations[nextAddress]+'","'+siteimages[nextAddress]+'","'+subtitle[nextAddress]+'","'+permalinkview[nextAddress]+'",theNext)', delay);
nextAddress++;
} else {
map.fitBounds(bounds);
}
}
theNext();
function mycontent(add, siteimage, subtitle, permalinkview){
return contentString = '<div class="infoW">' +
'<div class="propImg">' +
'<img src="'+siteimage+'">' +
'</div>' +
'<div class="paWrapper">' +
'<div class="propTitle">'+ add +'</div>' +
'<div class="propAddress">'+subtitle+'</div>'+
'</div>' +
'<div class="clearfix"></div>' +
'<div class="infoButtons">' +
'<a href="#" class="btn btn-sm btn-round btn-gray btn-o closeInfo">Close</a>' +
'<a href="'+permalinkview+'" class="btn btn-sm btn-round btn-green viewInfo">View</a>' +
'</div>' +
'</div>';
}
</script>
</body>
</html>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map { position: relative; }
.infoW {
font-family: 'open_sansregular', sans-serif, Arial;
color: #333;
padding: 0 1px;
z-index: 10;
}
.propImg {
position: relative;
}
.propImg img {
width: 200px;
height: 120px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.propType {
background-color: #eab134;
font-size: 10px;
line-height: 11px;
color: #fff;
padding: 2px 4px;
border-radius: 2px;
position: absolute;
right: 10px;
bottom: 10px;
text-transform: uppercase;
z-index: 3;
}
.paWrapper {
padding: 10px 10px 0 10px;
}
.propPrice {
position: absolute;
left: 10px;
bottom: 10px;
color: #fff;
font-size: 12px;
line-height: 12px;
z-index: 3;
}
.propTitle {
/*font-weight: bold;*/
font-size: 14px;
line-height: 16px;
white-space: nowrap;
overflow: hidden;
padding-bottom: 3px;
}
.propAddress {
white-space: nowrap;
overflow: hidden;
color: #999;
font-size: 11px;
line-height: 12px;
padding-bottom: 12px;
height: 24px;
}
.infoButtons {
padding: 10px;
}
a.btn.viewInfo, a.btn.closeInfo {
width: 85px;
padding: 6px 29px;
}
a.btn.viewInfo {
margin-left: 10px;
}
.btn-green {
background-color: #0eaaa6;
color: #fff;
}
.btn {
border-radius: 2px;
text-decoration: none;
}
.btn-round {
border-radius: 50px;
}
.btn-o {
border-width: 1px;
border-style: solid;
}
.btn-gray {
background-color: #999;
color: #fff;
}
.btn-o.btn-gray {
background-color: transparent;
color: #999;
border-color: #999;
}
.no-touch .btn-gray:hover,
.btn-gray:focus,
.btn-gray:active,
.btn-gray.active,
.open > .dropdown-toggle.btn-gray {
background-color: #333;
color: #fff;
}
.no-touch .btn-o.btn-gray:hover,
.btn-o.btn-gray:focus,
.btn-o.btn-gray:active,
.btn-o.btn-gray.active,
.open > .dropdown-toggle.btn-o.btn-gray {
background-color: #999;
color: #fff;
}
.btn-light-gray {
background-color: #dfdfdf;
color: #333;
}
.btn-o.btn-light-gray {
background-color: transparent;
color: #999;
border-color: #dfdfdf;
}
.no-touch .btn-light-gray:hover,
.btn-light-gray:focus,
.btn-light-gray:active,
.btn-light-gray.active,
.open > .dropdown-toggle.btn-light-gray {
background-color: #999;
color: #333;
}
.no-touch .btn-o.btn-light-gray:hover,
.btn-o.btn-light-gray:focus,
.btn-o.btn-light-gray:active,
.btn-o.btn-light-gray.active,
.open > .dropdown-toggle.btn-o.btn-light-gray {
background-color: transparent;
color: #333;
border-color: #999;
}
.btn-white {
background-color: #fff;
color: #999;
}
.btn-o.btn-white {
background-color: transparent;
color: #fff;
border-color: #fff;
}
.no-touch .btn-white:hover,
.btn-white:focus,
.btn-white:active,
.btn-white.active,
.open > .dropdown-toggle.btn-white {
background-color: #fff;
color: #333;
}
.no-touch .btn-o.btn-white:hover,
.btn-o.btn-white:focus,
.btn-o.btn-white:active,
.btn-o.btn-white.active,
.open > .dropdown-toggle.btn-o.btn-white {
background-color: #fff;
color: #333;
}
.btn-black {
background-color: #333;
color: #fff;
}
.btn-o.btn-black {
background-color: transparent;
color: #333;
border-color: #333;
}
.no-touch .btn-black:hover,
.btn-black:focus,
.btn-black:active,
.btn-black.active,
.open > .dropdown-toggle.btn-black {
background-color: #000;
color: #fff;
}
.no-touch .btn-o.btn-black:hover,
.btn-o.btn-black:focus,
.btn-o.btn-black:active,
.btn-o.btn-black.active,
.open > .dropdown-toggle.btn-o.btn-black {
background-color: #000;
color: #fff;
}
.btn-green {
background-color: #0eaaa6;
color: #fff;
}
.btn-o.btn-green {
background-color: transparent;
color: #0eaaa6;
border-color: #0eaaa6;
}
.no-touch .btn-green:hover,
.btn-green:focus,
.btn-green:active,
.btn-green.active,
.open > .dropdown-toggle.btn-green {
background-color: #068b85;
color: #fff;
}
.no-touch .btn-o.btn-green:hover,
.btn-o.btn-green:focus,
.btn-o.btn-green:active,
.btn-o.btn-green.active,
.open > .dropdown-toggle.btn-o.btn-green {
background-color: #0eaaa6;
color: #fff;
}
.btn-blue {
background-color: #1d82aa;
color: #fff;
}
.btn-o.btn-blue {
background-color: transparent;
color: #1d82aa;
border-color: #1d82aa;
}
.no-touch .btn-blue:hover,
.btn-blue:focus,
.btn-blue:active,
.btn-blue.active,
.open > .dropdown-toggle.btn-blue {
background-color: #086492;
color: #fff;
}
.no-touch .btn-o.btn-blue:hover,
.btn-o.btn-blue:focus,
.btn-o.btn-blue:active,
.btn-o.btn-blue.active,
.open > .dropdown-toggle.btn-o.btn-blue {
background-color: #1d82aa;
color: #fff;
}
.btn-magenta {
background-color: #9b156e;
color: #fff;
}
.btn-o.btn-magenta {
background-color: transparent;
color: #9b156e;
border-color: #9b156e;
}
.no-touch .btn-magenta:hover,
.btn-magenta:focus,
.btn-magenta:active,
.btn-magenta.active,
.open > .dropdown-toggle.btn-magenta {
background-color: #7e115f;
color: #fff;
}
.no-touch .btn-o.btn-magenta:hover,
.btn-o.btn-magenta:focus,
.btn-o.btn-magenta:active,
.btn-o.btn-magenta.active,
.open > .dropdown-toggle.btn-o.btn-magenta {
background-color: #9b156e;
color: #fff;
}
.btn-yellow {
background-color: #eab134;
color: #fff;
}
.btn-o.btn-yellow {
background-color: transparent;
color: #eab134;
border-color: #eab134;
}
.no-touch .btn-yellow:hover,
.btn-yellow:focus,
.btn-yellow:active,
.btn-yellow.active,
.open > .dropdown-toggle.btn-yellow {
background-color: #dfa412;
color: #fff;
}
.no-touch .btn-o.btn-yellow:hover,
.btn-o.btn-yellow:focus,
.btn-o.btn-yellow:active,
.btn-o.btn-yellow.active,
.open > .dropdown-toggle.btn-o.btn-yellow {
background-color: #eab134;
color: #fff;
}
.btn-red {
background-color: #ea3d36;
color: #fff;
}
.btn-o.btn-red {
background-color: transparent;
color: #ea3d36;
border-color: #ea3d36;
}
.no-touch .btn-red:hover,
.btn-red:focus,
.btn-red:active,
.btn-red.active,
.open > .dropdown-toggle.btn-red {
background-color: #d22a2a;
color: #fff;
}
.no-touch .btn-o.btn-red:hover,
.btn-o.btn-red:focus,
.btn-o.btn-red:active,
.btn-o.btn-red.active,
.open > .dropdown-toggle.btn-o.btn-red {
background-color: #ea3d36;
color: #fff;
}
.btn-facebook {
background-color: #43609c;
color: #fff;
}
.btn-o.btn-facebook {
background-color: transparent;
color: #43609c;
border-color: #43609c;
}
.no-touch .btn-facebook:hover,
.btn-facebook:focus,
.btn-facebook:active,
.btn-facebook.active,
.open > .dropdown-toggle.btn-facebook {
background-color: #395285;
color: #fff;
}
.no-touch .btn-o.btn-facebook:hover,
.btn-o.btn-facebook:focus,
.btn-o.btn-facebook:active,
.btn-o.btn-facebook.active,
.open > .dropdown-toggle.btn-o.btn-facebook {
background-color: #43609c;
color: #fff;
}
.btn-twitter {
background-color: #55acee;
color: #fff;
}
.btn-o.btn-twitter {
background-color: transparent;
color: #55acee;
border-color: #55acee;
}
.no-touch .btn-twitter:hover,
.btn-twitter:focus,
.btn-twitter:active,
.btn-twitter.active,
.open > .dropdown-toggle.btn-twitter {
background-color: #4993cc;
color: #fff;
}
.no-touch .btn-o.btn-twitter:hover,
.btn-o.btn-twitter:focus,
.btn-o.btn-twitter:active,
.btn-o.btn-twitter.active,
.open > .dropdown-toggle.btn-o.btn-twitter {
background-color: #55acee;
color: #fff;
}
.btn-google {
background-color: #dd4b39;
color: #fff;
}
.btn-o.btn-google {
background-color: transparent;
color: #dd4b39;
border-color: #dd4b39;
}
.no-touch .btn-google:hover,
.btn-google:focus,
.btn-google:active,
.btn-google.active,
.open > .dropdown-toggle.btn-google {
background-color: #c44433;
color: #fff;
}
.no-touch .btn-o.btn-google:hover,
.btn-o.btn-google:focus,
.btn-o.btn-google:active,
.btn-o.btn-google.active,
.open > .dropdown-toggle.btn-o.btn-google {
background-color: #dd4b39;
color: #fff;
}
.btn-pinterest {
background-color: #cb2027;
color: #fff;
}
.btn-o.btn-pinterest {
background-color: transparent;
color: #cb2027;
border-color: #cb2027;
}
.no-touch .btn-pinterest:hover,
.btn-v:focus,
.btn-pinterest:active,
.btn-pinterest.active,
.open > .dropdown-toggle.btn-pinterest {
background-color: #b51d22;
color: #fff;
}
.no-touch .btn-o.btn-pinterest:hover,
.btn-o.btn-pinterest:focus,
.btn-o.btn-pinterest:active,
.btn-o.btn-pinterest.active,
.open > .dropdown-toggle.btn-o.btn-pinterest {
background-color: #cb2027;
color: #fff;
}
.btn-linkedin {
background-color: #0177b5;
color: #fff;
}
.btn-o.btn-linkedin {
background-color: transparent;
color: #0177b5;
border-color: #0177b5;
}
.no-touch .btn-linkedin:hover,
.btn-linkedin:focus,
.btn-linkedin:active,
.btn-linkedin.active,
.open > .dropdown-toggle.btn-linkedin {
background-color: #026599;
color: #fff;
}
.no-touch .btn-o.btn-linkedin:hover,
.btn-o.btn-linkedin:focus,
.btn-o.btn-linkedin:active,
.btn-o.btn-linkedin.active,
.open > .dropdown-toggle.btn-o.btn-linkedin {
background-color: #0177b5;
color: #fff;
}
.btn-icon {
padding-left: 0 !important;
padding-right: 0 !important;
width: 36px;
text-align: center;
}
.btn-icon.btn-lg {
width: 41px;
}
.btn-icon.btn-sm {
width: 31px;
}
.btn-icon.btn-xs {
width: 22px;
}
.btn-icon.btn-round {
border-radius: 50%;
}
.btn > .state, .btn.active > .state-active {
display: inline-block;
}
.btn.active > .state, .btn > .state-active {
display: none;
}
Author: aabir
Official Website: https://gist.github.com/aabir/61c9b851bd8fc62581e7
1652925979
If you are a beginner or a pro. This video is for everyone who want to make his/her portfolio an outstanding one. In this tutorial, you’ll learn to create your own modern looking portfolio website using HTML, CSS and JS. In the video, you’ll create smooth transition on navigations, you’ll create CSS timeline to showcase your education and experience, you’ll make a separate section for your project with a cool hover effect. You must make this portfolio to impress your recruiter.
⏰ Timestamps ⏰
————————————
00:00 - Intro
00:16 - Portfolio - Demo
02:24 - Portfolio - Navbar
07:20 - Portfolio - Home section
11:11 - Portfolio - Project Section
22:05 - Portfolio - Naviagtion (app.js)
25:06 - Portfolio - About Section
31:01 - Portfolio - Skills section
39:12 - Portfolio - CSS Timeline
49:17 - Portfolio - Contact Section
57:07 - Great Work! We are done👏
So let's start, to create navbar first write the HTML basic template and link style.css
and app.js
file to index.html
file. After done with all of this. Create navbar.
<!-- navbar -->
<nav class="navbar">
<ul class="link-group">
<li class="link active"><a href="#">home</a></li>
<li class="link"><a href="#">projects</a></li>
<li class="link"><a href="#">about</a></li>
<li class="link"><a href="#">contact</a></li>
</ul>
</nav>
Okay we are done with HTMl, so add some style to it also.
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
width: 100%;
max-width: 1400px;
display: block;
margin: auto;
min-height: 100vh;
background: #191919;
font-family: sans-serif;
}
.navbar{
width: 100%;
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 9;
background: #1a1a1a;
}
.link-group{
list-style: none;
display: flex;
}
.link a{
color: #fff;
opacity: 0.5;
text-decoration: none;
text-transform: capitalize;
padding: 10px 30px;
margin: 0 20px;
line-height: 80px;
transition: .5s;
font-size: 20px;
}
.link a:hover, .link.active a{
opacity: 1;
}
After done with this, you'll probably see something like this.
Okay, so with that we are done with navbar. So let's move on to our home section
To create home section code this HTML structure after navbar element.
<!-- home section -->
<section class="home-section active">
<h1 class="hero-heading">hello, i am <br> kunaal</h1>
<img src="img/home.png" class="home-img" alt="">
</section>
And give it some styles.
.home-section{
width: 100%;
height: 100vh;
padding: 0 150px;
display: flex;
align-items: center;
position: relative;
top: 0;
opacity: 0;
transition: 1s;
}
.hero-heading{
color: #fff;
font-size: 120px;
text-transform: capitalize;
font-weight: 300;
}
.home-img{
position: absolute;
top: 0;
right: 0;
height: 100vh;
width: 50%;
object-fit: cover;
opacity: 0.2;
}
If you see the above code, you'll see position: relative
and top: 0
under .home-section
. These properties are important while navigation, cause how will our navigation work is little complex. All of our sections (home, project, about, contact) all of these will have position: fixed
because of this, all sections will be on top of each other. And we'll use active
class to indicate the active section. Using active
class we'll set section's position's to relative along with its opacity to 1. This is how our navigation will work. Isn't is complicated ??
Output
So, once you are done with home section make sure you change its position to fixed
from relative.
.home-section{
/* previous styles */
position: fixed;
}
Then make active
class styles.
.home-section.active,
.project-section.active,
.about-section.active,
.contact-section.active{
position: relative;
opacity: 1;
z-index: 8;
}
You can see I have added each and every section here in order to make smooth navigation.
Now, let's make project section. For that code this HTML.
<!-- project section -->
<section class="project-section">
<h1 class="project-heading">some of my projects</h1>
<div class="project-container">
<div class="project-card">
<img src="img/project-1.png" class="project-img" alt="">
<div class="project-content">
<h1 class="project-title">project 01</h1>
<p class="project-info">
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Impedit vitae delectus cumque repudiandae aliquam optio accusamus natus nobis! Nam, sunt?
</p>
<div class="project-btn-grp">
<button class="project-btn github">github repo</button>
<button class="project-btn live">see live</button>
</div>
</div>
</div>
// +3 more cards
</div>
</section>
Also style it.
/* project-section */
.project-section{
width: 100%;
min-height: 100vh;
padding: 150px 100px 100px;
position: fixed;
top: 0;
transition: 1s;
opacity: 0;
}
.project-heading{
font-size: 100px;
background: #252525;
text-transform: capitalize;
text-align: center;
margin-bottom: 50px;
color: #1a1a1a;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-stroke: 8px transparent;
}
.project-container{
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 100px;
}
.project-card{
height: 400px;
position: relative;
}
.project-img{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
object-fit: cover;
transition: .5s;
}
.project-content{
position: relative;
padding: 40px;
color: #fff;
transition: .5s;
opacity: 0;
}
.project-title{
font-size: 50px;
text-transform: capitalize;
text-align: center;
font-weight: 300;
}
.project-info{
margin: 40px;
font-size: 20px;
line-height: 30px;
text-align: center;
}
.project-btn-grp{
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
}
.project-btn{
height: 40px;
text-transform: capitalize;
font-size: 18px;
border: none;
background: #000;
color: #fff;
cursor: pointer;
}
.project-btn.live{
background: none;
border: 2px solid #fff;
}
.project-card:hover .project-img{
filter: blur(20px);
}
.project-card:hover .project-content{
opacity: 1;
}
In the above code, I have already added fixed
position to project-section
and defined its opacity to 0. But for you in order to see the output. make sure you add active
class in project-section
like this.
<section class="project-section active">
Output [ With hover effect ]
Before going forward, let's make the navigation system first. For that code this inside app.js
file.
const links = document.querySelectorAll('.link');
const sections = document.querySelectorAll('section');
let activeLink = 0;
links.forEach((link, i) => {
link.addEventListener('click', () => {
if(activeLink != i){
links[activeLink].classList.remove('active');
link.classList.add('active');
sections[activeLink].classList.remove('active');
setTimeout(() => {
activeLink = i;
sections[i].classList.add('active');
}, 1000);
}
})
})
In the above code, first I am selecting all the links and sections. After that, I defined activeLink
this variable will track the current active section or link. After that, I used forEach
method to loop through all the links. Inside that I am access individual link and its index.
Inside it first, I am adding click event to link using addEventListener
. Then I used a simple condition to make sure user is not clicking on the active link. After that, I am removing the active class from the current active link using classList.remove
and adding active
class to the clicked link using classList.add
. I am doing the same to remove the active
class from the active section.
Once done with that, I am using setTimeout
to add a 1s delay in executing the below codes. Inside the timeout, it is just simply adding the active class again.
You might see the navigation as a very easy one, but it was the second hardest thing to make in this project😅
Now, let's create the about section. Honestly, my favourite section in this entire website is this about section. Our about section has everything, it has skills section, and also a education timeline.
To create about section, code this after project section
.
<!-- about section -->
<section class="about-section">
<div class="about">
<div class="about-img-container">
<img src="img/home.png" class="about-img" alt="">
<button class="download-cv-btn">downlaod cv</button>
</div>
<p class="about-info">Lorem ipsum.....</p>
</div>
</section>
And style it.
/* about-section */
.about-section{
width: 100%;
min-height: 100vh;
padding: 150px 100px 0;
position: fixed;
top: 0;
opacity: 0;
transition: 1s;
}
.about{
width: 100%;
display: grid;
grid-template-columns: 30% 65%;
grid-gap: 40px;
}
.about-img-container{
position: relative;
}
.about-info{
color: #fff;
opacity: 0.6;
font-size: 20px;
line-height: 40px;
}
.about-img{
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 20px;
}
.download-cv-btn{
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
padding: 10px 20px;
color: #fff;
border: none;
font-size: 16px;
text-transform: capitalize;
cursor: pointer;
transition: .5s;
background: rgba(0, 0, 0, 0.5);
}
.download-cv-btn:hover{
background: #000;
}
Again you might not see anything, make sure to add
active
class toabout-section
and remove it from all other sections.
Output
So, now shall we create the skills section ? Well in our skills section I do not have any skill progress bar which is I think is most used thing in the portfolio. But I think its the worst thing to have. I somewhere read on internet that the progress bar might look awesome to you, but let say it know python 90% and you add it to your website saying, you know 90% of python. There is a change that your client think you know 90% python so maybe you don't know the advance topic although you know the advance topics too. So its create a confusion. Well its just a preference. Anyway, let's make the skills section.
<!-- skills -->
<div class="skill-section">
<h1 class="heading">skills</h1>
<div class="skills-container">
<div class="skill-card">
<img src="img/html.png" class="skill-img" alt="">
<div class="skill-level">98%</div>
<h1 class="skill-name">HTML</h1>
<p class="skill-info">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Consequatur, delectus!</p>
</div>
// +4 more cards
</div>
</div>
Code the above code under about-section
element and style them.
/* skills */
.skill-section{
position: relative;
margin: 100px 0;
}
.heading{
text-align: center;
font-size: 60px;
color: #fff;
text-transform: capitalize;
font-weight: 300;
margin-bottom: 100px;
}
.skills-container{
width: 95%;
margin: auto;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 100px;
color: #fff;
}
.skill-card{
position: relative;
}
.skill-img{
display: block;
margin: auto;
height: 200px;
}
.skill-name{
font-size: 30px;
font-weight: 300;
text-align: center;
text-transform: capitalize;
margin: 30px 0 20px;
}
.skill-info{
text-align: center;
opacity: 0.5;
font-size: 18px;
line-height: 30px;
}
.skill-level{
position: absolute;
top: 80px;
right: 0;
width: 150px;
height: 150px;
display: flex;
justify-content: center;
align-items: center;
font-size: 22px;
border-radius: 50%;
border: 10px solid;
}
.skill-card:nth-child(1) .skill-level{
background: #ff4f4f28;
border-color: #ff4f4f;
color: #ff4f4f;
}
.skill-card:nth-child(2) .skill-level{
background: #4fa0ff28;
border-color: #4fa0ff;
color: #4fa0ff;
}
.skill-card:nth-child(3) .skill-level{
background: #ffed4f28;
border-color: #ffed4f;
color: #ffed4f;
}
.skill-card:nth-child(4) .skill-level{
background: #52ff4f28;
border-color: #52ff4f;
color: #52ff4f;
}
.skill-card:nth-child(5) .skill-level{
background: #4fdfff28;
border-color: #4fdfff;
color: #4fdfff;
}
Output
And now the hardest thing, CSS timeline. It was little hard for me to make at first, but I tried my best not to use lot of code to achieve the goal.
<!-- timeline -->
<div class="timeline">
<h1 class="heading">education and experience</h1>
<div class="card">
<div class="card-body">
<h1 class="card-title">2000-2002</h1>
<p class="card-detail">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Architecto sequi recusandae laborum ipsam dignissimos nostrum vitae provident officia, consectetur ab accusantium corrupti exercitationem temporibus repellat non magni cupiditate ea reprehenderit.</p>
</div>
</div>
//+4 more cards
</div>
Make sure to add these codes inside about-section
also.
/* timeline */
.timeline{
display: block;
width: 80%;
margin: 150px auto;
}
.timeline .heading{
margin-bottom: 150px;
}
.card{
width: 45%;
padding: 30px;
border-radius: 10px;
color: #fff;
display: block;
margin: -80px 0;
position: relative;
background: #f00;
}
.card:nth-child(even){
margin-left: auto;
}
.card:nth-child(even):before{
content: '';
position: absolute;
left: -15%;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
border: 5px solid #191919;
border-radius: 50%;
}
.card:nth-child(even):after{
content: '';
position: absolute;
left: -8.5%;
top: 50%;
transform: translateY(-50%);
width: 7%;
height: 2px;
background: #fff;
z-index: -1;
}
.card:nth-child(odd):before{
content: '';
position: absolute;
right: -13%;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
border: 5px solid #191919;
border-radius: 50%;
}
.card:nth-child(odd):after{
content: '';
position: absolute;
right: -8.5%;
top: 50%;
transform: translateY(-50%);
width: 7%;
height: 2px;
background: #fff;
z-index: -1;
}
.card:nth-child(2), .card:nth-child(2):before{
background: #ff4f4f;
}
.card:nth-child(3), .card:nth-child(3):before{
background: #ffb84f;
}
.card:nth-child(4), .card:nth-child(4):before{
background: #3dca5c;
}
.card:nth-child(5), .card:nth-child(5):before{
background: #565252;
}
.card:nth-child(6), .card:nth-child(6):before{
background: #4fa0ff;
}
.card:nth-child(even) .card-body:before{
content: '';
position: absolute;
left: -12%;
top: 0;
width: 0px;
height: 100%;
border: 1px dashed #fff;
z-index: -1;
}
.card-title{
font-size: 30px;
font-weight: 300;
margin-bottom: 20px;
}
Output
Anddddddd, the last part contact section. Let's create this also.
<!-- contact section -->
<section class="contact-section">
<form class="contact-form">
<input type="text" name="name" id="name" autocomplete="off" placeholder="name">
<input type="text" name="email" id="email" autocomplete="off" placeholder="email">
<textarea name="msg" id="msg" placeholder="message" autocomplete="off"></textarea>
<button type="submit" class="form-submit-btn">contact</button>
</form>
<!-- map -->
<div class="map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d448181.163742937!2d76.81306771991275!3d28.647279935262464!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x390cfd5b347eb62d%3A0x37205b715389640!2sDelhi!5e0!3m2!1sen!2sin!4v1639489002410!5m2!1sen!2sin" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
</div>
</section>
By the way, the above iframe
code is the google map embed link. You can get it using google map.
.contact-section{
position: absolute;
top: 0;
opacity: 0;
transition: 1s;
padding: 100px 150px;
height: 100vh;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 50px;
}
.contact-form input, .contact-form textarea{
width: 100%;
height: 40px;
background: rgba(255, 255, 255, 0.2);
border: 1px solid #fff;
margin-bottom: 30px;
border-radius: 5px;
text-transform: capitalize;
color: #fff;
padding: 5px 10px;
}
::placeholder{
color: #fff;
}
#msg{
height: 280px;
resize: none;
font-family: sans-serif;
}
.form-submit-btn{
background: #ff4f4f;
color: #fff;
text-transform: capitalize;
padding: 15px 40px;
display: block;
margin: auto;
border: none;
border-radius: 10px;
cursor: pointer;
}
.map{
width: 100%;
height: 100%;
padding: 10px;
border: 2px solid #fff;
background: rgba(255, 255, 255, 0.2);
border-radius: 10px;
}
.map iframe{
width: 100%;
height: 100%;
border-radius: 5px;
}
Output
So, that's it. Great work guys. We are done with the portfolio.
📌 Download Images - https://drive.google.com/drive/folders/1z8ZdauuOMkoYoNWx5NlxjlQbqLHGpPhN?usp=sharing
#html #css #javascript #webdev #programming
1650446549
In this guide you’ll learn how to Create a Quiz Application with Timer using HTML CSS & JavaScript.
To create a Quiz Application with Timer using HTML CSS & JavaScript. First, you need to create four Files one HTML File, CSS File and the other two are JavaScript files.
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Awesome Quiz App | Codequs</title>
<link rel="stylesheet" href="style.css">
<!-- FontAweome CDN Link for Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
</head>
<body>
<!-- start Quiz button -->
<div class="start_btn"><button>Start Quiz</button></div>
<!-- Info Box -->
<div class="info_box">
<div class="info-title"><span>Some Rules of this Quiz</span></div>
<div class="info-list">
<div class="info">1. You will have only <span>15 seconds</span> per each question.</div>
<div class="info">2. Once you select your answer, it can't be undone.</div>
<div class="info">3. You can't select any option once time goes off.</div>
<div class="info">4. You can't exit from the Quiz while you're playing.</div>
<div class="info">5. You'll get points on the basis of your correct answers.</div>
</div>
<div class="buttons">
<button class="quit">Exit Quiz</button>
<button class="restart">Continue</button>
</div>
</div>
<!-- Quiz Box -->
<div class="quiz_box">
<header>
<div class="title">Awesome Quiz Application</div>
<div class="timer">
<div class="time_left_txt">Time Left</div>
<div class="timer_sec">15</div>
</div>
<div class="time_line"></div>
</header>
<section>
<div class="que_text">
<!-- Here I've inserted question from JavaScript -->
</div>
<div class="option_list">
<!-- Here I've inserted options from JavaScript -->
</div>
</section>
<!-- footer of Quiz Box -->
<footer>
<div class="total_que">
<!-- Here I've inserted Question Count Number from JavaScript -->
</div>
<button class="next_btn">Next Que</button>
</footer>
</div>
<!-- Result Box -->
<div class="result_box">
<div class="icon">
<i class="fas fa-crown"></i>
</div>
<div class="complete_text">You've completed the Quiz!</div>
<div class="score_text">
<!-- Here I've inserted Score Result from JavaScript -->
</div>
<div class="buttons">
<button class="restart">Replay Quiz</button>
<button class="quit">Quit Quiz</button>
</div>
</div>
<!-- Inside this JavaScript file I've inserted Questions and Options only -->
<script src="js/questions.js"></script>
<!-- Inside this JavaScript file I've coded all Quiz Codes -->
<script src="js/script.js"></script>
</body>
</html>
</html>
/* importing google fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
background: #007bff;
}
::selection{
color: #fff;
background: #007bff;
}
.start_btn,
.info_box,
.quiz_box,
.result_box{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.info_box.activeInfo,
.quiz_box.activeQuiz,
.result_box.activeResult{
opacity: 1;
z-index: 5;
pointer-events: auto;
transform: translate(-50%, -50%) scale(1);
}
.start_btn button{
font-size: 25px;
font-weight: 500;
color: #007bff;
padding: 15px 30px;
outline: none;
border: none;
border-radius: 5px;
background: #fff;
cursor: pointer;
}
.info_box{
width: 540px;
background: #fff;
border-radius: 5px;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.info_box .info-title{
height: 60px;
width: 100%;
border-bottom: 1px solid lightgrey;
display: flex;
align-items: center;
padding: 0 30px;
border-radius: 5px 5px 0 0;
font-size: 20px;
font-weight: 600;
}
.info_box .info-list{
padding: 15px 30px;
}
.info_box .info-list .info{
margin: 5px 0;
font-size: 17px;
}
.info_box .info-list .info span{
font-weight: 600;
color: #007bff;
}
.info_box .buttons{
height: 60px;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 30px;
border-top: 1px solid lightgrey;
}
.info_box .buttons button{
margin: 0 5px;
height: 40px;
width: 100px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
border: none;
outline: none;
border-radius: 5px;
border: 1px solid #007bff;
transition: all 0.3s ease;
}
.quiz_box{
width: 550px;
background: #fff;
border-radius: 5px;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.quiz_box header{
position: relative;
z-index: 2;
height: 70px;
padding: 0 30px;
background: #fff;
border-radius: 5px 5px 0 0;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0px 3px 5px 1px rgba(0,0,0,0.1);
}
.quiz_box header .title{
font-size: 20px;
font-weight: 600;
}
.quiz_box header .timer{
color: #004085;
background: #cce5ff;
border: 1px solid #b8daff;
height: 45px;
padding: 0 8px;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: space-between;
width: 145px;
}
.quiz_box header .timer .time_left_txt{
font-weight: 400;
font-size: 17px;
user-select: none;
}
.quiz_box header .timer .timer_sec{
font-size: 18px;
font-weight: 500;
height: 30px;
width: 45px;
color: #fff;
border-radius: 5px;
line-height: 30px;
text-align: center;
background: #343a40;
border: 1px solid #343a40;
user-select: none;
}
.quiz_box header .time_line{
position: absolute;
bottom: 0px;
left: 0px;
height: 3px;
background: #007bff;
}
section{
padding: 25px 30px 20px 30px;
background: #fff;
}
section .que_text{
font-size: 25px;
font-weight: 600;
}
section .option_list{
padding: 20px 0px;
display: block;
}
section .option_list .option{
background: aliceblue;
border: 1px solid #84c5fe;
border-radius: 5px;
padding: 8px 15px;
font-size: 17px;
margin-bottom: 15px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: space-between;
}
section .option_list .option:last-child{
margin-bottom: 0px;
}
section .option_list .option:hover{
color: #004085;
background: #cce5ff;
border: 1px solid #b8daff;
}
section .option_list .option.correct{
color: #155724;
background: #d4edda;
border: 1px solid #c3e6cb;
}
section .option_list .option.incorrect{
color: #721c24;
background: #f8d7da;
border: 1px solid #f5c6cb;
}
section .option_list .option.disabled{
pointer-events: none;
}
section .option_list .option .icon{
height: 26px;
width: 26px;
border: 2px solid transparent;
border-radius: 50%;
text-align: center;
font-size: 13px;
pointer-events: none;
transition: all 0.3s ease;
line-height: 24px;
}
.option_list .option .icon.tick{
color: #23903c;
border-color: #23903c;
background: #d4edda;
}
.option_list .option .icon.cross{
color: #a42834;
background: #f8d7da;
border-color: #a42834;
}
footer{
height: 60px;
padding: 0 30px;
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid lightgrey;
}
footer .total_que span{
display: flex;
user-select: none;
}
footer .total_que span p{
font-weight: 500;
padding: 0 5px;
}
footer .total_que span p:first-child{
padding-left: 0px;
}
footer button{
height: 40px;
padding: 0 13px;
font-size: 18px;
font-weight: 400;
cursor: pointer;
border: none;
outline: none;
color: #fff;
border-radius: 5px;
background: #007bff;
border: 1px solid #007bff;
line-height: 10px;
opacity: 0;
pointer-events: none;
transform: scale(0.95);
transition: all 0.3s ease;
}
footer button:hover{
background: #0263ca;
}
footer button.show{
opacity: 1;
pointer-events: auto;
transform: scale(1);
}
.result_box{
background: #fff;
border-radius: 5px;
display: flex;
padding: 25px 30px;
width: 450px;
align-items: center;
flex-direction: column;
justify-content: center;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.result_box .icon{
font-size: 100px;
color: #007bff;
margin-bottom: 10px;
}
.result_box .complete_text{
font-size: 20px;
font-weight: 500;
}
.result_box .score_text span{
display: flex;
margin: 10px 0;
font-size: 18px;
font-weight: 500;
}
.result_box .score_text span p{
padding: 0 4px;
font-weight: 600;
}
.result_box .buttons{
display: flex;
margin: 20px 0;
}
.result_box .buttons button{
margin: 0 10px;
height: 45px;
padding: 0 20px;
font-size: 18px;
font-weight: 500;
cursor: pointer;
border: none;
outline: none;
border-radius: 5px;
border: 1px solid #007bff;
transition: all 0.3s ease;
}
.buttons button.restart{
color: #fff;
background: #007bff;
}
.buttons button.restart:hover{
background: #0263ca;
}
.buttons button.quit{
color: #007bff;
background: #fff;
}
.buttons button.quit:hover{
color: #fff;
background: #007bff;
}
// creating an array and passing the number, questions, options, and answers
let questions = [
{
numb: 1,
question: "What does HTML stand for?",
answer: "Hyper Text Markup Language",
options: [
"Hyper Text Preprocessor",
"Hyper Text Markup Language",
"Hyper Text Multiple Language",
"Hyper Tool Multi Language"
]
},
{
numb: 2,
question: "What does CSS stand for?",
answer: "Cascading Style Sheet",
options: [
"Common Style Sheet",
"Colorful Style Sheet",
"Computer Style Sheet",
"Cascading Style Sheet"
]
},
{
numb: 3,
question: "What does PHP stand for?",
answer: "Hypertext Preprocessor",
options: [
"Hypertext Preprocessor",
"Hypertext Programming",
"Hypertext Preprogramming",
"Hometext Preprocessor"
]
},
{
numb: 4,
question: "What does SQL stand for?",
answer: "Structured Query Language",
options: [
"Stylish Question Language",
"Stylesheet Query Language",
"Statement Question Language",
"Structured Query Language"
]
},
{
numb: 5,
question: "What does XML stand for?",
answer: "eXtensible Markup Language",
options: [
"eXtensible Markup Language",
"eXecutable Multiple Language",
"eXTra Multi-Program Language",
"eXamine Multiple Language"
]
},
// you can uncomment the below codes and make duplicate as more as you want to add question
// but remember you need to give the numb value serialize like 1,2,3,5,6,7,8,9.....
// {
// numb: 6,
// question: "Your Question is Here",
// answer: "Correct answer of the question is here",
// options: [
// "Option 1",
// "option 2",
// "option 3",
// "option 4"
// ]
// },
];
//selecting all required elements
const start_btn = document.querySelector(".start_btn button");
const info_box = document.querySelector(".info_box");
const exit_btn = info_box.querySelector(".buttons .quit");
const continue_btn = info_box.querySelector(".buttons .restart");
const quiz_box = document.querySelector(".quiz_box");
const result_box = document.querySelector(".result_box");
const option_list = document.querySelector(".option_list");
const time_line = document.querySelector("header .time_line");
const timeText = document.querySelector(".timer .time_left_txt");
const timeCount = document.querySelector(".timer .timer_sec");
// if startQuiz button clicked
start_btn.onclick = ()=>{
info_box.classList.add("activeInfo"); //show info box
}
// if exitQuiz button clicked
exit_btn.onclick = ()=>{
info_box.classList.remove("activeInfo"); //hide info box
}
// if continueQuiz button clicked
continue_btn.onclick = ()=>{
info_box.classList.remove("activeInfo"); //hide info box
quiz_box.classList.add("activeQuiz"); //show quiz box
showQuetions(0); //calling showQestions function
queCounter(1); //passing 1 parameter to queCounter
startTimer(15); //calling startTimer function
startTimerLine(0); //calling startTimerLine function
}
let timeValue = 15;
let que_count = 0;
let que_numb = 1;
let userScore = 0;
let counter;
let counterLine;
let widthValue = 0;
const restart_quiz = result_box.querySelector(".buttons .restart");
const quit_quiz = result_box.querySelector(".buttons .quit");
// if restartQuiz button clicked
restart_quiz.onclick = ()=>{
quiz_box.classList.add("activeQuiz"); //show quiz box
result_box.classList.remove("activeResult"); //hide result box
timeValue = 15;
que_count = 0;
que_numb = 1;
userScore = 0;
widthValue = 0;
showQuetions(que_count); //calling showQestions function
queCounter(que_numb); //passing que_numb value to queCounter
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
startTimer(timeValue); //calling startTimer function
startTimerLine(widthValue); //calling startTimerLine function
timeText.textContent = "Time Left"; //change the text of timeText to Time Left
next_btn.classList.remove("show"); //hide the next button
}
// if quitQuiz button clicked
quit_quiz.onclick = ()=>{
window.location.reload(); //reload the current window
}
const next_btn = document.querySelector("footer .next_btn");
const bottom_ques_counter = document.querySelector("footer .total_que");
// if Next Que button clicked
next_btn.onclick = ()=>{
if(que_count < questions.length - 1){ //if question count is less than total question length
que_count++; //increment the que_count value
que_numb++; //increment the que_numb value
showQuetions(que_count); //calling showQestions function
queCounter(que_numb); //passing que_numb value to queCounter
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
startTimer(timeValue); //calling startTimer function
startTimerLine(widthValue); //calling startTimerLine function
timeText.textContent = "Time Left"; //change the timeText to Time Left
next_btn.classList.remove("show"); //hide the next button
}else{
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
showResult(); //calling showResult function
}
}
// getting questions and options from array
function showQuetions(index){
const que_text = document.querySelector(".que_text");
//creating a new span and div tag for question and option and passing the value using array index
let que_tag = '<span>'+ questions[index].numb + ". " + questions[index].question +'</span>';
let option_tag = '<div class="option"><span>'+ questions[index].options[0] +'</span></div>'
+ '<div class="option"><span>'+ questions[index].options[1] +'</span></div>'
+ '<div class="option"><span>'+ questions[index].options[2] +'</span></div>'
+ '<div class="option"><span>'+ questions[index].options[3] +'</span></div>';
que_text.innerHTML = que_tag; //adding new span tag inside que_tag
option_list.innerHTML = option_tag; //adding new div tag inside option_tag
const option = option_list.querySelectorAll(".option");
// set onclick attribute to all available options
for(i=0; i < option.length; i++){
option[i].setAttribute("onclick", "optionSelected(this)");
}
}
// creating the new div tags which for icons
let tickIconTag = '<div class="icon tick"><i class="fas fa-check"></i></div>';
let crossIconTag = '<div class="icon cross"><i class="fas fa-times"></i></div>';
//if user clicked on option
function optionSelected(answer){
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
let userAns = answer.textContent; //getting user selected option
let correcAns = questions[que_count].answer; //getting correct answer from array
const allOptions = option_list.children.length; //getting all option items
if(userAns == correcAns){ //if user selected option is equal to array's correct answer
userScore += 1; //upgrading score value with 1
answer.classList.add("correct"); //adding green color to correct selected option
answer.insertAdjacentHTML("beforeend", tickIconTag); //adding tick icon to correct selected option
console.log("Correct Answer");
console.log("Your correct answers = " + userScore);
}else{
answer.classList.add("incorrect"); //adding red color to correct selected option
answer.insertAdjacentHTML("beforeend", crossIconTag); //adding cross icon to correct selected option
console.log("Wrong Answer");
for(i=0; i < allOptions; i++){
if(option_list.children[i].textContent == correcAns){ //if there is an option which is matched to an array answer
option_list.children[i].setAttribute("class", "option correct"); //adding green color to matched option
option_list.children[i].insertAdjacentHTML("beforeend", tickIconTag); //adding tick icon to matched option
console.log("Auto selected correct answer.");
}
}
}
for(i=0; i < allOptions; i++){
option_list.children[i].classList.add("disabled"); //once user select an option then disabled all options
}
next_btn.classList.add("show"); //show the next button if user selected any option
}
function showResult(){
info_box.classList.remove("activeInfo"); //hide info box
quiz_box.classList.remove("activeQuiz"); //hide quiz box
result_box.classList.add("activeResult"); //show result box
const scoreText = result_box.querySelector(".score_text");
if (userScore > 3){ // if user scored more than 3
//creating a new span tag and passing the user score number and total question number
let scoreTag = '<span>and congrats! , You got <p>'+ userScore +'</p> out of <p>'+ questions.length +'</p></span>';
scoreText.innerHTML = scoreTag; //adding new span tag inside score_Text
}
else if(userScore > 1){ // if user scored more than 1
let scoreTag = '<span>and nice , You got <p>'+ userScore +'</p> out of <p>'+ questions.length +'</p></span>';
scoreText.innerHTML = scoreTag;
}
else{ // if user scored less than 1
let scoreTag = '<span>and sorry , You got only <p>'+ userScore +'</p> out of <p>'+ questions.length +'</p></span>';
scoreText.innerHTML = scoreTag;
}
}
function startTimer(time){
counter = setInterval(timer, 1000);
function timer(){
timeCount.textContent = time; //changing the value of timeCount with time value
time--; //decrement the time value
if(time < 9){ //if timer is less than 9
let addZero = timeCount.textContent;
timeCount.textContent = "0" + addZero; //add a 0 before time value
}
if(time < 0){ //if timer is less than 0
clearInterval(counter); //clear counter
timeText.textContent = "Time Off"; //change the time text to time off
const allOptions = option_list.children.length; //getting all option items
let correcAns = questions[que_count].answer; //getting correct answer from array
for(i=0; i < allOptions; i++){
if(option_list.children[i].textContent == correcAns){ //if there is an option which is matched to an array answer
option_list.children[i].setAttribute("class", "option correct"); //adding green color to matched option
option_list.children[i].insertAdjacentHTML("beforeend", tickIconTag); //adding tick icon to matched option
console.log("Time Off: Auto selected correct answer.");
}
}
for(i=0; i < allOptions; i++){
option_list.children[i].classList.add("disabled"); //once user select an option then disabled all options
}
next_btn.classList.add("show"); //show the next button if user selected any option
}
}
}
function startTimerLine(time){
counterLine = setInterval(timer, 29);
function timer(){
time += 1; //upgrading time value with 1
time_line.style.width = time + "px"; //increasing width of time_line with px by time value
if(time > 549){ //if time value is greater than 549
clearInterval(counterLine); //clear counterLine
}
}
}
function queCounter(index){
//creating a new span tag and passing the question number and total question
let totalQueCounTag = '<span><p>'+ index +'</p> of <p>'+ questions.length +'</p> Questions</span>';
bottom_ques_counter.innerHTML = totalQueCounTag; //adding new span tag inside bottom_ques_counter
}
1602224552
In this video you’ll learn how to Create a Quiz Application with Timer using HTML CSS & JavaScript.
In this program [Quiz App with Timer]
, there are three layers or boxes, and these boxes shown one by one on a particular button clicked. At first, on the webpage, there is shown a button labeled as “Start Quiz” and when you clicked on that button, then the info box appears with popup animation. In this infobox, there are some rules of the quiz and two buttons labeled as “Exit” and “Continue”. When you clicked on the Exit button, the info box will be hidden but when you clicked on the Continue button, then the Quiz Box appears.
In the Quiz Box, there is a header with a title on the left side and a timer box on the right side. This timer starts decrement from 15 to 0 sec and there is also shown a timeline indicator that is sliding from the left to right side according to the timer. If the user selects an option between 15 to 0 sec, the timer will be stopped and all available options will be disabled. If the user selected option is correct, the selected option color, background color changed to green and there is also shown the tick icon to inform the user that the selected answer is correct. If the user selects an option is incorrect, the selected option color, background-color changed to red and there is shown the cross icon to inform the user that the selected option is incorrect and the correct option will be automatically selected.
If the user doesn’t select an option between 15 to 0 sec, the timer will be stopped once it comes in 0 and the correct option of that question will be selected automatically. After that, there is the next button to show the next question, and there is a total of five questions on this Quiz. In the end, the result box will be appeared and shown the user score and two buttons [Replay Quiz, Quit Quiz], if the user clicked on the replay quiz button, the quiz will again start with the number 1 question, and the score of the user will be 0 but if the user clicked on the quit quiz button, the current window will be reloaded and the quiz starts from the begin.
HTML:
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Awesome Quiz App</title>
<link rel="stylesheet" href="style.css">
<!-- FontAweome CDN Link for Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
</head>
<body>
<!-- start Quiz button -->
<div class="start_btn"><button>Start Quiz</button></div>
<!-- Info Box -->
<div class="info_box">
<div class="info-title"><span>Some Rules of this Quiz</span></div>
<div class="info-list">
<div class="info">1. You will have only <span>15 seconds</span> per each question.</div>
<div class="info">2. Once you select your answer, it can't be undone.</div>
<div class="info">3. You can't select any option once time goes off.</div>
<div class="info">4. You can't exit from the Quiz while you're playing.</div>
<div class="info">5. You'll get points on the basis of your correct answers.</div>
</div>
<div class="buttons">
<button class="quit">Exit Quiz</button>
<button class="restart">Continue</button>
</div>
</div>
<!-- Quiz Box -->
<div class="quiz_box">
<header>
<div class="title">Awesome Quiz Application</div>
<div class="timer">
<div class="time_left_txt">Time Left</div>
<div class="timer_sec">15</div>
</div>
<div class="time_line"></div>
</header>
<section>
<div class="que_text">
<!-- Here I've inserted question from JavaScript -->
</div>
<div class="option_list">
<!-- Here I've inserted options from JavaScript -->
</div>
</section>
<!-- footer of Quiz Box -->
<footer>
<div class="total_que">
<!-- Here I've inserted Question Count Number from JavaScript -->
</div>
<button class="next_btn">Next Que</button>
</footer>
</div>
<!-- Result Box -->
<div class="result_box">
<div class="icon">
<i class="fas fa-crown"></i>
</div>
<div class="complete_text">You've completed the Quiz!</div>
<div class="score_text">
<!-- Here I've inserted Score Result from JavaScript -->
</div>
<div class="buttons">
<button class="restart">Replay Quiz</button>
<button class="quit">Quit Quiz</button>
</div>
</div>
<!-- Inside this JavaScript file I've inserted Questions and Options only -->
<script src="js/questions.js"></script>
<!-- Inside this JavaScript file I've coded all Quiz Codes -->
<script src="js/script.js"></script>
</body>
</html>
</html>
CSS:
/* importing google fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
background: #007bff;
}
::selection{
color: #fff;
background: #007bff;
}
.start_btn,
.info_box,
.quiz_box,
.result_box{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.info_box.activeInfo,
.quiz_box.activeQuiz,
.result_box.activeResult{
opacity: 1;
z-index: 5;
pointer-events: auto;
transform: translate(-50%, -50%) scale(1);
}
.start_btn button{
font-size: 25px;
font-weight: 500;
color: #007bff;
padding: 15px 30px;
outline: none;
border: none;
border-radius: 5px;
background: #fff;
cursor: pointer;
}
.info_box{
width: 540px;
background: #fff;
border-radius: 5px;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.info_box .info-title{
height: 60px;
width: 100%;
border-bottom: 1px solid lightgrey;
display: flex;
align-items: center;
padding: 0 30px;
border-radius: 5px 5px 0 0;
font-size: 20px;
font-weight: 600;
}
.info_box .info-list{
padding: 15px 30px;
}
.info_box .info-list .info{
margin: 5px 0;
font-size: 17px;
}
.info_box .info-list .info span{
font-weight: 600;
color: #007bff;
}
.info_box .buttons{
height: 60px;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 30px;
border-top: 1px solid lightgrey;
}
.info_box .buttons button{
margin: 0 5px;
height: 40px;
width: 100px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
border: none;
outline: none;
border-radius: 5px;
border: 1px solid #007bff;
transition: all 0.3s ease;
}
.quiz_box{
width: 550px;
background: #fff;
border-radius: 5px;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.quiz_box header{
position: relative;
z-index: 2;
height: 70px;
padding: 0 30px;
background: #fff;
border-radius: 5px 5px 0 0;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0px 3px 5px 1px rgba(0,0,0,0.1);
}
.quiz_box header .title{
font-size: 20px;
font-weight: 600;
}
.quiz_box header .timer{
color: #004085;
background: #cce5ff;
border: 1px solid #b8daff;
height: 45px;
padding: 0 8px;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: space-between;
width: 145px;
}
.quiz_box header .timer .time_left_txt{
font-weight: 400;
font-size: 17px;
user-select: none;
}
.quiz_box header .timer .timer_sec{
font-size: 18px;
font-weight: 500;
height: 30px;
width: 45px;
color: #fff;
border-radius: 5px;
line-height: 30px;
text-align: center;
background: #343a40;
border: 1px solid #343a40;
user-select: none;
}
.quiz_box header .time_line{
position: absolute;
bottom: 0px;
left: 0px;
height: 3px;
background: #007bff;
}
section{
padding: 25px 30px 20px 30px;
background: #fff;
}
section .que_text{
font-size: 25px;
font-weight: 600;
}
section .option_list{
padding: 20px 0px;
display: block;
}
section .option_list .option{
background: aliceblue;
border: 1px solid #84c5fe;
border-radius: 5px;
padding: 8px 15px;
font-size: 17px;
margin-bottom: 15px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: space-between;
}
section .option_list .option:last-child{
margin-bottom: 0px;
}
section .option_list .option:hover{
color: #004085;
background: #cce5ff;
border: 1px solid #b8daff;
}
section .option_list .option.correct{
color: #155724;
background: #d4edda;
border: 1px solid #c3e6cb;
}
section .option_list .option.incorrect{
color: #721c24;
background: #f8d7da;
border: 1px solid #f5c6cb;
}
section .option_list .option.disabled{
pointer-events: none;
}
section .option_list .option .icon{
height: 26px;
width: 26px;
border: 2px solid transparent;
border-radius: 50%;
text-align: center;
font-size: 13px;
pointer-events: none;
transition: all 0.3s ease;
line-height: 24px;
}
.option_list .option .icon.tick{
color: #23903c;
border-color: #23903c;
background: #d4edda;
}
.option_list .option .icon.cross{
color: #a42834;
background: #f8d7da;
border-color: #a42834;
}
footer{
height: 60px;
padding: 0 30px;
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid lightgrey;
}
footer .total_que span{
display: flex;
user-select: none;
}
footer .total_que span p{
font-weight: 500;
padding: 0 5px;
}
footer .total_que span p:first-child{
padding-left: 0px;
}
footer button{
height: 40px;
padding: 0 13px;
font-size: 18px;
font-weight: 400;
cursor: pointer;
border: none;
outline: none;
color: #fff;
border-radius: 5px;
background: #007bff;
border: 1px solid #007bff;
line-height: 10px;
opacity: 0;
pointer-events: none;
transform: scale(0.95);
transition: all 0.3s ease;
}
footer button:hover{
background: #0263ca;
}
footer button.show{
opacity: 1;
pointer-events: auto;
transform: scale(1);
}
.result_box{
background: #fff;
border-radius: 5px;
display: flex;
padding: 25px 30px;
width: 450px;
align-items: center;
flex-direction: column;
justify-content: center;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.result_box .icon{
font-size: 100px;
color: #007bff;
margin-bottom: 10px;
}
.result_box .complete_text{
font-size: 20px;
font-weight: 500;
}
.result_box .score_text span{
display: flex;
margin: 10px 0;
font-size: 18px;
font-weight: 500;
}
.result_box .score_text span p{
padding: 0 4px;
font-weight: 600;
}
.result_box .buttons{
display: flex;
margin: 20px 0;
}
.result_box .buttons button{
margin: 0 10px;
height: 45px;
padding: 0 20px;
font-size: 18px;
font-weight: 500;
cursor: pointer;
border: none;
outline: none;
border-radius: 5px;
border: 1px solid #007bff;
transition: all 0.3s ease;
}
.buttons button.restart{
color: #fff;
background: #007bff;
}
.buttons button.restart:hover{
background: #0263ca;
}
.buttons button.quit{
color: #007bff;
background: #fff;
}
.buttons button.quit:hover{
color: #fff;
background: #007bff;
}
JavaScript:
// creating an array and passing the number, questions, options, and answers
let questions = [
{
numb: 1,
question: "What does HTML stand for?",
answer: "Hyper Text Markup Language",
options: [
"Hyper Text Preprocessor",
"Hyper Text Markup Language",
"Hyper Text Multiple Language",
"Hyper Tool Multi Language"
]
},
{
numb: 2,
question: "What does CSS stand for?",
answer: "Cascading Style Sheet",
options: [
"Common Style Sheet",
"Colorful Style Sheet",
"Computer Style Sheet",
"Cascading Style Sheet"
]
},
{
numb: 3,
question: "What does PHP stand for?",
answer: "Hypertext Preprocessor",
options: [
"Hypertext Preprocessor",
"Hypertext Programming",
"Hypertext Preprogramming",
"Hometext Preprocessor"
]
},
{
numb: 4,
question: "What does SQL stand for?",
answer: "Structured Query Language",
options: [
"Stylish Question Language",
"Stylesheet Query Language",
"Statement Question Language",
"Structured Query Language"
]
},
{
numb: 5,
question: "What does XML stand for?",
answer: "eXtensible Markup Language",
options: [
"eXtensible Markup Language",
"eXecutable Multiple Language",
"eXTra Multi-Program Language",
"eXamine Multiple Language"
]
},
// you can uncomment the below codes and make duplicate as more as you want to add question
// but remember you need to give the numb value serialize like 1,2,3,5,6,7,8,9.....
// {
// numb: 6,
// question: "Your Question is Here",
// answer: "Correct answer of the question is here",
// options: [
// "Option 1",
// "option 2",
// "option 3",
// "option 4"
// ]
// },
];
//selecting all required elements
const start_btn = document.querySelector(".start_btn button");
const info_box = document.querySelector(".info_box");
const exit_btn = info_box.querySelector(".buttons .quit");
const continue_btn = info_box.querySelector(".buttons .restart");
const quiz_box = document.querySelector(".quiz_box");
const result_box = document.querySelector(".result_box");
const option_list = document.querySelector(".option_list");
const time_line = document.querySelector("header .time_line");
const timeText = document.querySelector(".timer .time_left_txt");
const timeCount = document.querySelector(".timer .timer_sec");
// if startQuiz button clicked
start_btn.onclick = ()=>{
info_box.classList.add("activeInfo"); //show info box
}
// if exitQuiz button clicked
exit_btn.onclick = ()=>{
info_box.classList.remove("activeInfo"); //hide info box
}
// if continueQuiz button clicked
continue_btn.onclick = ()=>{
info_box.classList.remove("activeInfo"); //hide info box
quiz_box.classList.add("activeQuiz"); //show quiz box
showQuetions(0); //calling showQestions function
queCounter(1); //passing 1 parameter to queCounter
startTimer(15); //calling startTimer function
startTimerLine(0); //calling startTimerLine function
}
let timeValue = 15;
let que_count = 0;
let que_numb = 1;
let userScore = 0;
let counter;
let counterLine;
let widthValue = 0;
const restart_quiz = result_box.querySelector(".buttons .restart");
const quit_quiz = result_box.querySelector(".buttons .quit");
// if restartQuiz button clicked
restart_quiz.onclick = ()=>{
quiz_box.classList.add("activeQuiz"); //show quiz box
result_box.classList.remove("activeResult"); //hide result box
timeValue = 15;
que_count = 0;
que_numb = 1;
userScore = 0;
widthValue = 0;
showQuetions(que_count); //calling showQestions function
queCounter(que_numb); //passing que_numb value to queCounter
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
startTimer(timeValue); //calling startTimer function
startTimerLine(widthValue); //calling startTimerLine function
timeText.textContent = "Time Left"; //change the text of timeText to Time Left
next_btn.classList.remove("show"); //hide the next button
}
// if quitQuiz button clicked
quit_quiz.onclick = ()=>{
window.location.reload(); //reload the current window
}
const next_btn = document.querySelector("footer .next_btn");
const bottom_ques_counter = document.querySelector("footer .total_que");
// if Next Que button clicked
next_btn.onclick = ()=>{
if(que_count < questions.length - 1){ //if question count is less than total question length
que_count++; //increment the que_count value
que_numb++; //increment the que_numb value
showQuetions(que_count); //calling showQestions function
queCounter(que_numb); //passing que_numb value to queCounter
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
startTimer(timeValue); //calling startTimer function
startTimerLine(widthValue); //calling startTimerLine function
timeText.textContent = "Time Left"; //change the timeText to Time Left
next_btn.classList.remove("show"); //hide the next button
}else{
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
showResult(); //calling showResult function
}
}
// getting questions and options from array
function showQuetions(index){
const que_text = document.querySelector(".que_text");
//creating a new span and div tag for question and option and passing the value using array index
let que_tag = '<span>'+ questions[index].numb + ". " + questions[index].question +'</span>';
let option_tag = '<div class="option"><span>'+ questions[index].options[0] +'</span></div>'
+ '<div class="option"><span>'+ questions[index].options[1] +'</span></div>'
+ '<div class="option"><span>'+ questions[index].options[2] +'</span></div>'
+ '<div class="option"><span>'+ questions[index].options[3] +'</span></div>';
que_text.innerHTML = que_tag; //adding new span tag inside que_tag
option_list.innerHTML = option_tag; //adding new div tag inside option_tag
const option = option_list.querySelectorAll(".option");
// set onclick attribute to all available options
for(i=0; i < option.length; i++){
option[i].setAttribute("onclick", "optionSelected(this)");
}
}
// creating the new div tags which for icons
let tickIconTag = '<div class="icon tick"><i class="fas fa-check"></i></div>';
let crossIconTag = '<div class="icon cross"><i class="fas fa-times"></i></div>';
//if user clicked on option
function optionSelected(answer){
clearInterval(counter); //clear counter
clearInterval(counterLine); //clear counterLine
let userAns = answer.textContent; //getting user selected option
let correcAns = questions[que_count].answer; //getting correct answer from array
const allOptions = option_list.children.length; //getting all option items
if(userAns == correcAns){ //if user selected option is equal to array's correct answer
userScore += 1; //upgrading score value with 1
answer.classList.add("correct"); //adding green color to correct selected option
answer.insertAdjacentHTML("beforeend", tickIconTag); //adding tick icon to correct selected option
console.log("Correct Answer");
console.log("Your correct answers = " + userScore);
}else{
answer.classList.add("incorrect"); //adding red color to correct selected option
answer.insertAdjacentHTML("beforeend", crossIconTag); //adding cross icon to correct selected option
console.log("Wrong Answer");
for(i=0; i < allOptions; i++){
if(option_list.children[i].textContent == correcAns){ //if there is an option which is matched to an array answer
option_list.children[i].setAttribute("class", "option correct"); //adding green color to matched option
option_list.children[i].insertAdjacentHTML("beforeend", tickIconTag); //adding tick icon to matched option
console.log("Auto selected correct answer.");
}
}
}
for(i=0; i < allOptions; i++){
option_list.children[i].classList.add("disabled"); //once user select an option then disabled all options
}
next_btn.classList.add("show"); //show the next button if user selected any option
}
function showResult(){
info_box.classList.remove("activeInfo"); //hide info box
quiz_box.classList.remove("activeQuiz"); //hide quiz box
result_box.classList.add("activeResult"); //show result box
const scoreText = result_box.querySelector(".score_text");
if (userScore > 3){ // if user scored more than 3
//creating a new span tag and passing the user score number and total question number
let scoreTag = '<span>and congrats! , You got <p>'+ userScore +'</p> out of <p>'+ questions.length +'</p></span>';
scoreText.innerHTML = scoreTag; //adding new span tag inside score_Text
}
else if(userScore > 1){ // if user scored more than 1
let scoreTag = '<span>and nice , You got <p>'+ userScore +'</p> out of <p>'+ questions.length +'</p></span>';
scoreText.innerHTML = scoreTag;
}
else{ // if user scored less than 1
let scoreTag = '<span>and sorry , You got only <p>'+ userScore +'</p> out of <p>'+ questions.length +'</p></span>';
scoreText.innerHTML = scoreTag;
}
}
function startTimer(time){
counter = setInterval(timer, 1000);
function timer(){
timeCount.textContent = time; //changing the value of timeCount with time value
time--; //decrement the time value
if(time < 9){ //if timer is less than 9
let addZero = timeCount.textContent;
timeCount.textContent = "0" + addZero; //add a 0 before time value
}
if(time < 0){ //if timer is less than 0
clearInterval(counter); //clear counter
timeText.textContent = "Time Off"; //change the time text to time off
const allOptions = option_list.children.length; //getting all option items
let correcAns = questions[que_count].answer; //getting correct answer from array
for(i=0; i < allOptions; i++){
if(option_list.children[i].textContent == correcAns){ //if there is an option which is matched to an array answer
option_list.children[i].setAttribute("class", "option correct"); //adding green color to matched option
option_list.children[i].insertAdjacentHTML("beforeend", tickIconTag); //adding tick icon to matched option
console.log("Time Off: Auto selected correct answer.");
}
}
for(i=0; i < allOptions; i++){
option_list.children[i].classList.add("disabled"); //once user select an option then disabled all options
}
next_btn.classList.add("show"); //show the next button if user selected any option
}
}
}
function startTimerLine(time){
counterLine = setInterval(timer, 29);
function timer(){
time += 1; //upgrading time value with 1
time_line.style.width = time + "px"; //increasing width of time_line with px by time value
if(time > 549){ //if time value is greater than 549
clearInterval(counterLine); //clear counterLine
}
}
}
function queCounter(index){
//creating a new span tag and passing the question number and total question
let totalQueCounTag = '<span><p>'+ index +'</p> of <p>'+ questions.length +'</p> Questions</span>';
bottom_ques_counter.innerHTML = totalQueCounTag; //adding new span tag inside bottom_ques_counter
}
Subscribe : https://www.youtube.com/channel/UCk7xIEmd3MeyhIu2StLX5yA
#html #css #javascript
1662966297
In this tutorial, you'll learn how to create a responsive admin dashboard with HTML and CSS. Responsive Admin Dashboard Page HTML And CSS | Create Admin Panel
Timelapse:
00:00 Dashboard Template Design | Demo
02:07 Admin Dashboard Responsive | Demo
04:07 Sidebar Menu HTML code of Dashboard
04:18 Import Icon's CDN link for Dashboard
04:45 Importing Fonts Icon in HTML
08:05 CSS Code of Side menu bar of Dashboard Panel
13:07 Dashboard Navigation Bar HTML code
13:51 CSS code for Admin Dashboard Navbar
18:34 How to make search bar
24:07 How to create a JavaScript file
24:15 Animated Sidebar Menu with javascript code
27:14 Overview boxes HTML Code for Dashboard
29:11 How to make Sticky Navigation menu bar
32:14 Designing overview boxes in CSS
39:32 How to make an admin dashboard responsive
43:14 Sales data HTML Code CSS code from here
53:35 Home to make Admin Dashboard fully responsive
HTML CODE:
<head>
<meta charset="UTF-8">
<!--<title> Responsiive Admin Dashboard | Codequs </title>-->
<link rel="stylesheet" href="style.css">
<!-- Boxicons CDN Link -->
<link href='https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css' rel='stylesheet'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="sidebar">
<div class="logo-details">
<i class='bx bxl-c-plus-plus'></i>
<span class="logo_name">Codequs</span>
</div>
<ul class="nav-links">
<li>
<a href="#" class="active">
<i class='bx bx-grid-alt' ></i>
<span class="links_name">Dashboard</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-box' ></i>
<span class="links_name">Product</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-list-ul' ></i>
<span class="links_name">Order list</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-pie-chart-alt-2' ></i>
<span class="links_name">Analytics</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-coin-stack' ></i>
<span class="links_name">Stock</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-book-alt' ></i>
<span class="links_name">Total order</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-user' ></i>
<span class="links_name">Team</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-message' ></i>
<span class="links_name">Messages</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-heart' ></i>
<span class="links_name">Favrorites</span>
</a>
</li>
<li>
<a href="#">
<i class='bx bx-cog' ></i>
<span class="links_name">Setting</span>
</a>
</li>
<li class="log_out">
<a href="#">
<i class='bx bx-log-out'></i>
<span class="links_name">Log out</span>
</a>
</li>
</ul>
</div>
<section class="home-section">
<nav>
<div class="sidebar-button">
<i class='bx bx-menu sidebarBtn'></i>
<span class="dashboard">Dashboard</span>
</div>
<div class="search-box">
<input type="text" placeholder="Search...">
<i class='bx bx-search' ></i>
</div>
<div class="profile-details">
<!--<img src="images/profile.jpg" alt="">-->
<span class="admin_name">Prem Shahi</span>
<i class='bx bx-chevron-down' ></i>
</div>
</nav>
<div class="home-content">
<div class="overview-boxes">
<div class="box">
<div class="right-side">
<div class="box-topic">Total Order</div>
<div class="number">40,876</div>
<div class="indicator">
<i class='bx bx-up-arrow-alt'></i>
<span class="text">Up from yesterday</span>
</div>
</div>
<i class='bx bx-cart-alt cart'></i>
</div>
<div class="box">
<div class="right-side">
<div class="box-topic">Total Sales</div>
<div class="number">38,876</div>
<div class="indicator">
<i class='bx bx-up-arrow-alt'></i>
<span class="text">Up from yesterday</span>
</div>
</div>
<i class='bx bxs-cart-add cart two' ></i>
</div>
<div class="box">
<div class="right-side">
<div class="box-topic">Total Profit</div>
<div class="number">$12,876</div>
<div class="indicator">
<i class='bx bx-up-arrow-alt'></i>
<span class="text">Up from yesterday</span>
</div>
</div>
<i class='bx bx-cart cart three' ></i>
</div>
<div class="box">
<div class="right-side">
<div class="box-topic">Total Return</div>
<div class="number">11,086</div>
<div class="indicator">
<i class='bx bx-down-arrow-alt down'></i>
<span class="text">Down From Today</span>
</div>
</div>
<i class='bx bxs-cart-download cart four' ></i>
</div>
</div>
<div class="sales-boxes">
<div class="recent-sales box">
<div class="title">Recent Sales</div>
<div class="sales-details">
<ul class="details">
<li class="topic">Date</li>
<li><a href="#">02 Jan 2021</a></li>
<li><a href="#">02 Jan 2021</a></li>
<li><a href="#">02 Jan 2021</a></li>
<li><a href="#">02 Jan 2021</a></li>
<li><a href="#">02 Jan 2021</a></li>
<li><a href="#">02 Jan 2021</a></li>
<li><a href="#">02 Jan 2021</a></li>
</ul>
<ul class="details">
<li class="topic">Customer</li>
<li><a href="#">Alex Doe</a></li>
<li><a href="#">David Mart</a></li>
<li><a href="#">Roe Parter</a></li>
<li><a href="#">Diana Penty</a></li>
<li><a href="#">Martin Paw</a></li>
<li><a href="#">Doe Alex</a></li>
<li><a href="#">Aiana Lexa</a></li>
<li><a href="#">Rexel Mags</a></li>
<li><a href="#">Tiana Loths</a></li>
</ul>
<ul class="details">
<li class="topic">Sales</li>
<li><a href="#">Delivered</a></li>
<li><a href="#">Pending</a></li>
<li><a href="#">Returned</a></li>
<li><a href="#">Delivered</a></li>
<li><a href="#">Pending</a></li>
<li><a href="#">Returned</a></li>
<li><a href="#">Delivered</a></li>
<li><a href="#">Pending</a></li>
<li><a href="#">Delivered</a></li>
</ul>
<ul class="details">
<li class="topic">Total</li>
<li><a href="#">$204.98</a></li>
<li><a href="#">$24.55</a></li>
<li><a href="#">$25.88</a></li>
<li><a href="#">$170.66</a></li>
<li><a href="#">$56.56</a></li>
<li><a href="#">$44.95</a></li>
<li><a href="#">$67.33</a></li>
<li><a href="#">$23.53</a></li>
<li><a href="#">$46.52</a></li>
</ul>
</div>
<div class="button">
<a href="#">See All</a>
</div>
</div>
<div class="top-sales box">
<div class="title">Top Seling Product</div>
<ul class="top-sales-details">
<li>
<a href="#">
<!--<img src="images/sunglasses.jpg" alt="">-->
<span class="product">Vuitton Sunglasses</span>
</a>
<span class="price">$1107</span>
</li>
<li>
<a href="#">
<!--<img src="images/jeans.jpg" alt="">-->
<span class="product">Hourglass Jeans </span>
</a>
<span class="price">$1567</span>
</li>
<li>
<a href="#">
<!-- <img src="images/nike.jpg" alt="">-->
<span class="product">Nike Sport Shoe</span>
</a>
<span class="price">$1234</span>
</li>
<li>
<a href="#">
<!--<img src="images/scarves.jpg" alt="">-->
<span class="product">Hermes Silk Scarves.</span>
</a>
<span class="price">$2312</span>
</li>
<li>
<a href="#">
<!--<img src="images/blueBag.jpg" alt="">-->
<span class="product">Succi Ladies Bag</span>
</a>
<span class="price">$1456</span>
</li>
<li>
<a href="#">
<!--<img src="images/bag.jpg" alt="">-->
<span class="product">Gucci Womens's Bags</span>
</a>
<span class="price">$2345</span>
<li>
<a href="#">
<!--<img src="images/addidas.jpg" alt="">-->
<span class="product">Addidas Running Shoe</span>
</a>
<span class="price">$2345</span>
</li>
<li>
<a href="#">
<!--<img src="images/shirt.jpg" alt="">-->
<span class="product">Bilack Wear's Shirt</span>
</a>
<span class="price">$1245</span>
</li>
</ul>
</div>
</div>
</div>
</section>
<script>
let sidebar = document.querySelector(".sidebar");
let sidebarBtn = document.querySelector(".sidebarBtn");
sidebarBtn.onclick = function() {
sidebar.classList.toggle("active");
if(sidebar.classList.contains("active")){
sidebarBtn.classList.replace("bx-menu" ,"bx-menu-alt-right");
}else
sidebarBtn.classList.replace("bx-menu-alt-right", "bx-menu");
}
</script>
</body>
</html>
CSS CODE:
/* Googlefont Poppins CDN Link */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
.sidebar{
position: fixed;
height: 100%;
width: 240px;
background: #0A2558;
transition: all 0.5s ease;
}
.sidebar.active{
width: 60px;
}
.sidebar .logo-details{
height: 80px;
display: flex;
align-items: center;
}
.sidebar .logo-details i{
font-size: 28px;
font-weight: 500;
color: #fff;
min-width: 60px;
text-align: center
}
.sidebar .logo-details .logo_name{
color: #fff;
font-size: 24px;
font-weight: 500;
}
.sidebar .nav-links{
margin-top: 10px;
}
.sidebar .nav-links li{
position: relative;
list-style: none;
height: 50px;
}
.sidebar .nav-links li a{
height: 100%;
width: 100%;
display: flex;
align-items: center;
text-decoration: none;
transition: all 0.4s ease;
}
.sidebar .nav-links li a.active{
background: #081D45;
}
.sidebar .nav-links li a:hover{
background: #081D45;
}
.sidebar .nav-links li i{
min-width: 60px;
text-align: center;
font-size: 18px;
color: #fff;
}
.sidebar .nav-links li a .links_name{
color: #fff;
font-size: 15px;
font-weight: 400;
white-space: nowrap;
}
.sidebar .nav-links .log_out{
position: absolute;
bottom: 0;
width: 100%;
}
.home-section{
position: relative;
background: #f5f5f5;
min-height: 100vh;
width: calc(100% - 240px);
left: 240px;
transition: all 0.5s ease;
}
.sidebar.active ~ .home-section{
width: calc(100% - 60px);
left: 60px;
}
.home-section nav{
display: flex;
justify-content: space-between;
height: 80px;
background: #fff;
display: flex;
align-items: center;
position: fixed;
width: calc(100% - 240px);
left: 240px;
z-index: 100;
padding: 0 20px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
transition: all 0.5s ease;
}
.sidebar.active ~ .home-section nav{
left: 60px;
width: calc(100% - 60px);
}
.home-section nav .sidebar-button{
display: flex;
align-items: center;
font-size: 24px;
font-weight: 500;
}
nav .sidebar-button i{
font-size: 35px;
margin-right: 10px;
}
.home-section nav .search-box{
position: relative;
height: 50px;
max-width: 550px;
width: 100%;
margin: 0 20px;
}
nav .search-box input{
height: 100%;
width: 100%;
outline: none;
background: #F5F6FA;
border: 2px solid #EFEEF1;
border-radius: 6px;
font-size: 18px;
padding: 0 15px;
}
nav .search-box .bx-search{
position: absolute;
height: 40px;
width: 40px;
background: #2697FF;
right: 5px;
top: 50%;
transform: translateY(-50%);
border-radius: 4px;
line-height: 40px;
text-align: center;
color: #fff;
font-size: 22px;
transition: all 0.4 ease;
}
.home-section nav .profile-details{
display: flex;
align-items: center;
background: #F5F6FA;
border: 2px solid #EFEEF1;
border-radius: 6px;
height: 50px;
min-width: 190px;
padding: 0 15px 0 2px;
}
nav .profile-details img{
height: 40px;
width: 40px;
border-radius: 6px;
object-fit: cover;
}
nav .profile-details .admin_name{
font-size: 15px;
font-weight: 500;
color: #333;
margin: 0 10px;
white-space: nowrap;
}
nav .profile-details i{
font-size: 25px;
color: #333;
}
.home-section .home-content{
position: relative;
padding-top: 104px;
}
.home-content .overview-boxes{
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
padding: 0 20px;
margin-bottom: 26px;
}
.overview-boxes .box{
display: flex;
align-items: center;
justify-content: center;
width: calc(100% / 4 - 15px);
background: #fff;
padding: 15px 14px;
border-radius: 12px;
box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
.overview-boxes .box-topic{
font-size: 20px;
font-weight: 500;
}
.home-content .box .number{
display: inline-block;
font-size: 35px;
margin-top: -6px;
font-weight: 500;
}
.home-content .box .indicator{
display: flex;
align-items: center;
}
.home-content .box .indicator i{
height: 20px;
width: 20px;
background: #8FDACB;
line-height: 20px;
text-align: center;
border-radius: 50%;
color: #fff;
font-size: 20px;
margin-right: 5px;
}
.box .indicator i.down{
background: #e87d88;
}
.home-content .box .indicator .text{
font-size: 12px;
}
.home-content .box .cart{
display: inline-block;
font-size: 32px;
height: 50px;
width: 50px;
background: #cce5ff;
line-height: 50px;
text-align: center;
color: #66b0ff;
border-radius: 12px;
margin: -15px 0 0 6px;
}
.home-content .box .cart.two{
color: #2BD47D;
background: #C0F2D8;
}
.home-content .box .cart.three{
color: #ffc233;
background: #ffe8b3;
}
.home-content .box .cart.four{
color: #e05260;
background: #f7d4d7;
}
.home-content .total-order{
font-size: 20px;
font-weight: 500;
}
.home-content .sales-boxes{
display: flex;
justify-content: space-between;
/* padding: 0 20px; */
}
/* left box */
.home-content .sales-boxes .recent-sales{
width: 65%;
background: #fff;
padding: 20px 30px;
margin: 0 20px;
border-radius: 12px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}
.home-content .sales-boxes .sales-details{
display: flex;
align-items: center;
justify-content: space-between;
}
.sales-boxes .box .title{
font-size: 24px;
font-weight: 500;
/* margin-bottom: 10px; */
}
.sales-boxes .sales-details li.topic{
font-size: 20px;
font-weight: 500;
}
.sales-boxes .sales-details li{
list-style: none;
margin: 8px 0;
}
.sales-boxes .sales-details li a{
font-size: 18px;
color: #333;
font-size: 400;
text-decoration: none;
}
.sales-boxes .box .button{
width: 100%;
display: flex;
justify-content: flex-end;
}
.sales-boxes .box .button a{
color: #fff;
background: #0A2558;
padding: 4px 12px;
font-size: 15px;
font-weight: 400;
border-radius: 4px;
text-decoration: none;
transition: all 0.3s ease;
}
.sales-boxes .box .button a:hover{
background: #0d3073;
}
/* Right box */
.home-content .sales-boxes .top-sales{
width: 35%;
background: #fff;
padding: 20px 30px;
margin: 0 20px 0 0;
border-radius: 12px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}
.sales-boxes .top-sales li{
display: flex;
align-items: center;
justify-content: space-between;
margin: 10px 0;
}
.sales-boxes .top-sales li a img{
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 12px;
margin-right: 10px;
background: #333;
}
.sales-boxes .top-sales li a{
display: flex;
align-items: center;
text-decoration: none;
}
.sales-boxes .top-sales li .product,
.price{
font-size: 17px;
font-weight: 400;
color: #333;
}
/* Responsive Media Query */
@media (max-width: 1240px) {
.sidebar{
width: 60px;
}
.sidebar.active{
width: 220px;
}
.home-section{
width: calc(100% - 60px);
left: 60px;
}
.sidebar.active ~ .home-section{
/* width: calc(100% - 220px); */
overflow: hidden;
left: 220px;
}
.home-section nav{
width: calc(100% - 60px);
left: 60px;
}
.sidebar.active ~ .home-section nav{
width: calc(100% - 220px);
left: 220px;
}
}
@media (max-width: 1150px) {
.home-content .sales-boxes{
flex-direction: column;
}
.home-content .sales-boxes .box{
width: 100%;
overflow-x: scroll;
margin-bottom: 30px;
}
.home-content .sales-boxes .top-sales{
margin: 0;
}
}
@media (max-width: 1000px) {
.overview-boxes .box{
width: calc(100% / 2 - 15px);
margin-bottom: 15px;
}
}
@media (max-width: 700px) {
nav .sidebar-button .dashboard,
nav .profile-details .admin_name,
nav .profile-details i{
display: none;
}
.home-section nav .profile-details{
height: 50px;
min-width: 40px;
}
.home-content .sales-boxes .sales-details{
width: 560px;
}
}
@media (max-width: 550px) {
.overview-boxes .box{
width: 100%;
margin-bottom: 15px;
}
.sidebar.active ~ .home-section nav .profile-details{
display: none;
}
}
@media (max-width: 400px) {
.sidebar{
width: 0;
}
.sidebar.active{
width: 60px;
}
.home-section{
width: 100%;
left: 0;
}
.sidebar.active ~ .home-section{
left: 60px;
width: calc(100% - 60px);
}
.home-section nav{
width: 100%;
left: 0;
}
.sidebar.active ~ .home-section nav{
left: 60px;
width: calc(100% - 60px);
}
}
#html #css #webdev