kandi background
Explore Kits

Shadow | 零反射全动态Android插件框架

 by   Tencent Java Version: 2.3.0 License: BSD-3-Clause

 by   Tencent Java Version: 2.3.0 License: BSD-3-Clause

Download this library from

kandi X-RAY | Shadow Summary

Shadow is a Java library. Shadow has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. However Shadow has 25 bugs. You can download it from GitHub.
零反射全动态Android插件框架
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • Shadow has a medium active ecosystem.
  • It has 6293 star(s) with 1005 fork(s). There are 159 watchers for this library.
  • There were 1 major release(s) in the last 6 months.
  • There are 194 open issues and 435 have been closed. On average issues are closed in 28 days. There are 6 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of Shadow is 2.3.0
Shadow Support
Best in #Java
Average in #Java
Shadow Support
Best in #Java
Average in #Java

quality kandi Quality

  • Shadow has 25 bugs (0 blocker, 0 critical, 12 major, 13 minor) and 1257 code smells.
Shadow Quality
Best in #Java
Average in #Java
Shadow Quality
Best in #Java
Average in #Java

securitySecurity

  • Shadow has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • Shadow code analysis shows 0 unresolved vulnerabilities.
  • There are 15 security hotspots that need review.
Shadow Security
Best in #Java
Average in #Java
Shadow Security
Best in #Java
Average in #Java

license License

  • Shadow is licensed under the BSD-3-Clause License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
Shadow License
Best in #Java
Average in #Java
Shadow License
Best in #Java
Average in #Java

buildReuse

  • Shadow releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
Shadow Reuse
Best in #Java
Average in #Java
Shadow Reuse
Best in #Java
Average in #Java
Top functions reviewed by kandi - BETA

kandi has reviewed Shadow and discovered the below as its top functions. This is intended to give you an instant insight into Shadow implemented functionality, and help decide if they suit your requirements.

  • On transactional .
  • init test case categories
  • Bind a service to the server .
  • copy from apk file
  • Installs a plugin from a zip file .
  • load plugin loader for a plugin
  • Installs the plugin service
  • Unpack plugin .
  • Loads the class .
  • Intercept the touch event .

Shadow Key Features

零反射全动态Android插件框架

环境准备

copy iconCopydownload iconDownload
./gradlew build

How to fade edges of background image of element to blend in with the main background image?

copy iconCopydownload iconDownload
.body {
  display: grid;
  width: 200px;
  height: 200px;
  /* replace with the image you like here */
  background-image: repeating-linear-gradient(-45deg,
      yellow,
      yellow 20px,
      black 20px,
      black 40px);
}

.content {
  margin: 25px;
  /* replace with the image you like here */
  background-image: linear-gradient(to top, blue 0%, blue 100%);
  
  /* for webkit-based browsers */
  -webkit-mask-image:
    linear-gradient(to top, black 0%, black 100%),
    linear-gradient(to top, transparent 0%, black 100%),
    linear-gradient(to right, transparent 0%, black 100%),
    linear-gradient(to bottom, transparent 0%, black 100%),
    linear-gradient(to left, transparent 0%, black 100%);
  -webkit-mask-position:
    center,
    top,
    right,
    bottom,
    left;
  -webkit-mask-size:
    100% 100%,
    100% 10px,
    10px 100%,
    100% 10px,
    10px 100%;
  -webkit-mask-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
   -webkit-mask-composite:
    source-out,
    source-over,
    source-over,
    source-over;
    
   /* for browsers which have implemented the official spec */
  mask-image:
    linear-gradient(to top, black 0%, black 100%),
    linear-gradient(to top, transparent 0%, black 100%),
    linear-gradient(to right, transparent 0%, black 100%),
    linear-gradient(to bottom, transparent 0%, black 100%),
    linear-gradient(to left, transparent 0%, black 100%);
  mask-position:
    center,
    top,
    right,
    bottom,
    left;
  mask-size:
    100% 100%,
    100% 10px,
    10px 100%,
    100% 10px,
    10px 100%;
  mask-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
  mask-composite:
    subtract,
    add,
    add,
    add;
}
<div class="body">
  <div class="content"></div>
</div>
-----------------------
.body {
  display: grid;
  width: 200px;
  height: 200px;
  /* replace with the image you like here */
  background-image: repeating-linear-gradient(-45deg,
      yellow,
      yellow 20px,
      black 20px,
      black 40px);
}

.content {
  margin: 25px;
  /* replace with the image you like here */
  background-image: linear-gradient(to top, blue 0%, blue 100%);
  
  /* for webkit-based browsers */
  -webkit-mask-image:
    linear-gradient(to top, black 0%, black 100%),
    linear-gradient(to top, transparent 0%, black 100%),
    linear-gradient(to right, transparent 0%, black 100%),
    linear-gradient(to bottom, transparent 0%, black 100%),
    linear-gradient(to left, transparent 0%, black 100%);
  -webkit-mask-position:
    center,
    top,
    right,
    bottom,
    left;
  -webkit-mask-size:
    100% 100%,
    100% 10px,
    10px 100%,
    100% 10px,
    10px 100%;
  -webkit-mask-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
   -webkit-mask-composite:
    source-out,
    source-over,
    source-over,
    source-over;
    
   /* for browsers which have implemented the official spec */
  mask-image:
    linear-gradient(to top, black 0%, black 100%),
    linear-gradient(to top, transparent 0%, black 100%),
    linear-gradient(to right, transparent 0%, black 100%),
    linear-gradient(to bottom, transparent 0%, black 100%),
    linear-gradient(to left, transparent 0%, black 100%);
  mask-position:
    center,
    top,
    right,
    bottom,
    left;
  mask-size:
    100% 100%,
    100% 10px,
    10px 100%,
    100% 10px,
    10px 100%;
  mask-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
  mask-composite:
    subtract,
    add,
    add,
    add;
}
<div class="body">
  <div class="content"></div>
</div>

Gradient border and text is not working on Safari and IPhone devices

copy iconCopydownload iconDownload
export const Tab = styled.li`
display: flex;
${fontStyles[fontSizes.eighteen]};
border-bottom: 3px solid transparent;
background-image: -webkit-linear-gradient(rgba(0, 145, 148, 1), rgba(72, 71, 112, 1)),
    ${colors.gradientGreen};
background-clip: content-box, border-box;
box-shadow: 2px 1000px 1px ${colors.offWhite} inset;
cursor: pointer;
outline: none;`;
-----------------------
<html>
<body>
<p>Biometrics</p>
</body>
</html>
/*  gradient variable */
:root{
  --gradient: linear-gradient(to right, yellow, green);
}
/*
  align items to center inside the body
*/
body{
  display: flex;
  justify-content: center;
  align-items:center;
  background: #121212;
}

/* real useful code  */
/*    text    */
p{
  display:block;
  height: contain;
  max-width: max-content !important;
  font-size: 63px;
  font-weight: 900;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: red;
}
/*    underline   */
p:after {
    content: '\00a0';
    background-image:
      var(--gradient);
    background-size: 100% 12px;
    background-repeat: no-repeat;
    float:left;
    width:100%;
}
-----------------------
<html>
<body>
<p>Biometrics</p>
</body>
</html>
/*  gradient variable */
:root{
  --gradient: linear-gradient(to right, yellow, green);
}
/*
  align items to center inside the body
*/
body{
  display: flex;
  justify-content: center;
  align-items:center;
  background: #121212;
}

/* real useful code  */
/*    text    */
p{
  display:block;
  height: contain;
  max-width: max-content !important;
  font-size: 63px;
  font-weight: 900;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: red;
}
/*    underline   */
p:after {
    content: '\00a0';
    background-image:
      var(--gradient);
    background-size: 100% 12px;
    background-repeat: no-repeat;
    float:left;
    width:100%;
}
-----------------------
@font-face {
font-family: Gotham_Book;
font-display: swap;
src: url(../Fonts/GothamBook.eot);
src: url(../Fonts/GothamBook.eot?#iefix) format("embedded-opentype"), url(../Fonts/Gotham-Book.woff2) format("woff2"), url(../Fonts/GothamBook.woff) format("woff"), url(../Fonts/GothamBook.ttf) format("truetype"),
    url(../Fonts/GothamBook.svg#svgFontName) format("svg");
}

Apply sepiaTone to photos in swiftui into scrollview object

copy iconCopydownload iconDownload
import SwiftUI
import CoreImage
import CoreImage.CIFilterBuiltins

    //BoxImage filter ui
    struct BoxImage{
        var id:Int
        let title,imageurl:String
    }
    
    //BoxView filter ui
    struct BoxView:View{
        let box:BoxImage
        
        var body: some View{
            VStack{
                Image("\(box.imageurl)").resizable().cornerRadius(12).frame(width: 80, height: 80 )
                Text(box.title).font(.subheadline).fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
            }
        }
        
    }
    
    struct FilterUiView: View {
        
        //Setup filter
        @State private var currentFilter = CIFilter.sepiaTone()
        let context = CIContext()
        
        @Environment(\.presentationMode) var mode: Binding<PresentationMode>
        
        @State var imageselected:UIImage?
     
        @State var showImagePicker: Bool = false
        @State private var showingSheet = false
       
        
        func applyProcessing() {
              
            guard let cgimg = imageselected?.cgImage else {
                print("imageView doesn't have an image!")
                return
            }
 
            let coreImage = CIImage(cgImage: cgimg)
 
            currentFilter.setValue(coreImage, forKey: kCIInputImageKey)
            
            
            guard let outputImage = currentFilter.outputImage else { return }
    
            if let cgimg = context.createCGImage(outputImage, from: outputImage.extent) {
                let uiImage = UIImage(cgImage: cgimg)
                self.imageselected =  uiImage
                
                print("Tono seppia")
            }
            
            print("processo tono seppia")
        }
        
        var body: some View {
            
            VStack {
                Text("Filter")
                    .font(.system(size: 25, weight: .bold, design: .serif))
                    .foregroundColor(Color(#colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1)))
                    .padding(.top, 5)
                Spacer()
                Spacer()
                Spacer()
                VStack{
                    if imageselected == nil {
                        Image("Geometry")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .cornerRadius(10)
                            .overlay(RoundedRectangle(cornerRadius: 10)
                                        .stroke(Color.green, lineWidth: 4))
                            .shadow(radius: 10).onTapGesture {
                                self.showImagePicker.toggle()
                            }
                    }
                    else {
                        Image(uiImage: imageselected! )
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .cornerRadius(10)
                            .overlay(RoundedRectangle(cornerRadius: 10)
                                        .stroke(Color.green, lineWidth: 4))
                            .shadow(radius: 10).onTapGesture {
                                self.showImagePicker.toggle()
                            }
                    }

            }.sheet(isPresented: $showImagePicker) {
                        ImagePicker(sourceType: .photoLibrary) { image in
                            self.imageselected =   image
                                       
                        }
                    }
                
    
                Spacer()
                Spacer()
                Spacer()
                
                VStack {
                    ScrollView(.horizontal){
                        HStack(spacing: 20) {
                            BoxView(box:  BoxImage(id: 0, title: "Sepia", imageurl: "sepia")).onTapGesture {
                               applyProcessing()
                            }
                            BoxView(box:  BoxImage(id: 1, title: "Model", imageurl: "Abstract"))
                            BoxView(box: BoxImage(id: 2,title: "Modify ui",imageurl: "Aj"))
                            BoxView(box: BoxImage(id: 4,title: "Modify ui",imageurl: "Aj"))
                            BoxView(box: BoxImage(id: 5,title: "Modify2i",imageurl: "Aj"))
                            BoxView(box: BoxImage(id: 6,title: "Modify2i",imageurl: "Aj"))
                            
                        }
                    }
                    
                 
                    
                }
                
            }.background(Color.white).navigationBarHidden(true)
    
        }
       
    }



public struct ImagePicker: UIViewControllerRepresentable {

    private let sourceType: UIImagePickerController.SourceType
    private let onImagePicked: (UIImage) -> Void
    @Environment(\.presentationMode) private var presentationMode

    public init(sourceType: UIImagePickerController.SourceType, onImagePicked: @escaping (UIImage) -> Void) {
        self.sourceType = sourceType
        self.onImagePicked = onImagePicked
    }

    public func makeUIViewController(context: Context) -> UIImagePickerController {
        let picker = UIImagePickerController()
        picker.sourceType = self.sourceType
        picker.delegate = context.coordinator
        return picker
    }

    public func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {}

    public func makeCoordinator() -> Coordinator {
        Coordinator(
            onDismiss: { self.presentationMode.wrappedValue.dismiss() },
            onImagePicked: self.onImagePicked
        )
    }

    final public class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate {

        private let onDismiss: () -> Void
        private let onImagePicked: (UIImage) -> Void

        init(onDismiss: @escaping () -> Void, onImagePicked: @escaping (UIImage) -> Void) {
            self.onDismiss = onDismiss
            self.onImagePicked = onImagePicked
        }

        public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
            if let image = info[.originalImage] as? UIImage {
                self.onImagePicked(image)
            }
            self.onDismiss()
        }

        public func imagePickerControllerDidCancel(_: UIImagePickerController) {
            self.onDismiss()
        }

    }

}

How do i add new image on the new card

copy iconCopydownload iconDownload
    const row = document.querySelector(".row");
const addItem = document.querySelector(".add-item");

const newProductInput = document.querySelector(".product");
const newPriceInput = document.querySelector(".price");
const newPhotoInput = document.querySelector("#inputImage");


addItem.addEventListener('click', (e) => {
    if (e.target.className === 'addItemBtn') {
        addCardContent();
    }
})


function addCardContent() {

    let newContainer = document.createElement('div');
    let newCard = document.createElement('div');
    let newCardProduct = document.createElement('h4');
    let newCardPrice = document.createElement('p');
    let newBtn = document.createElement('button');
    let newImg = document.createElement('img');
    
    let reader = new FileReader();

    reader.onload = function() {
        var dataURL = reader.result;
        newImg.src = dataURL;
    }
    reader.readAsDataURL(newPhotoInput.files[0]);


    newCard.className = 'card col';
    newContainer.className = 'container';
    newBtn.className = 'orderBtn';
    newBtn.textContent = 'Order';

    newCardPrice.textContent = newPriceInput.value;
    newCardProduct.textContent = newProductInput.value;

    newCard.appendChild(newImg);
    newCard.appendChild(newContainer);
    newContainer.appendChild(newCardProduct);
    newContainer.appendChild(newCardPrice);
    newContainer.appendChild(newBtn);

    row.appendChild(newCard);

}
/* ================================= 
  Base Element Styles
==================================== */

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Lobster', cursive;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
}

img {
    width: 100%;
}


/* ================================= 
  Base Layout Styles
==================================== */


/* ---- Navigation ---- */

.main-header {
    width: 80%;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
}

.logo {
    border: 4px solid black;
    border-radius: 4px;
    background-color: black;
}

.logo a {
    color: white;
}

.nav {
    display: flex;
}

.nav li {
    padding: 10px 15px;
}

.nav li a {
    color: black;
    text-transform: uppercase;
}


/* ---- Layout Containers ---- */

.intro-webshop {
    height: 60vh;
    background-color: coral;
    text-align: center;
}

.search-bar {
    width: 80%;
    margin: 4em auto;
    text-align: center;
}

.row {
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto;
}

.card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    width: 20%;
    margin: 1em 2em;
}

.image-top {
    width: 100%;
    height: 15vw;
    background-size: cover;
}

.card:hover {
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}

.container {
    text-align: center;
    padding: 2px 16px;
}


/* ---- Layout Buttons ---- */

.orderBtn {
    width: 150px;
    background-color: white;
    color: black;
    border: 2px solid #008CBA;
    margin-bottom: 2em;
    cursor: pointer;
    font-family: 'Lobster', cursive;
}

.orderBtn:hover {
    background-color: #008CBA;
    color: white;
}

.add-item {
    margin: auto;
    width: 15%;
    padding: 10px;
}

.add-item input {
    display: block;
}

.add-item p {
    margin: 5px 0;
}

.add-item button {
    margin: 10px 0 0 0;
}


/* ---- Layout Footer ---- */

.main-footer {
    text-align: center;
    background: #d9e4ea;
    padding: 1.5em 0;
    margin-top: 2em;
}


/* ================================= 
  Media Queries
==================================== */

@media (max-width: 415px) {
    .main-header {
        display: block;
        text-align: center;
    }
    .nav {
        display: block;
        padding: 0;
    }
    .nav li {
        padding: 0 0 25px 0;
    }
    .row {
        display: block;
    }
    .card {
        width: 100%;
        margin: 1em 0;
    }
    .image-top {
        height: 100%;
    }
    .add-item {
        width: 50%;
    }
}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web-Shop Urban</title>
    <link rel="stylesheet" href="/css/webshop.css">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
</head>

<body>

    <header class="main-header">
        <h1 class="logo"><a href="/html/index.html">Urban</a></h1>
        <!-- <div id="menu-bar"> -->
        <!-- <div id="menu" onclick="onClickMenu()">
                <div id="bar1" class="bar"></div>
                <div id="bar2" class="bar"></div>
                <div id="bar3" class="bar"></div>
            </div> -->
        <ul class="nav" id="nav">
            <li><a href="/html/index.html#about">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
        <!-- </div> -->
    </header>

    <main>
        <div class="intro-webshop">
        </div>
        <div class="search-bar">
            <input type="text"> <button>search</button>
        </div>

        <div class="row">
            <div class="card col">
                <img src="/img/2d8169059eaa219df13b70de2b33676a.jpg" alt="shoes" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
            <div class="card col">
                <img src="/img/istockphoto-909472812-170667a.jpg" alt="jeans" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
            <div class="card col">
                <img src="/img/unnamed-removebg-preview.png" alt="tshirt" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
        </div>


        <div class="add-item">
            <p>Image</p>
            <input type="file" accept='image/*' id="inputImage">
            <p>Produt</p>
            <input type="text" class="product">
            <p>Price</p>
            <input type="text" class="price">
            <button class="addItemBtn">Add item</button>
        </div>

    </main>

    <footer class="main-footer">
        <span>&copy;2021 Urban.</span>
    </footer>
    <script src="/js/javascript.js"></script>
</body>

</html>
-----------------------
    const row = document.querySelector(".row");
const addItem = document.querySelector(".add-item");

const newProductInput = document.querySelector(".product");
const newPriceInput = document.querySelector(".price");
const newPhotoInput = document.querySelector("#inputImage");


addItem.addEventListener('click', (e) => {
    if (e.target.className === 'addItemBtn') {
        addCardContent();
    }
})


function addCardContent() {

    let newContainer = document.createElement('div');
    let newCard = document.createElement('div');
    let newCardProduct = document.createElement('h4');
    let newCardPrice = document.createElement('p');
    let newBtn = document.createElement('button');
    let newImg = document.createElement('img');
    
    let reader = new FileReader();

    reader.onload = function() {
        var dataURL = reader.result;
        newImg.src = dataURL;
    }
    reader.readAsDataURL(newPhotoInput.files[0]);


    newCard.className = 'card col';
    newContainer.className = 'container';
    newBtn.className = 'orderBtn';
    newBtn.textContent = 'Order';

    newCardPrice.textContent = newPriceInput.value;
    newCardProduct.textContent = newProductInput.value;

    newCard.appendChild(newImg);
    newCard.appendChild(newContainer);
    newContainer.appendChild(newCardProduct);
    newContainer.appendChild(newCardPrice);
    newContainer.appendChild(newBtn);

    row.appendChild(newCard);

}
/* ================================= 
  Base Element Styles
==================================== */

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Lobster', cursive;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
}

img {
    width: 100%;
}


/* ================================= 
  Base Layout Styles
==================================== */


/* ---- Navigation ---- */

.main-header {
    width: 80%;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
}

.logo {
    border: 4px solid black;
    border-radius: 4px;
    background-color: black;
}

.logo a {
    color: white;
}

.nav {
    display: flex;
}

.nav li {
    padding: 10px 15px;
}

.nav li a {
    color: black;
    text-transform: uppercase;
}


/* ---- Layout Containers ---- */

.intro-webshop {
    height: 60vh;
    background-color: coral;
    text-align: center;
}

.search-bar {
    width: 80%;
    margin: 4em auto;
    text-align: center;
}

.row {
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto;
}

.card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    width: 20%;
    margin: 1em 2em;
}

.image-top {
    width: 100%;
    height: 15vw;
    background-size: cover;
}

.card:hover {
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}

.container {
    text-align: center;
    padding: 2px 16px;
}


/* ---- Layout Buttons ---- */

.orderBtn {
    width: 150px;
    background-color: white;
    color: black;
    border: 2px solid #008CBA;
    margin-bottom: 2em;
    cursor: pointer;
    font-family: 'Lobster', cursive;
}

.orderBtn:hover {
    background-color: #008CBA;
    color: white;
}

.add-item {
    margin: auto;
    width: 15%;
    padding: 10px;
}

.add-item input {
    display: block;
}

.add-item p {
    margin: 5px 0;
}

.add-item button {
    margin: 10px 0 0 0;
}


/* ---- Layout Footer ---- */

.main-footer {
    text-align: center;
    background: #d9e4ea;
    padding: 1.5em 0;
    margin-top: 2em;
}


/* ================================= 
  Media Queries
==================================== */

@media (max-width: 415px) {
    .main-header {
        display: block;
        text-align: center;
    }
    .nav {
        display: block;
        padding: 0;
    }
    .nav li {
        padding: 0 0 25px 0;
    }
    .row {
        display: block;
    }
    .card {
        width: 100%;
        margin: 1em 0;
    }
    .image-top {
        height: 100%;
    }
    .add-item {
        width: 50%;
    }
}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web-Shop Urban</title>
    <link rel="stylesheet" href="/css/webshop.css">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
</head>

<body>

    <header class="main-header">
        <h1 class="logo"><a href="/html/index.html">Urban</a></h1>
        <!-- <div id="menu-bar"> -->
        <!-- <div id="menu" onclick="onClickMenu()">
                <div id="bar1" class="bar"></div>
                <div id="bar2" class="bar"></div>
                <div id="bar3" class="bar"></div>
            </div> -->
        <ul class="nav" id="nav">
            <li><a href="/html/index.html#about">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
        <!-- </div> -->
    </header>

    <main>
        <div class="intro-webshop">
        </div>
        <div class="search-bar">
            <input type="text"> <button>search</button>
        </div>

        <div class="row">
            <div class="card col">
                <img src="/img/2d8169059eaa219df13b70de2b33676a.jpg" alt="shoes" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
            <div class="card col">
                <img src="/img/istockphoto-909472812-170667a.jpg" alt="jeans" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
            <div class="card col">
                <img src="/img/unnamed-removebg-preview.png" alt="tshirt" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
        </div>


        <div class="add-item">
            <p>Image</p>
            <input type="file" accept='image/*' id="inputImage">
            <p>Produt</p>
            <input type="text" class="product">
            <p>Price</p>
            <input type="text" class="price">
            <button class="addItemBtn">Add item</button>
        </div>

    </main>

    <footer class="main-footer">
        <span>&copy;2021 Urban.</span>
    </footer>
    <script src="/js/javascript.js"></script>
</body>

</html>
-----------------------
    const row = document.querySelector(".row");
const addItem = document.querySelector(".add-item");

const newProductInput = document.querySelector(".product");
const newPriceInput = document.querySelector(".price");
const newPhotoInput = document.querySelector("#inputImage");


addItem.addEventListener('click', (e) => {
    if (e.target.className === 'addItemBtn') {
        addCardContent();
    }
})


function addCardContent() {

    let newContainer = document.createElement('div');
    let newCard = document.createElement('div');
    let newCardProduct = document.createElement('h4');
    let newCardPrice = document.createElement('p');
    let newBtn = document.createElement('button');
    let newImg = document.createElement('img');
    
    let reader = new FileReader();

    reader.onload = function() {
        var dataURL = reader.result;
        newImg.src = dataURL;
    }
    reader.readAsDataURL(newPhotoInput.files[0]);


    newCard.className = 'card col';
    newContainer.className = 'container';
    newBtn.className = 'orderBtn';
    newBtn.textContent = 'Order';

    newCardPrice.textContent = newPriceInput.value;
    newCardProduct.textContent = newProductInput.value;

    newCard.appendChild(newImg);
    newCard.appendChild(newContainer);
    newContainer.appendChild(newCardProduct);
    newContainer.appendChild(newCardPrice);
    newContainer.appendChild(newBtn);

    row.appendChild(newCard);

}
/* ================================= 
  Base Element Styles
==================================== */

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Lobster', cursive;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
}

img {
    width: 100%;
}


/* ================================= 
  Base Layout Styles
==================================== */


/* ---- Navigation ---- */

.main-header {
    width: 80%;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
}

.logo {
    border: 4px solid black;
    border-radius: 4px;
    background-color: black;
}

.logo a {
    color: white;
}

.nav {
    display: flex;
}

.nav li {
    padding: 10px 15px;
}

.nav li a {
    color: black;
    text-transform: uppercase;
}


/* ---- Layout Containers ---- */

.intro-webshop {
    height: 60vh;
    background-color: coral;
    text-align: center;
}

.search-bar {
    width: 80%;
    margin: 4em auto;
    text-align: center;
}

.row {
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto;
}

.card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    width: 20%;
    margin: 1em 2em;
}

.image-top {
    width: 100%;
    height: 15vw;
    background-size: cover;
}

.card:hover {
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}

.container {
    text-align: center;
    padding: 2px 16px;
}


/* ---- Layout Buttons ---- */

.orderBtn {
    width: 150px;
    background-color: white;
    color: black;
    border: 2px solid #008CBA;
    margin-bottom: 2em;
    cursor: pointer;
    font-family: 'Lobster', cursive;
}

.orderBtn:hover {
    background-color: #008CBA;
    color: white;
}

.add-item {
    margin: auto;
    width: 15%;
    padding: 10px;
}

.add-item input {
    display: block;
}

.add-item p {
    margin: 5px 0;
}

.add-item button {
    margin: 10px 0 0 0;
}


/* ---- Layout Footer ---- */

.main-footer {
    text-align: center;
    background: #d9e4ea;
    padding: 1.5em 0;
    margin-top: 2em;
}


/* ================================= 
  Media Queries
==================================== */

@media (max-width: 415px) {
    .main-header {
        display: block;
        text-align: center;
    }
    .nav {
        display: block;
        padding: 0;
    }
    .nav li {
        padding: 0 0 25px 0;
    }
    .row {
        display: block;
    }
    .card {
        width: 100%;
        margin: 1em 0;
    }
    .image-top {
        height: 100%;
    }
    .add-item {
        width: 50%;
    }
}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web-Shop Urban</title>
    <link rel="stylesheet" href="/css/webshop.css">
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
</head>

<body>

    <header class="main-header">
        <h1 class="logo"><a href="/html/index.html">Urban</a></h1>
        <!-- <div id="menu-bar"> -->
        <!-- <div id="menu" onclick="onClickMenu()">
                <div id="bar1" class="bar"></div>
                <div id="bar2" class="bar"></div>
                <div id="bar3" class="bar"></div>
            </div> -->
        <ul class="nav" id="nav">
            <li><a href="/html/index.html#about">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
        <!-- </div> -->
    </header>

    <main>
        <div class="intro-webshop">
        </div>
        <div class="search-bar">
            <input type="text"> <button>search</button>
        </div>

        <div class="row">
            <div class="card col">
                <img src="/img/2d8169059eaa219df13b70de2b33676a.jpg" alt="shoes" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
            <div class="card col">
                <img src="/img/istockphoto-909472812-170667a.jpg" alt="jeans" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
            <div class="card col">
                <img src="/img/unnamed-removebg-preview.png" alt="tshirt" style="width:100%" class="image-top">
                <div class="container">
                    <h4><b>Produt</b></h4>
                    <p>Price</p>
                    <button class="orderBtn">Order</button>
                </div>
            </div>
        </div>


        <div class="add-item">
            <p>Image</p>
            <input type="file" accept='image/*' id="inputImage">
            <p>Produt</p>
            <input type="text" class="product">
            <p>Price</p>
            <input type="text" class="price">
            <button class="addItemBtn">Add item</button>
        </div>

    </main>

    <footer class="main-footer">
        <span>&copy;2021 Urban.</span>
    </footer>
    <script src="/js/javascript.js"></script>
</body>

</html>

Change the colour of a specific area of a picture onclick

copy iconCopydownload iconDownload
var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  document.querySelector('.product.selected').style.fill = hex;
}

document.querySelectorAll('.product').forEach((el) => {
  el.addEventListener('click', (e) => {
    document.querySelectorAll('.product').forEach((el) => {
      el.classList.remove('selected')
    });
    e.currentTarget.classList.add('selected');
  });
});
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path class="product selected" id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path class="product" id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path class="product" id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  document.querySelector('.product.selected').style.fill = hex;
}

document.querySelectorAll('.product').forEach((el) => {
  el.addEventListener('click', (e) => {
    document.querySelectorAll('.product').forEach((el) => {
      el.classList.remove('selected')
    });
    e.currentTarget.classList.add('selected');
  });
});
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path class="product selected" id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path class="product" id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path class="product" id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  document.querySelector('.product.selected').style.fill = hex;
}

document.querySelectorAll('.product').forEach((el) => {
  el.addEventListener('click', (e) => {
    document.querySelectorAll('.product').forEach((el) => {
      el.classList.remove('selected')
    });
    e.currentTarget.classList.add('selected');
  });
});
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path class="product selected" id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path class="product" id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path class="product" id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
let overlay;
document.querySelectorAll('#product-a, #product-b, #product-c').forEach(function(path) {
  path.onclick = chooseProduct;
})

function chooseProduct(e) {
  if (overlay) overlay.classList.remove('highlight')
  overlay = e.target
  overlay.classList.add('highlight')
}


var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  if (overlay) overlay.style.fill = hex;
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}

.highlight {
  stroke-width: 10px;
  stroke: #000;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
let overlay;
document.querySelectorAll('#product-a, #product-b, #product-c').forEach(function(path) {
  path.onclick = chooseProduct;
})

function chooseProduct(e) {
  if (overlay) overlay.classList.remove('highlight')
  overlay = e.target
  overlay.classList.add('highlight')
}


var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  if (overlay) overlay.style.fill = hex;
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}

.highlight {
  stroke-width: 10px;
  stroke: #000;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
let overlay;
document.querySelectorAll('#product-a, #product-b, #product-c').forEach(function(path) {
  path.onclick = chooseProduct;
})

function chooseProduct(e) {
  if (overlay) overlay.classList.remove('highlight')
  overlay = e.target
  overlay.classList.add('highlight')
}


var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  if (overlay) overlay.style.fill = hex;
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}

.highlight {
  stroke-width: 10px;
  stroke: #000;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
const overlays = document.querySelectorAll("#product-svg path"); //Select all path
var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

overlays.forEach(overlay => { //Iterate over all overlays
  overlay.onclick = () => {
    let id = this.id; // Get the id of clicked overlay
    overlays.forEach(overlay => {
      if (overlay.id != id) {
        overlay.classList.remove("active") //Remove the active class from other overlays
      }
    });
    overlay.classList.add("active") //Add active class to clicked overlay
  };
})

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  document.querySelector(".active").style.fill = hex; //change the color of element with active class
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path class="active" id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
const overlays = document.querySelectorAll("#product-svg path"); //Select all path
var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

overlays.forEach(overlay => { //Iterate over all overlays
  overlay.onclick = () => {
    let id = this.id; // Get the id of clicked overlay
    overlays.forEach(overlay => {
      if (overlay.id != id) {
        overlay.classList.remove("active") //Remove the active class from other overlays
      }
    });
    overlay.classList.add("active") //Add active class to clicked overlay
  };
})

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  document.querySelector(".active").style.fill = hex; //change the color of element with active class
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path class="active" id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>
-----------------------
const overlays = document.querySelectorAll("#product-svg path"); //Select all path
var el = document.getElementsByClassName("color");
for (var i = 0; i < el.length; i++) {
  el[i].onclick = changeColor;
}

overlays.forEach(overlay => { //Iterate over all overlays
  overlay.onclick = () => {
    let id = this.id; // Get the id of clicked overlay
    overlays.forEach(overlay => {
      if (overlay.id != id) {
        overlay.classList.remove("active") //Remove the active class from other overlays
      }
    });
    overlay.classList.add("active") //Add active class to clicked overlay
  };
})

function changeColor(e) {
  let hex = e.target.getAttribute("data-hex");
  document.querySelector(".active").style.fill = hex; //change the color of element with active class
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#container {
  height: 200px;
  width: 200px;
}

#product-svg {
  position: relative;
  z-index: 2;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: 50%;
  mix-blend-mode: multiply;
}

path {
  fill: #CCCCCC;
}

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  height: auto;
  z-index: 1;
}

.colors {
  display: flex;
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 3;
}

.color {
  height: 36px;
  width: 36px;
  margin-left: 0.5em;
  border-radius: 18px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #aaa;
  cursor: pointer;
}
<div id="container">

  <svg id="product-svg" viewBox="0 0 744 1074">
      <path class="active" id="product-a" d="M51 207.5L51 348L686 348L686 67L51 67L51 207.5Z" />
      <path id="product-b" d="M51 544.5L51 685L686 685L686 404L51 404L51 544.5Z" />
      <path id="product-c" d="M51 883.5L51 1024L686 1024L686 743L51 743L51 883.5Z" />
    </svg>
  <img id="background-image" src="boxes.jpg" alt="">
</div>

<div class="colors">
  <div class="color" style="background-color: #ff0000" data-hex="#ff0000"></div>
  <div class="color" style="background-color: #ffff33" data-hex="#ffff33"></div>
  <div class="color" style="background-color: #3399ff" data-hex="#3399ff"></div>
</div>

Vaadin TextArea set starting row number to 1

copy iconCopydownload iconDownload
var textArea = new TextArea();
textArea.getElement().executeJs("this.shadowRoot.querySelector('textarea').rows = $0;", rows);

10-seconds count-up timer / vue.js

