-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc9e1aa
commit 466de66
Showing
7 changed files
with
287 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>User Attributes Selection</title> | ||
|
||
<!-- jQuery --> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> | ||
<!-- bootstrap 5 --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="row m-0"> | ||
<div class="col-12 col-md-6 col-lg-8"> | ||
<h1>User Attributes Selection</h1> | ||
<h3> Gender </h3> | ||
<span> | ||
<input type="checkbox" class="btn-check" id="10110" autocomplete="off" checked> | ||
<label class="btn btn-outline-warning my-1" for="10110">Male</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10111" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10111">Female</label> | ||
</span> | ||
|
||
<h3>In-market Interests</h3> | ||
<span> | ||
<input type="checkbox" class="btn-check" id="10684" autocomplete="off" checked> | ||
<label class="btn btn-outline-warning my-1" for="10684">3c Product</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11092" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11092">Appliances</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11278" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11278">Clothing, Shoes & Bags</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11379" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11379">Beauty & Personal Care</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11423" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11423">Household & Home Improvement</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11512" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11512">Infant & Mom Products</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11576" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11576">Sports Item</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11632" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11632">Outdoor</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11680" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11680">Health Care Products</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11724" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11724">Luxury</label> | ||
|
||
<input type="checkbox" class="btn-check" id="11944" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="11944">Real Estate</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13042" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13042">Automobile</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13403" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13403">Finance</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13496" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13496">Travel</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13678" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13678">Education</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13776" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13776">Service</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13874" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13874">Electronic Game</label> | ||
|
||
<input type="checkbox" class="btn-check" id="16593" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="16593">Book</label> | ||
|
||
<input type="checkbox" class="btn-check" id="16617" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="16617">Medicine</label> | ||
|
||
<input type="checkbox" class="btn-check" id="16661" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="16661">Food & Drink</label> | ||
</span> | ||
|
||
<h3>Long-term Interests</h3> | ||
<span> | ||
<input type="checkbox" class="btn-check" id="10006" autocomplete="off" checked> | ||
<label class="btn btn-outline-warning my-1" for="10006">News</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10024" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10024">Education</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10031" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10031">Automobile</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10048" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10048">Real Estate</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10052" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10052">IT</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10057" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10057">Electronic Game</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10059" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10059">Fashion</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10063" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10063">Entertainment</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10067" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10067">Luxury</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10074" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10074">Home and Lifestyle</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10075" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10075">Health</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10076" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10076">Food</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10077" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10077">Divine</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10079" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10079">Motherhood & Parenting</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10083" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10083">Sports</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10093" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10093">Travel & Outdoors</label> | ||
|
||
<input type="checkbox" class="btn-check" id="10102" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="10102">Social</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13800" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13800">Art & Photography & Design</label> | ||
|
||
<input type="checkbox" class="btn-check" id="13866" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="13866">Online Literature</label> | ||
|
||
<input type="checkbox" class="btn-check" id="14273" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="14273">3c</label> | ||
|
||
<input type="checkbox" class="btn-check" id="16706" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="16706">Culture</label> | ||
|
||
<input type="checkbox" class="btn-check" id="16751" autocomplete="off"> | ||
<label class="btn btn-outline-warning my-1" for="16751">Sex</label> | ||
</span> | ||
</div> | ||
<style> | ||
.overlay { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.8) 90%); | ||
z-index: 1; | ||
} | ||
|
||
.overlay.card-title { | ||
font-size: 4vw; | ||
line-height: 2.5vw; | ||
} | ||
|
||
.overlay.card-text { | ||
font-size: 2vw; | ||
line-height: 2.5vw; | ||
} | ||
</style> | ||
<div class="col-12 col-md-6 col-lg-4"> | ||
<div class="ad p-4"></div> | ||
<div class="ad p-4"></div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<script> | ||
|
||
// Update ads | ||
function updateAds() { | ||
let userTags = []; | ||
$(".btn-check:checked").each(function () { | ||
userTags.push($(this).attr("id")); | ||
}); | ||
|
||
userTags = userTags.join("%2C"); | ||
fetch(`/ad_request?user_tags=${userTags}&floor_price=10&number=${$('.ad').length}`, | ||
{ | ||
method: 'GET', | ||
headers: { | ||
'Accept': 'application/json', | ||
}, | ||
}) | ||
.then(response => response.json()) | ||
.then(data => { | ||
for (let i = 0; i < data.length; i++){ | ||
$('.ad').eq(i).html(` | ||
<div class="card p-0 m-0" style="width: 100%; aspect-ratio: 1/1; overflow: hidden"> | ||
<img src="https://cataas.com/cat" class="card-img-top" alt="..." style="width: 100%; height: 100%; object-fit: cover;"> | ||
<div class="overlay"> | ||
<div class="card-img-overlay d-flex flex-column justify-content-end text-light"> | ||
<h1 class="card-title">${data[i].advertiser}</h1> | ||
<p class="card-text">${data[i].adText}</p> | ||
</div> | ||
</div> | ||
</div>`); | ||
} | ||
}); | ||
} | ||
|
||
// Update ads when page loaded | ||
updateAds(); | ||
$(".btn-check").change(function () { | ||
updateAds(); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |