Back to Shopify Liquid
2000+ people voted
Shopify Liquid

2000+ people voted

Drop this Shopify Liquid snippet into your theme to add the 2000+ people voted block. Copy the code below, paste it into your theme files, save and you're done.

163 lines · 5.0 KB
Shopify Liquid
1<!DOCTYPE html>
2<html lang="en">
3<head>
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>Feedback Section</title>
7<style>
8 body.unique-feedback-body-Xyz123 {
9 background-color: #f0f0f0; /* Açık arka plan rengi */
10 color: #333;
11 font-family: Arial, sans-serif;
12 display: flex;
13 justify-content: flex-start; /* Sola hizalama */
14 align-items: center;
15 height: 100vh;
16 margin: 0;
17 padding-left: 20px; /* Soldan biraz boşluk */
18 }
19
20 .unique-feedback-container-Abc456 {
21 background-color: #fff;
22 padding: 10px 20px;
23 border-radius: 10px;
24 text-align: center;
25 box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Hafif gölge efekti */
26 max-width: 100%; /* Mobil ve masaüstü cihazlar için uyumlu genişlik */
27 width: 500px; /* Maksimum genişlik */
28 margin: 2px auto; /* Yukarı ve aşağı 2px boşluk */
29 }
30
31 .unique-feedback-question-Def789 {
32 font-size: 14px; /* Font boyutu küçültüldü */
33 margin-bottom: 10px;
34 display: flex;
35 align-items: center;
36 justify-content: flex-start;
37 border-left: 5px solid green; /* Sol tarafta yeşil çizgi */
38 padding-left: 10px;
39 background-color: #f9f9f9; /* Hafif gri arka plan */
40 border-radius: 5px;
41 padding: 5px 10px; /* İçerik ile kenar arasındaki boşluk */
42 }
43
44 .unique-thumbs-up-icon-Ghi012 {
45 color: green;
46 margin-right: 5px;
47 font-size: 14px; /* Emoji ve metin boyutları eşitlendi */
48 }
49
50 .unique-feedback-buttons-Jkl345 {
51 display: flex;
52 justify-content: space-between;
53 gap: 10px;
54 margin-bottom: 10px;
55 }
56
57 .unique-feedback-button-Mno678 {
58 padding: 8px 15px; /* Buton padding azaltıldı */
59 border: none;
60 border-radius: 5px;
61 cursor: pointer;
62 font-size: 14px; /* Font boyutu */
63 flex-grow: 1;
64 background-color: #e0e0e0; /* Açık buton rengi */
65 color: #333; /* Metin rengi */
66 transition: transform 0.1s ease-in-out; /* Animasyon efekti */
67 }
68
69 .unique-feedback-button-Mno678:active {
70 transform: scale(1.1); /* Butona tıklama animasyonu */
71 }
72
73 #unique-like-button-Pqr901, #unique-dislike-button-Stu234 {
74 background-color: #e0e0e0; /* Açık buton rengi */
75 color: #333; /* Metin rengi */
76 }
77
78 .unique-feedback-progress-Vwx567 {
79 background-color: #ddd;
80 border-radius: 5px;
81 height: 15px; /* Yükseklik azaltıldı */
82 overflow: hidden;
83 margin-bottom: 10px;
84 width: 100%;
85 display: flex;
86 align-items: center;
87 }
88
89 .unique-progress-bar-Yza890 {
90 background-color: green; /* Progress bar rengi yeşil */
91 height: 100%;
92 width: 85%; /* Default olarak %85'den başlayacak */
93 text-align: center;
94 line-height: 15px; /* Yükseklik ile uyumlu */
95 color: white; /* Metin rengi beyaz */
96 font-weight: bold;
97 font-size: 12px; /* Font boyutu küçültüldü */
98 transition: width 0.5s ease-in-out; /* Animasyon efekti */
99 }
100
101 .unique-feedback-percentage-Bcd123 {
102 font-size: 14px;
103 display: none;
104 }
105
106 .unique-feedback-votes-Efg456 {
107 font-size: 12px;
108 color: #666;
109 margin-top: 10px;
110 }
111</style>
112</head>
113<body class="unique-feedback-body-Xyz123">
114 <div class="unique-feedback-container-Abc456">
115 <div class="unique-feedback-question-Def789">
116 <span class="unique-thumbs-up-icon-Ghi012">👍</span>
117 Did you like the product?
118 </div>
119 <div class="unique-feedback-buttons-Jkl345">
120 <button class="unique-feedback-button-Mno678" id="unique-like-button-Pqr901">Like</button>
121 <button class="unique-feedback-button-Mno678" id="unique-dislike-button-Stu234">Dislike</button>
122 </div>
123 <div class="unique-feedback-progress-Vwx567">
124 <div class="unique-progress-bar-Yza890" id="unique-progress-bar-Yza890">85%</div>
125 </div>
126 <p class="unique-feedback-percentage-Bcd123" id="unique-feedback-percentage-Bcd123">85%</p>
127 <p class="unique-feedback-votes-Efg456">2000+ people have voted</p>
128 </div>
129 <script>
130 const likeButtonUnique = document.getElementById('unique-like-button-Pqr901');
131 const dislikeButtonUnique = document.getElementById('unique-dislike-button-Stu234');
132 const progressBarUnique = document.getElementById('unique-progress-bar-Yza890');
133 const feedbackPercentageUnique = document.getElementById('unique-feedback-percentage-Bcd123');
134
135 let likesUnique = 85;
136 let dislikesUnique = 15;
137
138 function updateProgressBarUnique() {
139 const totalUnique = likesUnique + dislikesUnique;
140 const percentageUnique = totalUnique === 0 ? 0 : (likesUnique / totalUnique) * 100;
141 progressBarUnique.style.width = percentageUnique + '%';
142 progressBarUnique.textContent = Math.round(percentageUnique) + '%';
143 feedbackPercentageUnique.textContent = Math.round(percentageUnique) + '%';
144 }
145
146 likeButtonUnique.addEventListener('click', () => {
147 likesUnique++;
148 updateProgressBarUnique();
149 });
150
151 dislikeButtonUnique.addEventListener('click', () => {
152 dislikesUnique++;
153 updateProgressBarUnique();
154 });
155
156 // Initialize progress bar with animation
157 setTimeout(() => {
158 updateProgressBarUnique();
159 }, 100);
160 </script>
161</body>
162</html>

Related snippets