copy iconCopydownload iconDownload
let interval= () =>{ setInterval(callback, 1000);
var count=0;
var app = new Vue({
    el: '#app',
    data: {
        time: "0",
        count:0
    },
    mounted() {

        // Create startTime
        this.startTime = moment();

        // Define callback
        let callback = () => {

            // Calculate time diff
            let time_diff = moment().diff(this.startTime);
            this.time = moment.utc(time_diff).format("s");
            this.running=true;

            // Bumb counter
            ++count;

            // Clear interval on count==10
            if (count==10) clearInterval(interval);
        };

        // Start interval
        let interval = setInterval(callback, 1000);
    }
})
div#app  { padding: 30px; margin: 30px auto; width: 300px; text-align: center; border: 1px solid #ccc; box-shadow: 3px 3px 3px #aaa; }
div#time { font-size: 25pt; padding: 5px; margin: 0px auto; background: #ccc; width: 200px; border: 1px solid black; }

/* Hide console wrapper */
.as-console-wrapper { display: none !important; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>

<div id="app">
  <h1>counter1</h1>
  <div id="time">{{ time }}</div>
</div>
-----------------------
let interval= () =>{ setInterval(callback, 1000);
var count=0;
var app = new Vue({
    el: '#app',
    data: {
        time: "0",
        count:0
    },
    mounted() {

        // Create startTime
        this.startTime = moment();

        // Define callback
        let callback = () => {

            // Calculate time diff
            let time_diff = moment().diff(this.startTime);
            this.time = moment.utc(time_diff).format("s");
            this.running=true;

            // Bumb counter
            ++count;

            // Clear interval on count==10
            if (count==10) clearInterval(interval);
        };

        // Start interval
        let interval = setInterval(callback, 1000);
    }
})
div#app  { padding: 30px; margin: 30px auto; width: 300px; text-align: center; border: 1px solid #ccc; box-shadow: 3px 3px 3px #aaa; }
div#time { font-size: 25pt; padding: 5px; margin: 0px auto; background: #ccc; width: 200px; border: 1px solid black; }

/* Hide console wrapper */
.as-console-wrapper { display: none !important; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>

<div id="app">
  <h1>counter1</h1>
  <div id="time">{{ time }}</div>
</div>
-----------------------
let interval= () =>{ setInterval(callback, 1000);
var count=0;
var app = new Vue({
    el: '#app',
    data: {
        time: "0",
        count:0
    },
    mounted() {

        // Create startTime
        this.startTime = moment();

        // Define callback
        let callback = () => {

            // Calculate time diff
            let time_diff = moment().diff(this.startTime);
            this.time = moment.utc(time_diff).format("s");
            this.running=true;

            // Bumb counter
            ++count;

            // Clear interval on count==10
            if (count==10) clearInterval(interval);
        };

        // Start interval
        let interval = setInterval(callback, 1000);
    }
})
div#app  { padding: 30px; margin: 30px auto; width: 300px; text-align: center; border: 1px solid #ccc; box-shadow: 3px 3px 3px #aaa; }
div#time { font-size: 25pt; padding: 5px; margin: 0px auto; background: #ccc; width: 200px; border: 1px solid black; }

/* Hide console wrapper */
.as-console-wrapper { display: none !important; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>

<div id="app">
  <h1>counter1</h1>
  <div id="time">{{ time }}</div>
</div>
-----------------------
let interval= () =>{ setInterval(callback, 1000);
var count=0;
var app = new Vue({
    el: '#app',
    data: {
        time: "0",
        count:0
    },
    mounted() {

        // Create startTime
        this.startTime = moment();

        // Define callback
        let callback = () => {

            // Calculate time diff
            let time_diff = moment().diff(this.startTime);
            this.time = moment.utc(time_diff).format("s");
            this.running=true;

            // Bumb counter
            ++count;

            // Clear interval on count==10
            if (count==10) clearInterval(interval);
        };

        // Start interval
        let interval = setInterval(callback, 1000);
    }
})
div#app  { padding: 30px; margin: 30px auto; width: 300px; text-align: center; border: 1px solid #ccc; box-shadow: 3px 3px 3px #aaa; }
div#time { font-size: 25pt; padding: 5px; margin: 0px auto; background: #ccc; width: 200px; border: 1px solid black; }

/* Hide console wrapper */
.as-console-wrapper { display: none !important; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>

<div id="app">
  <h1>counter1</h1>
  <div id="time">{{ time }}</div>
</div>
-----------------------
<script type="text/javascript">
    var count=0;
    var app = new Vue({
      el: '#app',
      data: {
        time: "0",
        count:0
      },
      mounted() {
          this.startTime = moment();

          let interval;
          let callback = () => {
            let time_diff = moment().diff(this.startTime);
            this.time = moment.utc(time_diff).format("s");
            this.running=true;

            ++count;
            if(count == 10) clearInterval(interval);            
          };

          interval = setInterval(callback, 1000)
    })
</script>

How to upload files on laravel and storing it in a directory

copy iconCopydownload iconDownload
'profile_image' => $request->file('profile_image') ? Storage::disk('public')->put('images',$request->profile_image) : null
$url = \Storage::disk('public')->url($user->profile_image)
<form class="user" method="POST" action="{{ route('register.register') }}" enctype="multipart/form-data">
-----------------------
'profile_image' => $request->file('profile_image') ? Storage::disk('public')->put('images',$request->profile_image) : null
$url = \Storage::disk('public')->url($user->profile_image)
<form class="user" method="POST" action="{{ route('register.register') }}" enctype="multipart/form-data">
-----------------------
'profile_image' => $request->file('profile_image') ? Storage::disk('public')->put('images',$request->profile_image) : null
$url = \Storage::disk('public')->url($user->profile_image)
<form class="user" method="POST" action="{{ route('register.register') }}" enctype="multipart/form-data">

New button after all elements have been loaded

copy iconCopydownload iconDownload
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft === 0) {
    $('#load-more').text("GO ->");
  }
}
$('#load-more').click(function() {
      if (numberLeft === 0) {
        alert("Go to next page")
      } else {
        loadNextSeven();
        isThisTheEnd();
      }
    });
function loadNextSeven() {
  let moveItems = $('#off-items-bucket .item').slice(0, 7);
  moveItems.hide().appendTo('#on-items-bucket').fadeIn('medium');
}
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft == 0) {
    $('#load-more').text("GO ->");
  }
}

$(document).ready(function() {
  loadNextSeven();
  isThisTheEnd();
});


$('#load-more').click(function() {
  if (numberLeft === 0) {
    alert("Go to next page")
  } else {
    loadNextSeven();
    isThisTheEnd();
  }
});
.items-wrapper {
  width: 800px;
  margin: 0 auto;
}

#off-items-bucket {
  display: none;
  /* REALLY THE ONLY LINE YOU NEED*/
  background-color: palegreen;
  box-shadow: 0 0 0 5px #000;
  float: left;
  box-sizing: border-box;
  margin: 20px 0;
  width: 100%;
}

.item {
  width: 100px;
  height: 100px;
  float: left;
  margin: 5px;
}

.green {
  background-color: green;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
}

.yellow {
  background-color: yellow;
}

button {
  width: 200px;
  margin: 0 auto;
  padding: 10px;
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items-wrapper">
  <div id="on-items-bucket"></div>
  <div id="off-items-bucket">
    <!-- put the items in the bucket -->
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
  </div>
  <button id="load-more">LOAD MORE</button>
</div>
-----------------------
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft === 0) {
    $('#load-more').text("GO ->");
  }
}
$('#load-more').click(function() {
      if (numberLeft === 0) {
        alert("Go to next page")
      } else {
        loadNextSeven();
        isThisTheEnd();
      }
    });
function loadNextSeven() {
  let moveItems = $('#off-items-bucket .item').slice(0, 7);
  moveItems.hide().appendTo('#on-items-bucket').fadeIn('medium');
}
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft == 0) {
    $('#load-more').text("GO ->");
  }
}

$(document).ready(function() {
  loadNextSeven();
  isThisTheEnd();
});


$('#load-more').click(function() {
  if (numberLeft === 0) {
    alert("Go to next page")
  } else {
    loadNextSeven();
    isThisTheEnd();
  }
});
.items-wrapper {
  width: 800px;
  margin: 0 auto;
}

#off-items-bucket {
  display: none;
  /* REALLY THE ONLY LINE YOU NEED*/
  background-color: palegreen;
  box-shadow: 0 0 0 5px #000;
  float: left;
  box-sizing: border-box;
  margin: 20px 0;
  width: 100%;
}

.item {
  width: 100px;
  height: 100px;
  float: left;
  margin: 5px;
}

.green {
  background-color: green;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
}

.yellow {
  background-color: yellow;
}

button {
  width: 200px;
  margin: 0 auto;
  padding: 10px;
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items-wrapper">
  <div id="on-items-bucket"></div>
  <div id="off-items-bucket">
    <!-- put the items in the bucket -->
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
  </div>
  <button id="load-more">LOAD MORE</button>
</div>
-----------------------
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft === 0) {
    $('#load-more').text("GO ->");
  }
}
$('#load-more').click(function() {
      if (numberLeft === 0) {
        alert("Go to next page")
      } else {
        loadNextSeven();
        isThisTheEnd();
      }
    });
function loadNextSeven() {
  let moveItems = $('#off-items-bucket .item').slice(0, 7);
  moveItems.hide().appendTo('#on-items-bucket').fadeIn('medium');
}
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft == 0) {
    $('#load-more').text("GO ->");
  }
}

$(document).ready(function() {
  loadNextSeven();
  isThisTheEnd();
});


$('#load-more').click(function() {
  if (numberLeft === 0) {
    alert("Go to next page")
  } else {
    loadNextSeven();
    isThisTheEnd();
  }
});
.items-wrapper {
  width: 800px;
  margin: 0 auto;
}

#off-items-bucket {
  display: none;
  /* REALLY THE ONLY LINE YOU NEED*/
  background-color: palegreen;
  box-shadow: 0 0 0 5px #000;
  float: left;
  box-sizing: border-box;
  margin: 20px 0;
  width: 100%;
}

.item {
  width: 100px;
  height: 100px;
  float: left;
  margin: 5px;
}

.green {
  background-color: green;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
}

.yellow {
  background-color: yellow;
}

