Archive Not linked. Backups to roll back the homepage. Nothing here runs. Homepage examples list (EN | FR | days to deadline), removed Nov 6, 2026 (52 dares) 1. finally make that decision | enfin prendre cette décision | 6 days 2. ask for the raise | demander une augmentation | 9 days 3. apologize first | m’excuser en premier | 0 days 4. reply to every text I’ve ignored | répondre à tous mes messages ignorés | 0 days 5. tell my dad I love him | dire à mon père que je l’aime | 6 days 6. book the therapy session | réserver ma séance de thérapie | 6 days 7. get that mole checked | faire vérifier ce grain de beauté | 29 days 8. pay off my credit card | rembourser ma carte de crédit | 89 days 9. launch my side project | lancer mon projet perso | 59 days 10. finally learn to swim | enfin apprendre à nager | 99 days 11. book that solo trip | réserver ce voyage en solo | 13 days 12. call the friend I miss | appeler la personne qui me manque | 2 days 13. apply for the job I want | postuler pour le job que je veux | 13 days 14. go a month without alcohol | passer un mois sans alcool | 29 days 15. finally ask for help | enfin demander de l’aide | 6 days 16. sleep phone-free for 30 days | dormir sans téléphone pendant 30 jours | 29 days 17. book my checkup | réserver mon bilan de santé | 13 days 18. quit what’s draining me | arrêter ce qui m’épuise | 29 days 19. run my first 5 km | courir mes premiers 5 km | 59 days 20. sign up for that course | m’inscrire à cette formation | 6 days 21. talk money with my partner | parler finances en couple | 6 days 22. share my work publicly | partager mon travail publiquement | 13 days 23. visit my grandparents | rendre visite à mes grands-parents | 29 days 24. set up automatic savings | mettre en place une épargne automatique | 6 days 25. ask someone out | proposer un rendez-vous à quelqu’un | 13 days 26. delete my most-used app | supprimer mon appli la plus utilisée | 6 days 27. take myself on a dinner date | m’inviter moi-même au restaurant | 13 days 28. take a dance class | suivre un cours de danse | 29 days 29. go to a concert solo | aller à un concert en solo | 29 days 30. try stand-up at an open mic | faire du stand-up à un open mic | 59 days 31. take a cold plunge | faire un bain glacé | 6 days 32. watch five sunrises this month | voir le soleil se lever 5 fois | 29 days 33. go a week buying nothing | passer une semaine sans rien acheter | 6 days 34. read a book that makes me think | lire un livre qui me fait réfléchir | 29 days 35. go a month without takeout | passer un mois sans plats à emporter | 29 days 36. skip online shopping for a month | passer un mois sans achats en ligne | 29 days 37. go a week without my car | passer une semaine sans voiture | 6 days 38. go 30 days without social media | passer 30 jours sans réseaux sociaux | 29 days 39. go 48 hours without screens | passer 48 heures sans écran | 2 days 40. go a week without complaining | passer une semaine sans me plaindre | 6 days 41. go a week without added sugar | passer une semaine sans sucre ajouté | 6 days 42. list what drains me and fuels me | noter ce qui me vide et me nourrit | 2 days 43. do something badly, on purpose | faire exprès de mal faire une chose | 6 days 44. sit an hour doing nothing | rester une heure à ne rien faire | 2 days 45. cancel one plan and rest instead | annuler un plan pour me reposer | 6 days 46. ask my parents what they regret | demander à mes parents leurs regrets | 13 days 47. close all 87 browser tabs | fermer mes 87 onglets ouverts | 0 days 48. listen to my 47 voicemails | écouter mes 47 messages vocaux | 0 days 49. actually use my gym membership | enfin aller à ma salle de sport | 13 days 50. track my monthly expenses | noter chaque dépense du mois | 29 days 51. cancel subscriptions I don’t use | annuler mes abonnements inutiles | 2 days 52. use the toilet phone-free | aller aux toilettes sans téléphone | 0 days Homepage code v20 (live until Nov 2026). To roll back: copy all, paste into the homepage Code block. <!-- Dare & Commit homepage v20 (2026-11-04). Phone-first. Screen 1: "Dare yourself.", a story-style dare ticket (auto, tap = next), DARE. Then the deal (win first), the siblings, DARE. Old hero blocks hidden. EN/FR via dc_lang. Backups: Project docs. --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@600;700&family=Space+Grotesk:wght@500;600;700&display=swap"> <style> .fe-block-yui_3_17_2_1_1788976352936_9075, .fe-block-yui_3_17_2_1_1790354800935_1238, .fe-block-yui_3_17_2_1_1791209007525_1456, .fe-block-yui_3_17_2_1_1791843968163_15016 { display: none !important; } /* layout fixes are switched on by the script only (never in the Squarespace editor, where they freeze it) */ .fluid-engine.dcf-flow { grid-template-rows: none !important; grid-auto-rows: auto !important; } .dcf-flow-sec .content-wrapper { padding-top: 12px !important; padding-bottom: 24px !important; } .fe-block.dcf-full { grid-column: 1 / -1 !important; grid-row: 1 / -1 !important; } .dcf-flow-sec, .dcf-flow-sec .section-background { background: #000 !important; } footer .fluid-engine.dcf-foot { grid-template-rows: none !important; grid-auto-rows: auto !important; row-gap: 0 !important; padding-top: 8px !important; padding-bottom: 24px !important; } footer .fluid-engine.dcf-foot > .fe-block { grid-row: auto !important; } #dcf { --ink:#F2F3F4; --mid:#C2C8CC; --mute:#8A9095; --line:#232628; --card:#0B0C0D; --hot:#F4F5F6; font-family: 'Space Grotesk', system-ui, sans-serif; color: var(--mid); text-align: center; max-width: 520px; margin: 0 auto; padding: 0 0 24px; } #dcf *, #dcf *::before, #dcf *::after { box-sizing: border-box; } /* ---------- screen 1 ---------- */ #dcf .dcf-hero { padding: 4px 0 8px; } #dcf .dcf-h1 { font-weight: 700; color: var(--ink); margin: 0; font-size: clamp(52px, 15vw, 88px); line-height: .92; letter-spacing: -.045em; } #dcf .dcf-sub { margin: 10px 0 20px; font-size: clamp(19px, 5.2vw, 24px); font-weight: 500; color: var(--mute); letter-spacing: -.01em; } #dcf .dcf-sub b { color: var(--hot); font-weight: 600; } /* the dare ticket, story style */ #dcf .dcf-ticket { position: relative; margin: 0 -6px; border-radius: 26px; padding: 18px 22px 0; text-align: left; cursor: pointer; background: radial-gradient(120% 90% at 50% -10%, #1b1d20 0%, var(--card) 62%); -webkit-tap-highlight-color: transparent; box-shadow: 0 0 0 1px var(--line), 0 40px 90px -40px rgba(255,255,255,.12); overflow: hidden; user-select: none; } #dcf .dcf-ticket::before { content: ''; position: absolute; inset: 0; border-radius: 26px; padding: 1px; pointer-events: none; background: linear-gradient(160deg, rgba(242,243,244,.38), rgba(242,243,244,0) 38%, rgba(242,243,244,0) 70%, rgba(242,243,244,.18)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; } #dcf .dcf-bars { display: flex; gap: 4px; margin: 0 0 18px; } #dcf .dcf-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(242,243,244,.16); overflow: hidden; } #dcf .dcf-bar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); } #dcf .dcf-bar.is-done i { transform: scaleX(1); } #dcf .dcf-bar.is-on i { animation: dcfBar linear forwards; } #dcf .dcf-ticket { -webkit-touch-callout: none; touch-action: manipulation; } @media (max-width: 767px) { #dcf { padding-left: 16px; padding-right: 16px; } } @keyframes dcfBar { to { transform: scaleX(1); } } #dcf .dcf-top { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; } #dcf .dcf-lead { font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--mid); margin: 0; } #dcf .dcf-lead[data-t="by"] { font-size: 16px; } #dcf .dcf-tag { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); border: 1px solid #2e3235; border-radius: 999px; padding: 4px 9px; } #dcf .dcf-stage { position: relative; min-height: 2.9em; display: flex; align-items: center; font-size: clamp(30px, 8.4vw, 40px); } #dcf .dcf-dare { width: 100%; font-weight: 700; color: var(--ink); margin: 0; font-size: 1em; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; } #dcf .dcf-dare.is-short { font-size: clamp(38px, 10.8vw, 50px); } #dcf .dcf-dare.is-long { font-size: clamp(26px, 7.4vw, 34px); letter-spacing: -.02em; } #dcf .dcf-dare.is-in { animation: dcfUp .5s cubic-bezier(.2,.9,.2,1); } @keyframes dcfUp { from { opacity: 0; transform: translateY(28px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } } #dcf .dcf-tear { position: relative; height: 1px; margin: 22px -22px 18px; background-image: linear-gradient(90deg, #3a3f43 50%, transparent 50%); background-size: 10px 1px; } #dcf .dcf-tear::before, #dcf .dcf-tear::after { content: ''; position: absolute; top: -13px; width: 26px; height: 26px; border-radius: 50%; background: #000; box-shadow: inset 0 0 0 1px var(--line); } #dcf .dcf-tear::before { left: -13px; } #dcf .dcf-tear::after { right: -13px; } #dcf .dcf-board { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 22px; min-height: 1.6em; perspective: 400px; } #dcf .dcf-tile { display: inline-grid; place-items: center; width: 1.22em; height: 1.6em; border-radius: 6px; background: #17181a; color: var(--hot); font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-weight: 700; font-size: clamp(20px, 5.8vw, 27px); box-shadow: inset 0 -1px 0 #000, 0 1px 0 #26282a; background-image: linear-gradient(to bottom, transparent calc(50% - .5px), #0008 calc(50% - .5px), #0008 calc(50% + .5px), transparent calc(50% + .5px)); } #dcf .dcf-tile.is-gap { background: none; box-shadow: none; width: .4em; } #dcf .dcf-tile.is-flip { animation: dcfTile .12s ease-out; } @keyframes dcfTile { from { transform: rotateX(80deg); } to { transform: none; } } /* buttons */ #dcf .dcf-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 66px; margin: 20px 0 0; border-radius: 999px; color: #000 !important; text-decoration: none !important; font-weight: 700; font-size: 18px; letter-spacing: .24em; text-transform: uppercase; position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(100deg, #8A9095 0%, #E6E9EB 28%, #FFFFFF 48%, #C2C8CC 70%, #7D8388 100%); box-shadow: 0 16px 48px -14px rgba(255,255,255,.30), inset 0 1px 0 rgba(255,255,255,.9), inset 0 -2px 0 rgba(0,0,0,.18); transition: transform .15s, box-shadow .25s, filter .15s; } #dcf .dcf-btn::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%); transform: translateX(-120%); animation: dcfShine 5s ease-in-out 1.5s infinite; } @keyframes dcfShine { 0% { transform: translateX(-120%); } 32%, 100% { transform: translateX(120%); } } #dcf .dcf-btn:hover { box-shadow: 0 18px 56px -12px rgba(255,255,255,.42), inset 0 1px 0 rgba(255,255,255,.9), inset 0 -2px 0 rgba(0,0,0,.18); } #dcf .dcf-btn:active { transform: scale(.97); filter: brightness(1.08); } #dcf .dcf-safe { margin: 10px 0 0; font-size: 12px; color: var(--mute); } /* ---------- the deal: win first ---------- */ #dcf .dcf-deal { margin-top: 64px; text-align: left; } #dcf .dcf-deal h2 { font-family: 'Space Grotesk', system-ui, sans-serif !important; margin: 0 !important; text-align: left !important; letter-spacing: -.03em !important; } #dcf .dcf-win { font-weight: 700 !important; color: var(--ink) !important; font-size: clamp(38px, 11vw, 60px) !important; line-height: .98 !important; } #dcf .dcf-win span { display: block; color: var(--hot); } #dcf .dcf-deal h2.dcf-lose { margin-top: 18px !important; font-weight: 500 !important; color: var(--mute) !important; font-size: clamp(18px, 5vw, 22px) !important; line-height: 1.3 !important; letter-spacing: -.01em !important; } /* ---------- the siblings ---------- */ /* ---------- live dare: a real dare, shown only with the darer's OK (column N), fed by the script ---------- */ #dcf .dcl { margin: 56px -6px 0; position: relative; border-radius: 22px; padding: 18px 22px 20px; text-align: left; background: radial-gradient(120% 90% at 50% -10%, #1b1d20 0%, var(--card) 62%); box-shadow: 0 0 0 1px var(--line), 0 40px 90px -40px rgba(255,255,255,.12); } #dcf .dcl[hidden] { display: none !important; } #dcf .dcl-top { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); } #dcf .dcl-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.5); animation: dclPulse 2s ease-in-out infinite; } @keyframes dclPulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 50% { opacity: .6; box-shadow: 0 0 0 7px rgba(255,255,255,0); } } #dcf .dcl-lead { margin: 0; font-size: 16px; font-weight: 500; color: var(--mid); } #dcf .dcl-dare { margin: 4px 0 18px; font-size: clamp(24px, 6.8vw, 32px); font-weight: 700; line-height: 1.12; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; } #dcf .dcl-clock { display: flex; align-items: flex-start; gap: 6px; } #dcf .dcl-u { display: flex; flex-direction: column; align-items: center; min-width: 2.2em; } #dcf .dcl-u b { font-size: clamp(28px, 8vw, 38px); font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; } #dcf .dcl-u i { margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); } #dcf .dcl-sep { font-size: clamp(28px, 8vw, 38px); font-weight: 700; line-height: 1; color: #4a4f53; } #dcf .dcl-ask { margin: 16px 0 0; font-size: 15px; color: var(--mid); } #dcf .dcl-note { margin: 8px 0 0; font-size: 12px; color: var(--mute); } @media (min-width: 768px) { #dcf .dcl { margin-left: 0; margin-right: 0; padding: 22px 30px 24px; } } #dcf .dcf-us { margin-top: 64px; display: flex; align-items: center; gap: 16px; text-align: left; } #dcf .dcf-us img { flex: 0 0 96px; width: 96px; height: 96px; border-radius: 22px; object-fit: cover; object-position: 50% 45%; filter: grayscale(1) contrast(1.05); box-shadow: 0 0 0 1px var(--line); } #dcf .dcf-us p { margin: 0; font-size: 16px; line-height: 1.4; color: var(--mid); } #dcf .dcf-us p b { color: var(--ink); font-weight: 600; } /* ---------- try-it simulator ---------- */ #dcf .dcs { margin-top: 80px; text-align: left; } #dcf .dcs-k { margin: 0 0 20px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); } #dcf .dcs-h { font-family: 'Space Grotesk', system-ui, sans-serif !important; margin: 0 0 10px !important; text-align: left !important; font-weight: 700 !important; color: var(--ink) !important; font-size: clamp(30px, 8.4vw, 40px) !important; line-height: 1.02 !important; letter-spacing: -.03em !important; } #dcf .dcs-card { position: relative; margin: 0 -6px; border-radius: 26px; padding: 22px 22px 24px; background: radial-gradient(120% 90% at 50% -10%, #1b1d20 0%, var(--card) 62%); box-shadow: 0 0 0 1px var(--line), 0 40px 90px -40px rgba(255,255,255,.12); overflow: hidden; } #dcf .dcs-l { margin: 0; font-size: 16px; font-weight: 500; color: var(--mid); } #dcf .dcs-in { display: block; width: 100%; margin: 6px 0 22px; padding: 4px 0 10px; border: 0; border-bottom: 1px solid #34383b; border-radius: 0; background: none; outline: none; font: 700 clamp(19px, 5.6vw, 24px)/1.2 'Space Grotesk', system-ui, sans-serif; letter-spacing: -.02em; color: var(--ink); caret-color: #fff; text-overflow: ellipsis; -webkit-appearance: none; } #dcf .dcs-in::placeholder { color: #7D8388; } #dcf .dcs-in:focus { border-bottom-color: #C2C8CC; } #dcf .dcs-lrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } #dcf .dcs-hint { font-size: 13px; color: var(--mute); white-space: nowrap; cursor: text; transition: opacity .2s; } #dcf .dcs-hint.is-off { opacity: 0; } #dcf .dcs-in.is-name { font-size: 18px; margin-bottom: 20px; } #dcf .dcs-opt { font-size: 13px; color: var(--mute); font-weight: 400; } #dcf .dcs-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 24px; } #dcf .dcs-chip { position: relative; min-width: 0; height: 58px; padding: 0 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; border: 1px solid #2e3235; background: #111314; color: var(--mid); font: 600 15px 'Space Grotesk', system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s, transform .15s; -webkit-tap-highlight-color: transparent; } #dcf .dcs-chip:active { transform: scale(.96); } #dcf .dcs-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; font-size: 16px; cursor: pointer; -webkit-appearance: none; appearance: none; } #dcf .dcs-pick small:empty { display: none; } #dcf .dcs-chip b { font-size: 15px; font-weight: 700; white-space: nowrap; } #dcf .dcs-chip small { font-size: 12px; font-weight: 500; opacity: .8; white-space: nowrap; } #dcf .dcs-cap { margin: 20px 8px 0; text-align: center; font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--ink); min-height: 3.2em; transition: opacity .3s, transform .3s; } #dcf .dcs-cap small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); } #dcf .dcs-cap.is-out { opacity: 0; transform: translateY(6px); } #dcf .dcs-chip.is-on { color: #000; border-color: transparent; background: linear-gradient(100deg, #8A9095 0%, #E6E9EB 28%, #FFFFFF 48%, #C2C8CC 70%, #7D8388 100%); } #dcf .dcs-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; } #dcf .dcs-amt { font: 700 30px/1 'Space Grotesk', system-ui, sans-serif; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; } #dcf .dcs-pile { position: relative; width: 46px; height: 92px; flex: 0 0 46px; } #dcf .dcs-disc { position: absolute; left: 0; width: 46px; height: 13px; border-radius: 50%; background: linear-gradient(180deg, #FFFFFF 0%, #D9DDE0 45%, #8A9095 100%); box-shadow: 0 2px 0 #5e6367, 0 4px 8px rgba(0,0,0,.5); animation: dcsPop .25s cubic-bezier(.2,1.6,.4,1); } @keyframes dcsPop { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } } #dcf .dcs-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 14px 0 4px; background: none; cursor: pointer; } #dcf .dcs-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #E6E9EB var(--p, 10%), #2a2d30 var(--p, 10%)); } #dcf .dcs-range::-moz-range-track { height: 4px; border-radius: 4px; background: #2a2d30; } #dcf .dcs-range::-moz-range-progress { height: 4px; border-radius: 4px; background: #E6E9EB; } #dcf .dcs-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #C2C8CC 55%, #7D8388); box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.6); } #dcf .dcs-range::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #C2C8CC 55%, #7D8388); } #dcf .dcs-note { margin: 0 0 22px; font-size: 13px; color: var(--mute); } #dcf .dcs-go { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 58px; border-radius: 999px; border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.04); color: var(--ink); font: 700 15px 'Space Grotesk', system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .2s, transform .15s; } #dcf .dcs-go:hover { background: rgba(255,255,255,.09); } #dcf .dcs-go:active { transform: scale(.97); } #dcf .dcs-go i { font-style: normal; display: inline-block; animation: dcsNudge 1.6s ease-in-out infinite; } @keyframes dcsNudge { 0%, 100% { transform: none; } 50% { transform: translateX(5px); } } /* time flies: tear-off calendar, then the inbox */ #dcf .dcs-film { margin-top: 4px; } #dcf .dcs-cal { position: relative; width: 116px; height: 124px; margin: 10px auto 22px; } #dcf .dcs-cal::before { content: ''; position: absolute; left: 50%; top: -6px; width: 64px; height: 12px; margin-left: -32px; z-index: 40; border-radius: 6px; background: radial-gradient(circle at 12px 6px, #000 3px, transparent 4px), radial-gradient(circle at 52px 6px, #000 3px, transparent 4px), linear-gradient(100deg, #8A9095, #FFFFFF 48%, #7D8388); } #dcf .dcs-page { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(180deg, #FFFFFF 0%, #E9ECEE 100%); color: #0B0C0D; text-align: center; box-shadow: 0 1px 0 #c9ced2, 0 18px 40px -16px rgba(255,255,255,.35); transform-origin: 50% 0; display: flex; flex-direction: column; align-items: center; justify-content: center; } #dcf .dcs-page i { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: #5b6064; } #dcf .dcs-page b { font-size: 54px; font-weight: 700; line-height: 1; letter-spacing: -.04em; margin: 2px 0; } #dcf .dcs-page em { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .2em; color: #5b6064; } #dcf .dcs-inbox { border-radius: 18px; background: #0F1112; box-shadow: 0 0 0 1px #232628; overflow: hidden; text-align: left; } #dcf .dcs-ibar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid #1c1f21; } #dcf .dcs-ibar b { font-weight: 700; color: var(--mid); } #dcf .dcs-ibar span { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 12px; letter-spacing: 0; font-weight: 700; color: #000; background: linear-gradient(100deg, #8A9095, #FFFFFF 48%, #7D8388); } #dcf .dcs-ibar span:empty { visibility: hidden; } #dcf .dcs-mails:empty { min-height: 70px; } #dcf .dcs-mail { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px 16px; border-top: 1px solid #1c1f21; animation: dcsMail .5s cubic-bezier(.2,.9,.2,1); } #dcf .dcs-mail:first-child { border-top: 0; } @keyframes dcsMail { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } } #dcf .dcs-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #000; background: radial-gradient(circle at 35% 30%, #fff, #C2C8CC 60%, #7D8388); } #dcf .dcs-mb { min-width: 0; } #dcf .dcs-mf { margin: 0; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--mid); } #dcf .dcs-mf b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #dcf .dcs-mf span { flex: 0 0 auto; font-size: 12px; color: var(--mute); } #dcf .dcs-ms { margin: 2px 0 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); } #dcf .dcs-mp { margin: 3px 0 0; font-size: 13px; line-height: 1.4; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } #dcf .dcs-mail.is-new .dcs-ms::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 7px 2px 0; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; } #dcf .dcs-mail { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .4s, padding .4s; } #dcf .dcs-ms, #dcf .dcs-mp { transition: font-size .4s, max-height .45s, opacity .3s, margin .3s, color .3s; } #dcf .dcs-mp { max-height: 6em; } #dcf .dcs-mail.is-focus { cursor: default; background: radial-gradient(120% 100% at 50% 0%, #1b1d20, #0F1112 70%); } #dcf .dcs-mail.is-focus .dcs-ms { font-size: 20px; letter-spacing: -.02em; } #dcf .dcs-mail.is-focus .dcs-mp { max-height: 10em; -webkit-line-clamp: 7; color: var(--mid); font-size: 15px; } #dcf .dcs-mail.is-fold { padding-top: 11px; padding-bottom: 11px; } #dcf .dcs-mail.is-fold .dcs-ms { font-size: 14px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #dcf .dcs-mail.is-fold .dcs-ms::before { content: '✓'; margin-right: 7px; color: var(--mute); } #dcf .dcs-mail.is-fold .dcs-mp { max-height: 0; opacity: 0; margin: 0; } #dcf .dcs-mail.is-fold.is-peek .dcs-mp { max-height: 10em; opacity: 1; margin-top: 4px; -webkit-line-clamp: 7; } #dcf .dcs-mail.is-fold.is-peek .dcs-ms { white-space: normal; } #dcf .dcs-read { display: flex; align-items: center; gap: 10px; margin-top: 14px; } #dcf .dcs-read b { flex: 1; height: 2px; border-radius: 2px; background: #2a2d30; overflow: hidden; } #dcf .dcs-read i { display: block; height: 100%; background: #E6E9EB; transform: scaleX(0); transform-origin: 0 50%; } #dcf .dcs-read span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); white-space: nowrap; } #dcf .dcs-yn { display: flex; gap: 8px; margin-top: 14px; } #dcf .dcs-yn button { flex: 1; height: 50px; padding: 0 6px; white-space: nowrap; border-radius: 999px; font: 700 14px 'Space Grotesk', system-ui, sans-serif; letter-spacing: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s; } #dcf .dcs-yn button:active { transform: scale(.96); } #dcf .dcs-yes { border: 0; color: #000; background: linear-gradient(100deg, #8A9095 0%, #E6E9EB 28%, #FFFFFF 48%, #C2C8CC 70%, #7D8388 100%); animation: dcsAsk 2.4s ease-in-out 1s infinite; } @keyframes dcsAsk { 0%, 100% { box-shadow: 0 10px 30px -12px rgba(255,255,255,.35); } 50% { box-shadow: 0 10px 40px -6px rgba(255,255,255,.7); } } #dcf .dcs-no { border: 1px solid #3a3f43; background: #111314; color: var(--mid); } #dcf .dcs-24 { margin: 10px 0 0; font-size: 12px; color: var(--mute); } /* the ending */ #dcf .dcs-end { margin-top: 8px; text-align: center; } #dcf .dcs-stage { position: relative; height: 215px; margin: 0 -22px; } #dcf .dcs-card .dcs-real { margin-top: 22px; } #dcf .dcs-coin { position: absolute; left: 0; top: 0; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; z-index: 2; background: radial-gradient(circle at 34% 28%, #fff 0%, #E6E9EB 30%, #A7ADB1 70%, #6E7478 100%); box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), inset 0 0 0 5px rgba(0,0,0,.18), 0 6px 14px rgba(0,0,0,.55); display: grid; place-items: center; font: 700 15px 'Space Grotesk', system-ui, sans-serif; color: #4a4f53; } #dcf .dcs-jar { position: absolute; left: 50%; bottom: 6px; width: 156px; height: 176px; margin-left: -78px; border-radius: 30px 30px 44px 44px; z-index: 1; border: 1.5px solid rgba(255,255,255,.38); background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.07)); box-shadow: inset 0 -20px 40px rgba(255,255,255,.04), 0 40px 90px -30px rgba(255,255,255,.28); overflow: hidden; } #dcf .dcs-glow { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, rgba(255,255,255,.30), rgba(255,255,255,0)); transition: height 1.2s cubic-bezier(.2,.9,.2,1); } #dcf .dcs-glass { position: absolute; left: 50%; bottom: 6px; width: 156px; height: 176px; margin-left: -78px; border-radius: 30px 30px 44px 44px; z-index: 3; pointer-events: none; background: linear-gradient(90deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 14%, rgba(255,255,255,0) 78%, rgba(255,255,255,.12) 90%, rgba(255,255,255,0) 100%); } #dcf .dcs-glass b { position: absolute; left: 0; right: 0; top: 46%; font-size: 12px; font-weight: 700; letter-spacing: .24em; color: rgba(255,255,255,.62); } #dcf .dcs-lid { position: absolute; left: 50%; bottom: 176px; width: 112px; height: 16px; margin-left: -56px; border-radius: 6px 6px 3px 3px; z-index: 3; background: linear-gradient(100deg, #8A9095 0%, #E6E9EB 28%, #FFFFFF 48%, #C2C8CC 70%, #7D8388 100%); box-shadow: 0 3px 0 #4a4f53; transform-origin: 0 100%; transition: transform .5s cubic-bezier(.2,1.4,.4,1); } #dcf .dcs-lid.is-open { transform: translate(-10px, -18px) rotate(-24deg); } #dcf .dcs-wallet { position: absolute; left: 50%; bottom: 14px; width: 196px; height: 122px; margin-left: -98px; border-radius: 16px; z-index: 3; text-align: left; padding: 16px 18px; background: linear-gradient(115deg, #8A9095 0%, #E6E9EB 30%, #FFFFFF 48%, #C2C8CC 68%, #7D8388 100%); box-shadow: 0 30px 80px -24px rgba(255,255,255,.45), inset 0 1px 0 #fff; color: #111; transition: transform .2s; } #dcf .dcs-wallet.is-hit { transform: scale(1.04); } #dcf .dcs-wallet .dcs-chipc { width: 30px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #d9d2b8, #a39b7e); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); } #dcf .dcs-wallet .dcs-who { position: absolute; left: 18px; bottom: 14px; font-size: 13px; font-weight: 700; letter-spacing: .2em; } #dcf .dcs-wallet .dcs-nfc { position: absolute; right: 16px; top: 14px; font-size: 13px; font-weight: 700; letter-spacing: -.1em; opacity: .55; } #dcf .dcs-spark { position: absolute; left: 50%; z-index: 4; font-size: 22px; color: #fff; text-shadow: 0 0 16px #fff; pointer-events: none; } #dcf .dcs-big { margin: 8px 0 0; font: 700 48px/1 'Space Grotesk', system-ui, sans-serif; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; } #dcf .dcs-sub { margin: 8px 0 0; font-size: 19px; font-weight: 600; color: var(--ink); } #dcf .dcs-fine { margin: 10px auto 0; max-width: 30ch; font-size: 14px; line-height: 1.4; color: var(--mute); } #dcf .dcs-again { margin: 16px auto 0; display: block; border: 0; background: none; color: var(--mute); font: 600 14px 'Space Grotesk', system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; } #dcf .dcs [hidden] { display: none !important; } @media (min-width: 768px) { #dcf .dcf-ticket { margin: 0; padding: 22px 30px 0; } #dcf .dcf-tear { margin: 24px -30px 20px; } #dcf .dcf-hero { padding-top: 32px; } } @media (prefers-reduced-motion: reduce) { #dcf *, #dcf *::before, #dcf *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } } </style> <div id="dcf"> <div class="dcf-hero"> <h1 class="dcf-h1" data-t="h1">Dare yourself.</h1> <p class="dcf-sub" id="dcf-sub">Put <b>money</b> on it.<br>Get it back when you do it.</p> <div class="dcf-ticket" id="dcf-ticket" role="button" aria-label="Next example" aria-live="polite"> <div class="dcf-bars" id="dcf-bars"></div> <div class="dcf-top"><p class="dcf-lead" data-t="lead">I dare myself to</p><span class="dcf-tag" data-t="tag">Example</span></div> <div class="dcf-stage"><p class="dcf-dare" id="dcf-dare"></p></div> <div class="dcf-tear" aria-hidden="true"></div> <p class="dcf-lead" data-t="by">by midnight on</p> <div class="dcf-board" id="dcf-board" role="img"></div> </div> <a class="dcf-btn is-pulse" href="https://tally.so/r/NpkEBB" data-t="dare">Dare</a> <p class="dcf-safe" data-t="safe">Secure payment by Stripe.</p> </div> <div class="dcf-deal"> <h2 class="dcf-win" id="dcf-win">Do your dare.<span>Get your money back.</span></h2> <h2 class="dcf-lose" id="dcf-lose">Don’t, and it funds another darer’s dream.</h2> </div> <div class="dcl" id="dcl" hidden aria-live="off"> <div class="dcl-top"><span class="dcl-dot" aria-hidden="true"></span><span data-t="liveL">Live dare</span></div> <p class="dcl-lead" data-t="lead">I dare myself to</p> <p class="dcl-dare" id="dcl-dare"></p> <div class="dcl-clock" id="dcl-clock"></div> <p class="dcl-ask" id="dcl-ask"></p> <p class="dcl-note" data-t="liveN">A real dare, shared by choice. Yours stays private.</p> </div> <div class="dcs" id="dcs"> <h2 class="dcs-h" data-t="sh">See how it works.</h2> <p class="dcs-k" data-t="sk">Try it. No money needed.</p> <div class="dcs-card"> <div id="dcs-set"> <div class="dcs-lrow"><p class="dcs-l" data-t="lead">I dare myself to</p><span class="dcs-hint" id="dcs-hint" data-t="hint2">✎ or write your own</span></div> <input class="dcs-in" id="dcs-dare" type="text" maxlength="60" autocomplete="off" enterkeyhint="done"> <p class="dcs-l" data-t="by">by midnight on</p> <div class="dcs-chips" id="dcs-chips"> <button type="button" class="dcs-chip" data-d="1"><b></b><small data-t="c1">tomorrow</small></button> <button type="button" class="dcs-chip is-on" data-d="7"><b></b><small data-t="c7">in 1 week</small></button> <button type="button" class="dcs-chip" data-d="30"><b></b><small data-t="c30">in 1 month</small></button> <label class="dcs-chip dcs-pick" id="dcs-pick"><b>Pick a date</b><small></small><input type="date" id="dcs-date" aria-label="Pick a date"></label> </div> <div class="dcs-row"> <div><p class="dcs-l" data-t="put">I put down</p><div class="dcs-amt" id="dcs-amt">20</div></div> <div class="dcs-pile" id="dcs-pile" aria-hidden="true"></div> </div> <input class="dcs-range" id="dcs-range" type="range" min="10" max="100" step="10" value="20" aria-label="Stake"> <p class="dcs-note" data-t="note">You get it all back when you do it.</p> <button type="button" class="dcs-go" id="dcs-go"><span data-t="go">See what happens</span> <i>▶</i></button> </div> <div class="dcs-film" id="dcs-film" hidden> <div class="dcs-cal" id="dcs-cal" aria-hidden="true"></div> <div class="dcs-inbox"> <div class="dcs-ibar"><b data-t="inbox">Inbox</b><span id="dcs-count"></span></div> <div class="dcs-mails" id="dcs-mails"></div> </div> <p class="dcs-cap is-out" id="dcs-cap" aria-live="polite"></p> </div> <div class="dcs-end" id="dcs-end" hidden> <div class="dcs-stage" id="dcs-stage"></div> <p class="dcs-big" id="dcs-big"></p> <p class="dcs-sub" id="dcs-sub"></p> <p class="dcs-fine" id="dcs-fine"></p> <a class="dcf-btn dcs-real" id="dcs-real" href="https://tally.so/r/NpkEBB" data-t="real">Make it real</a> <button type="button" class="dcs-again" id="dcs-again" data-t="again">Play again</button> </div> </div> </div> <div class="dcf-us"> <img src="https://images.squarespace-cdn.com/content/6aa1939b838b4a102ff0e8d2/759ae9a9-f5cf-4e83-8b46-9728b445922e/image.jpg?format=300w" alt="" width="96" height="96" loading="lazy"> <p id="dcf-us"><b>Made by a brother and sister</b> who have dared each other for years. Now it’s your turn.</p> </div> </div> <script> (function () { var root = document.getElementById('dcf'); if (!root || root.__dcf) return; root.__dcf = true; var fe = root.closest('.fluid-engine'); if (fe) fe.classList.add('dcf-flow'); var sec = root.closest('section'); if (sec) sec.classList.add('dcf-flow-sec'); var feb = root.closest('.fe-block'); if (feb) feb.classList.add('dcf-full'); function dcFoot() { var ffe = document.querySelector('footer .fluid-engine'); if (ffe) ffe.classList.add('dcf-foot'); } dcFoot(); document.addEventListener('DOMContentLoaded', dcFoot); window.addEventListener('load', dcFoot); var FORM = 'https://tally.so/r/NpkEBB'; var EVERY = 5000; /* ms per dare */ var FIRST = 7000; /* first dare: time to read the headline too */ var dur = FIRST, shown = 0, left = 0, startAt = 0, held = false, holdT = null, wasHold = false; var BARS = 5; /* story segments shown */ /* [dare, days until the deadline (0 = today), French]. First one always shows first, for 7 s. Source: Dare_and_Commit_Homepage_Dares.xlsx (Nov 3 2026) */ var DARES = [ ['finally make that decision', 6, 'enfin prendre cette décision'], ['ask for the raise', 9, 'demander une augmentation'], ['apologize first', 0, 'm’excuser en premier'], ['reply to every text I’ve ignored', 0, 'répondre à tous mes messages ignorés'], ['tell my dad I love him', 6, 'dire à mon père que je l’aime'], ['book the therapy session', 6, 'réserver ma séance de thérapie'], ['get that mole checked', 29, 'faire vérifier ce grain de beauté'], ['pay off my credit card', 89, 'rembourser ma carte de crédit'], ['launch my side project', 59, 'lancer mon projet perso'], ['finally learn to swim', 99, 'enfin apprendre à nager'], ['book that solo trip', 13, 'réserver ce voyage en solo'], ['call the friend I miss', 2, 'appeler la personne qui me manque'], ['apply for the job I want', 13, 'postuler pour le job que je veux'], ['go a month without alcohol', 29, 'passer un mois sans alcool'], ['finally ask for help', 6, 'enfin demander de l’aide'], ['sleep phone-free for 30 days', 29, 'dormir sans téléphone pendant 30 jours'], ['book my checkup', 13, 'réserver mon bilan de santé'], ['quit what’s draining me', 29, 'arrêter ce qui m’épuise'], ['run my first 5 km', 59, 'courir mes premiers 5 km'], ['sign up for that course', 6, 'm’inscrire à cette formation'], ['talk money with my partner', 6, 'parler finances en couple'], ['share my work publicly', 13, 'partager mon travail publiquement'], ['visit my grandparents', 29, 'rendre visite à mes grands-parents'], ['set up automatic savings', 6, 'mettre en place une épargne automatique'], ['ask someone out', 13, 'proposer un rendez-vous à quelqu’un'], ['delete my most-used app', 6, 'supprimer mon appli la plus utilisée'], ['take myself on a dinner date', 13, 'm’inviter moi-même au restaurant'], ['take a dance class', 29, 'suivre un cours de danse'], ['go to a concert solo', 29, 'aller à un concert en solo'], ['try stand-up at an open mic', 59, 'faire du stand-up à un open mic'], ['take a cold plunge', 6, 'faire un bain glacé'], ['watch five sunrises this month', 29, 'voir le soleil se lever 5 fois'], ['go a week buying nothing', 6, 'passer une semaine sans rien acheter'], ['read a book that makes me think', 29, 'lire un livre qui me fait réfléchir'], ['go a month without takeout', 29, 'passer un mois sans plats à emporter'], ['skip online shopping for a month', 29, 'passer un mois sans achats en ligne'], ['go a week without my car', 6, 'passer une semaine sans voiture'], ['go 30 days without social media', 29, 'passer 30 jours sans réseaux sociaux'], ['go 48 hours without screens', 2, 'passer 48 heures sans écran'], ['go a week without complaining', 6, 'passer une semaine sans me plaindre'], ['go a week without added sugar', 6, 'passer une semaine sans sucre ajouté'], ['list what drains me and fuels me', 2, 'noter ce qui me vide et me nourrit'], ['do something badly, on purpose', 6, 'faire exprès de mal faire une chose'], ['sit an hour doing nothing', 2, 'rester une heure à ne rien faire'], ['cancel one plan and rest instead', 6, 'annuler un plan pour me reposer'], ['ask my parents what they regret', 13, 'demander à mes parents leurs regrets'], ['close all 87 browser tabs', 0, 'fermer mes 87 onglets ouverts'], ['listen to my 47 voicemails', 0, 'écouter mes 47 messages vocaux'], ['actually use my gym membership', 13, 'enfin aller à ma salle de sport'], ['track my monthly expenses', 29, 'noter chaque dépense du mois'], ['cancel subscriptions I don’t use', 2, 'annuler mes abonnements inutiles'], ['use the toilet phone-free', 0, 'aller aux toilettes sans téléphone'] ]; function shuf(a) { for (var k = a.length - 1; k > 0; k--) { var j = Math.floor(Math.random() * (k + 1)); var x = a[k]; a[k] = a[j]; a[j] = x; } return a; } var LIST = [DARES[0]].concat(shuf(DARES.slice(1))), i = -1, timer = null; var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; function isFr() { try { return localStorage.getItem('dc_lang') === 'fr'; } catch (e) { return false; } } var T = { en: { h1: 'Dare yourself.', sub: 'Put <b>money</b> on it.<br>Get it back when you do it.', tag: 'Example', lead: 'I dare myself to', by: 'by midnight on', hint: 'Tap', dare: 'Dare', safe: 'Secure payment by Stripe.', today: 'TODAY', win: 'Do your dare.<span>Get your money back.</span>', lose: 'Don’t, and it funds another darer’s dream.', us: '<b>Made by a brother and sister</b> who have dared each other for years. Now it’s your turn.' }, fr: { h1: 'Lance-toi.', sub: 'Mets de l’<b>argent</b> dessus.<br>Récupère-le quand tu le fais.', tag: 'Exemple', lead: 'Je me lance le défi :', by: 'd’ici minuit le', hint: 'Touche', dare: 'Je me lance', safe: 'Paiement sécurisé par Stripe.', today: 'AUJOURD’HUI', win: 'Fais ton défi.<span>Récupère ton argent.</span>', lose: 'Sinon, il finance le rêve de quelqu’un d’autre.', us: '<b>Créé par un frère et une sœur</b> qui se lancent des défis depuis des années. À ton tour.' } }; function t(k) { var L = isFr() ? T.fr : T.en; return L[k] != null ? L[k] : T.en[k]; } /* ---------- dates ---------- */ function addDays(n) { var d = new Date(); d.setHours(0, 0, 0, 0); d.setDate(d.getDate() + n); return d; } var D3 = ['SUN','MON','TUE','WED','THU','FRI','SAT'], M3 = ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC']; var D3F = ['DIM','LUN','MAR','MER','JEU','VEN','SAM'], M3F = ['JANV','FÉVR','MARS','AVR','MAI','JUIN','JUIL','AOÛT','SEPT','OCT','NOV','DÉC']; function boardText(n) { if (n === 0) return t('today'); var d = addDays(n); return isFr() ? D3F[d.getDay()] + ' ' + d.getDate() + ' ' + M3F[d.getMonth()] : D3[d.getDay()] + ' ' + M3[d.getMonth()] + ' ' + d.getDate(); } var $ = function (id) { return document.getElementById(id); }; var elDare = $('dcf-dare'), elBoard = $('dcf-board'), elBars = $('dcf-bars'); /* story bars */ for (var b = 0; b < BARS; b++) { var s = document.createElement('span'); s.className = 'dcf-bar'; s.appendChild(document.createElement('i')); elBars.appendChild(s); } function bars() { var pos = i % BARS, all = elBars.children; for (var k = 0; k < all.length; k++) { all[k].className = 'dcf-bar' + (k < pos ? ' is-done' : ''); var fill = all[k].firstChild; fill.style.animationDuration = ''; fill.style.animationPlayState = ''; if (k === pos && !document.hidden) { void fill.offsetWidth; fill.style.animationDuration = dur + 'ms'; all[k].className = 'dcf-bar is-on'; } } } var flips = []; function board(text) { elBoard.innerHTML = ''; elBoard.setAttribute('aria-label', text); flips.forEach(clearTimeout); flips = []; var CH = 'ABCDEFGHIJKLMNOPRSTUVWY0123456789'; text.split('').forEach(function (ch, k) { var s = document.createElement('span'); s.className = 'dcf-tile' + (ch === ' ' ? ' is-gap' : ''); elBoard.appendChild(s); if (ch === ' ') return; if (reduce) { s.textContent = ch; return; } var steps = 3 + Math.floor(Math.random() * 3) + Math.floor(k / 2); for (var m = 0; m <= steps; m++) (function (m) { flips.push(setTimeout(function () { s.textContent = m === steps ? ch : CH.charAt(Math.floor(Math.random() * CH.length)); s.classList.remove('is-flip'); void s.offsetWidth; s.classList.add('is-flip'); }, 140 + m * 45)); })(m); }); } function show(anim) { var item = LIST[i]; var txt = isFr() ? item[2] : item[0]; elDare.textContent = txt; elDare.className = 'dcf-dare' + (txt.length <= 20 ? ' is-short' : (txt.length > 40 ? ' is-long' : '')); if (elDare.offsetHeight > parseFloat(getComputedStyle(elDare).lineHeight) * 2.5) elDare.classList.add('is-long'); if (anim && !reduce) { elDare.classList.remove('is-in'); void elDare.offsetWidth; elDare.classList.add('is-in'); } board(boardText(item[1])); } function arm(ms) { clearTimeout(timer); left = ms; startAt = Date.now(); if (!document.hidden && !held) timer = setTimeout(next, ms); } function next() { i = (i + 1) % LIST.length; dur = shown++ === 0 ? FIRST : EVERY; show(true); bars(); arm(dur); } document.addEventListener('visibilitychange', function () { clearTimeout(timer); if (!document.hidden) { held = false; bars(); arm(dur); } }); /* Stories controls: tap = next, hold = pause */ var tk = $('dcf-ticket'); function play(st) { var on = elBars.querySelector('.is-on i'); if (on) on.style.animationPlayState = st; } function pause() { if (held) return; held = true; clearTimeout(timer); left = Math.max(0, left - (Date.now() - startAt)); play('paused'); } function resume() { if (!held) return; held = false; play('running'); startAt = Date.now(); if (!document.hidden) timer = setTimeout(next, left); } function up() { clearTimeout(holdT); if (held) resume(); } tk.addEventListener('pointerdown', function () { wasHold = false; clearTimeout(holdT); holdT = setTimeout(function () { wasHold = true; pause(); }, 250); }); tk.addEventListener('pointerup', up); tk.addEventListener('pointercancel', up); tk.addEventListener('pointerleave', up); tk.addEventListener('contextmenu', function (e) { e.preventDefault(); }); tk.addEventListener('click', function () { if (wasHold) { wasHold = false; return; } next(); }); /* ---------- DARE buttons: the form, with their time zone ---------- */ function formHref() { return window.dcTz ? FORM + '?tz=' + encodeURIComponent(window.dcTz) : FORM; } var btns = root.querySelectorAll('.dcf-btn:not(.dcs-real)'); for (var k = 0; k < btns.length; k++) (function (a) { a.addEventListener('click', function () { a.href = formHref(); }, true); })(btns[k]); function wire() { for (var k = 0; k < btns.length; k++) btns[k].href = formHref(); } /* ---------- language ---------- */ var lastLang = null; function texts() { var els = root.querySelectorAll('[data-t]'); for (var k = 0; k < els.length; k++) els[k].textContent = t(els[k].getAttribute('data-t')); var lang = isFr() ? 'fr' : 'en'; document.documentElement.lang = lang; if (lang !== lastLang) { /* the site's "dream" door re-wraps the word in the h2 by itself */ $('dcf-sub').innerHTML = t('sub'); $('dcf-win').innerHTML = t('win'); $('dcf-lose').innerHTML = t('lose'); $('dcf-us').innerHTML = t('us'); lastLang = lang; } } window.addEventListener('dc:lang', function () { texts(); show(false); wire(); }); /* ---------- "See how it works": play a dare, watch time fly, get the real emails, see where the money goes ---------- */ (function sim() { var S = { en: { sk: 'Try it. No money needed.', sh: 'See how it works.', nm: 'Your first name', opt: '(optional)', hint2: '✎ or write your own', c1: 'tomorrow', c7: 'in 1 week', c30: 'in 1 month', step: 'Step {k} of 3', cap1: 'You get a confirmation.', cap2: 'You get a reminder.', cap3: 'You answer if you did it.', put: 'I put down', note: 'You get it all back when you do it.', go: 'See what happens', inbox: 'Inbox', today2: 'Today', before: 'Before your deadline', pick: 'Pick a date', pickS: 'your date', s1: 'It’s written down now.', p1: '“{d}” by midnight on {date}. {amt} on the line.', s2: '{n}, your dare is due {date}', s2x: 'Your dare is due {date}', p2: 'Midnight on {date}. You got this.', s3: '{n}, did you do it?', s3x: 'Did you do it?', p3: '“{d}” by midnight on {date}. Tap your answer:', yes: 'YES, I did', no: 'NO, I didn’t', n24: 'No answer within 24 hours counts as NO.', skip: 'Tap to skip', real: 'Make it real', again: 'Play again', back: 'back to you.', backFine: 'Your money goes back to your card. You did it.', fund: 'now funds another darer’s dream.', fundFine: 'Being honest is brave. Ready to try again?', jar: 'DREAM FUND', you: 'YOU' }, fr: { sk: 'Essaie. Sans argent.', sh: 'Vois comment ça marche.', nm: 'Ton prénom', opt: '(facultatif)', hint2: '✎ ou écris le tien', c1: 'demain', c7: 'dans 1 semaine', c30: 'dans 1 mois', step: 'Étape {k} sur 3', cap1: 'Tu reçois une confirmation.', cap2: 'Tu reçois un rappel.', cap3: 'Tu réponds si tu l’as fait.', put: 'Je mets', note: 'Tu récupères tout quand tu le fais.', go: 'Voir ce qui se passe', inbox: 'Boîte de réception', today2: 'Aujourd’hui', before: 'Avant ta date', pick: 'Choisis ta date', pickS: 'ta date', s1: 'C’est écrit maintenant.', p1: '« {d} » d’ici minuit le {date}. {amt} en jeu.', s2: '{n}, ton défi est pour le {date}', s2x: 'Ton défi est pour le {date}', p2: 'Minuit le {date}. Tu vas y arriver.', s3: '{n}, tu l’as fait ?', s3x: 'Tu l’as fait ?', p3: '« {d} » d’ici minuit le {date}. Touche ta réponse :', yes: 'OUI, fait', no: 'NON, pas fait', n24: 'Pas de réponse en 24 h = NON.', skip: 'Touche pour passer', real: 'Pour de vrai', again: 'Rejouer', back: 'pour toi.', backFine: 'Ton argent retourne sur ta carte. Tu l’as fait.', fund: 'finance le rêve de quelqu’un d’autre.', fundFine: 'Être honnête, c’est courageux. On réessaie ?', jar: 'DREAM FUND', you: 'TOI' } }; T.en = Object.assign(T.en, S.en); T.fr = Object.assign(T.fr, S.fr); var box = $('dcs'); if (!box) return; var inp = $('dcs-dare'), nameIn = $('dcs-name'), hint = $('dcs-hint'), range = $('dcs-range'), amtEl = $('dcs-amt'), pile = $('dcs-pile'), stage = $('dcs-stage'), mails = $('dcs-mails'); var days = 7, ph = 0, phT = null, busy = false, run = 0; function cur() { return /^Europe/.test(window.dcTz || '') ? '€' : 'CA$'; } function moneyEn(n) { return cur() === '€' ? (isFr() ? n + ' €' : '€' + n) : 'CA$' + n; } function stake() { return +range.value; } function vib(ms) { try { if (navigator.vibrate) navigator.vibrate(ms || 8); } catch (e) {} } function esc(s) { return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); } function fill(s, o) { return s.replace('{n}', o.n || '').replace('{d}', o.d || '').replace('{date}', o.date || '').replace('{amt}', o.amt || ''); } var DE = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], ME = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var DF = ['dim.','lun.','mar.','mer.','jeu.','ven.','sam.'], MF = ['janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre']; function fmt(d) { return isFr() ? DF[d.getDay()] + ' ' + d.getDate() + ' ' + MF[d.getMonth()] : DE[d.getDay()] + ' ' + ME[d.getMonth()] + ' ' + d.getDate(); } /* the dare box: rotating example + "or write your own" */ var SHORT = DARES.filter(function (d) { return d[0].length <= 26 && d[2].length <= 26; }); function place() { var item = SHORT[ph % SHORT.length]; inp.placeholder = isFr() ? item[2] : item[0]; } function phLoop() { clearTimeout(phT); phT = setTimeout(function () { if (!inp.value && document.activeElement !== inp) { ph++; place(); } phLoop(); }, 5000); } function hintState() { hint.classList.toggle('is-off', !!inp.value || document.activeElement === inp); } inp.addEventListener('input', hintState); inp.addEventListener('focus', hintState); inp.addEventListener('blur', hintState); hint.addEventListener('click', function () { inp.focus(); }); /* stake: amount, slider fill, a pile of coins that grows */ function setStake(pop) { var n = stake(); amtEl.textContent = moneyEn(n); range.style.setProperty('--p', ((n - 10) / 90 * 100) + '%'); var want = n / 10, have = pile.children.length; while (have < want) { var c = document.createElement('i'); c.className = 'dcs-disc'; c.style.bottom = (have * 8) + 'px'; if (!pop) c.style.animation = 'none'; pile.appendChild(c); have++; } while (have > want) { pile.removeChild(pile.lastChild); have--; } } range.addEventListener('input', function () { setStake(true); vib(); }); var chips = box.querySelectorAll('.dcs-chip[data-d]'), pick = $('dcs-pick'), dIn = $('dcs-date'), picked = 0; var MFS = ['janv.','févr.','mars','avr.','mai','juin','juil.','août','sept.','oct.','nov.','déc.']; function chipDates() { for (var k = 0; k < chips.length; k++) { var d = addDays(+chips[k].getAttribute('data-d')); chips[k].querySelector('b').textContent = chipTxt(d); } pick.querySelector('b').textContent = picked ? chipTxt(addDays(picked)) : t('pick'); pick.querySelector('small').textContent = picked ? t('pickS') : ''; dIn.min = ymd(addDays(1)); dIn.max = ymd(addDays(100)); dIn.setAttribute('aria-label', t('pick')); } function chipTxt(d) { return isFr() ? DF[d.getDay()] + ' ' + d.getDate() + ' ' + MFS[d.getMonth()] : DE[d.getDay()] + ' ' + ME[d.getMonth()] + ' ' + d.getDate(); } for (var k = 0; k < chips.length; k++) chips[k].addEventListener('click', function () { for (var j = 0; j < chips.length; j++) chips[j].classList.remove('is-on'); pick.classList.remove('is-on'); this.classList.add('is-on'); days = +this.getAttribute('data-d'); vib(); }); /* pick a date: the phone's own calendar opens */ dIn.addEventListener('click', function () { try { if (dIn.showPicker) dIn.showPicker(); } catch (e) {} }); dIn.addEventListener('change', function () { var p = (dIn.value || '').split('-'); if (p.length !== 3) return; var n = Math.round((new Date(+p[0], p[1] - 1, +p[2]) - addDays(0)) / 864e5); if (!(n >= 1)) return; n = Math.min(n, 100); picked = days = n; for (var j = 0; j < chips.length; j++) chips[j].classList.remove('is-on'); pick.classList.add('is-on'); chipDates(); vib(); }); function who() { return ''; } function dareText() { return inp.value.trim() || inp.placeholder; } function ymd(d) { return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2); } function realHref() { var q = '?dare=' + encodeURIComponent(dareText()) + '&deadline=' + ymd(addDays(days)) + '¤cy=' + encodeURIComponent(cur()); if (who()) q += '&name=' + encodeURIComponent(who()); if (window.dcTz) q += '&tz=' + encodeURIComponent(window.dcTz); return FORM + q; } $('dcs-real').addEventListener('click', function () { this.href = realHref(); }, true); function show(id, on) { $(id).hidden = !on; } function later(ms, my, fn) { setTimeout(function () { if (my === run) fn(); }, reduce ? 0 : ms); } /* the tear-off calendar: one page per day, time flies between emails */ var cal = $('dcs-cal'), calOff = 0; function page(off) { var d = addDays(off), p = document.createElement('div'); p.className = 'dcs-page'; p.innerHTML = '<i>' + (isFr() ? MF : ME)[d.getMonth()].toUpperCase() + '</i><b>' + d.getDate() + '</b><em>' + (isFr() ? DF : DE)[d.getDay()].toUpperCase() + '</em>'; return p; } function calSet(off) { cal.innerHTML = ''; cal.appendChild(page(off)); calOff = off; } function tearTo(my, to, done) { var offs = [], step = Math.max(1, Math.ceil((to - calOff) / 10)); for (var k = calOff; k < to; k += step) offs.push(k); offs.push(to); var pages = offs.map(page); cal.innerHTML = ''; for (var j = pages.length - 1; j >= 0; j--) cal.appendChild(pages[j]); var i = 0, last = pages.length - 1; function tear() { if (my !== run) return; if (i >= last) { calOff = to; vib(15); setTimeout(function () { if (my === run) done(); }, reduce ? 0 : 350); return; } var p = pages[i], dur = last > 1 ? Math.round(200 - 120 * (i / (last - 1))) : 260, dir = i % 2 ? 1 : -1; if (reduce || !p.animate) { p.style.visibility = 'hidden'; } else { p.style.zIndex = 30; p.animate([{ transform: 'none', opacity: 1 }, { transform: 'translate(' + (dir * 90) + 'px,-50px) rotate(' + (dir * 32) + 'deg)', opacity: 0 }], { duration: dur + 260, easing: 'cubic-bezier(.4,.2,.6,1)', fill: 'forwards' }); } vib(4); i++; setTimeout(tear, reduce ? 0 : dur); } setTimeout(tear, reduce ? 0 : 300); } /* the inbox: the 3 real emails, oldest on top, one at a time */ var skipFn = null; function mail(when, from, subj, prev, ask) { var old = mails.querySelectorAll('.dcs-mail'); for (var k = 0; k < old.length; k++) old[k].classList.remove('is-new'); var m = document.createElement('div'); m.className = 'dcs-mail is-new is-focus'; m.innerHTML = '<span class="dcs-av" aria-hidden="true">D&C</span><div class="dcs-mb"><p class="dcs-mf"><b>' + esc(from) + '</b><span>' + esc(when) + '</span></p><p class="dcs-ms">' + esc(subj) + '</p><p class="dcs-mp">' + esc(prev) + '</p>' + (ask ? '<div class="dcs-yn"><button type="button" class="dcs-yes">' + esc(t('yes')) + '</button><button type="button" class="dcs-no">' + esc(t('no')) + '</button></div><p class="dcs-24">' + esc(t('n24')) + '</p>' : '') + '</div>'; mails.appendChild(m); $('dcs-count').textContent = mails.children.length; setTimeout(function () { var r = m.getBoundingClientRect(), over = r.bottom + 120 - window.innerHeight; if (over > 0) window.scrollBy({ top: over, behavior: reduce ? 'auto' : 'smooth' }); }, 80); vib(12); return m; } function fold(m) { m.classList.remove('is-focus'); m.classList.add('is-fold'); } /* time to read: about 17 characters a second, then the next email. Tap the email to skip. */ function readThen(my, m, done) { var len = m.querySelector('.dcs-ms').textContent.length + m.querySelector('.dcs-mp').textContent.length; var ms = Math.max(3500, Math.min(6500, 1500 + len * 45)); var bar = document.createElement('div'); bar.className = 'dcs-read'; bar.innerHTML = '<b><i></i></b><span>' + esc(t('skip')) + '</span>'; m.querySelector('.dcs-mb').appendChild(bar); var fillEl = bar.querySelector('i'); fillEl.style.transition = 'transform ' + ms + 'ms linear'; requestAnimationFrame(function () { requestAnimationFrame(function () { fillEl.style.transform = 'scaleX(1)'; }); }); var tm = setTimeout(next, ms); function next() { if (skipFn !== next) return; skipFn = null; clearTimeout(tm); bar.parentNode.removeChild(bar); if (my === run) done(); } skipFn = next; } var cap = $('dcs-cap'); function setCap(my, k) { cap.classList.add('is-out'); setTimeout(function () { if (my !== run) return; cap.innerHTML = '<small>' + esc(t('step').replace('{k}', k)) + '</small>' + esc(t('cap' + k)); cap.classList.remove('is-out'); }, reduce ? 0 : 300); } function story(my) { var o = { n: who(), d: dareText(), date: fmt(addDays(days)), amt: moneyEn(stake()) }, nm = !!o.n; calSet(0); later(500, my, function () { var m1 = mail(t('today2'), 'Dare & Commit', t('s1'), fill(t('p1'), o), false); setCap(my, 1); readThen(my, m1, function () { fold(m1); tearTo(my, days, function () { var m2 = mail(t('before'), 'Dare & Commit', fill(t(nm ? 's2' : 's2x'), o), fill(t('p2'), o), false); setCap(my, 2); readThen(my, m2, function () { fold(m2); tearTo(my, days + 1, function () { mail(fmt(addDays(days + 1)), 'Dare & Commit', nm ? fill(t('s3'), o) : t('s3x'), fill(t('p3'), o), true); setCap(my, 3); busy = false; }); }); }); }); }); } mails.addEventListener('click', function (e) { var b = e.target.closest('button'); if (b) { if (b.classList.contains('dcs-yes')) ending(true); else if (b.classList.contains('dcs-no')) ending(false); return; } var m = e.target.closest('.dcs-mail'); if (!m) return; if (m.classList.contains('is-focus')) { if (skipFn) skipFn(); return; } if (m.classList.contains('is-fold')) m.classList.toggle('is-peek'); }); $('dcs-go').addEventListener('click', function () { if (busy) return; busy = true; vib(); var my = ++run; skipFn = null; show('dcs-set', false); show('dcs-film', true); show('dcs-end', false); mails.innerHTML = ''; $('dcs-count').textContent = ''; cap.innerHTML = ''; cap.classList.add('is-out'); box.querySelector('.dcs-card').scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'start' }); story(my); }); /* coins */ function coin(x, y) { var c = document.createElement('div'); c.className = 'dcs-coin'; c.textContent = cur() === '€' ? '€' : '$'; c.style.transform = 'translate(' + x + 'px,' + y + 'px)'; stage.appendChild(c); return c; } function path(c, pts, delay, dur) { if (reduce || !c.animate) { var e = pts[pts.length - 1]; c.style.transform = 'translate(' + e[0] + 'px,' + e[1] + 'px)'; return Promise.resolve(); } var kf = pts.map(function (p, k) { return { transform: 'translate(' + p[0] + 'px,' + p[1] + 'px) rotate(' + (k * 190) + 'deg) scale(' + (p[2] || 1) + ')', offset: p[3] }; }); return c.animate(kf, { duration: dur, delay: delay, easing: 'cubic-bezier(.3,.1,.3,1)', fill: 'forwards' }).finished; } function countUp(el, n, pre) { var t0 = null, d = reduce ? 1 : 1200; function f(tm) { if (!t0) t0 = tm; var p = Math.min(1, (tm - t0) / d); el.textContent = pre + moneyEn(Math.round(n * (1 - Math.pow(1 - p, 3)))); if (p < 1) requestAnimationFrame(f); } requestAnimationFrame(f); } function ending(won) { if (busy) return; busy = true; vib(); run++; show('dcs-film', false); show('dcs-end', true); box.querySelector('.dcs-card').scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'start' }); var n = stake(), count = n / 10, W = stage.clientWidth, H = stage.clientHeight, cx = W / 2; stage.innerHTML = ''; $('dcs-big').textContent = ''; $('dcs-sub').textContent = ''; $('dcs-fine').textContent = ''; var all = [], start = [cx, 30]; if (won) { var w = document.createElement('div'); w.className = 'dcs-wallet'; w.innerHTML = '<div class="dcs-chipc"></div><span class="dcs-nfc">)))</span><span class="dcs-who">' + esc(who() ? who().toUpperCase() : t('you')) + '</span>'; stage.appendChild(w); var burst = Math.max(8, count * 2); for (var k = 0; k < burst; k++) (function (k) { var c = coin(start[0], start[1]), ang = (k / burst) * Math.PI * 2 + Math.random() * .4, r = 70 + Math.random() * 70; var bx = cx + Math.cos(ang) * r * 1.4, by = 70 + Math.sin(ang) * r * .55, tx = cx + (Math.random() - .5) * 60, ty = H - 75; all.push(path(c, [[start[0], start[1], .4, 0], [bx, by, 1.15, .38], [tx, ty, .7, 1]], 120 + k * 45, 1150).then(function () { c.style.opacity = '0'; vib(5); w.classList.add('is-hit'); setTimeout(function () { w.classList.remove('is-hit'); }, 110); })); })(k); } else { stage.insertAdjacentHTML('beforeend', '<div class="dcs-jar"><div class="dcs-glow" id="dcs-glow"></div></div><div class="dcs-lid" id="dcs-lid"></div><div class="dcs-glass"><b>' + esc(t('jar')) + '</b></div>'); setTimeout(function () { var l = $('dcs-lid'); if (l) l.classList.add('is-open'); }, 80); for (var k = 0; k < count; k++) { var row = Math.floor(k / 4), col = k % 4, m = Math.min(4, count - row * 4), hx = cx - (m - 1) * 14 + col * 28, hy = H - 30 - row * 20; (function (c) { all.push(path(c, [[start[0], start[1], 1, 0], [(start[0] + hx) / 2, Math.min(start[1], hy) - 30, 1.1, .45], [hx, hy, .92, 1]], 260 + k * 110, 820).then(function () { vib(6); })); })(coin(start[0], start[1])); } } countUp($('dcs-big'), n, won ? '+' : ''); $('dcs-sub').textContent = t(won ? 'back' : 'fund'); Promise.all(all).then(function () { $('dcs-fine').textContent = t(won ? 'backFine' : 'fundFine'); if (!won) { var g = $('dcs-glow'); if (g) g.style.height = (30 + count * 6) + '%'; var l2 = $('dcs-lid'); if (l2) l2.classList.remove('is-open'); var s = document.createElement('div'); s.className = 'dcs-spark'; s.textContent = '✦'; s.style.top = (H - 200) + 'px'; stage.appendChild(s); if (s.animate && !reduce) s.animate([{ transform: 'translate(-50%,0) scale(.4)', opacity: 0 }, { transform: 'translate(-50%,-30px) scale(1.2)', opacity: 1, offset: .3 }, { transform: 'translate(-50%,-90px) scale(.6)', opacity: 0 }], { duration: 1600, fill: 'forwards' }); } busy = false; }); } $('dcs-again').addEventListener('click', function () { run++; busy = false; show('dcs-end', false); show('dcs-film', false); show('dcs-set', true); stage.innerHTML = ''; box.querySelector('.dcs-card').scrollIntoView({ behavior: 'smooth', block: 'start' }); }); window.addEventListener('dc:lang', function () { place(); setStake(false); chipDates(); }); place(); phLoop(); setStake(false); hintState(); chipDates(); })(); /* ---------- live dare: next deadline among dares marked "yes" in column N (Show on site). Hidden when there is none. ---------- */ (function live() { T.en = Object.assign(T.en, { liveL: 'Live dare', liveN: 'A real dare, shared by choice. Yours stays private.', liveAsk: 'Will they do it? Check back when the clock hits zero.', liveEnd: 'Time’s up. Did they do it?', lDay: 'day', lDays: 'days', lHrs: 'hours' }); T.fr = Object.assign(T.fr, { liveL: 'Défi en cours', liveN: 'Un vrai défi, partagé par choix. Le tien reste privé.', liveAsk: 'Le défi sera-t-il relevé ? Reviens quand le compteur tombe à zéro.', liveEnd: 'Temps écoulé. Défi relevé ?', lDay: 'jour', lDays: 'jours', lHrs: 'heures' }); var FEED = 'https://script.google.com/macros/s/AKfycbzo35qz4yGzM91XDF_wkvaAJtkMNPCc3BX9DGB0xYBU5-ZaFIYH0LOSf5DKsAIOEKs-/exec'; var KEY = 'dc-next-deadline'; var box = $('dcl'); if (!box) return; var clock = $('dcl-clock'), ask = $('dcl-ask'), dareEl = $('dcl-dare'); var timer = null, shownEnd = null, ended = false, last = [0, 0, 0, 0]; function pad(n) { return (n < 10 ? '0' : '') + n; } function unit(n, name) { return '<div class="dcl-u"><b>' + n + '</b><i>' + name + '</i></div>'; } function draw(d, h, m, s) { last = [d, h, m, s]; var p = []; if (d > 0) p.push(unit(d, d === 1 ? t('lDay') : t('lDays'))); p.push(unit(pad(h), t('lHrs')), unit(pad(m), 'min'), unit(pad(s), 'sec')); clock.innerHTML = p.join('<span class="dcl-sep">:</span>'); } function labels() { ask.textContent = ended ? t('liveEnd') : t('liveAsk'); } function remember(n) { try { localStorage.setItem(KEY, JSON.stringify(n)); } catch (e) {} } function recall() { try { return JSON.parse(localStorage.getItem(KEY)); } catch (e) { return null; } } function show(n) { if (!n || !n.endsAt || !n.dare) return false; var end = new Date(n.endsAt).getTime(); if (!(end > Date.now())) return false; dareEl.textContent = n.dare; box.hidden = false; if (shownEnd === end) return true; shownEnd = end; clearInterval(timer); function tick() { var s = Math.floor((end - Date.now()) / 1000); if (s <= 0) { draw(0, 0, 0, 0); ended = true; labels(); clearInterval(timer); setTimeout(function () { load(0); }, 5 * 60 * 1000); return; } draw(Math.floor(s / 86400), Math.floor(s % 86400 / 3600), Math.floor(s % 3600 / 60), s % 60); ended = false; labels(); } tick(); timer = setInterval(tick, 1000); return true; } function load(attempt) { if (!window.fetch) return; fetch(FEED, { cache: 'no-store' }) .then(function (r) { return r.json(); }) .then(function (d) { if (d && d.next && show(d.next)) { remember(d.next); } else { remember(null); if (!ended) { box.hidden = true; shownEnd = null; clearInterval(timer); } } }) .catch(function () { if (attempt < 3) setTimeout(function () { load(attempt + 1); }, 3000 * (attempt + 1)); }); } window.addEventListener('dc:lang', function () { labels(); if (!box.hidden) draw(last[0], last[1], last[2], last[3]); }); labels(); show(recall()); load(0); setInterval(function () { load(0); }, 10 * 60 * 1000); })(); texts(); next(); wire(); setTimeout(wire, 500); setTimeout(wire, 1500); })(); </script>