button {
  width: 200px;
  margin: 0 auto;
  padding: 10px;
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items-wrapper">
  <div id="on-items-bucket"></div>
  <div id="off-items-bucket">
    <!-- put the items in the bucket -->
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
  </div>
  <button id="load-more">LOAD MORE</button>
</div>
-----------------------
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft === 0) {
    $('#load-more').text("GO ->");
  }
}
$('#load-more').click(function() {
      if (numberLeft === 0) {
        alert("Go to next page")
      } else {
        loadNextSeven();
        isThisTheEnd();
      }
    });
function loadNextSeven() {
  let moveItems = $('#off-items-bucket .item').slice(0, 7);
  moveItems.hide().appendTo('#on-items-bucket').fadeIn('medium');
}
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft == 0) {
    $('#load-more').text("GO ->");
  }
}

$(document).ready(function() {
  loadNextSeven();
  isThisTheEnd();
});


$('#load-more').click(function() {
  if (numberLeft === 0) {
    alert("Go to next page")
  } else {
    loadNextSeven();
    isThisTheEnd();
  }
});
.items-wrapper {
  width: 800px;
  margin: 0 auto;
}

#off-items-bucket {
  display: none;
  /* REALLY THE ONLY LINE YOU NEED*/
  background-color: palegreen;
  box-shadow: 0 0 0 5px #000;
  float: left;
  box-sizing: border-box;
  margin: 20px 0;
  width: 100%;
}

.item {
  width: 100px;
  height: 100px;
  float: left;
  margin: 5px;
}

.green {
  background-color: green;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
}

.yellow {
  background-color: yellow;
}

button {
  width: 200px;
  margin: 0 auto;
  padding: 10px;
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items-wrapper">
  <div id="on-items-bucket"></div>
  <div id="off-items-bucket">
    <!-- put the items in the bucket -->
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
  </div>
  <button id="load-more">LOAD MORE</button>
</div>
-----------------------
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft === 0) {
    $('#load-more').text("GO ->");
  }
}
$('#load-more').click(function() {
      if (numberLeft === 0) {
        alert("Go to next page")
      } else {
        loadNextSeven();
        isThisTheEnd();
      }
    });
function loadNextSeven() {
  let moveItems = $('#off-items-bucket .item').slice(0, 7);
  moveItems.hide().appendTo('#on-items-bucket').fadeIn('medium');
}
let numberLeft

function isThisTheEnd() {
  numberLeft = $('#off-items-bucket .item').length;

  if (numberLeft == 0) {
    $('#load-more').text("GO ->");
  }
}

$(document).ready(function() {
  loadNextSeven();
  isThisTheEnd();
});


$('#load-more').click(function() {
  if (numberLeft === 0) {
    alert("Go to next page")
  } else {
    loadNextSeven();
    isThisTheEnd();
  }
});
.items-wrapper {
  width: 800px;
  margin: 0 auto;
}

#off-items-bucket {
  display: none;
  /* REALLY THE ONLY LINE YOU NEED*/
  background-color: palegreen;
  box-shadow: 0 0 0 5px #000;
  float: left;
  box-sizing: border-box;
  margin: 20px 0;
  width: 100%;
}

.item {
  width: 100px;
  height: 100px;
  float: left;
  margin: 5px;
}

.green {
  background-color: green;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
}

.yellow {
  background-color: yellow;
}

button {
  width: 200px;
  margin: 0 auto;
  padding: 10px;
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="items-wrapper">
  <div id="on-items-bucket"></div>
  <div id="off-items-bucket">
    <!-- put the items in the bucket -->
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item red"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item yellow"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item blue"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
    <div class="item green"></div>
  </div>
  <button id="load-more">LOAD MORE</button>
</div>

SQL saving shadow table for a column on value change

copy iconCopydownload iconDownload
CREATE TRIGGER AspNetUsersEmail_trigger
ON AspNetUsers
AFTER UPDATE 
AS

SET NOCOUNT ON;

IF (UPDATE(Email))
    INSERT INTO [dbo].[AspNetUserEmailAudit]
        (UserId, UserName, Email, NormalizedEmail, FirstName, LastName)
    SELECT Id, UserName, Email, NormalizedEmail, FirstName, LastName
    FROM inserted i
    WHERE EXISTS (SELECT i.Id, i.Email   -- always include the primary key
                  EXCEPT
                  SELECT d.Id, d.Email
                  FROM deleted d);

GO

Community Discussions

Trending Discussions on Shadow
  • How to fade edges of background image of element to blend in with the main background image?
  • Gradient border and text is not working on Safari and IPhone devices
  • Apply sepiaTone to photos in swiftui into scrollview object
  • How do i add new image on the new card
  • Change the colour of a specific area of a picture onclick
  • Vaadin TextArea set starting row number to 1
  • 10-seconds count-up timer / vue.js
  • Fixing footer to bottom in laravel bootstrap
  • How to upload files on laravel and storing it in a directory
  • New button after all elements have been loaded
Trending Discussions on Shadow

QUESTION

How to fade edges of background image of element to blend in with the main background image?

Asked 2021-Jun-16 at 03:34

I've come across an issue of trying to fade the edges of the background image of a div so that it looks like it's blending with the background image of the full site (so the background image applied to the body).

<head>
  <style>
  body{
    background-image: url('some url here') !important;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: 100%;
    background-size: 1150px;
  }
  #blendElement{
    background: url('some other url here');
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100%;
  }
  </style>
</head>

<body>
 <div>
   <div id="blendElement"> This should have edges blending to the main (body's) background image behind it.
   </div>
 </div>
</body>

If you've ever used PowerPoint and tried an image effect called soft edges, that's exactly what I'm trying to do here. The only related "answer" I was able to find was for solid body background colors by using box-shadow with inset:

box-shadow: 25px 25px 50px 0 (color matching background color) inset;

But since the body has a background image and not a solid color, there's no way to make it look like it's blending in. And obviously using a transparent color in box shadow just shows the div background image as it normally would look.

Could someone help me out with this? (And I can't edit the div image to give it transparent fading edges, so it'll have to be directly done with CSS or JS)

ANSWER

Answered 2021-Jun-16 at 02:49

You can use the background as gradient where the edges are rgba(0,0,0,0). This way it will smoothly blend with background. But this will not work for images. For images You will have to a div of background color and rgba(0,0,0,0) in gradient with color facing outward.

Source https://stackoverflow.com/questions/67995632

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install Shadow

You can download it from GitHub.
You can use Shadow like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Shadow component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.